query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
used when filling up the update product form
function readTwo(){ // query to read single record $query = "SELECT * from companies where username='$this->username'"; // prepare query statement $stmt = $this->conn->prepare( $query ); // execute query $stmt->execute(); // get retrieved row $row = $stmt->fetch(PDO::FETCH_ASSOC); // set values to object properties $this->cid = $row['cid']; $this->name = $row['name']; $this->email = $row['email']; $this->password = $row['password']; $this->latitude = $row['latitude']; $this->longitude = $row['longitude']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function product_update_post()\n\t\t\t\t{\n\t\t\t\t}", "public function updateproduct(){\n //retreive and clean data from the register card form\n $pruductid = parent::CleanData($_GET['pruductid']);\n $matgroup = parent::CleanData($_GET['matgroup']); \n $glaccount = parent::CleanData($_GET['glaccount']);\n $funcarea = parent::CleanData($_GET['funcarea']);\n $shortdesc = parent::CleanData($_GET['shortdesc']);\n //check for empty fields\n if (empty($pruductid) || empty($matgroup) || empty($glaccount) || empty($funcarea) || empty($shortdesc))\n {\n ?>\n <p>* Nekatera polja so prazna, prosim da pozkusite ponovno.</p>\n <?php \n } else {\n //create query with form data\n $query = \"INSERT INTO table2 (Func_area_test, Sifra_BL_ST, Material_group, GLAccount_override, Short_desc)\n VALUES('$funcarea','$pruductid','$matgroup','$glaccount','$shortdesc')\";\n //execute query\n $result = mysql_query($query);\n //Check result\n if ($result) {\n ?>\n <p>* Produkt je bil registriran, prosim da validirate ponovno</p>\n <?php \n } else {\n ?>\n <p>* Registriranje ni mozno: <?php print mysql_error();?></p>\n <?php\n }\n }\n }", "public function testUpdateProductUsingPOST()\n {\n }", "public function update(){\n $this->product->id = $_POST['id'];\n $this->product->name = $_POST['name'];\n $this->product->price = $_POST['price'];\n $this->product->description = $_POST['description'];\n $this->product->category_id = $_POST['category_id'];\n\n\n\n // update the product\n if($this->product->update()){\n header(\"Refresh:2\");\n echo \"<div class=\\\"alert alert-success alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Product was updated.\";\n echo \"</div>\";\n }\n\n // if unable to update the product, tell the user\n else{\n echo \"<div class=\\\"alert alert-danger alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Unable to update product.\";\n echo \"</div>\";\n }\n }", "public function update_product() {\n\t\t$values=array(\"product_name\"=>$_POST['product_name'],\"description\"=>$_POST['description']);\t\t\t\t\n\t\t$where =array(\"id\"=>$_POST['product_id']);\n\t\tif($this->update(\"products\",$values,$where)) {\t\t\t\n\t\t\techo true;\n\t\t}\n\t\telse\n\t\t\techo 'Error while updating';\n\t}", "public function hydrate_product_form()\n {\n $em = EntityManagerSingleton::getInstance();\n\n $this->create_update_form->get('name')->setValue($this->product->getName());\n\n $this->create_update_form->get('product_id')->setValue($this->product->getId());\n $this->create_update_form->get('base_price')->setValue($this->product->getBasePrice());\n $this->create_update_form->get('discount_price')->setValue($this->product->getDiscountPrice());\n $this->create_update_form->get('tax')->setValue($this->product->getTax());\n $this->create_update_form->get('base_weight')->setValue($this->product->getBaseWeight());\n $this->create_update_form->get('description')->setValue($this->product->getDescription());\n $this->create_update_form->get('meta_description')->setValue($this->product->getPage()->getDescription());\n $this->create_update_form->get('keywords')->setValue($this->product->getPage()->getKeywords());\n $this->create_update_form->get('date_added')->setValue($this->product->getDateCreated()->format('m/d/Y'));\n $this->create_update_form->get('show_more_caption')->setValue($this->product->shouldShowMoreCaption());\n\n // Get the quantity and status from the skus\n $quantity = $this->product->getQuantityFromSkus();\n $status_override = $this->product->getStatusOverride();\n $status = $this->product->getStatus();\n\n if (!($status_override instanceof Status))\n $this->create_update_form->get('status_override')->setValue(0);\n else\n $this->create_update_form->get('status_override')->setValue($status_override->getId());\n\n if (!($status instanceof Status))\n $this->create_update_form->get('status')->setValue(0);\n else\n $this->create_update_form->get('status')->setValue($status->getId());\n\n\n $this->create_update_form->get('quantity')->setValue($quantity);\n $this->create_update_form->get('sort_order')->setValue($this->product->getSortOrder());\n $this->create_update_form->get('product_code')->setValue($this->product->getProductCode());\n\n // Place themes and categories in the category box\n $category_listings = [];\n $theme_ids = [];\n $ancestor_listing_name = \"\";\n $product_categories = $this->product->getProductCategories();\n\n foreach($product_categories as $product_category)\n {\n $category = $product_category->getCategory();\n\n // Place theme categories in the theme check box list\n if ($category->getId() == Category::THEME_CATEGORY_ID || (!is_null($category->getParentCategory()) && $category->getParentCategory()->getId() == Category::THEME_CATEGORY_ID))\n {\n $theme_ids[] = $category->getId();\n }\n else\n {\n $category_info = $em->getRepository('Library\\Model\\Category\\Category')->findCategoryAncestors($category);\n $category_ancestors = $category_info['ancestors'];\n\n if (count($category_ancestors) > 0)\n {\n // Construct listing name\n if (count($category_ancestors) > 0)\n {\n foreach ($category_ancestors as $ancestor)\n {\n $ancestor_listing_name .= $ancestor['name'] . \" >> \";\n }\n }\n }\n\n $category_name = $ancestor_listing_name . $category->getName();\n $category_listings[] = ['id' => $category->getId(), 'name' => $category_name];\n $ancestor_listing_name = \"\";\n }\n }\n\n return [$category_listings, $theme_ids];\n }", "public function update_field() {\n\n\t\t//init controller data\n\t\t$this->extensions->hk_InitData($this, __FUNCTION__);\n\n\t\tif (!$this->user->canModify('listing_grid/product')) {\n\t\t\t$error = new AError('');\n\t\t\treturn $error->toJSONResponse('NO_PERMISSIONS_402',\n\t\t\t\tarray( 'error_text' => sprintf($this->language->get('error_permission_modify'), 'listing_grid/product'),\n\t\t\t\t\t'reset_value' => true\n\t\t\t\t));\n\t\t}\n\n\t\t$this->loadLanguage('catalog/product');\n\n\t\t$this->loadModel('catalog/product');\n\t\tif (isset($this->request->get['id'])) {\n\t\t\t//request sent from edit form. ID in url\n\t\t\tforeach ($this->request->post as $key => $value) {\n\t\t\t\t$err = $this->_validateField($key, $value);\n\t\t\t\tif (!empty($err)) {\n\t\t\t\t\t$error = new AError('');\n\t\t\t\t\treturn $error->toJSONResponse('VALIDATION_ERROR_406', array( 'error_text' => $err ));\n\t\t\t\t}\n if($key=='date_available'){\n $value = dateDisplay2ISO($value);\n }\n $data = array( $key => $value );\n\t\t\t\t$this->model_catalog_product->updateProduct($this->request->get['id'], $data);\n\t\t\t\t$this->model_catalog_product->updateProductLinks($this->request->get['id'], $data);\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\n\t\t//request sent from jGrid. ID is key of array\n\t\t$fields = array( 'product_id', 'product_description', /* 'model',*//* 'price',*//* 'call_to_order', *//* 'quantity',*/ 'status' );\n\t\tforeach ($fields as $f) {\n\t\t\tif (isset($this->request->post[ $f ]))\n\t\t\t\tforeach ($this->request->post[ $f ] as $k => $v) {\n\t\t\t\t\t$err = $this->_validateField($f, $v);\n\t\t\t\t\tif (!empty($err)) {\n\t\t\t\t\t\t$error = new AError('');\n\t\t\t\t\t\treturn $error->toJSONResponse('VALIDATION_ERROR_406', array( 'error_text' => $err ));\n\t\t\t\t\t}\n\t\t\t\t\t$this->model_catalog_product->updateProduct($k, array( $f => $v ));\n\t\t\t\t}\n\t\t}\n\n\t\t//update controller data\n\t\t$this->extensions->hk_UpdateData($this, __FUNCTION__);\n\t}", "public function edit()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/product/edit');\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/update';\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/edit', $this->data);\r\n\r\n\r\n }", "function uc_order_edit_products_form($form, &$form_state, $products) {\n if (($product_count = count($products)) > 0) {\n $form['products'] = tapir_get_table('uc_op_products_edit_table');\n for ($i=0, $product = reset($products); $i < $product_count; $i++, $product = next($products)) {\n $form['products'][$i]['remove'] = array(\n '#type' => 'image_button',\n '#title' => t('Remove this product.'),\n '#src' => drupal_get_path('module', 'uc_store') . '/images/error.gif',\n '#button_type' => 'remove',\n '#submit' => array('uc_order_edit_products_remove', 'uc_order_edit_form_submit'),\n '#return_value' => $product->order_product_id,\n );\n $form['products'][$i]['order_product_id'] = array(\n '#type' => 'hidden',\n '#value' => $product->order_product_id,\n );\n $form['products'][$i]['nid'] = array(\n '#type' => 'hidden',\n '#value' => $product->nid,\n );\n\n $form['products'][$i]['model'] = array(\n '#type' => 'textfield',\n '#title' => t('SKU'),\n '#title_display' => 'invisible',\n '#default_value' => $product->model,\n '#size' => 6,\n );\n \n $form['products'][$i]['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Title'),\n '#title_display' => 'invisible',\n '#default_value' => $product->title,\n '#size' => 30,\n '#maxlength' => 255,\n );\n \n $form['products'][$i]['qty'] = array(\n '#type' => 'uc_quantity',\n '#title' => theme('uc_qty_label'),\n '#title_display' => 'invisible',\n '#default_value' => $product->qty,\n );\n\n\n $form['products'][$i]['weight'] = array(\n '#type' => 'textfield',\n '#title' => t('Weight'),\n '#title_display' => 'invisible',\n '#default_value' => $product->weight,\n '#size' => 3,\n );\n $units = array(\n 'lb' => t('Pounds'),\n 'kg' => t('Kilograms'),\n 'oz' => t('Ounces'),\n 'g' => t('Grams'),\n );\n $form['products'][$i]['weight_units'] = array(\n '#type' => 'select',\n '#title' => t('Units'),\n '#title_display' => 'invisible',\n '#default_value' => $product->weight_units,\n '#options' => $units,\n );\n $form['products'][$i]['cost'] = array(\n '#type' => 'uc_price',\n '#title' => t('Cost'),\n '#title_display' => 'invisible',\n '#default_value' => $product->cost,\n '#size' => 5,\n );\n $form['products'][$i]['price'] = array(\n '#type' => 'uc_price',\n '#title' => t('Price'),\n '#title_display' => 'invisible',\n '#default_value' => $product->price,\n '#size' => 5,\n );\n \n $form['products'][$i]['vat_rate'] = array(\n '#type' => 'uc_vat_rate',\n '#title' => t('VAT rate'),\n '#title_display' => 'invisible',\n '#default_value' => $product->vat_rate,\n '#size' => 6,\n ); \n \n $form['products'][$i]['data'] = array(\n '#type' => 'hidden',\n '#value' => serialize($product->data),\n );\n }\n }\n else {\n $form['products'] = array(\n '#markup' => t('This order contains no products.'),\n '#prefix' => '<div id=\"order-edit-products\">',\n '#suffix' => '</div>',\n );\n }\n\n return $form;\n}", "public function getUpdateProductData();", "public function edit_product_form(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$this->data['heading'] = 'Edit Product';\r\n\t\t\t$product_id = $this->uri->segment(4,0);\r\n\t\t\t$condition = array('id' => $product_id);\r\n\t\t\t$this->data['product_details'] = $this->product_model->view_product($condition);\r\n\t\t\tif ($this->data['product_details']->num_rows() == 1){\r\n\t\t\t\t$this->data['categoryView'] = $this->product_model->get_category_details($this->data['product_details']->row()->category_id);\r\n\t\t\t\t$this->data['atrributeValue'] = $this->product_model->view_atrribute_details();\r\n\t\t\t\t$this->data['SubPrdVal'] = $this->product_model->view_subproduct_details($product_id);\r\n\t\t\t\t$this->data['PrdattrVal'] = $this->product_model->view_product_atrribute_details();\r\n\t\t\t\t$this->load->view('admin/product/edit_product',$this->data);\r\n\t\t\t}else {\r\n\t\t\t\tredirect('admin');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function update(SaveProductRequest $request, Product $product)\n {\n\n $product = Product::find($product->id);\n \n //$product->fill($request->all());\n\n if ($request->get('name') == null) {\n $product->name = $product->name;\n } else {\n $product->name = $request->get('name');\n }\n\n \n if ($request->get('description') == null) {\n $product->description = $product->description;\n } else {\n $product->description = $request->get('description');\n }\n\n \n if ($request->get('size') == null) {\n $product->size = $product->size;\n } else {\n $product->size = $request->get('size');\n }\n\n \n if ($request->get('price') == null) {\n $product->price = $product->price;\n } else {\n $product->price = $request->get('price');\n }\n\n if ($request->file('image') == null) {\n \n } else {\n $product->image = \\Request::file('image');\n }\n\n if ($request->file('description_file') == null) {\n \n } else {\n $product->description_file = \\Request::file('description_file');\n }\n\n if ($request->get('visible') == null) {\n $product->visible = 1;\n } else {\n $product->visible = $request->get('visible');\n }\n\n if ($request->get('category_id') == null) {\n $product->category_id = $product->category_id;\n } else {\n $product->category_id = $request->get('category_id');\n }\n\n if ($request->get('varietal_id') == null) {\n $product->varietal_id = $product->varietal_id;\n } else {\n $product->varietal_id = $request->get('varietal_id');\n }\n\n \n if ($request->get('winery_id') == null) {\n $product->winery_id = $product->winery_id;\n } else {\n $product->winery_id = $request->get('winery_id');\n }\n\n/*\n $request->get('name') == null ? $product->name = $product->name : $product->name =$request->get('name');\n $description = $request->get('description') == null ? $product->description = $product->description : $product->description = $request->get('description');\n $request->get('size') == null ? $product->size = $product->size : $product->size = $request->get('size');\n $request->get('price') == null ? $product->price = $product->price : $product->price = $request->get('price');\n $request->file('image') == null ? $product->image = $product->image : $product->image = \\Request::file('image');\n $request->file('description_file') == null ? $product->description_file = $product->description_file : $product->description_file = \\Request::file('description_file');\n $request->get('visible') == null ? $product->visible = 1 : $product->visible = $request->get('visible');\n $request->get('category_id') == null ? $product->category_id = $product->category_id : $product->category_id = $request->get('category_id');\n $request->get('varietal_id') == null ? $product->varietal_id = $product->varietal_id : $product->varietal_id = $request->get('varietal_id');\n $request->get('winery_id') == null ? $product->winery_id = $product->winery_id : $product->winery_id = $request->get('winery_id');\n\n \n $product->name = $name;\n $product->description = $description;\n $product->size = $size;\n $product->price = $price;\n $product->image = $image;\n $product->description_file = $description_file;\n $product->visible = $visible;\n $product->category_id = $category_id;\n $product->varietal_id = $varietal_id;\n $product->winery_id = $varietal_id;\n*/\n \n\n $updated = $product->save();\n\n $message = $updated ? 'Producto actualizado correctamente' : 'El Producto NO pudo ser actualizado';\n \n return redirect()->route('admin.product.index')->with('message', $message);\n }", "public function edit_user_product_form(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$this->data['heading'] = 'Edit Affiliate Product';\r\n\t\t\t$product_id = $this->uri->segment(4,0);\r\n\t\t\t$condition = \" where `seller_product_id` ='\".$product_id.\"'\";\r\n\t\t\t$this->data['product_details'] = $this->product_model->view_notsell_product_details($condition);\r\n\t\t\t$this->load->view('admin/product/edit_affiliate_product',$this->data);\r\n\t\t}\r\n\t}", "public function editAction()\n {\n $request = $this->getRequest();\n\n $productId = $request->getParam('id');\n\n if(!$productId) {\n $this->redirect('/');\n }\n\n $this->_helper->viewRenderer->setRender('form');\n\n $form = new Application_Form_Product();\n\n $this->loadModel('product');\n \n if ($request->isPost()) {\n if ($form->isValid($request->getPost())) {\n\n $this->modelProduct->update($form->getValues());\n\n $this->view->success = true;\n $this->view->productName = $form->getValues()['name'];\n $this->view->actionPerformed = 'updated';\n $form->reset();\n }\n } else {\n\n $product = $this->modelProduct->findById($productId);\n\n $this->view->headTitle()->prepend('Edit Product ' . $product['name']);\n\n $categoryToProduct = $this->modelProduct->getCategoryToProduct($productId);\n\n $form->populate($product->toArray());\n\n $form->populate($categoryToProduct->toArray());\n \n }\n\n \n $this->view->form = $form;\n\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(Product $product)\n {\n //\n }", "public function updateAction()\n\t{\n\t\t//vérification du statut d'admin\n\t\t$customersManager = new CustomersManager();\n\t\t$customer = $customersManager -> getLoginInfo();\n\t\tif (empty($customer) OR $customer['email'] != ADMIN_EMAIL)\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n\t\t\texit();\n\t\t}\n\n\t\t//sécurisation CSRF\n\t\tif(!array_key_exists('CSRFToken', $customer) OR !array_key_exists('CSRFToken', $_POST) OR $_POST['CSRFToken'] != $customer['CSRFToken'])\n\t\t{\n\t\t\theader('Location:'.CLIENT_ROOT.'customers/account');\n exit();\n\t\t}\n\n\t\t//vérification des données reçues\n\t\t$enteredData =\n\t\t[\n\t\t\t'name' => trim($_POST['name']),\n\t\t\t'description' => trim($_POST['description']),\n\t\t\t'imagePath' => trim($_POST['imagePath']),\n\t\t\t'priceHT' => trim($_POST['priceHT']),\n\t\t\t'VATRate' => trim($_POST['VATRate']),\n\t\t\t'idCategory' => trim($_POST['idCategory']),\n\t\t\t'id' => trim($_POST['id'])\n\t\t];\n\n\t\t$requiredFields = ['id', 'name', 'description', 'imagePath', 'priceHT', 'VATRate', 'idCategory'];\n\t\t$requiredFieldsNumber = count($requiredFields);\n\n\t\t// vérification des champs\n\t\tfor ($i=0; $i < $requiredFieldsNumber; $i++) { \n\t\t\tif(!array_key_exists($requiredFields[$i], $_POST))\n\t\t\t{\n\t\t\t\t$_SESSION['alertMessages']['error'][] = 'Veuillez entrer des informations valides.';\n\t\t\t\theader('Location:'.CLIENT_ROOT.'products/manageForm');\n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(empty($_POST[$requiredFields[$i]]))\n\t\t\t{\n\t\t\t\t$_SESSION['alertMessages']['error'][] = 'Veuillez remplir tous les champs obligatoires.';\n\t\t\t\theader('Location:'.CLIENT_ROOT.'products/manageForm');\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\n\t\t//mise à jour des infos dans la BDD\n\t\t$requiredData = $enteredData;\n\t\t$productsManager = new ProductsManager();\n\t\t$productUpdated = $productsManager -> update($requiredData);\n\n\t\tif($productUpdated)\n\t\t{\n\t\t\t$_SESSION['alertMessages']['success'][] = 'Le produit a bien été mis à jour !';\n\t\t\theader('Location:'.CLIENT_ROOT.'products/manageForm');\n\t\t\texit();\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['alertMessages']['error'][] = 'La mise à jour du produit a échoué !';\n\t\t\theader('Location:'.CLIENT_ROOT.'products/manageForm');\n\t\t\texit();\n\t\t}\n\t}", "public function processSave() {\n\t\t\t//set == 0 for edit existing product\n\t\t\t//when produc has been added then by deafult its not active\n\t\t\tglobal $currentIndex;\n\t\t\t$currentindex = $currentIndex;\n\t\t\t\n\t\t\t$is_proceess = Tools::getValue('set');\n\t\t\t\n\t\t\t$product_name = Tools::getValue('product_name');\n\t\t\t$product_price = Tools::getValue('product_price');\n\t\t\t$product_quantity = Tools::getValue('product_quantity');\n\t\t\t$product_description = Tools::getValue('product_description');\n\t\t\t$product_category = Tools::getValue('product_category');\n\t\t\t$short_description = Tools::getValue('short_description');\n\t\t\t\n\t\t\tif($product_name=='') {\n\t\t\t\t$this->errors[] = Tools::displayError('Product name is requried field.');\n\t\t\t} else {\n\t\t\t\t$is_valid_name = Validate::isGenericName($product_name);\n\t\t\t\tif(!$is_valid_name) {\n\t\t\t\t\t$this->errors[] = Tools::displayError($this->l('Product name must not have Invalid characters <>;=#{}'));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($product_price=='') {\n\t\t\t\t$this->errors[] = Tools::displayError('Product price is requried field.');\n\t\t\t} else {\n\t\t\t\tif(!is_numeric($product_price)) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product price is should be numeric.');\n\t\t\t\t} else if($product_price<=0) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product price is should be greater than 0.');\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\tif($product_quantity=='') {\n\t\t\t\t$this->errors[] = Tools::displayError('Product quantity requried field.');\n\t\t\t} else {\n\t\t\t\t$product_quantity = (int)$product_quantity;\n\t\t\t\tif(!is_int($product_quantity)) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product quantity should be integer.'.$product_quantity);\n\t\t\t\t} else if($product_quantity<=0) {\n\t\t\t\t\t$this->errors[] = Tools::displayError('Product quantity should be greater than 0.');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($product_category == false){\n\t\t\t\t$this->errors[] = Tools::displayError('Please select atleast one category.');\n\t\t\t}\n\t\t\t\n\t\t\tif($is_proceess==1) {\n\t\t\t\tif (empty($this->errors)) {\n\t\t\t\t\t$customer_id = Tools::getValue('shop_customer');\n\t\t\t\t\t$obj_seller_product = new SellerProductDetail();\n\t\t\t\t\t$obj_mp_shop = new MarketplaceShop();\n\t\t\t\t\t$marketplace_shop = $obj_mp_shop->getMarketPlaceShopInfoByCustomerId($customer_id);\n\t\t\t\t\t\n\t\t\t\t\t$id_shop = $marketplace_shop['id'];\n\t\t\t\t\t$id_seller = MarketplaceShop::findMpSellerIdByShopId($id_shop);\n\t\t\t\t\t\n\t\t\t\t\t$obj_seller_product->id_seller = $id_seller;\n\t\t\t\t\t$obj_seller_product->price = $product_price;\n\t\t\t\t\t$obj_seller_product->quantity = $product_quantity;\n\t\t\t\t\t$obj_seller_product->product_name = $product_name;\n\t\t\t\t\t$obj_seller_product->description = $product_description;\n\t\t\t\t\t$obj_seller_product->short_description = $short_description;\n\t\t\t\t\t$obj_seller_product->id_category = $product_category[0];\n\t\t\t\t\t$obj_seller_product->ps_id_shop = $this->context->shop->id;\n\t\t\t\t\t$obj_seller_product->id_shop = $id_shop;\n\t\t\t\t\t$obj_seller_product->save();\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t$seller_product_id = $obj_seller_product->id;\n\t\t\t\t\t\n\t\t\t\t\t//Add into category table\n\t\t\t\t\t$obj_seller_product_category = new SellerProductCategory();\n\t\t\t\t\t$obj_seller_product_category->id_seller_product = $seller_product_id;\n\t\t\t\t\t$obj_seller_product_category->is_default = 1;\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($product_category as $p_category){\n\t\t\t\t\t\t$obj_seller_product_category->id_category = $p_category;\n\t\t\t\t\t\tif($i != 0)\n\t\t\t\t\t\t\t$obj_seller_product_category->is_default = 0;\n\t\t\t\t\t\t$obj_seller_product_category->add();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//Close\n\t\t\t\t\t\n\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\n\t\t\t\t\tif(isset($_FILES['product_image'])) {\n\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t$characters= \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t$u_id= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor ($p=0;$p<$length;$p++) {\n\t\t\t\t\t\t\t$u_id= $u_id.$characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES['product_image']['size']>0) {\n\t\t\t\t\t\t\t$result1 = Db::getInstance()->insert(\n\t\t\t\t\t\t\t\t\t\t\t\t'marketplace_product_image', array(\n\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_id' => (int) $seller_product_id,\n\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_image_id' => pSQL($u_id)\n\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t$image_name = $u_id . \".jpg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tmove_uploaded_file($_FILES[\"product_image\"][\"tmp_name\"],$address.$image_name);\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\tif(isset($_FILES['images'])) {\n\t\t\t\t\t\t$other_images = $_FILES[\"images\"]['tmp_name'];\n\t\t\t\t\t\t$count = count($other_images);\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t$characters = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t$u_other_id = \"\";\n\t\t\t\t\t\tfor ($p = 0; $p < $length; $p++) {\n\t\t\t\t\t\t\t$u_other_id .= $characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$result2 = Db::getInstance()->insert('marketplace_product_image', array(\n\t\t\t\t\t\t\t'seller_product_id' => (int) $seller_product_id,\n\t\t\t\t\t\t\t'seller_product_image_id' => pSQL($u_other_id)\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$image_name = $u_other_id . \".jpg\";\n\t\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\tmove_uploaded_file($other_images[$i], $address . $image_name);\n\t\t\t\t\t}\n\t\t\t\t\tHook::exec('actionAddproductExtrafield', array('marketplace_product_id' => $seller_product_id));\n\t\t\t\t\tTools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token);\n\t\t\t\t} else {\n\t\t\t\t\t$this->display = 'add';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (empty($this->errors)) {\n\t\t\t\t\t$id = Tools::getValue('market_place_product_id');\n\t\t\t\t\t$obj_seller_product = new SellerProductDetail($id);\n\t\t\t\t\t\n\t\t\t\t\t$obj_seller_product->price = $product_price;\n\t\t\t\t\t$obj_seller_product->quantity = $product_quantity;\n\t\t\t\t\t$obj_seller_product->product_name = $product_name;\n\t\t\t\t\t$obj_seller_product->description = $product_description;\n\t\t\t\t\t$obj_seller_product->short_description = $short_description;\n\t\t\t\t\t$obj_seller_product->id_category = $product_category[0];\n\t\t\t\t\t//save category\n\t\t\t\t\t$obj_seller_product->save();\n\n\t\t\t\t\t//Update new categories\n\t\t\t\t\tDb::getInstance()->delete('marketplace_seller_product_category','id_seller_product = '.$id); //Delete previous\n\t\t\t\t\t//Add new category into table\n\t\t\t\t\t$obj_seller_product_category = new SellerProductCategory();\n\t\t\t\t\t$obj_seller_product_category->id_seller_product = $id;\n\t\t\t\t\t$obj_seller_product_category->is_default = 1;\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach($product_category as $p_category){\n\t\t\t\t\t\t$obj_seller_product_category->id_category = $p_category;\n\t\t\t\t\t\tif($i != 0)\n\t\t\t\t\t\t\t$obj_seller_product_category->is_default = 0;\n\t\t\t\t\t\t$obj_seller_product_category->add();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t//Update Close\n\t\t\t\t\t\n\t\t\t\t\t$is_active = $obj_seller_product->active;\n\t\t\t\t\t\n\t\t\t\t\tif($is_active == 1){\n\t\t\t\t\t\t$obj_mpshop_pro = new MarketplaceShopProduct();\n\t\t\t\t\t\t$product_deatil = $obj_mpshop_pro->findMainProductIdByMppId($id);\n\t\t\t\t\t\t$main_product_id = $product_deatil['id_product'];\n\t\t\t\t\t\tif(isset($_FILES['product_image']) && $_FILES['product_image'][\"tmp_name\"]!='') {\n\t\t\t\t\t\t\t$seller_product_image=$_FILES['product_image'];\n\t\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t\t$characters = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t\t$u_id = \"\"; \n\t\t\t\t\t\t\tfor ($p =0;$p<$length;$p++) {\n\t\t\t\t\t\t\t\t$u_id .= $characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$image_name =$u_id.\".jpg\";\n\t\t\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (move_uploaded_file($_FILES[\"product_image\"][\"tmp_name\"], $address.$image_name)) {\n\t\t\t\t\t\t\t\t$insert = Db::getInstance()->insert('marketplace_product_image',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_id' =>(int)$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_image_id' =>pSQL($u_id),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'active' =>0,\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\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$image_dir = '../modules/marketplace/img/product_img';\n\t\t\t\t\t\t\n\t\t\t\t\t\t$is_update = $obj_seller_product->updatePsProductByMarketplaceProduct($id, $image_dir,1,$main_product_id);\n\t\t\t\t\t}\n\t\t\t\t\telse if($is_active == 0) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($_FILES['product_image']) && $_FILES['product_image'][\"tmp_name\"]!='') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$seller_product_image=$_FILES['product_image'];\n\t\t\t\t\t\t\t$length = 6;\n\t\t\t\t\t\t\t$characters = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t\t\t\t\t\t$u_id = \"\"; \n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tfor ($p =0;$p<$length;$p++) {\n\t\t\t\t\t\t\t\t\t$u_id .= $characters[mt_rand(0, strlen($characters))];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$image_name =$u_id.\".jpg\";\n\t\t\t\t\t\t\t$address = \"../modules/marketplace/img/product_img/\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$result1=Db::getInstance()->insert('marketplace_product_image', array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_id' =>(int)$id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'seller_product_image_id' =>pSQL($u_id)\n\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\n\t\t\t\t\t\t\tmove_uploaded_file($_FILES[\"product_image\"][\"tmp_name\"],$address.$image_name);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tHook::exec('actionUpdateproductExtrafield', array('marketplace_product_id' =>Tools::getValue('market_place_product_id')));\n\t\t\t\t\tTools::redirectAdmin($currentIndex.'&conf=4&token='.$this->token);\n\t\t\t\t} else {\n\t\t\t\t\t$this->display = 'edit';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function updateProduct(Product $product);", "public function edit(Product $product) {\n //\n }", "public function edit(product $product)\n {\n //\n }", "public function edit(product $product)\n {\n //\n }", "public function edit(product $product)\n {\n //\n }", "function edit_product($tbl_name){\n\t\t\n\t\tunset($_POST['submitLog']);\n\t\tunset($_FILES['file']);\n\t\t\n\t\t$this->db->where('ListID', $_POST['ListID']);\n\t\t\n\t\t$this->db->update($tbl_name,$_POST);\t\t\n\t}", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "public function edit(Product $product)\n {\n //\n }", "function updateProduct()\n\t{\n\n\t\t//convert all special charactor into hyphens and lower case\n\t\tif($_POST['product_alias']!='')\n\t\t{\n\t\t\t\n\t\t\t$sluggable=$_POST['product_alias'];\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sqlcheck=\"SELECT * FROM products_table WHERE alias='\".$_POST['product_title'].\"'\";\n\t\t\t$objcheck=new Bin_Query();\n\t\t\tif(!$objcheck->executeQuery($sqlcheck))\t\n\t\t\t{\n\t\t\t\t$sluggable=$_POST['product_title'];\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t//convert all special charactor into hyphens and lower case\n\t\t$sluggable = preg_replace(\"/[^a-zA-Z0-9\\/_|+ -]/\", '', $sluggable);\n\t\t$sluggable = trim($sluggable, '-');\n\t\tif( function_exists('mb_strtolower') ) { \n\t\t\t$sluggable = mb_strtolower( $sluggable );\n\t\t} else { \n\t\t\t$sluggable = strtolower( $sluggable );\n\t\t}\n\t\t$sluggable = preg_replace(\"/[\\/_|+ -]+/\", '-', $sluggable);\n\n\t\tinclude('classes/Lib/ThumbImage.php');\n\t\t\n// \t\t$category_id=(int)$_POST['selcatgory'];\n\t\t$category_id = implode(\",\",$_POST['selcatgory']);\n// \t\t$category_parent_id=(int)$_POST['selsubcatgory'];\n// \t\t$sub_category_parent_id =(int)$_POST['selsubundersubcatgory'];\n\t\t$title=$_POST['product_title'];\n\t\t$description=$_POST['desc'];\n\t\t$sku=$_POST['sku'];\n\t\t$brand=$_POST['new_brand'];\n\t\t$model=$_POST['model'];\n\t\t$tag=$_POST['tag'];\n\t\t$intro_date= $_POST['intro_date'];\n\t\tif($_POST['cse_enabled']=='on')\n\t\t{\n\t\t\t$cse_enabled=1;\n\t\t\t$csekeyid=trim($_POST['csekeyid']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cse_enabled=0;\n\t\t\t$csekeyid='';\n\t\t}\n\t\t\t\n\t\tif($_POST['is_feautured']=='on')\n\t\t\t$is_feautured=1;\n\t\telse\n\t\t\t$is_feautured=0;\n\t\t\t\n\t\tif($_POST['status']=='on')\n\t\t\n\t\t\t$status=1;\n\t\telse\n\t\t\t$status=0;\t\n\t\t\n\t\tif($_POST['is__product_status']=='')\n\t\t{\n\t\t\t$product_status=0;\n\t\t}\t\t\n\t\telseif($_POST['is__product_status']!='')\n\t\t{\n\t\t\t$product_status=$_POST['is__product_status'];\n\t\t}\n\t\t\n\t\t$attribute=$_POST['attribute'];\n\t\t\n\t\t$price=(float)$_POST['price'];\n\t\t$msrp_org=(float)$_POST['msrp_org'];\n\t\t$msrp=$_POST['msrp'];\n\t\t$quantity=$_POST['quantity'];\n\t\t$shipping_cost=$_POST['shipcost'];\n\t\t\n\t\t$soh=(int)$_POST['soh'];\n\t\t$rol=(int)$_POST['rol'];\n\t\t\n\t\t$meta_keywords=$_POST['meta_keywords'];\n\t\t$meta_desc=$_POST['meta_desc'];\n\t\t\n\t\t$related=$_POST['chkSub'];\n\t\t\n\t\t\n\t\tif(count($related)> 0 )\n\t\t{\n\t\t\tfor($i=0;$i<count($related);$i++)\n\t\t\t{\n\t\t\t\t$related_val.=$related[$i].\",\";\n\t\t\t}\n\t\t\t$len=strlen($related_val)-1;\n\t\t\t$related_val=substr($related_val,0,$len);\n\t\t}\n\t\t\n\t\tif(trim($brand)=='')\n\t\t $brand=$_POST['selbrand'];\n\t\t/*\tif(((int)$weight)>0)\n\t\t $weight.=' '.$units;\n\t\telse\n\t\t $weight='';\n\t\t$dimension=$_POST['dimension'];\n\t\t*/\t\t\n\t\t$pweight=trim($_POST['txtweight']);\n\t\t$pwidth=trim($_POST['txtwidth']);\n\t\t$pheight=trim($_POST['txtheight']);\n\t\t$pdepth=trim($_POST['txtdepth']);\n\t\tif($pweight>0)\n\t\t\t$weight=$pweight;\n\t\telse\n\t\t\t$weight='';\n\t\t$dimension='';\n\t\tif($pwidth<=0&&$pheight<=0&&$pdepth<=0)\n\t\t\t{\n\t\t\t\t$dimension='';\n\t\t\t\t\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tif($pwidth>0)\n\t\t\t\t\t$dimension=$pwidth.' x ';\n\t\t\t\telse\n\t\t\t\t\t$dimension='0 x ';\n\t\t\t\tif($pheight>0)\n\t\t\t\t\t$dimension.=$pheight.' x ';\n\t\t\t\telse\n\t\t\t\t\t$dimension.='0 x ';\n\t\t\t\tif($pdepth>0)\n\t\t\t\t\t$dimension.=$pdepth;\n\t\t\t\telse\n\t\t\t\t\t$dimension.='0';\n\t\t\t\t//$dimension=$pwidth.'-'.$pheight.'-'.$pdepth;\t\n\t\t\t}\n\t\t\n\t\t //$sql=\"update products_table set category_id = '\".$category_id.\"',sku = '\".$sku.\"',title = '\".$title.\"',description = '\".$description.\"', brand = '\".$brand.\"',model = '\".$model.\"',msrp = '\".$msrp_org.\"',price = '\".$price.\"', cse_enabled = '\".$cse_enabled.\"',weight = '\".$weight.\"',dimension = '\".$dimension.\"',shipping_cost = '\".$shipping_cost.\"',status = '\".$status.\"',tag = '\".$tag.\"',meta_desc = '\".$meta_desc.\"',meta_keywords = '\".$meta_keywords.\"',intro_date = '\".$intro_date.\"',is_featured = '\".$is_feautured.\"',thumb_image = '\".$thumb_image.\"',image = '\".$image.\"' where product_id =\".((int)$_GET['prodid'] );\n\t\tif($_POST['cse_enabled']=='on'&&$csekeyid!='')\n\t\t{\n\t\t $sql=\"update products_table set category_id = '\".$category_id.\"',sku = '\".$sku.\"',title = '\".$title.\"',description = '\".$description.\"', brand = '\".$brand.\"',model = '\".$model.\"',msrp = '\".$msrp_org.\"',price = '\".$price.\"', cse_enabled = '\".$cse_enabled.\"',cse_key='\".$csekeyid.\"',weight = '\".$weight.\"',dimension = '\".$dimension.\"',shipping_cost = '\".$shipping_cost.\"',status = '\".$status.\"',tag = '\".$tag.\"',meta_desc = '\".$meta_desc.\"',meta_keywords = '\".$meta_keywords.\"',intro_date = '\".$intro_date.\"',is_featured = '\".$is_feautured.\"',product_status='\".$product_status.\"',alias='\".$sluggable.\"' where product_id =\".((int)$_GET['prodid'] ); \n\t\t}\n\t\telse\n\t\t{\n\t\t $sql=\"update products_table set category_id = '\".$category_id.\"',sku = '\".$sku.\"',title = '\".$title.\"',description = '\".$description.\"', brand = '\".$brand.\"',model = '\".$model.\"',msrp = '\".$msrp_org.\"',price = '\".$price.\"', cse_enabled = '\".$cse_enabled.\"',weight = '\".$weight.\"',dimension = '\".$dimension.\"',shipping_cost = '\".$shipping_cost.\"',status = '\".$status.\"',tag = '\".$tag.\"',meta_desc = '\".$meta_desc.\"',meta_keywords = '\".$meta_keywords.\"',intro_date = '\".$intro_date.\"',is_featured = '\".$is_feautured.\"',product_status='\".$product_status.\"',alias='\".$sluggable.\"' where product_id =\".((int)$_GET['prodid'] );\n\t\t}\n\t\t$obj1234=new Bin_Query();\n\t\tif($obj1234->updateQuery($sql))\n\t\t{\t\n\t\t\t\n\t\t\t// For Image Uploading//\n\t\n\t\t\tif(count($_FILES['ufile']['tmp_name']) > 0)\n\t\t\t{\n\t\t\t\t$obj_insert= new Bin_Query();\n\t\t\t\t$product_id=(int)$_GET['prodid'];\n\t\t\t\t\tfor($i=0;$i<count($_FILES['ufile']['name']);$i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$imgfilename= $_FILES['ufile']['name'][$i];\n\t\t\t\t\t\tif($imgfilename!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$imagefilename = date(\"Y-m-d-His\").$imagefilename ; // generate a new name\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$image=\"images/products/\". $imgfilename; // updated into DB\n\t\t\t\t\t\t\t$thumb_image=\"images/products/thumb/\".$imgfilename; // updated into DB\n\t\t\t\t\t\t\t$large_image=\"images/products/large_image/\".$imgfilename; // updated large image into DB\n\t\t\t\t\t\t\t$stpath=ROOT_FOLDER.$image;\n\t\t\t\t\t\t\t$imageDir=ROOT_FOLDER.\"images/products\";\n\t\t\t\t\t\t\t$thumbDir=ROOT_FOLDER.\"images/products/thumb\";\n\t\t\t\t\t\t\t$largeDir=ROOT_FOLDER.\"images/products/large_image\";\n\t\t\t\t\t\t\tif(move_uploaded_file($_FILES[\"ufile\"][\"tmp_name\"][$i],$stpath))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tnew Lib_ThumbImage('thumb',$stpath,$thumbDir,THUMB_WIDTH,THUMB_HEIGHT);\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\tnew Lib_ThumbImage('thumb',$stpath,$imageDir,IMAGE1_WIDTH,IMAGE1_HEIGHT);\n\t\t\t\t\t\t\t\tnew Lib_ThumbImage('thumb',$stpath,$largeDir,IMAGE2_WIDTH,IMAGE2_HEIGHT);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($i==0)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tif($_POST['ufile_id'][$i]!='')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$spl=\"UPDATE product_images_table SET image_path='$image', thumb_image_path='$thumb_image',large_image_path='$large_image' WHERE product_images_id='\".$_POST['ufile_id'][$i].\"'\";\n\t\t\t\t\t\t\t\t\t$obj_insert->updateQuery($spl);\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$spl=\"INSERT INTO product_images_table(product_id,image_path,thumb_image_path,type,large_image_path) VALUES('\".$product_id.\"','$image','$thumb_image','main','$large_image')\";\n\t\t\t\t\t\t\t\t\t$obj_insert->updateQuery($spl);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$update=\"UPDATE products_table set image='$image',thumb_image='$thumb_image',large_image_path='$large_image' where product_id='\".$product_id.\"'\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$obj_insert->updateQuery($update);\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\n\t\t\t\t\t\t\t\tif($_POST['ufile_id'][$i]!='')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$spl=\"UPDATE product_images_table SET image_path='$image', thumb_image_path='$thumb_image',large_image_path='$large_image' WHERE product_images_id='\".$_POST['ufile_id'][$i].\"'\";\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$spl=\"INSERT INTO product_images_table(product_id,image_path,thumb_image_path,type,large_image_path) VALUES('\".$product_id.\"','$image','$thumb_image','sub','$large_image')\";\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\t$obj_insert->updateQuery($spl);\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\n\t\t\t$sqlrelated=\"insert into cross_products_table (product_id,cross_product_ids) values('\".$product_id.\"','\".$related_val.\"')\";\n\t\t\t$objrelated=new Bin_Query();\t\t\n\t\t\t$objrelated->updateQuery($sqlrelated);\n\t\t\t\n\t\t\t$sql=\"update product_inventory_table set rol=\".$rol.\", soh=\".$soh.\" where product_id =\".((int)$_GET['prodid'] );\n\t\t\t$obj_upd=new Bin_Query();\n\t\t\t$obj_upd->updateQuery($sql);\n\t\t\t\n\t\t\t$sql=\"delete from product_attrib_values_table where product_id =\".((int)$_GET['prodid'] );\n\t\t\t$obj_del=new Bin_Query();\n\t\t\t$obj_del->updateQuery($sql);\n\t\t\t\n\t\t\t\t\n\t\t\tif(count($attribute) > 0)\n\t\t\t{\n\t\t\t\tfor($i=0;$i<count($attribute);$i++)\n\t\t\t\t{\n\t\t\t\t\tif($attribute[$i] !=0)\n\t\t\t\t\t$sq=\"INSERT INTO product_attrib_values_table(product_id,attrib_value_id) VALUES ('\".((int)$_GET['prodid'] ).\"',$attribute[$i])\";\n\t\t\t\t\t$obj_ins_1=new Bin_Query();\n\t\t\t\t\t$obj_ins_1->updateQuery($sq);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\tif(count($msrp) > 0)\n\t\t\t{\n\t\t\t\t$obj1=new Bin_Query();\n\t\t\t\t$sql=\"delete from msrp_by_quantity_table where product_id =\".((int)$_GET['prodid'] );\n\t\t\t\t$obj1->updateQuery($sql);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<count($msrp);$i++)\n\t\t\t\t{\n\t\t\t\t\tif($msrp[$i]!='' && $quantity[$i]!='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sq12=\"INSERT INTO msrp_by_quantity_table(product_id,quantity,msrp) VALUES ('\".((int)$_GET['prodid'] ).\"',$quantity[$i],$msrp[$i])\";\n\t\t\t\t\t\t$obj_ins=new Bin_Query();\n\t\t\t\t\t\t$obj_ins->updateQuery($sq12);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\t$output='\t<div class=\"alert alert-success\">\n\t\t\t\t<button data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button>Product <b>'.$title.'</b> has been updated successfully</div>';\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output='\t<div class=\"alert alert-error\">\n\t\t\t\t<button data-dismiss=\"alert\" class=\"close\" type=\"button\">×</button>Product <b>'.$title.'</b> has not been updated</div>';\n\t\n\t\t}\n\t\treturn $output;\n\t\n\t\t\n\t}", "public function updproduct(){\n \n if ($this->session->userdata('validated')) {\n \n /*Valida que la peticion http sea POST*/\n if (!$this->input->post()){\n\n $this->module($info);\n\n } else {\n\n if ($this->MRecurso->validaRecurso(2)){\n \n /*Captura Variables*/\n $name = strtoupper($this->input->post('nameproduct'));\n $costo = $this->input->post('costoProducto');\n $valor = $this->input->post('valueproduct');\n $distributionproduct = $this->input->post('distributionproduct');\n $porcent_empleado = $distributionproduct/100;\n $stock = $this->input->post('stock');\n $unidosis = $this->input->post('unidosis');\n $estado = $this->input->post('estado');\n if ($estado == 'on'){ $valueState = 'S'; } else $valueState = 'N';\n $inventario = $this->input->post('inventario');\n if ($inventario == 'on'){ $valueInvent = 'S'; } else $valueInvent = 'N';\n $idproduct = $this->input->post('idproduct'); \n\n if ($this->jasr->validaTipoString($name,1)){\n\n if ($this->jasr->validaTipoString($valor,2) && $this->jasr->validaTipoString($stock,2) && $this->jasr->validaTipoString($unidosis,2) && $this->jasr->validaTipoString($costo,2)){\n\n if ($this->jasr->validaTipoString($distributionproduct,3)){\n\n /*Envia datos al modelo para la actualizacion del producto*/\n $updateData = $this->MProduct->update_product($idproduct,$name,$valor,$porcent_empleado,$stock,$unidosis,$valueState,$costo,$valueInvent);\n\n if ($updateData == TRUE){\n\n $info['message'] = \"Producto \".$name.\" Actualizado Exitosamente\";\n $info['alert'] = 1;\n $this->module($info);\n\n } else {\n\n $info['message'] = 'No fue posible Actualizar el Producto';\n $info['alert'] = 2;\n $this->module($info);\n\n }\n\n } else {\n\n $info['message'] = 'No fue posible actualizar el Producto. Porcentaje incorrecto.';\n $info['alert'] = 2;\n $this->module($info);\n\n }\n\n } else {\n\n $info['message'] = 'No fue posible actualizar el Producto. Valor, Stock y/o Unidosis incorrecto.';\n $info['alert'] = 2;\n $this->module($info);\n\n }\n\n } else {\n\n $info['message'] = 'No fue posible actualizar el Producto. Nombre incorrecto.';\n $info['alert'] = 2;\n $this->module($info);\n\n }\n \n } else {\n \n show_404();\n \n }\n\n }\n \n } else {\n \n $this->index();\n \n }\n \n }", "public function editAction()\n {\n $productId = $this->_getParam('product_id'); \n\n $this->_model->setId($productId);\n $productModel = $this->_model; \n\n\t $form = new Core_Form_Product_Edit($productId);\n $form->setAction($this->view->url(array(\n 'module' => 'default',\n 'controller' => 'product',\n 'action' => 'edit',\n 'product_id' => $productId,\n ), NULL, TRUE\n ));\n\n if ($this->_request->isPost()) {\n\n if ($form->isValid($_POST)) {\n $productModel->edit($form->getValues());\n\t \t $this->_helper->FlashMessenger('Product item edited successfully');\n $this->_redirect($this->view->url(array(\n 'module' => 'default',\n 'controller' => 'product',\n 'action' => 'viewdetails',\n 'product_id' => $productId,\n ), null, false));\n } else {\n $form->populate($_POST);\n $this->view->form = $form;\n }\n\n } else {\n\t $this->view->form = $form;\n }\n\n }", "public function insertEditProduct(){\r\n\t\t//\t\techo \"<pre>\";print_r($_POST);die;\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$product_name = $this->input->post('product_name');\r\n\t\t\t$product_id = $this->input->post('productID');\r\n\t\t\tif ($product_name == ''){\r\n\t\t\t\t$this->setErrorMessage('error','Product name required');\r\n\t\t\t\t//\t\t\t\tredirect('admin/product/add_product_form');\r\n\t\t\t\techo \"<script>window.history.go(-1)</script>\";exit();\r\n\t\t\t}\r\n\t\t\t$sale_price = $this->input->post('sale_price');\r\n\t\t\tif ($sale_price == ''){\r\n\t\t\t\t$this->setErrorMessage('error','Sale price required');\r\n\t\t\t\t//\t\t\t\tredirect('admin/product/add_product_form');\r\n\t\t\t\techo \"<script>window.history.go(-1)</script>\";exit();\r\n\t\t\t}else if ($sale_price <= 0){\r\n\t\t\t\t$this->setErrorMessage('error','Sale price must be greater than zero');\r\n\t\t\t\techo \"<script>window.history.go(-1)</script>\";exit();\r\n\t\t\t\t//redirect('admin/product/add_product_form');\r\n\t\t\t}\r\n\t\t\tif ($product_id == ''){\r\n\t\t\t\t$old_product_details = array();\r\n\t\t\t\t$condition = array('product_name' => $product_name);\r\n\t\t\t}else {\r\n\t\t\t\t$old_product_details = $this->product_model->get_all_details(PRODUCT,array('id'=>$product_id));\r\n\t\t\t\t$condition = array('product_name' => $product_name,'id !=' => $product_id);\r\n\t\t\t}\r\n\t\t\t/*\t\t\t$duplicate_name = $this->product_model->get_all_details(PRODUCT,$condition);\r\n\t\t\t if ($duplicate_name->num_rows() > 0){\r\n\t\t\t\t$this->setErrorMessage('error','Product name already exists');\r\n\t\t\t\techo \"<script>window.history.go(-1)</script>\";exit();\r\n\t\t\t\t}\r\n\t\t\t\t*/\t\t\t$price_range = '';\r\n\t\t\tif ($sale_price>0 && $sale_price<21){\r\n\t\t\t\t$price_range = '1-20';\r\n\t\t\t}else if ($sale_price>20 && $sale_price<101){\r\n\t\t\t\t$price_range = '21-100';\r\n\t\t\t}else if ($sale_price>100 && $sale_price<201){\r\n\t\t\t\t$price_range = '101-200';\r\n\t\t\t}else if ($sale_price>200 && $sale_price<501){\r\n\t\t\t\t$price_range = '201-500';\r\n\t\t\t}else if ($sale_price>500){\r\n\t\t\t\t$price_range = '501+';\r\n\t\t\t}\r\n\t\t\t$excludeArr = array(\"gateway_tbl_length\",\"imaged\",\"productID\",\"changeorder\",\"status\",\"category_id\",\"attribute_name\",\"attribute_val\",\"attribute_weight\",\"attribute_price\",\"product_image\",\"userID\",\"product_attribute_name\",\"product_attribute_val\",\"attr_name1\",\"attr_val1\",\"attr_type1\",\"product_attribute_type\");\r\n\r\n\t\t\tif ($this->input->post('status') != ''){\r\n\t\t\t\t$product_status = 'Publish';\r\n\t\t\t}else {\r\n\t\t\t\t$product_status = 'UnPublish';\r\n\t\t\t}\r\n\r\n\t\t\t$seourl = url_title($product_name, '-', TRUE);\r\n\t\t\t$checkSeo = $this->product_model->get_all_details(PRODUCT,array('seourl'=>$seourl,'id !='=>$product_id));\r\n\t\t\t$seo_count = 1;\r\n\t\t\twhile ($checkSeo->num_rows()>0){\r\n\t\t\t\t$seourl = $seourl.$seo_count;\r\n\t\t\t\t$seo_count++;\r\n\t\t\t\t$checkSeo = $this->product_model->get_all_details(PRODUCT,array('seourl'=>$seourl,'id !='=>$product_id));\r\n\t\t\t}\r\n\t\t\tif ($this->input->post('category_id') != ''){\r\n\t\t\t\t$category_id = implode(',', $this->input->post('category_id'));\r\n\t\t\t}else {\r\n\t\t\t\t$category_id = '';\r\n\t\t\t}\r\n\t\t\t$ImageName = '';\r\n\t\t\t$list_name_str = $list_val_str = '';\r\n\t\t\t$list_name_arr = $this->input->post('attribute_name');\r\n\t\t\t$list_val_arr = $this->input->post('attribute_val');\r\n\t\t\tif (is_array($list_name_arr) && count($list_name_arr)>0){\r\n\t\t\t\t$list_name_str = implode(',', $list_name_arr);\r\n\t\t\t\t$list_val_str = implode(',', $list_val_arr);\r\n\t\t\t}\r\n\t\t\t//\t\t\t$option['attribute_name'] = $this->input->post('attribute_name');\r\n\t\t\t//\t\t\t$option['attribute_val'] = $this->input->post('attribute_val');\r\n\t\t\t//\t\t\t$option['attribute_weight'] = $this->input->post('attribute_weight');\r\n\t\t\t//\t\t\t$option['attribute_price'] = $this->input->post('attribute_price');\r\n\t\t\t$datestring = \"%Y-%m-%d %h:%i:%s\";\r\n\t\t\t$time = time();\r\n\t\t\tif ($product_id == ''){\r\n\t\t\t\t$inputArr = array(\r\n\t\t\t\t\t\t\t'created' => mdate($datestring,$time),\r\n\t\t\t\t\t\t\t'seourl' => $seourl,\r\n\t\t\t\t\t\t\t'category_id' => $category_id,\r\n\t\t\t\t\t\t\t'status' => $product_status,\r\n\t\t\t\t\t\t\t'list_name' => $list_name_str,\r\n\t\t\t\t\t\t\t'list_value' => $list_val_str,\r\n\t\t\t\t\t\t\t'price_range'=> $price_range,\r\n\t\t\t\t//\t\t\t\t\t\t\t'option' => serialize($option),\r\n\t\t\t\t\t\t\t'user_id' => $this->input->post('userID'),\r\n\t\t\t\t\t\t\t'seller_product_id'\t=> mktime()\r\n\t\t\t\t);\r\n\t\t\t}else {\r\n\t\t\t\t$inputArr = array(\r\n\t\t\t\t\t\t\t'modified' => mdate($datestring,$time),\r\n\t\t\t\t\t\t\t'seourl' => $seourl,\r\n\t\t\t\t\t\t\t'category_id' => $category_id,\r\n\t\t\t\t\t\t\t'status' => $product_status,\r\n\t\t\t\t\t\t\t'price_range'=> $price_range,\r\n\t\t\t\t\t\t\t'list_name' => $list_name_str,\r\n\t\t\t\t\t\t\t'list_value' => $list_val_str\r\n\t\t\t\t//\t\t\t\t\t\t\t'option' => serialize($option)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t//$config['encrypt_name'] = TRUE;\r\n\t\t\t$config['overwrite'] = FALSE;\r\n\t\t\t$config['allowed_types'] = 'jpg|jpeg|gif|png|bmp';\r\n\t\t\t$config['max_size'] = 2000;\r\n\t\t\t$config['upload_path'] = './images/product';\r\n\r\n\t\t\t$this->load->library('upload', $config);\r\n\r\n\r\n\t\t\t//$thumbimagepath= './images/product/thumb';\r\n\r\n\r\n\t\t\t//echo \"<pre>\";print_r($_FILES);die;\r\n\t\t\tif ( $this->upload->do_multi_upload('product_image')){\r\n\t\t\t\t$logoDetails = $this->upload->get_multi_upload_data();\r\n\t\t\t\tforeach ($logoDetails as $fileDetails){\r\n\r\n\t\t\t\t\t//$this->imageResizeWithSpace(196, 196, $fileDetails['file_name'], './images/product/');\r\n\t\t\t\t\t$this->crop_and_resize_image(200, 200, './images/product/', $fileDetails['file_name'], './images/product/thumb/');\r\n\t\t\t\t\t$ImageName .= $fileDetails['file_name'].',';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif ($product_id == ''){\r\n\t\t\t\t$product_data = array( 'image' => $ImageName);\r\n\t\t\t}else {\r\n\t\t\t\t$existingImage = $this->input->post('imaged');\r\n\r\n\t\t\t\t$newPOsitionArr = $this->input->post('changeorder');\r\n\t\t\t\t$imagePOsit = array();\r\n\t\t\t\t\t\r\n\t\t\t\tfor($p=0;$p<sizeof($existingImage);$p++) {\r\n\t\t\t\t\t$imagePOsit[$newPOsitionArr[$p]] = $existingImage[$p];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tksort($imagePOsit);\r\n\t\t\t\tforeach ($imagePOsit as $keysss => $vald) {\r\n\t\t\t\t $imgArraypos[]=$vald;\r\n\t\t\t\t}\r\n\t\t\t\t$imagArraypo0 = @implode(\",\",$imgArraypos);\r\n\t\t\t\t$allImages = $imagArraypo0.','.$ImageName;\r\n\r\n\t\t\t\t$product_data = array( 'image' => $allImages);\r\n\t\t\t}\r\n\t\t\tif ($product_id != ''){\r\n\t\t\t\t$this->update_old_list_values($product_id,$list_val_arr,$old_product_details);\r\n\t\t\t}\r\n\t\t\t$dataArr = array_merge($inputArr,$product_data);\r\n\t\t\tif ($product_id == ''){\r\n\t\t\t\t$condition = array();\r\n\t\t\t\t$this->product_model->commonInsertUpdate(PRODUCT,'insert',$excludeArr,$dataArr,$condition);\r\n\t\t\t\t$this->setErrorMessage('success','Product added successfully');\r\n\t\t\t\t$product_id = $this->product_model->get_last_insert_id();\r\n\r\n\t\t\t\t$Attr_name_str = $Attr_val_str = '';\r\n\t\t\t\t$Attr_type_arr = $this->input->post('product_attribute_type');\r\n\t\t\t\t$Attr_name_arr = $this->input->post('product_attribute_name');\r\n\t\t\t\t$Attr_val_arr = $this->input->post('product_attribute_val');\r\n\t\t\t\tif (is_array($Attr_name_arr) && count($Attr_name_arr)>0){\r\n\t\t\t\t\tfor($k=0;$k<sizeof($Attr_name_arr);$k++){\r\n\t\t\t\t\t\t$dataSubArr = '';\r\n\t\t\t\t\t\t$dataSubArr = array('product_id'=> $product_id,'attr_id'=>$Attr_type_arr[$k],'attr_name'=>$Attr_name_arr[$k],'attr_price'=>$Attr_val_arr[$k]);\r\n\t\t\t\t\t\t//echo '<pre>'; print_r($dataSubArr);\r\n\t\t\t\t\t\t$this->product_model->add_subproduct_insert($dataSubArr);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->update_price_range_in_table('add',$price_range,$product_id,$old_product_details);\r\n\t\t\t}else {\r\n\t\t\t\t$condition = array('id'=>$product_id);\r\n\t\t\t\t$this->product_model->commonInsertUpdate(PRODUCT,'update',$excludeArr,$dataArr,$condition);\r\n\t\t\t\t$this->setErrorMessage('success','Product updated successfully');\r\n\r\n\t\t\t\t$Attr_name_str = $Attr_val_str = '';\r\n\t\t\t\t$Attr_type_arr = $this->input->post('product_attribute_type');\r\n\t\t\t\t$Attr_name_arr = $this->input->post('product_attribute_name');\r\n\t\t\t\t$Attr_val_arr = $this->input->post('product_attribute_val');\r\n\t\t\t\tif (is_array($Attr_name_arr) && count($Attr_name_arr)>0){\r\n\t\t\t\t\tfor($k=0;$k<sizeof($Attr_name_arr);$k++){\r\n\t\t\t\t\t\t$dataSubArr = '';\r\n\t\t\t\t\t\t$dataSubArr = array('product_id'=> $product_id,'attr_id'=>$Attr_type_arr[$k],'attr_name'=>$Attr_name_arr[$k],'attr_price'=>$Attr_val_arr[$k]);\r\n\t\t\t\t\t\t//echo '<pre>'; print_r($dataSubArr);\r\n\t\t\t\t\t\t$this->product_model->add_subproduct_insert($dataSubArr);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->update_price_range_in_table('edit',$price_range,$product_id,$old_product_details);\r\n\t\t\t}\r\n\r\n\t\t\t//Update the list table\r\n\t\t\tif (is_array($list_val_arr)){\r\n\t\t\t\tforeach ($list_val_arr as $list_val_row){\r\n\t\t\t\t\t$list_val_details = $this->product_model->get_all_details(LIST_VALUES,array('id'=>$list_val_row));\r\n\t\t\t\t\tif ($list_val_details->num_rows()==1){\r\n\t\t\t\t\t\t$product_count = $list_val_details->row()->product_count;\r\n\t\t\t\t\t\t$products_in_this_list = $list_val_details->row()->products;\r\n\t\t\t\t\t\t$products_in_this_list_arr = explode(',', $products_in_this_list);\r\n\t\t\t\t\t\tif (!in_array($product_id, $products_in_this_list_arr)){\r\n\t\t\t\t\t\t\tarray_push($products_in_this_list_arr, $product_id);\r\n\t\t\t\t\t\t\t$product_count++;\r\n\t\t\t\t\t\t\t$list_update_values = array(\r\n\t\t\t\t\t\t\t\t'products'=>implode(',', $products_in_this_list_arr),\r\n\t\t\t\t\t\t\t\t'product_count'=>$product_count\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$list_update_condition = array('id'=>$list_val_row);\r\n\t\t\t\t\t\t\t$this->product_model->update_details(LIST_VALUES,$list_update_values,$list_update_condition);\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}\r\n\r\n\t\t\t//Update user table count\r\n/*\t\t\tif ($edit_mode == 'insert'){\r\n\t\t\t\tif ($this->checkLogin('U') != ''){\r\n\t\t\t\t\t$user_details = $this->product_model->get_all_details(USERS,array('id'=>$this->checkLogin('U')));\r\n\t\t\t\t\tif ($user_details->num_rows()==1){\r\n\t\t\t\t\t\t$prod_count = $user_details->row()->products;\r\n\t\t\t\t\t\t$prod_count++;\r\n\t\t\t\t\t\t$this->product_model->update_details(USERS,array('products'=>$prod_count),array('id'=>$this->checkLogin('U')));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n*/\r\n\t\t\tredirect('admin/product/display_product_list');\r\n\t\t}\r\n\t}", "function modifyProduct()\n{\n global $connection;\n global $updateProductError, $updateProductSuccess;\n $updateProductError = $updateProductSuccess = '';\n\n if (isset($_POST['btn_save_product'])) {\n $product_id = addslashes($_POST['txt_userid']);\n\n $updateColumnProduct = '';\n\n $productName = addslashes($_POST['productName']);\n if (!empty($productName)) {\n $updateColumnProduct .= \"productName = '$productName',\";\n }\n\n $productUnit = addslashes($_POST['productUnit']);\n if (!empty($productUnit)) {\n $updateColumnProduct .= \"productUnit = '$productUnit',\";\n }\n $productPriceBought = addslashes($_POST['productPriceBought']);\n if (!empty($productPriceBought)) {\n $updateColumnProduct .= \"productPriceBought = '$productPriceBought',\";\n }\n $productPriceSold = addslashes($_POST['productPriceSold']);\n if (!empty($productPriceSold)) {\n $updateColumnProduct .= \"productPriceSold = '$productPriceSold',\";\n }\n $expiration_date = date('Y-m-d', strtotime($_POST['expiration_date']));\n if (!empty($expiration_date)) {\n $updateColumnProduct .= \"expiration_date = '$expiration_date',\";\n }\n $fiscal_code = $_POST['fiscal_code'];\n if (!empty($fiscal_code)) {\n $updateColumnProduct .= \"fiscal_code = '$fiscal_code',\";\n }\n\n $updateColumnProduct = rtrim($updateColumnProduct, ',');\n\n $query_update = \"UPDATE product SET $updateColumnProduct WHERE productId = '$product_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateProductSuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Te dhenat u modifikuan me sukses!\", \"success\")\n </script>';\n } else {\n $updateProductError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të produktit! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "public static function updateProduct( $data )\n {\n $consulta = DataBase::consulta(\"select * from productos where producto = \\\"\".$data[\"editNameProduct\"].\"\\\"\");\n //Adquirir el id de la empresa\n $idEmpresa = DataBase::consulta(\n \"select idEmpresa from empresa\n inner join persona on empresa.idEmpresa = persona.empresa\n inner join user on user.idUser = persona.idPersona\n where idUser = \".$_SESSION[\"userLogin\"][0][\"idUser\"]\n );\n //Comprobar si el nuevo producto editado existe\n if(count($consulta) > 0 ) {\n\n DataBase::insertar('\n update productosEmpresa set\n idproducto = '.$consulta[0][\"idProducto\"].',\n idempresa = '.$idEmpresa[0][\"idEmpresa\"].',\n precio = '.$data[\"editPrecioProduct\"].',\n stock = '.$data[\"editStockProduct\"].',\n plazoEntrega= '.$data[\"editEntregaProduct\"].',\n comprar = '.$data[\"editCheckProduct\"].',\n iva = '.$data[\"editIvaProduct\"].',\n referencia = \"'.$data[\"editRefProduct\"].'\",\n precioCoste = '.$data[\"editPrecioCostProduct\"].',\n imagen = \"'.$data[\"imagenProducto\"].'\"\n where referencia = \"'.$data[\"hiddenRefProduct\"].'\"'\n );\n\n } else {\n\n DataBase::insertar('\n insert into productos (producto, categoria)\n values (\"'.$data[\"editNameProduct\"].'\", '.$data[\"editCategoryProduct\"].')\n ');\n $idProducto = DataBase::consulta(\"\n select idProducto from productos\n where producto = \\\"\".$data[\"editNameProduct\"].\"\\\"\n \");\n\n DataBase::insertar('\n update productosEmpresa set\n idproducto = '.$idProducto[0][\"idProducto\"].',\n idempresa = '.$idEmpresa[0][\"idEmpresa\"].',\n precio = '.$data[\"editPrecioProduct\"].',\n stock = '.$data[\"editStockProduct\"].',\n plazoEntrega= '.$data[\"editEntregaProduct\"].',\n comprar = '.$data[\"editCheckProduct\"].',\n iva = '.$data[\"editIvaProduct\"].',\n referencia = \"'.$data[\"editRefProduct\"].'\",\n precioCoste = '.$data[\"editPrecioCostProduct\"].',\n imagen = \"'.$data[\"imagenProducto\"].'\"\n where referencia = \"'.$data[\"hiddenRefProduct\"].'\"'\n );\n }\n }", "public function update()\r\n {\r\n\r\n $this->load->helper(array('form'));\r\n\r\n\r\n /* Load form validation library */\r\n\r\n $this->load->library('form_validation');\r\n\r\n\r\n /* Set validation rule for name field in the form */\r\n\r\n $this->form_validation->set_rules('cicdn', 'CICDN', 'required');\r\n\r\n\r\n if ($this->form_validation->run() == FALSE) {\r\n\r\n header(\"Location: {$_SERVER['HTTP_REFERER']}\");\r\n\r\n exit;\r\n\r\n } else {\r\n\r\n $data = $_REQUEST;\r\n\r\n $this->products->change($data);\r\n\r\n redirect('admin/setup/products', 'location', 301);\r\n\r\n }\r\n\r\n }", "public function update_post()\n {\n\t\t$product_id = $this->post('product_id');\n\t\t$name = $this->post('name');\n $sku = $this->post('sku');\n $category = $this->post('category');\n $price = $this->post('price');\n\n\n\t\t$productData = array(\n 'name' => $name,\n 'sku' => $sku,\n 'category' => $category,\n 'price' => $price, \n );\n\t\n\t\t$this->db->where('id', $product_id);\n\t\t$this->db->update('products', $productData);\n\t\t$this->response([\n\t\t\t'status' => true,\n\t\t\t'message' => \"Update product details successfully\",\n\t\t], Restserver\\Libraries\\REST_Controller_Definitions::HTTP_CREATED); // CREATED (201) being the HTTP response code\n\t\texit;\n\t}", "public function edit(Product $product)\n {\n // \n }", "function update()\n\t{\n\t\t$id = getParameter('id');\n\t\t$name = getParameter('name');\n\t\t$price = getParameter('price');\n\t\t$img = $_FILES['image']['tmp_name'];\n\t\t$image = file_get_contents($img);\n\t\t$quantity = getParameter('quantity');\n\t\t$category = getParameter('category');\n\t\t$brand = getParameter('brand');\n\t\t// if ($category == 'VEST') {\n\t\t// \t$category = 1;\n\t\t// } elseif ($category == 'SƠ MI') {\n\t\t// \t$category = 2;\n\t\t// } elseif ($category == 'CARAVAT') {\n\t\t// \t$category = 3;\n\t\t// } elseif ($category == 'NƠ') {\n\t\t// \t$category = 4;\n\t\t// } elseif ($category == 'KHĂN CÀI VEST') {\n\t\t// \t$category = 5;\n\t\t// } elseif ($category == 'GIÀY DA') {\n\t\t// \t$category = 6;\n\t\t// } elseif ($category == 'ÁO DA') {\n\t\t// \t$category = 7;\n\t\t// } elseif ($category == 'QUẦN ÂU') {\n\t\t// \t$category = 8;\n\t\t// }\n\n\t\t// if ($brand == 'Adam') {\n\t\t// \t$brand = 1;\n\t\t// }\n\n\n\t\t$errors = [];\n\n\t\tif (count($errors > 0)) {\n\t\t\t$this->view->load('product/edit', [\n\t\t\t\t'errors' => $errors\n\t\t\t]);\n\t\t} else {\n\t\t\t$product = $this->model->product->update($id, [\n\t\t\t\t'name' => $name,\n\t\t\t\t'price' => $price,\n\t\t\t\t'image' => $image,\n\t\t\t\t'quantity' => $quantity,\n\t\t\t\t'categories_id' => $category,\n\t\t\t\t'brand' => $brand\n\t\t\t]);\n\n\t\t\tif ($product) {\n\t\t\t\t$this->view->load('product/index');\n\t\t\t} else {\n\t\t\t\t$this->layout->set('auth_layout');\n\t\t\t\t$this->view->load('product/edit', [\n\t\t\t\t\t'error_message' => 'Cập nhật không thành công'\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public function update()\n {\n\t $dataArr = array(\n\t\t'id' => $this->input->post('id'),\n\t\t'paper_code' => $this->input->post('paper_code'),\n\t\t'subject' => $this->input->post('subject'),\n\t\t'min_marks' => $this->input->post('min_marks'),\n\t\t'max_marks' => $this->input->post('max_marks')\n\t\t);\n\t $SetUp=new SetUpModel;\n $SetUp->update_product($dataArr);\n redirect(base_url('index.php/SetUp'));\n }", "function setProduct( $product )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $product ) == \"ezproduct\" )\n {\n $this->ProductID = $product->id();\n }\n }", "function es_save_custom_quickedit_product( $product ) {\n\tif ( isset( $_REQUEST['member_price'] ) AND ! empty( $_REQUEST['member_price'] ) ) {\n\t\tupdate_post_meta( $product->id, 'member_price', wc_clean( $_REQUEST['member_price'] ) );\n\t}\n\telse \n\t\tdelete_post_meta( $product->id, 'member_price' );\n}", "public function edit(Product_option $product_option)\n {\n //\n }", "public function edit(Product $product) //Editar\n {\n //\n }", "function Update_product_Stmt (){\n\nif (isset($_POST[\"Update_product\"])) {\n\n\n// Defining Variables for product Update SQL Statement \n\n$ProductID=$_POST['ProductID'];\n$ProductName=$_POST['ProductName'];\n$UserID=$_POST['UserID'];\n$AgentNo=$_POST['AgentNo'];\n$UpdateSQLproduct = \" UPDATE product SET \n\nProductID='$ProductID',ProductName='$ProductName',UserID='$UserID',AgentNo='$AgentNo' WHERE ProductID='$ProductID'\";\n// END of Update SQL Statement for product\n\n\n$Result_update = mysql_query($UpdateSQLproduct) or die(mysql_error());} //End If\n}", "function uploadProductForm( $retire_id, $product_id, $action_id, $category_id ){\r\n if($action_id == 1){\r\n $get_product_category = $this->connection->prepare (\"\r\n SELECT product_id, category_name \r\n FROM pro_category \r\n WHERE product_id=? \r\n \" );\r\n $get_product_category->bind_param(\"i\",$category_id);\r\n $send_id = 11;\r\n }else{\r\n $get_product_category = $this->connection->prepare (\"\r\n SELECT product_id, category_name \r\n FROM pro_category \r\n \" );\r\n $send_id = 7;\r\n }\r\n $get_product_category->execute();\r\n $get_product_category->bind_result( $product_category_id, $category_name );\r\n \r\n //create a form to be able to submit the product\r\n if($action_id>0){\r\n $heading = \"<h3>Update the product</h3>\";\r\n }else{\r\n $heading = \"<h3>Upload the product</h3>\";\r\n }\r\n echo \r\n \"<form id='upload_product_holder' action='object.php' method='post' enctype='multipart/form-data' class='upload_holder' style='display:block;'>\".\r\n $heading.\r\n \"<label class='label'> Choose Product Category </label>\".\r\n\r\n //create a select to select category name options \r\n \"<select name='product_category_id' class='text_inpu more_height'>\";\r\n\r\n //loop through each category\r\n while ( $get_product_category->fetch() ){\r\n //create product category names options to choose which category a product belongs to.\r\n echo \"<option value='\".$product_category_id.\"'>\".$category_name.\"<option/>\";\r\n }\r\n \r\n //close select options created\r\n echo\r\n \"</select>\";\r\n \r\n \r\n /*get product info if action is admin update*/\r\n if($action_id==1){\r\n $get_product = $this->connection->prepare (\"\r\n SELECT product_name, brand_id , product_description, product_color, weight, price\r\n FROM product \r\n WHERE product_id = ? \r\n \" );\r\n $get_product->bind_param(\"i\",$product_id);\r\n $get_product->execute();\r\n $get_product->bind_result( $product_name, $product_brand_id, $product_description, $product_color, $weight, $price );\r\n while($get_product->fetch()){}\r\n }else{\r\n $product_name = \"\";\r\n $product_brand_id = \"\"; \r\n $product_description = \"\"; \r\n $product_color = \"\"; \r\n $weight = \"\"; \r\n $price = \"\";\r\n }\r\n \r\n /*\r\n * get the brand name created in the database\r\n * To determine which brand a product belongs to\r\n */\r\n if($action_id==1){\r\n $get_product_brand = $this->connection->prepare(\"\r\n SELECT brand_id, brand_name \r\n FROM brand \r\n WHERE brand_id=?\r\n \");\r\n $get_product_brand->bind_param(\"i\",$product_brand_id);\r\n }else{\r\n $get_product_brand = $this->connection->prepare(\"\r\n SELECT brand_id, brand_name \r\n FROM brand \r\n \");\r\n }\r\n $get_product_brand->execute();\r\n $get_product_brand->bind_result( $brand_id, $brand_name );\r\n \r\n //create a select input to create brand name options\r\n echo \r\n \"<label class='label'> Choose Brand Name </label>\". \r\n \"<select name='product_brand_name' class='text_inpu more_height'>\";\r\n \r\n while ( $get_product_brand->fetch() ){\r\n \r\n $product_brand_name = $brand_id;\r\n //create options to choose brand name\r\n echo \"<option value='\".$product_brand_name.\"'>\".$brand_name.\"<option/>\";\r\n }\r\n \r\n //close the select input \r\n echo\r\n \"</select>\";\r\n echo\r\n \r\n \"</select>\".\r\n \"<label class='label'> Product Name </label>\".\r\n \"<input type='text' name='product_name' value='\".$product_name.\"' class='text_inpu' />\".\r\n \"<label class='label'> Product description </label>\".\r\n \"<textarea type='text' name='product_description' value='\".$product_description.\"' class='text_inpu textarea' maxlength='240' >\".$product_description.\"</textarea>\".\r\n \"<label class='label'> Product color ( Separated by comma ) </label>\".\r\n \"<input type='text' name='product_color' value='\".$product_color.\"' class='text_inpu' />\".\r\n \"<label class='label'> Product photo </label>\".\r\n \"<input type='file' name='product_photo[]' multiple class='text_inpu' />\".\r\n \"<label class='label'> Product size/weight available ( Separated by comma )</label>\".\r\n \"<input type='text' name='product_weight' value='\".$weight.\"' class='text_inpu' />\".\r\n \"<label class='label'> Product Prices by size/weight above ( Separated by comma ) </label>\".\r\n \"<input type='number' name='product_price' value='\".$price.\"' class='text_inpu' />\".\r\n \r\n \"<input type='hidden' name='product_match' value='0' />\".\r\n \"<input type='hidden' name='update_product_id' value='\".$product_id.\"' />\";\r\n \r\n /*\r\n * get the product type from the database\r\n */\r\n $get_product_type = $this->connection->prepare(\"\r\n SELECT type_id, type_name \r\n FROM pro_type \" );\r\n $get_product_type->execute();\r\n $get_product_type->bind_result( $type_id, $type_name );\r\n \r\n /*\r\n *Create a type select input to create options to choose\r\n */\r\n echo \r\n \"<label class='label'> Choose Product Type </label>\". \r\n \"<select name='product_type_id' class='text_inpu more_height'>\";\r\n \r\n while ( $get_product_type->fetch() ){\r\n \r\n $product_type_id = $type_id;\r\n \r\n echo \"<option value='\".$product_type_id.\"'>\".$type_name.\"<option/>\";\r\n \r\n }\r\n \r\n echo \"</select>\";\r\n \r\n echo\r\n \"<label class='label'>Gender</label>\".\r\n \"<select name='gender' class='text_inpu more_height'>\".\r\n \"<option value='1'>\".\"Unisex\".\"</option>\".\r\n \"<option value='2'>\".\"Women\".\"</option>\".\r\n \"<option value='3'>\".\"men\".\"</option>\".\r\n \"</select>\".\r\n \"<input type='hidden' name='send_id' value='\".$send_id.\"' />\".\r\n \"<input type='hidden' name='action_id' value='\".$action_id.\"' />\".\r\n \"<input type='submit' name='upload_product' value='submit' class='submit_btn ' />\".\r\n \"</form>\";\r\n \r\n //close connection\r\n $this->connection->close();\r\n }", "function add_product_fields( $product_id,\n$product ) {\nif ( $product->post_type == 'products' ) {\n// Store data in post meta table if present in post data\nif ( isset( $_POST['product_SKU'] ) &&\n$_POST['product_SKU'] != '' ) {\nupdate_post_meta( $product_id, 'SKU',\n$_POST['product_SKU'] );\n}\n\nif ( isset( $_POST['product_position'] ) &&\n$_POST['product_position'] != '' ) {\nupdate_post_meta( $product_id, 'position',\n$_POST['product_position'] );\n}\n}\n}", "public function actionUpdate($id)\r\n {\r\n // Access check\r\n self::checkAdmin();\r\n\r\n // Get the list of categories for the drop-down list\r\n $categoriesList = Category::getCategoriesListAdmin();\r\n\r\n // We receive data on a specific order\r\n $product = Product::getProductById($id);\r\n\r\n // Form processing\r\n if (isset($_POST['submit'])) {\r\n // If the form is submitted\r\n // Get data from the edit form. Validate values if necessary.\r\n $options['name'] = $_POST['name'];\r\n $options['code'] = $_POST['code'];\r\n $options['price'] = $_POST['price'];\r\n $options['category_id'] = $_POST['category_id'];\r\n $options['brand'] = $_POST['brand'];\r\n $options['availability'] = $_POST['availability'];\r\n $options['description'] = $_POST['description'];\r\n $options['is_new'] = $_POST['is_new'];\r\n $options['is_recommended'] = $_POST['is_recommended'];\r\n $options['status'] = $_POST['status'];\r\n\r\n // Save changes\r\n if (Product::updateProductById($id, $options)) {\r\n\r\n\r\n // If the record is saved\r\n // Check if the image is loaded through the form\r\n if (is_uploaded_file($_FILES[\"image\"][\"tmp_name\"])) {\r\n\r\n // If downloaded, move it to the desired folder, give a new name\r\n move_uploaded_file($_FILES[\"image\"][\"tmp_name\"], $_SERVER['DOCUMENT_ROOT'] . \"/upload/images/products/{$id}.jpg\");\r\n }\r\n }\r\n\r\n // Redirecting the user to the product management page\r\n header(\"Location: /admin/product\");\r\n }\r\n\r\n //Connect the view\r\n require_once(ROOT . '/views/admin_product/update.php');\r\n return true;\r\n }", "public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }", "public function actionProductUpdate1()\n\t{\t\n\t\t\n\t\t$data = $_POST;\n\t\t$connection = Yii::$app->getDb();\n\t\tif(isset($data['id'])){\n\t\t\ttry{\n\n\t\t\t\t$id = $data['id'];\n\t\t\t\t$productData = $data['data'];\n\t\t\t\t$logFIle = 'product/update/'.$id;\n\t\t\t\tData::createLog('getting walmart config : ',$logFIle,'a');\n\t\t\t\t$walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$data['merchant_id'].\"'\",'one','select');\n\n\t\t\t\t$walmartApi = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key']);\n\t\t\t\tData::createLog('create product on walmart : ',$logFIle,'a');\n\n\t\t\t\t$preparedData = $walmartApi->createProductOnWalmart([$id],$walmartApi,$data['merchant_id'],$connection,true);\n\t\t\t\t//Data::createLog('response:'.print_r($preparedData,true),$logFIle,'a');\n\t\t\t\tData::createLog('got prepared data : ',$logFIle,'a');\n\t\t\t\tforeach ($productData as $key => $pro_val) \n\t\t\t\t{\n\t\t\t\t\tforeach($pro_val as $index=>$val){\n\t\t\t\t\t\tswitch($index){\n\t\t\t\t\t\t\tcase 'name':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['productName'] = '<![CDATA[' . $val . ']]>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['longDescription'] = '<![CDATA[' . $val . ']]>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'shelfDescription':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['shelfDescription'] = '<![CDATA[' . $val . ']]>';\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'main_image':\n\t\t\t\t\t\t\t\t\t$preparedData['Product']['mainImage'] = [\n\t\t\t\t\t\t 'mainImageUrl' => $val,\n\t\t\t\t\t\t 'altText' => isset($pro_val['shelfDescription'])?$pro_val['shelfDescription']:$pro_val['sku'],\n\t\t\t\t\t\t ];\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'default':\n\t\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\n\t\t\t\t}\n\n\t\t\t\t$dir = Yii::getAlias('@webroot').'/frontend/modules/walmart/filestorage/product/update/';\n\t\t\t\t$filePath = $dir.$data['merchant_id'].'.php';\n\t\t\t\tif(file_exists($filePath)){\n\n\t\t\t\t\t$storedData = require $filePath;\n\t\t\t\t\tunset($preparedData['MPItemFeed']['_value'][0]);\n\t\t\t\t\t$feedItems = $preparedData['MPItemFeed']['_value'];\n\t\t\t\t\t$storedItems = $storedData['MPItemFeed']['_value'];\n\t\t\t\t\t$feedItems = array_merge($storedItems,$feedItems);\n\t\t\t\t\t$preparedData['MPItemFeed']['_value'] = $feedItems;\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!file_exists($dir)) {\n\t\t mkdir($dir, 0775, true);\n\n\t\t }\n\t\t Data::createLog('saving data : ',$logFIle,'a');\n\t\t\t\tfile_put_contents($filePath, '<?php return $arr = ' . var_export($preparedData, true) . ';');\n\t\t Data::createLog('Result : '.json_encode($preparedData),$logFIle,'a');\n\t\t }\n\t\t catch(Exception $e){\n\t\t \tData::createLog('Exception : '.$e->getMessage(),$logFIle,'a');\n\t\t }\n\t }\n\t}", "public function actionProductupdate()\n\t{\n\t\tif($_POST)\n\t\t{\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$product=$_POST;\n\t\t\t\t$path='productupdate/'.$product['merchant_id'].'/update.log';\n\t\t\t\t$walmartConfig=[];\n\t\t\t $walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$product['merchant_id'].\"'\",'one','select');\n\t\t\t $merchant_id = $product['merchant_id'];\n\t\t\t if(is_array($walmartConfig) && count($walmartConfig)>0)\n\t\t\t {\n\t\t\t \tData::createLog(\"walmart_configuration available: \".PHP_EOL,$path);\n\t\t\t //$walmartHelper = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key'],$walmartConfig['consumer_channel_type_id']);\n\t\t\t // define(\"MERCHANT_ID\", $merchant_id);\n\t\t\t if(isset($product['type']) && $product['type']==\"price\")\n\t\t\t {\n\t\t\t \t//update custom price on walmart\n\t\t\t \t/*$updatePrice = Data::getCustomPrice($product['price'],$merchant_id);\n\t\t\t \tif($updatePrice)\n\t\t\t \t\t$product['price']=$updatePrice;*/\n\n\t\t\t \t$product['price'] = WalmartRepricing::getProductPrice($product['price'], $product['type'], $product['id'], $merchant_id);\n\t\t\t \t\n\t\t\t \t//change price log\n\t\t\t \t//$path='productupdate/price/'.$merchant_id.'/'.Data::getKey($product['sku']).'.log';\n\t\t\t \t//Data::createLog(\"price data: \".json_encode($product).PHP_EOL,$path);\n\t\t\t \t$shopDetails = Data::getWalmartShopDetails(MERCHANT_ID);\n\t\t\t $product['currency'] = isset($shopDetails['currency'])?$shopDetails['currency']:'USD';\n\n\t\t\t //define(\"CURRENCY\", $currency);\n\t\t\t //$walmartHelper->updatePriceOnWalmart($product,\"webhook\");\n\t\t\t }\n\t\t\t elseif(isset($product['type']) && $product['type']==\"inventory\")\n\t\t\t {\n\t\t\t \t//change price log\n\t\t\t \t//$path='productupdate/inventory/'.$merchant_id.'/'.Data::getKey($product['sku']).'.log';\n\t\t\t \t//Data::createLog(\"inventory data: \".json_encode($product).PHP_EOL,$path);\n\t\t\t \t//$walmartHelper->updateInventoryOnWalmart($product,\"webhook\");\n\n\t\t\t }\n\t\t\t //save product update log\n\t\t\t $productExist=Data::sqlRecords(\"SELECT id FROM walmart_price_inventory_log WHERE merchant_id='\".$product['merchant_id'].\"' and sku='\".addslashes($product['sku']).\"' LIMIT 0,1\",'one','select');\n\t\t\t if(is_array($productExist) && count($productExist)>0)\n\t\t\t {\n\n\t\t\t \t$query=\"UPDATE walmart_price_inventory_log SET type='\".$product['type'].\"',data='\".addslashes(json_encode($product)).\"' WHERE merchant_id='\".$product['merchant_id'].\"' and sku='\".addslashes($product['sku']).\"'\";\n\t\t\t \tData::createLog(\"product update data: \".$query.PHP_EOL,$path);\n\t\t\t \t//echo \"<br>\".\"update\".$query;\n\t\t\t \tData::sqlRecords($query,null,'update');\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t \t$sku = addslashes($product['sku']);\n\t\t\t \t$query=\"INSERT INTO `walmart_price_inventory_log`(`merchant_id`,`type`,`data`,`sku`) VALUES('{$product['merchant_id']}','{$product['type']}','\".addslashes(json_encode($product)).\"','{$sku}')\";\n\t\t\t \t//echo \"<br>\".\"insert\".$query;\n\t\t\t \tData::createLog(\"product insert data: \".$query.PHP_EOL,$path);\n\t\t\t \tData::sqlRecords($query,null,'insert');\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tData::createLog(\"productupdate error \".json_decode($_POST),'productupdate/exception.log','a',true);\n\t\t\t}\n\t }\n\t else\n\t\t{\n\t\t\tData::createLog(\"product update error\");\n\t\t}\n\t}", "public function update(ProductFormRequest $request, $id) {\n \n// recupera os dados do formulario\n \n $dataForm = $request->all();\n // recupera o item\n $product = $this->product->find($id);\n // faz a verficacao do ativo\n if(!isset($dataForm['active'])){\n $dataForm['active'] = 0;\n }\n \n $update = $product->update($dataForm);\n \n if($update)\n return redirect()->route('produtos.index');\n else \n return redirect()->route('produtos.edit',$id)\n ->with(['errors' => 'não foi possivel atualizar o item']);\n \n \n }", "function _edit_update() {\n\t\t$sfgs = $_POST;\n//\t\tunset($sfgs['sfgs_header']['kode_sfg']);\n\t\tunset($sfgs['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($sfgs['sfgs_detail']['id_sfgs_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($sfgs['sfgs_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('sfgs/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('sfgs_detail', $sfgs['sfgs_detail']);\n $id_sfgs_header = $sfgs['sfgs_header']['id_sfgs_header'];\n\n \t\t\t$data = array (\n \t\t\t\t'id_sfgs_header' =>\t$id_sfgs_header,\n 'quantity_sfg' => $sfgs['sfgs_header']['quantity_sfg'],\n \t\t\t\t'uom_sfg' => $sfgs['sfgs_header']['uom_sfg'],\n \t\t\t);\n\n $input_detail_success = FALSE;\n\n if(($this->m_sfgs->sfgs_header_update($data))&&\n ($this->m_sfgs->sfgs_details_delete($id_sfgs_header))) {\n \t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\t\t\tif((!empty($sfgs['sfgs_detail']['quantity'][$i]))&&(!empty($sfgs['sfgs_detail']['material_no'][$i]))) {\n\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$sfgs_detail['quantity'] = $sfgs['sfgs_detail']['quantity'][$i];\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_h_detail'] = $sfgs['sfgs_detail']['id_sfgs_h_detail'][$i];\n\n\t\t\t\t\t\t$sfgs_detail['material_no'] = $sfgs['sfgs_detail']['material_no'][$i];\n\t\t\t\t\t\t$sfgs_detail['material_desc'] = $sfgs['sfgs_detail']['material_desc'][$i];\n\t\t\t\t\t\t$sfgs_detail['uom'] = $sfgs['sfgs_detail']['uom'][$i];\n\n\t\t\t\t\t\tif($this->m_sfgs->sfgs_detail_insert($sfgs_detail))\n $input_detail_success = TRUE;\n\t\t\t\t\t}\n\n \t \t}\n }\n\n \t\t\t$this->db->trans_complete();\n\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diubah', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '004'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diapprove', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '005'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\n\t}", "public function update(Request $request, Product $product) //Actualizar\n {\n //\n }", "public function update(Request $request)\n {\n $p;\n switch($request->product_type){\n case 'simple': \n $p = Product::where('id', $request->id)->first();\n\n $p->product_name = $request->product_name;\n $p->product_sku = $request->product_sku;\n $p->product_slug = $request->product_name;\n $p->product_category = $request->product_category;\n $p->product_brand = $request->product_brand;\n $p->product_short_desc = $request->product_short_desc;\n $p->product_long_desc = $request->product_long_desc;\n $p->product_type = $request->product_type;\n $p->product_mrp = $request->product_mrp;\n $p->product_price = $request->product_price;\n $p->product_quantity = $request->product_quantity;\n $p->product_primary_image = $request->product_primary_image;\n $p->product_other_images = !empty($request->product_other_images) ? $request->product_other_images : null;\n $p->product_meta_keywords = $request->product_meta_keywords;\n $p->product_meta_desc = $request->product_meta_desc;\n $p->product_published = $request->product_published;\n $p->product_featured = ($request->product_featured == true) ? 1 : 0;\n $p->product_tags = $request->product_tags;\n $p->product_dimensions = $request->product_dimensions;\n $p->updated_at = Carbon::now();\n $p->save();\n\n break;\n case 'affiliate': \n $p = Product::where('id', $request->id)->first();\n\n $p->product_name = $request->product_name;\n $p->product_sku = $request->product_sku;\n $p->product_slug = $request->product_name;\n $p->product_category = $request->product_category;\n $p->product_brand = $request->product_brand;\n $p->product_affiliate_link = $request->product_affiliate_link;\n $p->product_short_desc = $request->product_short_desc;\n $p->product_long_desc = $request->product_long_desc;\n $p->product_type = $request->product_type;\n $p->product_mrp = $request->product_mrp;\n $p->product_price = $request->product_price;\n $p->product_quantity = 0;\n $p->product_primary_image = $request->product_primary_image;\n $p->product_other_images = !empty($request->product_other_images) ? $request->product_other_images : null;\n $p->product_meta_keywords = $request->product_meta_keywords;\n $p->product_meta_desc = $request->product_meta_desc;\n $p->product_published = $request->product_published;\n $p->product_featured = ($request->product_featured == true) ? 1 : 0;\n $p->product_tags = $request->product_tags;\n $p->product_dimensions = $request->product_dimensions;\n $p->updated_at = Carbon::now();\n $p->save();\n\n break;\n case 'variable': break;\n }\n \n return response()->json($p, 200);\n }", "function product_put()\n {\n $this->form_validation->set_data($this->put());\n\n if($this->form_validation->run('product_put') != false){\n\n $product = $this->put();\n\n $product_id = $this->api_model->insert_product($product);\n\n if(!$product_id)\n {\n $this->response(array('status' => 'failure', 'message' => 'An unexpected error occured while trying to create the product'), REST_CONTROLLER::HTTP_INTERNAL_SERVER_ERROR);\n }\n else\n {\n $this->response(array('status' => 'success', 'message' => 'created'));\n }\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => $this->form_validation->get_errors_as_array()), REST_Controller::HTTP_BAD_REQUEST);\n }\n }", "public function update()\n\t{\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call update method of model to update product info of cart\n\t\t$model->update($post);\n\t\t$this->_carthelper->cartFinalCalculation();\n\t\t$this->_carthelper->carttodb();\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t$this->setRedirect($link);\n\t}", "public function post_edit( $id )\n {\n // Fetch the product record\n $product = Product::find( $id ); \n \n // Record Exists\n if( isSet($product->exists) )\n {\n // Loop through all of the submitted data\n foreach( Input::all() as $key => $value){\n \n // Determine if input was empty\n $val = (bool) trim($value);\n \n // If empty value..replace with N/A\n if(!$val) Input::replace(array($key => 'N/A'));\n }\n \n // Update db fields with escaped data.\n $product->product_detail->fill( Input::all() )->save_escape();\n \n // Redirect the user\n return Redirect::to_route('admin-products');\n }\n \n // Otherwise throw 404 error\n else return Response::error(404);\n }", "public function edit(ProductAttributes $productAttributes)\n {\n //\n }", "public function edit(StoreProduct $storeProduct)\n {\n //\n }", "public function edit(ImgProduct $imgProduct)\n {\n //\n }", "function ProductGroupEdit()\n {\n // loading the prototypes of form fields\n loadCoreFile('html_form.php');\n\n // getting the list of attributes to show\n $settings = modApiFunc('Settings', 'getParamListByGroup',\n 'PRODUCT_GROUP_EDIT', SETTINGS_WITH_DESCRIPTION);\n $this -> _attrs = array('ID' => 'YES');\n if (is_array($settings))\n foreach($settings as $v)\n {\n if ($v['param_name'] == 'CTL_PGE_TABULATION')\n $this -> _tabbing = $v['param_current_value'];\n elseif ($v['param_current_value'] == 'YES')\n $this -> _attrs[$v['param_name']] = 'YES';\n }\n\n // initializing the template filler\n $this -> mTmplFiller = new TmplFiller();\n\n // filling the headermap\n $this -> _headermap = array(\n 'ID' => 'PRD_ID_NAME',\n 'CTL_PGE_NAME' => 'PRD_NAME_NAME',\n 'CTL_PGE_SALEPRC' => 'PRD_SALEPRC_NAME',\n 'CTL_PGE_LISTPRC' => 'PRD_LISTPRC_NAME',\n 'CTL_PGE_QUINSTOCK' => 'PRD_QUINSTOCK_NAME',\n 'CTL_PGE_LOWLEV' => 'PRD_LOWLEV_NAME',\n 'CTL_PGE_SKU' => 'PRD_SKU_NAME',\n 'CTL_PGE_QUINORDER' => 'PRD_QUINORDER_NAME',\n 'CTL_PGE_AVAIL' => 'PRD_AVAIL_NAME',\n 'CTL_PGE_TAXCLASS' => 'PRD_TAX_CLASS_NAME',\n 'CTL_PGE_MANUFACTURER' => 'PRD_MANUFACTURER_NAME',\n 'CTL_PGE_SHIPPRC' => 'PRD_SHIPPRC_NAME',\n 'CTL_PGE_HANDPRC' => 'PRD_HANDRC_NAME',\n 'CTL_PGE_WEIGHT' => 'PRD_WEIGHT_NAME',\n 'CTL_PGE_FREESHIP' => 'PRD_FREESHIP_NAME',\n 'CTL_PGE_NEEDSHIP' => 'PRD_NEEDSHIP_NAME',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'PRD_CUSTOMER_REVIEWS_NAME'\n );\n\n // filling the attribute map\n $this -> _attrmap = array(\n 'ID' => 'ID',\n 'CTL_PGE_NAME' => 'Name',\n 'CTL_PGE_SALEPRC' => 'SalePrice',\n 'CTL_PGE_LISTPRC' => 'ListPrice',\n 'CTL_PGE_QUINSTOCK' => 'QuantityInStock',\n 'CTL_PGE_LOWLEV' => 'LowStockLevel',\n 'CTL_PGE_SKU' => 'SKU',\n 'CTL_PGE_QUINORDER' => 'MinQuantity',\n 'CTL_PGE_AVAIL' => 'Available',\n 'CTL_PGE_TAXCLASS' => 'TaxClass',\n 'CTL_PGE_MANUFACTURER' => 'Manufacturer',\n 'CTL_PGE_SHIPPRC' => 'PerItemShippingCost',\n 'CTL_PGE_HANDPRC' => 'PerItemHandlingCost',\n 'CTL_PGE_WEIGHT' => 'Weight',\n 'CTL_PGE_FREESHIP' => 'FreeShipping',\n 'CTL_PGE_NEEDSHIP' => 'NeedShipping',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'CustomerReviews'\n );\n }", "public function edit(Product $produto)\n {\n //\n }", "function _edit_update() {\n\t\t$tpaket = $_POST;\n\t\tunset($tpaket['tpaket_header']['id_tpaket_header']);\n\t\tunset($tpaket['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($tpaket['tpaket_detail']['id_tpaket_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($tpaket['tpaket_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('tpaket/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save']) || isset($_POST['button']['approve'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('tpaket_detail', $tpaket['tpaket_detail']);\n\n $id_tpaket_header = $this->uri->segment(3);\n $postingdate = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n\n \t\t\t$data = array (\n \t\t\t\t'id_tpaket_header' => $id_tpaket_header,\n \t\t\t\t'posting_date' => $postingdate,\n \t\t\t);\n\t\t\t\t/*$sirah= $id_tpaket_header;\n\t\t\t\t$ti=\"SELECT * FROM t_tpaket_detail_paket WHERE id_tpaket_header='$sirah'\";\n\t\t\t\t$tq=mysql_query($ta);\n\t\t\t\t$count1=mysql_num_rows($tq);*/\n \t\n\t\t\t $this->m_tpaket->tpaket_header_update($data);\n $edit_tpaket_header = $this->m_tpaket->tpaket_header_select($id_tpaket_header);\n\n \t\t\tif ($this->m_tpaket->tpaket_header_update($data)) {\n $input_detail_success = FALSE;\n \t\t\t if($this->m_tpaket->tpaket_details_delete($id_tpaket_header) && $this->m_tpaket->batch_delete($id_tpaket_header) ) {\n \t//\tfor($i = 1; $i <= $count; $i++) {\n \t\t\t\t\tif((!empty($tpaket['tpaket_detail']['quantity'][$i]))&&(!empty($tpaket['tpaket_detail']['material_no'][$i]))) {\n\n \t\t\t\t\t\t/*$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n \t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n \t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'][$i];\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $tpaket['tpaket_detail']['material_desc'][$i];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][$i];*/\n\n $tpaket_to_approve['item'][$i] = $tpaket_detail['id_tpaket_h_detail'];\n $tpaket_to_approve['material_no'][$i] = $tpaket_detail['material_no'];\n $tpaket_to_approve['quantity'][$i] = $tpaket_detail['quantity'];\n $tpaket_to_approve['uom'][$i] = $tpaket_detail['uom'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['qty'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = 1;\n\t\t\t\t\t\t$batch['BaseLinNum'] = 1;\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$item=$tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$date=date('ymd');\n\t\t\t\t\t\t$whs=$this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t$q=\"SELECT * FROM m_batch WHERE ItemCode = '$item' AND Whs ='$whs'\";\n\t\t\t\t\t\t$cek=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$item'\";\n\t\t\t\t\t\t$cek1=mysql_query($cek);\n\t\t\t\t\t\t$ra=mysql_fetch_array($cek1);\n\t\t\t\t\t\t$b=$ra['BATCH'];\n\t\t\t\t\t\t$tq=mysql_query($q);\n\t\t\t\t\t\t$count1=mysql_num_rows($tq) + 1;\n\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"0\";\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$dg=\"00\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$num=$item.$date.$dg.$count1;\n\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch['BatchNum'] = $num;\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$batch['BaseType'] = 4;\n\t\t\t\t\t\t$tpaket_detail['num'] = $num;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $ra['MAKTX'];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][1];\n\t\t\t\t\t\tif ($b=='Y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch_in=$this->m_tpaket->batch_insert($batch);\n\t\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$item','$num','$batch[Quantity]','$whs')\");\n\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$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t$batch['BaseLinNum'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n \t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'][$i];\n\t\t\t\t\t\t$batch['BatchNum'] = $tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t$batch['BaseType'] = 4;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);*/\n\n if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($tpaket_detail)) {\n /* if($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($tpaket_detail['material_no'])) {\n if($item_pakets !== FALSE) {\n \t\t$k = 1;\n unset($item_paket);\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$k] = $value;\n \t\t\t}\n \t\t\t$k++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }*/\n\t\t\t\t\t\t\t\t\t// echo \"$batch[BaseEntry],$batch[Quantity],$batch[BaseLinNum],$batch[ItemCode],$batch[BatchNum],$b <br>\";\n\t\t\t\t\t//\techo $tpaket_detail['id_tpaket_header'].\",\".$tpaket_detail['quantity'].\",\".$tpaket_detail['material_no'].\",\".$tpaket_detail['num'];\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t// $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\tfor($i = 1; $i <= $count; $i++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $i;\n\t\t\t\t\t\t\t $batch1['BaseLinNum'] =$i;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseType'] = 4;\n\t\t\t\t\t\t\t $batch1['ItemCode'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $qq=\"SELECT * FROM m_batch WHERE ItemCode = '$batch1[ItemCode]' AND Whs ='$whs'\";\n\t\t\t\t\t\t\t $cekQQ=mysql_query($qq);\n\t\t\t\t\t\t\t $rQ=mysql_num_rows($cekQQ);\n\t\t\t\t\t\t\t $num_detail=$tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t\t $date=date('ymd');\n\t\t\t\t\t\t\t $cekq=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$batch1[ItemCode]'\";\n\t\t\t\t\t\t\t $cekr=mysql_query($cekq);\n\t\t\t\t\t\t\t $rai=mysql_fetch_array($cekr);\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $rai['MAKTX'];\n\t\t\t\t\t\t\t $bet=$ra['MAKTX'];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $batch1['Createdate'] =$batch['Createdate'] ;\n $tpaket_detail_paket['material_no_paket'] = $tpaket_detail['material_no'];\n $tpaket_detail_paket['material_no'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$i];\n $tpaket_detail_paket['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t\t $batch1['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n $tpaket_detail_paket['uom'] = $tpaket['tpaket_detail']['detail_uom'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['num'] = $num_detail;\n\t\t\t\t\t\t\t $tpaket_detail_paket['quantity_total'] = $tpaket['tpaket_detail']['quantity'][$i] * $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t\t if ($num_detail != \"\" && $bet == 'Y')\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $batch1['BatchNum'] = $num_detail;\n\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\t$count1=$rQ + 1;\n\t\t\t\t\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$num=$batch1['ItemCode'].$date.$dg.$count1;\n\t\t\t\t\t\t\t\t\t\t\t$batch1['BatchNum'] = $num;\n\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$batch1[ItemCode]','$batch1[BatchNum]','$batch1[Quantity]','$whs')\");\n\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\t\n\t\t\t\t\t\t\t// echo \"$batch1[BaseEntry],$batch1[Quantity],$batch1[BaseLinNum],$batch1[ItemCode],$batch1[BatchNum],$b <br>\";\n\t\t\t\t\t\t\t if ($batch1['Quantity'] != \"\" && $bet=='Y')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->m_tpaket->batch_insert($batch1);\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 if($this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket)) {\n $input_detail_success = TRUE;\n \t\t\t\t\t } else {\n $input_detail_success = FALSE; } } }\n \n \t else {\n $input_detail_success = FALSE;\n\t\t\t\t\t\t\t\t //echo \"aaaaaaaaaaaaaaaaa\";\n \t}\n// \t\t\t\t\t\tif($this->m_tpaket->tpaket_detail_insert($tpaket_detail))\n// $input_detail_success = TRUE;\n \t\t\t\t\t}\n\n \t \t//}\n }\n }\n\n\t\t\tif (($input_detail_success == TRUE) && (isset($_POST['button']['approve']))) {\n $internal_order = $this->m_tpaket->tpaket_internal_order_select();\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['internal_order'] = $internal_order['internal_order'];\n $tpaket_to_approve['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n $tpaket_to_approve['posting_date'] = date('Ymd',strtotime($edit_tpaket_header['posting_date']));\n $tpaket_to_approve['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['id_tpaket_plant'] = $edit_tpaket_header['id_tpaket_plant'];\n $tpaket_to_approve['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n $tpaket_to_approve['web_trans_id'] = $this->l_general->_get_web_trans_id($edit_tpaket_header['plant'],$edit_tpaket_header['posting_date'],\n $edit_tpaket_header['id_tpaket_plant'],'17');\n\t\t\t/* $approved_data = $this->m_tpaket->sap_tpaket_header_approve($tpaket_to_approve);\n \t\t\tif((!empty($approved_data['material_document'])) && ($approved_data['material_document'] !== '') &&\n (!empty($approved_data['material_document_out'])) && ($approved_data['material_document_out'] !== '')) {\n \t\t\t $tpaket_no = $approved_data['material_document'];\n \t\t\t $tpaket_no_out = $approved_data['material_document_out'];*/\n \t\t\t\t$data = array (\n \t\t\t\t\t'id_tpaket_header'\t=>$id_tpaket_header,\n \t\t\t\t\t'material_doc_no'\t=>\t$tpaket_no,\n \t\t\t\t\t'material_doc_no_out'\t=>\t$tpaket_no_out,\n \t\t\t\t\t'status'\t=>\t'2',\n \t\t\t\t\t'id_user_approved'\t=>\t$this->session->userdata['ADMIN']['admin_id'],\n \t\t\t\t);\n \t\t\t\t$tpaket_header_update_status = $this->m_tpaket->tpaket_header_update($data);\n \t\t\t\t $approve_data_success = TRUE;\n\t\t\t\t/*} else {\n\t\t\t\t $approve_data_success = FALSE;\n\t\t\t\t}*/\n }\n\n \t\t\t$this->db->trans_complete();\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diubah', site_url('tpaket/browse'));\n } else {\n \t\t\t $this->jagmodule['error_code'] = '006'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diapprove', site_url('tpaket/browse'));\n } else {\n \t\t $this->jagmodule['error_code'] = '007'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\t}", "public function update($id)\n {\n if (Input::get('check_update') == 1) {\n $validator = Validator::make(Input::all(), Products::$rules2);\n\n if ($validator->passes()) {\n $product = Products::find($id);\n $product->name = addslashes(Input::get('name'));\n $product->color_id = Input::get('color');\n $product->cp = Input::get('cp');\n $product->sp = Input::get('sp');\n $product->type_id = Input::get('type_id');\n $product->unit_id = Input::get('unit_id');\n $product->save();\n return Redirect::route('products.index')\n ->with('success', 'Product updated successfully');\n } else {\n return Redirect::route('products.edit', $id)\n ->withErrors($validator)\n ->withInput(Input::all());\n }\n\n } else {\n $validator = Validator::make(Input::all(), Products::$rules3);\n\n if ($validator->passes()) {\n $product = Products::find($id);\n $product->discount = Input::get('discount');\n $product->save();\n\n return Redirect::route('products.index')\n ->with('success', 'Product discount updated successfully');\n } else {\n return Redirect::route('products.discount', $id)\n ->withErrors($validator)\n ->withInput(Input::all());\n }\n }\n\n }", "function updateProduct($product_id, $name, $price, $available, $society_id) {\r\n\t\t\tif ($product_id == null) {\r\n\t\t\t\t$sql = \"INSERT IGNORE INTO `products` (product_name, price, available, society_id) VALUES('%s', '%s', '%s', '%s')\";\r\n\t\t\t\treturn $this->query($sql, $name, $price, $available, $society_id);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"UPDATE `products` SET product_name='%s', price='%s', available='%s', society_id='%s' WHERE product_id='%s'\";\r\n\t\t\t\treturn $this->query($sql, $name, $price, $available, $society_id, $product_id);\r\n\t\t\t}\r\n\t\t}", "public function editOwnProduct($editProductName, $editProductDescription, $editProductImage, $editProductQuantity, $editProductPrice, $productId) {\n\n $query = $this->db->prepare(\"UPDATE `products` SET `product_name` = ?, `product_description` = ?, `product_image_url` = ?, `product_quantity` = ?, `product_price` = ? WHERE `product_id` = ?\");\n\n $query->bindValue(1, $editProductName);\n $query->bindValue(2, $editProductDescription);\n $query->bindValue(3, $editProductImage);\n $query->bindValue(4, $editProductQuantity);\n $query->bindValue(5, $editProductPrice);\n $query->bindValue(6, $productId);\n\n\n try {\n\n $query->execute();\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function edit(Products $products)\n {\n //\n }", "public function edit(Products $products)\n {\n //\n }", "public function edit(Products $products)\n {\n //\n }" ]
[ "0.7826243", "0.7625819", "0.7594294", "0.7397117", "0.7355545", "0.7338606", "0.7289273", "0.72772527", "0.7152448", "0.7144114", "0.70489174", "0.6969377", "0.69673026", "0.69349486", "0.69148356", "0.690606", "0.6904122", "0.6873214", "0.68418413", "0.6836852", "0.683679", "0.683679", "0.683679", "0.68344754", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68283325", "0.68095094", "0.6778451", "0.67719007", "0.674806", "0.6735739", "0.6731965", "0.6721349", "0.67195755", "0.66971743", "0.66823506", "0.66617346", "0.6623941", "0.66219217", "0.660792", "0.65892756", "0.6586814", "0.6581197", "0.65701103", "0.65664136", "0.65588325", "0.6540197", "0.65378815", "0.65253013", "0.6515302", "0.65070885", "0.6503476", "0.6500029", "0.6486349", "0.6485198", "0.6481691", "0.64791554", "0.64676815", "0.6460268", "0.6455179", "0.64527875", "0.6449804", "0.6448425", "0.64372605", "0.64334226", "0.64334226", "0.64334226" ]
0.0
-1
A constructor for the bundle.
public function __construct() { set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __construct()\n {\n [$arrStyleArchives, $arrStyleGroups] = static::loadBundleConfiguration();\n\n self::$arrArchive = $arrStyleArchives;\n self::$arrGroups = $arrStyleGroups;\n }", "protected function _construct()\n {\n $this->_init('bundle/option');\n }", "final private function __construct() {\n\t\t\t}", "final private function __construct()\n {\n }", "function __construct( ) {\n $this->initialize( );\n }", "protected function __init__() { }", "protected function __construct() {\n\t\t//Generated by ManagerGenerator::generateConstruct()\n\t}", "public function __construct(GravitonBundleBundle $bundleBundle)\n {\n $this->bundleStack = array($bundleBundle);\n }", "final private function __construct()\n\t{\n\t}", "function __constructor(){}", "public function __init(){}", "final private function __construct() {}", "final private function __construct() {}", "public function construct()\n\t\t{\n\t\t}", "protected final function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct()\n {\n }", "final private function __construct()\n {\n }", "private function __construct() {\n\t\t}", "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 final function __construct() {}", "public function construct() {\n\n }", "function _construct(){ }", "function __construct() {\r\n parent ::__construct();\r\n }", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}", "public function __construct()\n {\n\n $this->plugin_name = 'myfossil-resources';\n $this->version = '0.0.1';\n\n $this->load_dependencies();\n $this->set_locale();\n $this->define_admin_hooks();\n $this->define_public_hooks();\n\n }", "final private function __construct()\n {\n \t$this->init();\n }", "public function __construct()\n {\n parent::__construct(array(\n 'name' => __('Module Boilerplate', 'fl-builder'),\n 'description' => __('An starting point for coding new modules.', 'fl-builder'),\n 'category'\t\t=> __('Advanced Modules', 'fl-builder'),\n 'dir' => MY_MODULES_DIR . 'module-name/',\n 'url' => MY_MODULES_URL . 'module-name/',\n 'editor_export' => true, // Defaults to true and can be omitted.\n 'enabled' => true, // Defaults to true and can be omitted.\n ));\n }", "private function __construct()\t{}", "protected function __construct()\r\n\t\t{\r\n\t\t}", "private function __construct() {\n\t\t$this->initialise();\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "function __construct() {\n\n\t\t}", "function __Construct()\n {\n parent::__Construct();\n }", "public function __construct( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\n\n\t\t$this->pluginName = 'ssm/core';\n\t\t$this->loader = new Loader();\n\n $this->defineConstants();\n\n\t}", "private function __construct( )\n {\n\t}", "final private function __construct(){\r\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "protected function _construct()\n {\n $this->_init('boleto_returns_file', 'returns_file_id');\n }", "function __construct() {\n\t\tparent::__construct();\n\t\t$this->init();\n\t}", "public function __construct() {\n\n\t\t}", "protected function _construct()\n {\n parent::_construct();\n $this->setTemplate(self::TEMPLATE);\n }", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _construct()\n\t{\n\n\t}", "public function __construct()\n\t{\n\t\t// TODO Auto-generated constructor\n\t}", "private function __construct() {\r\n\t\r\n\t}", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->catalogName = func_get_arg(0);\n $this->brands = func_get_arg(1);\n }\n }", "private function __construct()\r\n\t{\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "public function __construct()\n {\n global $Registry; \n $this->registry =& $Registry;\n \n // load init language files\n $this->load('init');\n $this->load('init_lang'); \n \n $this->lang_meta = $this->registry->_lang_meta;\n $this->lang = $this->registry->_lang; \n }", "public function __construct()\r\n\t\t{\r\n\t\t}", "private function __construct()\n\t{\n\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->registerUniversalTagAttributes();\n $this->registerArgument('phoneNumber', 'string', 'The phone number to link', true);\n $this->registerArgument(\n 'countryCode',\n 'string',\n 'The country calling code to use (defaults to \"49\")',\n false,\n '49'\n );\n $this->registerArgument('content', 'string', 'The content of the resulting tag');\n }" ]
[ "0.73895365", "0.726061", "0.7159506", "0.7081411", "0.70752233", "0.7024255", "0.7015669", "0.7012271", "0.7010502", "0.69509566", "0.69393545", "0.69333035", "0.69333035", "0.69254154", "0.6924351", "0.69114745", "0.69114745", "0.69114745", "0.68727255", "0.68727255", "0.68700266", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6815653", "0.6809325", "0.6807379", "0.6801412", "0.6794531", "0.6794186", "0.6794186", "0.6794186", "0.6794186", "0.6794186", "0.6794186", "0.6794186", "0.67939883", "0.6792863", "0.679233", "0.6789675", "0.67895675", "0.6788406", "0.67879087", "0.67875457", "0.6783296", "0.6780062", "0.677916", "0.67570746", "0.6752857", "0.67495716", "0.674628", "0.674628", "0.674628", "0.674628", "0.674628", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.6744816", "0.67340666", "0.67280644", "0.6716239", "0.6711056", "0.6710704", "0.6710704", "0.6710704", "0.6710511", "0.6707724", "0.67048347", "0.6704512", "0.6702816", "0.67014897", "0.66970557", "0.6694176", "0.6686388", "0.6686094", "0.66820097" ]
0.0
-1
Gets a type mapping from native types to Propel types
protected function getTypeMapping() { return self::$mysqlTypeMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeMapper();", "function db_type_map() {\n // Put :normal last so it gets preserved by array_flip. This makes\n // it much easier for modules (such as schema.module) to map\n // database types back into schema types.\n $map = array(\n 'varchar:normal' => 'VARCHAR',\n 'char:normal' => 'CHAR',\n\n 'text:tiny' => 'TINYTEXT',\n 'text:small' => 'TINYTEXT',\n 'text:medium' => 'MEDIUMTEXT',\n 'text:big' => 'LONGTEXT',\n 'text:normal' => 'TEXT',\n\n 'serial:tiny' => 'TINYINT',\n 'serial:small' => 'SMALLINT',\n 'serial:medium' => 'MEDIUMINT',\n 'serial:big' => 'BIGINT',\n 'serial:normal' => 'INT',\n\n 'int:tiny' => 'TINYINT',\n 'int:small' => 'SMALLINT',\n 'int:medium' => 'MEDIUMINT',\n 'int:big' => 'BIGINT',\n 'int:normal' => 'INT',\n\n 'float:tiny' => 'FLOAT',\n 'float:small' => 'FLOAT',\n 'float:medium' => 'FLOAT',\n 'float:big' => 'DOUBLE',\n 'float:normal' => 'FLOAT',\n\n 'numeric:normal' => 'DECIMAL',\n\n 'blob:big' => 'LONGBLOB',\n 'blob:normal' => 'BLOB',\n\n 'datetime:normal' => 'DATETIME',\n );\n return $map;\n}", "public static function getTypeMap() {\n return [\n 'charge_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'amount' => self::FIELD_INT,\n 'description' => self::FIELD_STRING,\n 'charge_date' => self::FIELD_EPOCH,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "public static function getTypeMap() {\n return [\n 'session_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'session_string' => self::FIELD_STRING,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "public function getPhpNative()\n {\n return PropelTypes::getPhpNative($this->getType());\n }", "function get_field_mapping_types() {\n return drupal_map_assoc([\n 'string',\n 'keyword',\n 'date',\n 'long',\n 'double',\n 'boolean',\n 'ip',\n 'object',\n 'nested',\n 'geo_point',\n 'geo_shape',\n 'completion',\n ]);\n}", "protected function initializeDoctrineTypeMappings()\n {\n $this->doctrineTypeMapping = array(\n 'int' => 'integer',\n 'timestamp' => 'datetime',\n 'time' => 'datetime',\n 'date' => 'date',\n 'varchar' => 'string',\n 'char' => 'string',\n 'double' => 'float',\n 'float' => 'float',\n 'int64' => 'float',\n 'smallint' => 'integer',\n );\n }", "abstract protected function initializeMappedTypes();", "function getTypeConverter() ;", "public static function getTypesMap()\n {\n return self::$typesMap;\n }", "public function getTypeMap()\n {\n }", "public function dataTypeMap()\n {\n return config('codegenerator.eloquent_type_to_method');\n }", "public function getTypeMap()\n {\n return $this->typeMap;\n }", "private function initializeMappedTypes()\n {\n $property = new \\ReflectionProperty('Fridge\\DBAL\\Platform\\AbstractPlatform', 'mappedTypes');\n $property->setAccessible(true);\n\n $property->setValue($this->platform, array('foo' => Type::INTEGER));\n }", "public function getPropelType()\n {\n return $this->getType();\n }", "public static function getFieldTypeMapping() {\n // Check the static cache first.\n if (empty(static::$fieldTypeMapping)) {\n // It's easier to write and understand this array in the form of\n // $search_api_field_type => array($data_types) and flip it below.\n $default_mapping = array(\n 'text' => array(\n 'field_item:string_long.string',\n 'field_item:text_long.string',\n 'field_item:text_with_summary.string',\n 'text',\n ),\n 'string' => array(\n 'string',\n 'email',\n 'uri',\n 'filter_format',\n 'duration_iso8601',\n ),\n 'integer' => array(\n 'integer',\n 'timespan',\n ),\n 'decimal' => array(\n 'decimal',\n 'float',\n ),\n 'date' => array(\n 'datetime_iso8601',\n 'timestamp',\n ),\n 'boolean' => array(\n 'boolean',\n ),\n // Types we know about but want/have to ignore.\n NULL => array(\n 'language',\n ),\n );\n\n foreach ($default_mapping as $search_api_type => $data_types) {\n foreach ($data_types as $data_type) {\n $mapping[$data_type] = $search_api_type;\n }\n }\n\n // Allow other modules to intercept and define what default type they want\n // to use for their data type.\n \\Drupal::moduleHandler()->alter('search_api_field_type_mapping', $mapping);\n\n static::$fieldTypeMapping = $mapping;\n }\n\n return static::$fieldTypeMapping;\n }", "function agilecrm_map_types($array)\n{\n $mapped = [];\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $mapped[] = $value;\n continue;\n }\n\n $type = in_array($key, TYPES['SYSTEM']) ? 'SYSTEM' : 'CUSTOM';\n\n $mapped[] = [\n 'type' => $type,\n 'name' => $key,\n 'value' => $value,\n ];\n }\n\n return $mapped;\n}", "public function getMappingEntityType();", "public function getTypeDoctrine()\n {\n if (isset(self::$doctrineTypeMap[$this->getType()])) {\n return self::$doctrineTypeMap[$this->getType()];\n }\n\n // our fallback default\n return self::$doctrineTypeMap[self::TYPE_STRING];\n }", "public static function getTableMap()\n {\n return Propel::getDatabaseMap(CastleTypePeer::DATABASE_NAME)->getTable(CastleTypePeer::TABLE_NAME);\n }", "public function getTypeConverter() {}", "public static function getTypesMap(): array\n {\n return self::$typesMap;\n }", "public function getMappingType(): string\n {\n return (string) $this->mappingType;\n }", "public function getMappedDataType($ormType, $length = 0)\n {\n if (!isset($this->ormTypeMapping[$ormType])) {\n return $ormType;\n }\n\n $mapping = $this->ormTypeMapping[$ormType];\n if (is_string($mapping)) {\n return $mapping;\n }\n\n $defaultType = isset($mapping['default']) ? $mapping['default'] : null;\n if (!isset($mapping['types'])) {\n return $defaultType;\n }\n\n if ($defaultType && ($length === null || $length === 0)) {\n return $defaultType;\n }\n\n $unit = isset($mapping['unit']) ? $mapping['unit'] : 'chars';\n if ($unit === self::UNIT_BYTES) {\n $length = (int)floor((log(pow(10, $length)) / log(2)) / 8);\n }\n return $this->getBestMatchingType($mapping['types'], $defaultType, $length);\n }", "protected function _getDataTypes(){\n\t\treturn ActiveRecordMetaData::getDataTypes($this->_source, $this->_schema);\n\t}", "public function getMappedDatabaseTypes(AbstractSpatialType $type)\n {\n $sqlType = mb_strtolower($type->getSQLType());\n\n if ($type instanceof GeographyType && 'geography' !== $sqlType) {\n $sqlType = sprintf('geography(%s)', $sqlType);\n }\n\n return [$sqlType];\n }", "public function meta_type();", "public function getObjectMaps()\n {\n return array(\n 'id' => self::TYPE_STRING,\n 'self' => self::TYPE_STRING,\n 'author' => self::TYPE_USER,\n 'comment' => self::TYPE_STRING,\n 'timeSpentSeconds' => 'integer',\n 'billedSeconds' => 'integer',\n 'dateStarted' => 'datatime',\n 'issue' => self::TYPE_ISSUE,\n// 'workAttributeValues'\n );\n }", "public static function defaultValueTypes()\n {\n return [\n 'bigInteger' => 'int',\n 'bigPrimaryKey' => 'int',\n 'binary' => 'string',\n 'boolean' => 'int',\n 'date' => 'string',\n 'dateTime' => 'string',\n 'decimal' => 'int',\n 'double' => 'int',\n 'float' => 'int',\n 'integer' => 'int',\n 'money' => 'int',\n 'primaryKey' => 'int',\n 'smallInteger' => 'int',\n 'string' => 'string',\n 'text' => 'string',\n 'time' => 'string',\n 'timestamp' => 'string',\n ];\n }", "function _getTypes()\n {\n $types = array(\n 0 => \"null\",\n 1 => \"bool\",\n 2 => \"int\",\n 3 => \"float\",\n 4 => \"varchar\",\n 5 => \"text\",\n 6 => \"blob\"\n );\n $tLeast = $this->table->count() < 2 ? 4 : 0;\n if ($this->GET('override')) {\n $types[1] = \"int\";\n $types[4] = \"text\";\n $types[6] = \"text\";\n }\n foreach ($this->table->fields as $field) {\n $t[$field] = strcasecmp($field, \"id\") ? $tLeast : 2;\n }\n while ($row = $this->table->each()) {\n foreach ($row as $field => $value) {\n if (preg_match('/[\\x00-\\x06\\x08\\x0B-\\x0C\\x0E-\\x13\\x16-\\x1F]/', $value))\n $t[$field] = 6;\n elseif (strlen($value) > 255 || strpos($value, \"\\n\"))\n $t[$field] = max($t[$field], 5);\n elseif (! empty($value) && ! is_numeric($value))\n $t[$field] = max($t[$field], 4);\n elseif (! preg_match('/^[+-]?\\d{0,10}$/s', $value))\n $t[$field] = max($t[$field], 3);\n elseif (! preg_match('/^[01]?$/s', $value))\n $t[$field] = max($t[$field], 2);\n elseif (strlen($value))\n $t[$field] = max($t[$field], 1);\n }\n }\n foreach ($this->table->fields as $field) {\n $this->types[$field] = $types[$t[$field]];\n }\n $this->table->reset();\n }", "protected function getVehicleTypeAliasByIdMap(): array\n {\n return [\n 'ID_TYPE_AGRICULTURAL' => 'agricultural',\n 'ID_TYPE_ARTIC' => 'artic',\n 'ID_TYPE_ATV' => 'atv',\n 'ID_TYPE_AUTOLOADER' => 'autoloader',\n 'ID_TYPE_BULLDOZER' => 'bulldozer',\n 'ID_TYPE_BUS' => 'bus',\n 'ID_TYPE_CAR' => 'car',\n 'ID_TYPE_CONSTRUCTION' => 'construction',\n 'ID_TYPE_CRANE' => 'crane',\n 'ID_TYPE_SELF_LOADER' => 'self_loader',\n 'ID_TYPE_DREDGE' => 'dredge',\n 'ID_TYPE_LIGHT_TRUCK' => 'light_truck',\n 'ID_TYPE_MOTORCYCLE' => 'motorcycle',\n 'ID_TYPE_MUNICIPAL' => 'municipal',\n 'ID_TYPE_SCOOTER' => 'scooter',\n 'ID_TYPE_SNOWMOBILE' => 'snowmobile',\n 'ID_TYPE_TRAILER' => 'trailer',\n 'ID_TYPE_TRUCK' => 'truck',\n ];\n }", "public function registerCustomTypes()\n {\n // enum\n DbalService::getSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');\n }", "private function _columnTypeTranslation($type) {\n $map = array(\n 'datetime' => 'timestamp',\n );\n if(!empty($map[$type])) {\n return $map[$type];\n }\n return $type;\n }", "public static function fromNative()\n {\n $value = func_get_arg(0);\n\n switch (true) {\n case preg_match(self::REGEX_TYPE_VARCHAR, $value, $matchesVarchar):\n $response = Varchar::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_CHAR, $value, $matchesVarchar):\n $response = Char::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_TIMESTAMP, $value, $matchesVarchar):\n $response = new Timestamp();\n break;\n\n case preg_match(self::REGEX_TYPE_DATETIME, $value, $matchesVarchar):\n $response = new Datetime();\n break;\n\n case preg_match(self::REGEX_TYPE_DATE, $value, $matchesVarchar):\n $response = new Date();\n break;\n\n case preg_match(self::REGEX_TYPE_TEXT, $value, $matchesVarchar):\n $response = new Text();\n break;\n\n case preg_match(self::REGEX_TYPE_INT_UNSIGNED, $value, $matchesVarchar):\n $response = IntUnsigned::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_INT_SIGNED, $value, $matchesVarchar):\n $response = IntSigned::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_DECIMAL, $value, $matchesVarchar):\n $response = Decimal::fromNative((int)$matchesVarchar[1], (int)$matchesVarchar[2]);\n break;\n\n case preg_match(self::REGEX_TYPE_TINYINT_SIGNED, $value, $matchesVarchar):\n $response = TinyIntSigned::fromNative($matchesVarchar[1]);\n break;\n\n case preg_match(self::REGEX_TYPE_ENUM, $value, $matchesVarchar):\n $response = Enum::fromNative($matchesVarchar[1]);\n break;\n\n // @todo Add more cases. http://dev.mysql.com/doc/refman/5.7/en/data-types.html\n\n default:\n $allowedPatterns = array_values(static::getConstants());\n throw new UnexpectedValueException($value, $allowedPatterns);\n break;\n }\n\n return $response;\n }", "public function getDataType($type)\n\t{\n\t\tstatic $types = array\n\t\t(\n\t\t\t// SQL-92\n\t\t\t'bit' => array('type' => 'string', 'exact' => true),\n\t\t\t'bit varying' => array('type' => 'string'),\n\t\t\t'char' => array('type' => 'string', 'exact' => true),\n\t\t\t'char varying' => array('type' => 'string'),\n\t\t\t'character' => array('type' => 'string', 'exact' => true),\n\t\t\t'character varying' => array('type' => 'string'),\n\t\t\t'date' => array('type' => 'string'),\n\t\t\t'dec' => array('type' => 'float', 'exact' => true),\n\t\t\t'decimal' => array('type' => 'float', 'exact' => true),\n\t\t\t'double precision' => array('type' => 'float'),\n\t\t\t'float' => array('type' => 'float'),\n\t\t\t'int' => array('type' => 'int', 'min' => '-2147483648', 'max' => '2147483647'),\n\t\t\t'integer' => array('type' => 'int', 'min' => '-2147483648', 'max' => '2147483647'),\n\t\t\t'interval' => array('type' => 'string'),\n\t\t\t'national char' => array('type' => 'string', 'exact' => true),\n\t\t\t'national char varying' => array('type' => 'string'),\n\t\t\t'national character' => array('type' => 'string', 'exact' => true),\n\t\t\t'national character varying' => array('type' => 'string'),\n\t\t\t'nchar' => array('type' => 'string', 'exact' => true),\n\t\t\t'nchar varying' => array('type' => 'string'),\n\t\t\t'numeric' => array('type' => 'float', 'exact' => true),\n\t\t\t'real' => array('type' => 'float'),\n\t\t\t'smallint' => array('type' => 'int', 'min' => '-32768', 'max' => '32767'),\n\t\t\t'time' => array('type' => 'string'),\n\t\t\t'time with time zone' => array('type' => 'string'),\n\t\t\t'timestamp' => array('type' => 'string'),\n\t\t\t'timestamp with time zone' => array('type' => 'string'),\n\t\t\t'varchar' => array('type' => 'string'),\n\t\t\t// SQL:1999\n\t\t\t'binary large object' => array('type' => 'string', 'binary' => true),\n\t\t\t'blob' => array('type' => 'string', 'binary' => true),\n\t\t\t'boolean' => array('type' => 'bool'),\n\t\t\t'char large object' => array('type' => 'string'),\n\t\t\t'character large object' => array('type' => 'string'),\n\t\t\t'clob' => array('type' => 'string'),\n\t\t\t'national character large object' => array('type' => 'string'),\n\t\t\t'nchar large object' => array('type' => 'string'),\n\t\t\t'nclob' => array('type' => 'string'),\n\t\t\t'time without time zone' => array('type' => 'string'),\n\t\t\t'timestamp without time zone' => array('type' => 'string'),\n\t\t\t// SQL:2003\n\t\t\t'bigint' => array('type' => 'int', 'min' => '-9223372036854775808', 'max' => '9223372036854775807'),\n\t\t\t// SQL:2008\n\t\t\t'binary' => array('type' => 'string', 'binary' => true, 'exact' => true),\n\t\t\t'binary varying' => array('type' => 'string', 'binary' => true),\n\t\t\t'varbinary' => array('type' => 'string', 'binary' => true)\n\t\t);\n\n\t\tif (isset($types[$type]))\n\t\t\treturn $types[$type];\n\n\t\treturn array();\n\t}", "public static function get_meta_type();", "protected function getMap()\n {\n return config('codegenerator.eloquent_type_to_html_type');\n }", "public static function buildTableMap()\n {\n $dbMap = Propel::getDatabaseMap(BaseCastleTypePeer::DATABASE_NAME);\n if (!$dbMap->hasTable(BaseCastleTypePeer::TABLE_NAME)) {\n $dbMap->addTableObject(new \\CastleTypeTableMap());\n }\n }", "protected abstract function get_meta_type();", "private function _transformType($dataType)\n {\n switch ($dataType) {\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_BOOLEAN:\n return self::PHP_TYPE_BOOLEAN;\n\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_INTEGER:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_SMALLINT:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_BIGINT:\n return self::PHP_TYPE_INTEGER;\n\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_DECIMAL:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_FLOAT:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_DOUBLE_PRECISION:\n return self::PHP_TYPE_FLOAT;\n\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_BLOB:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_TEXT:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_CHAR:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_BINARY_VARYING:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_VARCHAR:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_ENUM:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_DATE:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_TIME:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_TIMESTAMP:\n case ZendExt_Db_Schema_TypeMappingAdapter_Generic::TYPE_DATETIME:\n return self::PHP_TYPE_STRING;\n\n default:\n return \"unknown ({$dataType})\";\n break;\n }\n }", "protected function mapType($schema, $column)\n {\n $baseType = $schema->baseColumnType($column);\n switch ($baseType) {\n case 'uuid':\n return ['type' => 'text', 'index' => false, 'null_value' => '_null_'];\n case 'integer':\n return ['type' => 'integer', 'null_value' => pow(-2,31)];\n case 'date':\n return ['type' => 'date', 'format' => 'dateOptionalTime||basic_date||yyy-MM-dd', 'null_value' => '0001-01-01'];\n case 'datetime':\n case 'timestamp':\n return ['type' => 'date', 'format' => 'basic_t_time_no_millis||dateOptionalTime||basic_date_time||ordinal_date_time_no_millis||yyyy-MM-dd HH:mm:ss||basic_date', 'null_value' => '0001-01-01 00:00:00'];\n case 'float':\n case 'decimal':\n return ['type' => 'float', 'null_value' => pow(-2,31)];\n case 'float':\n case 'decimal':\n return ['type' => 'float', 'null_value' => pow(-2,31)];\n case 'boolean':\n return ['type' => 'boolean'];\n default:\n return [\n 'type' => 'text',\n 'fields' => [\n $column => ['type' => 'text'],\n 'raw' => ['type' => 'text', 'index' => false]\n ]\n ];\n }\n }", "public function getMappedOrmType($dataType)\n {\n return $this->hasDataType($dataType)\n ? $this->dataTypeMapping[$dataType]\n : null;\n }", "protected function mapType($internalType)\n\t{\n\t\tswitch ($internalType)\n\t\t{\n\t\t\tcase 'file':\n\t\t\tcase 'enum':\n\t\t\tcase 'int':\n\t\t\tcase 'double':\n\t\t\t\treturn 'NUMBER';\n\t\t\tcase 'string':\n\t\t\tcase 'callback':\n\t\t\t\treturn 'STRING';\n\t\t\tcase 'date':\n\t\t\t\treturn 'YEAR_MONTH_DAY';\n\t\t\tcase 'datetime':\n\t\t\t\treturn 'YEAR_MONTH_DAY_SECOND';\n\t\t\tcase 'bool':\n\t\t\t\treturn 'BOOLEAN';\n\t\t}\n\t\treturn 'STRING';\n\t}", "public function getCustomTypeId();", "public static function getMap()\n\t{\n\t\t/*\n\t\t\tboolean (наследует ScalarField)\n\t\t\tdate (наследует ScalarField)\n\t\t\tdatetime (наследует DateField)\n\t\t\tenum (наследует ScalarField)\n\t\t\tfloat (наследует ScalarField)\n\t\t\tinteger (наследует ScalarField)\n\t\t\tstring (наследует ScalarField)\n\t\t\ttext (наследует StringField)\n\t\t */\n\t\treturn array(\n\t\t\t'ID' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t\t'primary' => true,\n\t\t\t\t'autocomplete' => true,\n\t\t\t\t'title' => Loc::getMessage('AOS_LT_ID'),\n\t\t\t),\n\t\t\t'ACTIVE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'title' => Loc::getMessage('AOS_LT_ACTIVE'),\n\t\t\t),\n\t\t\t'NAME' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'title' => Loc::getMessage('AOS_LT_NAME'),\n\t\t\t),\n\t\t\t'STATUS_ID' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'title' => Loc::getMessage('AOS_LT_STATUS_ID'),\n\t\t\t),\n\t\t\t'DESCRIPTION' => array(\n\t\t\t\t'data_type' => 'text',\n\t\t\t\t'title' => Loc::getMessage('AOS_LT_DESCRIPTION'),\n\t\t\t),\n\t\t\t'DESCRIPTION_TYPE' => array(\n\t\t\t\t'data_type' => 'string',\n\t\t\t\t'title' => Loc::getMessage('AOS_LT_DESCRIPTION_TYPE'),\n\t\t\t),\n\t\t\t'DATE_MODIFY' => array(\n\t\t\t\t'data_type' => 'datetime',\n\t\t\t 'title' => Loc::getMessage('AOS_LT_DATE_MODIFY'),\n\t\t\t),\n\t\t\t'MODIFIED_BY' => array(\n\t\t\t\t'data_type' => 'integer',\n\t\t\t 'title' => Loc::getMessage('AOS_LT_MODIFIED_BY'),\n\t\t\t),\n\t\t);\n\t}", "public static function getTypes()\n {\n return [\n ModelRegistry::TRANSACTION => ModelRegistry::getById(ModelRegistry::TRANSACTION)->label,\n ModelRegistry::PRODUCT => ModelRegistry::getById(ModelRegistry::PRODUCT)->label,\n ];\n }", "protected function getColumnPhpType($type)\r\n {\r\n static $typeMap = [\r\n // abstract type => php type\r\n 'text' => 'string',\r\n 'number' => 'integer',\r\n 'container' => 'resource',\r\n 'date' => 'date',\r\n 'time' => 'time',\r\n 'timestamp' => 'timestamp',\r\n ];\r\n if (isset($typeMap[$type])) {\r\n return $typeMap[$type];\r\n } else {\r\n return 'string';\r\n }\r\n }", "public function getTypes()\n {\n $oDb = Factory::service('Database');\n $oResult = $oDb->query('SHOW COLUMNS FROM `' . $this->table . '` LIKE \"type\"')->row();\n $sTypes = $oResult->Type;\n $sTypes = preg_replace('/enum\\((.*)\\)/', '$1', $sTypes);\n $sTypes = str_replace(\"'\", '', $sTypes);\n $aTypes = explode(',', $sTypes);\n\n $aOut = [];\n\n foreach ($aTypes as $sType) {\n $aOut[$sType] = ucwords(strtolower($sType));\n }\n\n return $aOut;\n }", "public static function getTypes();", "public function getDataType($type)\n\t{\n\t\tstatic $types = array\n\t\t(\n\t\t\t'blob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '65535'),\n\t\t\t'bool' => array('type' => 'bool'),\n\t\t\t'bigint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '18446744073709551615'),\n\t\t\t'datetime' => array('type' => 'string'),\n\t\t\t'decimal unsigned' => array('type' => 'float', 'exact' => TRUE, 'min' => '0'),\n\t\t\t'double' => array('type' => 'float'),\n\t\t\t'double precision unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'double unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'enum' => array('type' => 'string'),\n\t\t\t'fixed' => array('type' => 'float', 'exact' => TRUE),\n\t\t\t'fixed unsigned' => array('type' => 'float', 'exact' => TRUE, 'min' => '0'),\n\t\t\t'float unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'geometry' => array('type' => 'string', 'binary' => TRUE),\n\t\t\t'int unsigned' => array('type' => 'int', 'min' => '0', 'max' => '4294967295'),\n\t\t\t'integer unsigned' => array('type' => 'int', 'min' => '0', 'max' => '4294967295'),\n\t\t\t'longblob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '4294967295'),\n\t\t\t'longtext' => array('type' => 'string', 'character_maximum_length' => '4294967295'),\n\t\t\t'mediumblob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '16777215'),\n\t\t\t'mediumint' => array('type' => 'int', 'min' => '-8388608', 'max' => '8388607'),\n\t\t\t'mediumint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '16777215'),\n\t\t\t'mediumtext' => array('type' => 'string', 'character_maximum_length' => '16777215'),\n\t\t\t'national varchar' => array('type' => 'string'),\n\t\t\t'numeric unsigned' => array('type' => 'float', 'exact' => TRUE, 'min' => '0'),\n\t\t\t'nvarchar' => array('type' => 'string'),\n\t\t\t'point' => array('type' => 'string', 'binary' => TRUE),\n\t\t\t'real unsigned' => array('type' => 'float', 'min' => '0'),\n\t\t\t'set' => array('type' => 'string'),\n\t\t\t'smallint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '65535'),\n\t\t\t'text' => array('type' => 'string', 'character_maximum_length' => '65535'),\n\t\t\t'tinyblob' => array('type' => 'string', 'binary' => TRUE, 'character_maximum_length' => '255'),\n\t\t\t'tinyint' => array('type' => 'int', 'min' => '-128', 'max' => '127'),\n\t\t\t'tinyint unsigned' => array('type' => 'int', 'min' => '0', 'max' => '255'),\n\t\t\t'tinytext' => array('type' => 'string', 'character_maximum_length' => '255'),\n\t\t\t'year' => array('type' => 'string'),\n\t\t);\n\n\t\t$type = str_replace(' zerofill', '', $type);\n\n\t\tif (isset($types[$type]))\n\t\t\treturn $types[$type];\n\n\t\treturn parent::getDataType($type);\n\t}", "private function initializeCustomTypes()\n {\n $property = new \\ReflectionProperty('Fridge\\DBAL\\Platform\\AbstractPlatform', 'customTypes');\n $property->setAccessible(true);\n\n $property->setValue($this->platform, array(Type::INTEGER));\n }", "public static function getColumnTypes()\n {\n return array(\n 'bookId' => 'int',\n 'languageId' => 'int'\n );\n }", "public function get_desired_types();", "public function getTypes(): array\n {\n return $this->map(static function (DataSetColumn $column) {\n return $column->getType();\n })->toArray();\n }", "public static function getColumnTypes()\n {\n return array(\n 'bookId' => 'int',\n 'title' => 'istring',\n 'bindingId' => 'int',\n 'minYear' => 'int',\n 'maxYear' => 'int',\n 'preciseDate' => 'date',\n 'placePublished' => 'istring',\n 'publisher' => 'istring',\n 'printVersion' => 'istring',\n 'firstPage' => 'int',\n 'lastPage' => 'int'\n );\n }", "function getDatatypesMapping() {\n return ['Protein' => ['pdb','swissprot','datacitesbgrid'],\n 'Phenotype' => ['clinvar','dbgap','mpd','datacitemorphobank'],\n 'Gene Expression' => ['geo', 'arrayexpress', 'gemma','nursadatasets','lsdb','genenetwork','gtexldacc'],\n 'Nucleotide Sequence' => ['sra','datacitebgi'],\n 'Morphology'=>['neuromorpho'],\n 'Clinical Trials'=>['clinicaltrials','ctn'],\n 'Proteomics Data'=>['peptideatlas','proteomexchange','yped'],\n 'Physiological Signals'=>['physiobank'],\n 'Epigenetic Data'=>['epigenomics'],\n 'Data from Papers'=>['datacitepeerj','ndarpapers'],\n\n 'Omics Data'=>['omicsdi'],\n 'Survey Data'=> ['datacitefdz'],\n 'Cell Signaling'=>['datacitesdscsg'],\n 'Imaging Data'=>['cvrg','neuromorpho','cia','openfmri','cil','bmrb','retina','emdb', 'nitrcir','neurovaultatlases','neurovaultcols','neurovaultnidm','datacitecxidb','datacitembf','datacitecandi'],\n 'Unspecified' => ['lincs','bioproject','dryad','dataverse','niddkcr','icpsr','gdc','rgd','vectorbase','datacitegnd','datacitezenodo',\n 'datacitecrcns','immport','datacitedatabrary','datacitelshtm','datacitejhu',\n 'simtk',\n 'datacitebils',\n 'dataciteada',\n 'dataciteukda',\n 'dataciteadaptive',\n 'datacitemit',\n 'datacitectsi',\n 'datacitenimh',\n 'nsrr','naturedata','datacitethieme','datacitefigshare','dataciteccdc','wormbase','metabolomics'],\n ];\n}", "protected function getMapping($type)\n {\n switch ($type) {\n case 'article':\n return [\n 'txtArtikel' => 'name',\n 'txtshortdescription' => 'description',\n 'txtlangbeschreibung' => 'descriptionLong',\n 'txtshippingtime' => 'shippingTime',\n 'txtzusatztxt' => 'additionalText',\n 'txtkeywords' => 'keywords',\n 'txtpackunit' => 'packUnit',\n ];\n case 'variant':\n return [\n 'txtshippingtime' => 'shippingTime',\n 'txtzusatztxt' => 'additionalText',\n 'txtpackunit' => 'packUnit',\n ];\n case 'link':\n return [\n 'linkname' => 'description',\n ];\n case 'download':\n return [\n 'downloadname' => 'description',\n ];\n case 'config_countries':\n return [\n 'countryname' => 'name',\n 'notice' => 'description',\n ];\n case 'config_units':\n return [\n 'description' => 'name',\n ];\n case 'config_dispatch':\n return [\n 'dispatch_name' => 'name',\n 'dispatch_description' => 'description',\n 'dispatch_status_link' => 'statusLink',\n ];\n default:\n return false;\n }\n }", "public function getProductTypes($criteria = [])\n {\n $results = DigitalProducts_ProductTypeRecord::model()->findAll($criteria);\n\n return DigitalProducts_ProductTypeModel::populateModels($results);\n }", "public function getAllTypes() {\n\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(\n array('t' => 'NEWAGENTTYPELOOKUP')\n );\n $allTypes = $this->fetchAll($select);\n $returnVal = array();\n foreach ($allTypes as $typeRow) {\n $returnVal[$typeRow->NEWAGENTTYPELOOKUPID] = $typeRow->LABEL;\n }\n\n return $returnVal;\n }", "protected function getTypes() {}", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "protected function getMappedType($type, $jvalue = null)\n {\n\n $class = @$jvalue->__class;\n if($class) $type = $class;\n if (isset($this->classMap[$type])) {\n $target = $this->classMap[$type];\n } else if (is_string($type) && $type !== '' && $type[0] == '\\\\'\n && isset($this->classMap[substr($type, 1)])\n ) {\n $target = $this->classMap[substr($type, 1)];\n } else {\n $target = null;\n }\n if ($target) {\n if (is_callable($target)) {\n $type = $target($type, $jvalue);\n } else {\n $type = $target;\n }\n }\n return $type;\n }", "public function getFieldMapping($field) {\n // Support of the custom data types. When such is implemented the type is\n // stored in the $field['real_type'] and the $field['type'] contains the\n // fallback type that will be used if the custom one is not supported.\n $field_type = (isset($field['real_type'])) ? $field['real_type'] : $field['type'];\n $type = search_api_extract_inner_type($field_type);\n\n switch ($type) {\n case 'text':\n return array(\n 'type' => 'string',\n 'boost' => $field['boost'],\n );\n\n case 'uri':\n case 'string':\n case 'token':\n return array(\n 'type' => 'string',\n 'index' => 'not_analyzed',\n );\n\n case 'integer':\n case 'duration':\n return array(\n 'type' => 'integer',\n );\n\n case 'boolean':\n return array(\n 'type' => 'boolean',\n );\n\n case 'decimal':\n return array(\n 'type' => 'float',\n );\n\n case 'date':\n return array(\n 'type' => 'date',\n 'format' => 'date_time',\n );\n\n case 'location':\n return array(\n 'type' => 'geo_point',\n 'lat_lon'=> TRUE,\n );\n\n default:\n return NULL;\n }\n }", "public function getMappedEntityType();", "protected function fieldTypeMap(Connection $connection, $type) {\n // Convert everything to lowercase.\n $map = array_map('strtolower', $connection->schema()->getFieldTypeMap());\n $map = array_flip($map);\n\n // The MySql map contains type:size. Remove the size part.\n return isset($map[$type]) ? explode(':', $map[$type])[0] : $type;\n }", "public function getServiceTypes() {\n $dql = \"SELECT s from ServiceType s\n ORDER BY s.name\";\n $query = $this->em->createQuery($dql);\n return $query->getResult();\n }", "public static function columnTypes()\n {\n return [\n 'bigInteger' => 'Bigint',\n 'bigPrimaryKey' => 'BigPK',\n 'binary' => 'Binary',\n 'boolean' => 'Boolean',\n 'date' => 'Date',\n 'dateTime' => 'Datetime',\n 'decimal' => 'Decimal',\n 'double' => 'Double',\n 'float' => 'Float',\n 'integer' => 'Integer',\n 'money' => 'Money',\n 'primaryKey' => 'PK',\n 'smallInteger' => 'Smallint',\n 'string' => 'String',\n 'text' => 'Text',\n 'time' => 'Time',\n 'timestamp' => 'Timestamp',\n ];\n }", "public function getPropertyTypes()\n\t{\n\t\treturn $this->hasOne(PropertyTypes:: className(), ['id' => 'property_type_id']);\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}", "public function getDomainForType($propelType);", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\t'ID' => new ORM\\Fields\\IntegerField(\n\t\t\t\t'ID',\n\t\t\t\t[\n\t\t\t\t\t'primary' => true,\n\t\t\t\t\t'autocomplete' => true,\n\t\t\t\t\t'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_ID_FIELD'),\n\t\t\t\t]\n\t\t\t),\n\t\t\t'STORE_ID' => new ORM\\Fields\\IntegerField(\n\t\t\t\t'STORE_ID',\n\t\t\t\t[\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_STORE_ID_FIELD'),\n\t\t\t\t]\n\t\t\t),\n\t\t\t'PRODUCT_ID' => new ORM\\Fields\\IntegerField(\n\t\t\t\t'PRODUCT_ID',\n\t\t\t\t[\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_PRODUCT_ID_FIELD'),\n\t\t\t\t]\n\t\t\t),\n\t\t\t'AMOUNT' => new ORM\\Fields\\FloatField(\n\t\t\t\t'AMOUNT',\n\t\t\t\t[\n\t\t\t\t\t'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_AMOUNT_FIELD'),\n\t\t\t\t]\n\t\t\t),\n\t\t\t'QUANTITY_RESERVED' => new ORM\\Fields\\FloatField(\n\t\t\t\t'QUANTITY_RESERVED',\n\t\t\t\t[\n\t\t\t\t\t'title' => Loc::getMessage('STORE_PRODUCT_ENTITY_QUANTITY_RESERVED_FIELD'),\n\t\t\t\t]\n\t\t\t),\n\t\t\t'STORE' => new ORM\\Fields\\Relations\\Reference(\n\t\t\t\t'STORE',\n\t\t\t\tStoreTable::class,\n\t\t\t\tORM\\Query\\Join::on('this.STORE_ID', 'ref.ID')\n\t\t\t),\n\t\t\t'PRODUCT' => new ORM\\Fields\\Relations\\Reference(\n\t\t\t\t'PRODUCT',\n\t\t\t\tProductTable::class,\n\t\t\t\tORM\\Query\\Join::on('this.PRODUCT_ID', 'ref.ID')\n\t\t\t),\n\t\t];\n\t}", "public static function getColumnTypes()\n {\n return array(\n 'bindingId' => 'int',\n 'libraryId' => 'int',\n 'signature' => 'istring',\n 'summary' => 'istring',\n 'status' => 'int',\n );\n }", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function get_relations_types_for_js() {\n\n\t\t\t$result = array();\n\n\t\t\tforeach ( $this->get_relations_types() as $value => $label ) {\n\t\t\t\t$result[] = array(\n\t\t\t\t\t'value' => $value,\n\t\t\t\t\t'label' => $label,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "public function get_type();", "public function setType(){\n switch($this->security){\n case 'H':\n case 'L':\n case '0.0':\n $typeId = 2; // k-space\n break;\n case 'A':\n $typeId = 3; // a-space\n break;\n default:\n $typeId = 1; // w-space\n }\n\n /**\n * @var $type MapTypeModel\n */\n $type = $this->rel('typeId');\n $type->getById($typeId);\n $this->typeId = $type;\n }", "public static function getTypes()\n {\n $sql = 'SELECT * FROM location_type';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "public function getFieldtypesFromTable()\n {\n $used_fieldtypes = ee()->db->select('name')->order_by('name')->get('fieldtypes');\n\n return array_column($used_fieldtypes->result_array(), 'name');\n }", "public function get_location_types()\n {\n return $this->retrieve('SELECT * FROM isys_obj_type WHERE isys_obj_type__container <> 0;');\n }", "public function getColumnType($name);", "public function getColumnType($name);", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "abstract public function getType();", "function _token_rules_map_type($type) {\r\n if (($data_type = rules_get_data_types($type)) && isset($data_type['token type'])) {\r\n return $data_type['token type'];\r\n }\r\n return $type;\r\n}", "protected function types()\n {\n return [\n 'bigint',\n 'blob',\n 'boolean',\n 'date',\n 'decimal',\n 'integer',\n 'longText',\n 'smallint',\n 'text',\n 'time',\n 'timestamp',\n 'timestamptz',\n ];\n }", "private static function _applyTypes(array $row, array $typeMap, array $defaultMap): array {\n\t\tforeach ($typeMap as $k => $type) {\n\t\t\t$v = $row[$k] ?? null;\n\t\t\tif ($v !== null) {\n\t\t\t\tif (is_string($type)) {\n\t\t\t\t\tswitch ($type) {\n\t\t\t\t\t\tcase 'boolean':\n\t\t\t\t\t\t\t$row[$k] = Types::toBool($v);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'timestamp':\n\t\t\t\t\t\tcase 'datetime':\n\t\t\t\t\t\t\t$row[$k] = Timestamp::factory($v);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthrow new KeyNotFound(\"Unknown type map $type in CSV::_applyTypes\");\n\t\t\t\t\t}\n\t\t\t\t} elseif (is_array($type)) {\n\t\t\t\t\t$v = $type[$v] ?? $defaultMap[$k] ?? null;\n\t\t\t\t\tif ($v !== null) {\n\t\t\t\t\t\t$row[$k] = $v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $row;\n\t}", "public function getTypeLabels()\n {\n $labelMap = array();\n foreach ($this->configServices as $configService) {\n $labelMap[$configService->getTypeCode()] = $configService->getTypeLabel();\n }\n return $labelMap;\n }", "function &getAssociatedTypes() {\n\t\tif ($this->getIsGeneric()) { return array(); }\n\t\t\n\t\t$sTable = KTUtil::getTableName('document_type_fieldsets');\n $aQuery = array(\n \"SELECT document_type_id FROM $sTable WHERE fieldset_id = ?\",\n array($this->getId()),\n );\n $aIds = DBUtil::getResultArrayKey($aQuery, 'document_type_id');\n\t\t\n\t\t$aRet = array();\n\t\tforeach ($aIds as $iID) {\n\t\t $oType = DocumentType::get($iID);\n\t\t\tif (!PEAR::isError($oType)) { \n\t\t\t $aRet[] = $oType;\n\t\t\t}\n\t\t}\n\t\treturn $aRet;\n\t}", "private function abapToType($type)\n {\n static $mapping = [\n 'b' => Element::TYPE_INTEGER, //1-byte integer (internal)\n 's' => Element::TYPE_INTEGER, //2-byte integer (internal)\n 'I' => Element::TYPE_INTEGER, //4-byte integer\n 'INT8' => Element::TYPE_INTEGER, //8-byte integer\n 'P' => Element::TYPE_FLOAT, //packed number 1-16 bytes\n 'DECFLOAT16' => Element::TYPE_FLOAT, //floating point with 16 positions\n 'DECFLOAT34' => Element::TYPE_FLOAT, //floating point with 34 positions\n 'F' => Element::TYPE_FLOAT, //binary floating point with 17 positions\n 'C' => Element::TYPE_STRING, //fixed length text field\n 'N' => Element::TYPE_INTEGER, //fixed length numeric text field 1-262143 positions\n 'STRING' => Element::TYPE_STRING, //text string\n 'X' => Element::TYPE_HEXBIN, //fixed length hexadecimal encoded binary data\n 'XSTRING' => Element::TYPE_HEXBIN, //fixed length hexadecimal encoded binary data\n 'D' => Element::TYPE_DATE, //date field\n 'T' => Element::TYPE_TIME, //time field\n ];\n if (!array_key_exists($type, $mapping)) {\n throw new SapLogicException(sprintf('Unknown SAP data type \\'%s\\'!', $type));\n }\n return $mapping[$type];\n }", "public function get_types()\n\t{\n\t\treturn $this->driver_query('type_list', FALSE);\n\t}", "public function loadColumnType($name);", "protected function translateSimpleColumnTypes(array &$info)\n {\n $type = (isset($info['type'])) ? $info['type'] : null;\n switch ($type) {\n // some types need massaging, some need other required properties\n case 'pk':\n case ColumnSchema::TYPE_ID:\n $info['type'] = 'int';\n $info['allow_null'] = false;\n $info['auto_increment'] = true;\n $info['is_primary_key'] = true;\n break;\n\n case 'fk':\n case ColumnSchema::TYPE_REF:\n $info['type'] = 'int';\n $info['is_foreign_key'] = true;\n // check foreign tables\n break;\n\n case ColumnSchema::TYPE_DATETIME:\n $info['type'] = 'datetime2';\n break;\n case ColumnSchema::TYPE_TIMESTAMP:\n $info['type'] = 'datetimeoffset';\n break;\n case ColumnSchema::TYPE_TIMESTAMP_ON_CREATE:\n case ColumnSchema::TYPE_TIMESTAMP_ON_UPDATE:\n $info['type'] = 'datetimeoffset';\n $default = (isset($info['default'])) ? $info['default'] : null;\n if (!isset($default)) {\n $default = 'CURRENT_TIMESTAMP';\n $info['default'] = ['expression' => $default];\n }\n break;\n case ColumnSchema::TYPE_USER_ID:\n case ColumnSchema::TYPE_USER_ID_ON_CREATE:\n case ColumnSchema::TYPE_USER_ID_ON_UPDATE:\n $info['type'] = 'int';\n break;\n\n case ColumnSchema::TYPE_BOOLEAN:\n $info['type'] = 'bit';\n $default = (isset($info['default'])) ? $info['default'] : null;\n if (isset($default)) {\n // convert to bit 0 or 1, where necessary\n $info['default'] = (int)filter_var($default, FILTER_VALIDATE_BOOLEAN);\n }\n break;\n\n case ColumnSchema::TYPE_INTEGER:\n $info['type'] = 'int';\n break;\n\n case ColumnSchema::TYPE_DOUBLE:\n $info['type'] = 'float';\n $info['type_extras'] = '(53)';\n break;\n\n case ColumnSchema::TYPE_TEXT:\n $info['type'] = 'varchar';\n $info['type_extras'] = '(max)';\n break;\n case 'ntext':\n $info['type'] = 'nvarchar';\n $info['type_extras'] = '(max)';\n break;\n case 'image':\n $info['type'] = 'varbinary';\n $info['type_extras'] = '(max)';\n break;\n\n case ColumnSchema::TYPE_STRING:\n $fixed =\n (isset($info['fixed_length'])) ? filter_var($info['fixed_length'], FILTER_VALIDATE_BOOLEAN) : false;\n $national =\n (isset($info['supports_multibyte'])) ? filter_var($info['supports_multibyte'],\n FILTER_VALIDATE_BOOLEAN) : false;\n if ($fixed) {\n $info['type'] = ($national) ? 'nchar' : 'char';\n } elseif ($national) {\n $info['type'] = 'nvarchar';\n } else {\n $info['type'] = 'varchar';\n }\n break;\n\n case ColumnSchema::TYPE_BINARY:\n $fixed =\n (isset($info['fixed_length'])) ? filter_var($info['fixed_length'], FILTER_VALIDATE_BOOLEAN) : false;\n $info['type'] = ($fixed) ? 'binary' : 'varbinary';\n break;\n }\n }", "public static function getTypesById()\n {\n return array_flip(self::getTypes());\n }" ]
[ "0.7133755", "0.6677361", "0.64745754", "0.6380785", "0.6304135", "0.6114649", "0.6107702", "0.5998361", "0.5919143", "0.5835542", "0.5824921", "0.5752554", "0.572003", "0.5692844", "0.56855685", "0.5673979", "0.56214356", "0.5601176", "0.55989885", "0.55362403", "0.55161154", "0.55121183", "0.5473606", "0.5444468", "0.5420171", "0.5396901", "0.53601927", "0.53546417", "0.53299284", "0.53198475", "0.53110206", "0.52544564", "0.5253769", "0.5231955", "0.52263784", "0.5213333", "0.52044135", "0.5192576", "0.5185084", "0.5178415", "0.5167914", "0.516652", "0.5152251", "0.5143664", "0.5118778", "0.5117408", "0.51173824", "0.51139396", "0.5111251", "0.5091817", "0.50905013", "0.50876224", "0.5084944", "0.5049019", "0.5047377", "0.50415736", "0.5031678", "0.502821", "0.50256646", "0.5021467", "0.50067866", "0.50067866", "0.50067866", "0.50067866", "0.50029176", "0.49925202", "0.49782312", "0.4966646", "0.4962079", "0.4951977", "0.49504888", "0.494567", "0.49414045", "0.49389762", "0.49322045", "0.4931046", "0.49295524", "0.4919886", "0.4914364", "0.49143133", "0.4898884", "0.48947656", "0.48938975", "0.48938975", "0.48919445", "0.48919445", "0.48919445", "0.48919445", "0.48919445", "0.48919445", "0.48841238", "0.48819718", "0.48813283", "0.48811466", "0.48795494", "0.48781514", "0.4876384", "0.48728442", "0.4872048", "0.48558322" ]
0.66917896
1
Adds Columns to the specified table.
protected function addColumns(Table $table) { $stmt = $this->dbh->query("SHOW FULL COLUMNS FROM `" . $table->getName() . "`"); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $column = $this->getColumnFromRow($row, $table); $table->addColumn($column); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addColumns($table, $cols)\n {\n foreach ($cols as $arg1 => $arg2) {\n $this->addColumn($table, is_integer($arg1) ? $arg2 : $arg1, is_integer($arg1) ? null : $arg2);\n }\n }", "public function modifyTable()\n {\n // create columns if they are not already added to the table\n foreach ($this->getParameter('columns') as $column) {\n if (!$this->getTable()->containsColumn($column)) {\n $this->getTable()->addColumn(array(\n 'name' => $column,\n 'type' => 'INTEGER',\n ));\n }\n }\n }", "function addColumn($table, $name, $type);", "private function createNewColumnsInBaseTable()\n {\n\n Schema::table($this->baseTable, function (Blueprint $table) {\n\n //If no associative columns, the use same column name as merge column.\n if (empty($this->columns)) {\n $columns = Schema::getColumnListing($this->mergeTable);\n\n foreach ($columns as $key) {\n if (!Schema::hasColumn($table->getTable(), $key)) {\n $table->text($key)->nullable();\n }\n }\n //Otherwise create only the table columns in baseTable which appears in array.\n } else {\n foreach ($this->columns as $baseColumn => $mergeColumn) {\n if (!Schema::hasColumn($table->getTable(), $baseColumn)) {\n $table->text($baseColumn)->nullable();\n }\n }\n }\n\n });\n }", "public function tableColumns($table,$column);", "abstract public function add_column($table_name, $column_name, $params);", "public function modifyTable() {\n $table = $this->getTable();\n\n $table->addColumn([\n 'name' => $this->getParameter('table_column'),\n 'type' => 'VARCHAR'\n ]);\n }", "protected function addColumns()\n {\n parent::addColumns();\n\n foreach ($this->config['fields'] as $key => $values) {\n\n switch ($values['type']) {\n case 'text':\n $this->table->addColumn($key, 'string', array('length' => 256, 'default' => ''));\n break;\n case 'textarea':\n case 'select':\n $this->table->addColumn($key, 'text', array('default' => ''));\n break;\n case 'checkbox':\n $this->table->addColumn($key, 'boolean', array('default' => 0));\n break;\n default:\n $this->table->addColumn($key, 'text', array('default' => ''));\n }\n\n }\n }", "private function createNewColumnsInBaseTable()\n {\n\n Schema::table($this->baseTable, function (Blueprint $table) {\n\n //If no associative columns, the use same column name as merge column.\n if(empty($this->associativeColumns))\n {\n $columns = Schema::getColumnListing($this->mergeTable);\n\n foreach($columns as $key){\n if(!Schema::hasColumn($table->getTable(),$key)) {\n $table->text($key)->nullable();\n }\n }\n //Otherwise create only the table columns in baseTable which appears in array.\n }else{\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn)\n {\n if(!Schema::hasColumn($table->getTable(),$baseColumn)) {\n $table->text($baseColumn)->nullable();\n }\n }\n }\n\n });\n }", "public function addColumns()\n {\n add_filter( 'manage_edit-' . $this->post_type . '_columns', array($this, 'editColumns') ) ; // Add or Remove a Column\n add_action( 'manage_' . $this->post_type . '_posts_custom_column', array($this, 'manageColumns') ); //Show and Modify Column Data\n add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortableColumns') ); // Flags sortable Columns\n add_action( 'load-edit.php', array($this, 'loadSortColumns') );\n }", "public function addColumn($column,$table = \"\", $as = \"\");", "abstract public function tableColumns();", "public function addColumn()\n {\n if ($this->name || $this->timestamps) {\n $this->columns[] = [\n 'column' => $this->name,\n 'length' => $this->length,\n 'dataType' => $this->dataType,\n 'nullable' => $this->nullable,\n 'unsigned' => $this->unsigned,\n 'pk' => $this->pk,\n 'timestamps' => $this->timestamps,\n 'autoIncrement' => $this->autoIncrement,\n 'default' => $this->default,\n 'comment' => $this->comment,\n 'unique' => $this->unique,\n ];\n $this->reset();\n }\n if ($this->foreignKey) {\n $this->columns[] = [\n 'foreignKey' => $this->foreignKey,\n 'references' => $this->references,\n 'on' => $this->on,\n 'onUpdate' => $this->onUpdate,\n 'onDelete' => $this->onDelete,\n ];\n $this->reset();\n }\n }", "public function add(Table $table, Magic $command)\n {\n $columns = array_map(function ($column) {\n return 'ADD COLUMN ' . $column;\n }, $this->columns($table));\n\n $sql = [];\n\n foreach ($columns as $column) {\n $sql[] = 'ALTER TABLE ' . $this->wrap($table) . ' ' . $column;\n }\n\n return $sql;\n }", "public function addNewColumns(string $auditSchemaName, string $tableName, TableColumnsMetadata $columns): void\n {\n $helper = new AlterAuditTableAddColumns($auditSchemaName, $tableName, $columns);\n $sql = $helper->buildStatement();\n\n $this->executeNone($sql);\n }", "public function setColumns($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Eolymp\\Typewriter\\Block\\Table\\Column::class);\n $this->columns = $arr;\n\n return $this;\n }", "public function addColumn($tableName, $schemaName, $column){ }", "public static function columns(Blueprint $table, $usesSoftDeletes = true)\n {\n self::addColumn($table, config('accountable.column_names.created_by'));\n self::addColumn($table, config('accountable.column_names.updated_by'));\n\n if ($usesSoftDeletes) {\n self::addColumn($table, config('accountable.column_names.deleted_by'));\n }\n }", "public function columns($table_name);", "protected function generateColumns()\n\t{\n\t\tforeach ($this->dataSource->getColumns() as $name) {\n\t\t\t$this->addColumn($name);\n\t\t}\n\t}", "public abstract function get_columns($table);", "public function addColumns($columns)\n {\n foreach($columns as $key => $column)\n {\n $this->addColumn($key, $column);\n }\n }", "public function addColumn($value) {\n array_push($this->columns, $value);\n }", "public function add(Table $table, Magic $command)\n {\n $columns = $this->columns($table);\n $columns = array_map(function ($column) {\n return 'ADD COLUMN '.$column;\n }, $columns);\n\n foreach ($columns as $column) {\n $sql[] = 'ALTER TABLE '.$this->wrap($table).' '.$column;\n }\n\n return (array) $sql;\n }", "private function setAddColumnSql() {\n\n if (!empty($this->add_columns)) {\n\n foreach ($this->add_columns as $key => $value) {\n\n foreach ($value as $keys) {\n\n $column_data = $this->one_db_table_columns[$key][$keys];\n\n\n\n $add_colum_params = \"\";\n $default_is_string = false;\n $null_string = \"\";\n $default_string = \"\";\n\n\n\n\n //Sütun tipi\n $add_colum_params .= \" \" . $column_data['Type'] . \" \";\n\n\n if ($column_data['Null'] == \"NO\") {\n\n $null_string = \"NOT NULL\";\n } else if ($column_data['Null'] == \"YES\") {\n\n $null_string = \"NULL\";\n }\n\n\n\n $field_type_detect = substr($column_data['Type'], 0, 4);\n\n if (\n $field_type_detect == \"varc\" ||\n $field_type_detect == \"text\" ||\n $field_type_detect == \"date\") {\n\n $default_is_string = true;\n }\n\n\n\n if ($column_data['Default'] != \"\" || !empty($column_data['Default']) || $column_data['Default'] != NULL) {\n\n\n $default_string = \" DEFAULT \";\n\n\n if ($default_is_string) {\n\n\n $default_string .= \" '\" . $column_data['Default'] . \"' \";\n } else {\n\n $default_string .= \" \" . $column_data['Default'] . \" \";\n }\n }\n\n\n\n $add_colum_params .= $null_string . $default_string;\n\n $writesql = <<< EOT\nALTER TABLE {$key} ADD COLUMN {$column_data['Field']} {$add_colum_params};\nEOT;\n\n $this->execute_sql[\"add_columns\"][] = $writesql;\n }\n }\n }\n }", "public abstract function getColumns($table);", "function addColumn($columnName, $dataType, $extraStuff = \"\", $primaryKey = false) {\n $this->columns[] = new DbColumn($columnName, $dataType, $extraStuff, $primaryKey);\n }", "public function addColumn($column_table_name, $label, $parameters = null, $relation = null, $function = null)\n {\n if (!$this->sqlColumns)\n {\n $this->sqlColumns = \"{$column_table_name} \";\n }\n else\n {\n $this->sqlColumns.= \" ,{$column_table_name} \";\n }\n\n $objColumn->label = $label;\n $objColumn->mask = $mask;\n $objColumn->relation = $relation;\n $objColumn->parameters = $parameters;\n $this->columns[$column_table_name] = $objColumn;\n }", "public static function columns(Blueprint $table)\n {\n $table->string(config('translatable.db.columns.langcode'))->nullable();\n $table->uuid(config('translatable.db.columns.translation_uuid'))->nullable();\n\n $table->index(static::getDefaultColumns());\n }", "protected function columns(Table $table)\n {\n $columns = [];\n \n foreach ($table->columns as $column) {\n $sql = $this->wrap($column).' '.$this->type($column);\n $elements = ['nullable', 'defaults', 'incrementer'];\n \n foreach ($elements as $element) {\n $sql .= $this->{$element}($table, $column);\n }\n\n $columns[] = $sql;\n }\n\n return $columns;\n }", "function migrate()\n {\n if (!$this->object->_columns) {\n throw new E_ColumnsNotDefinedException(\"Columns not defined for {$this->get_table_name()}\");\n }\n $added = FALSE;\n $removed = FALSE;\n // Add any missing columns\n foreach ($this->object->_columns as $key => $properties) {\n if (!in_array($key, $this->object->_table_columns)) {\n if ($this->object->_add_column($key, $properties['type'], $properties['default_value'])) {\n $added = TRUE;\n }\n }\n }\n // Remove any columns not defined\n //\t\tforeach ($this->object->_table_columns as $key) {\n //\t\t\tif (!isset($this->object->_columns[$key])) {\n //\t\t\t\t$this->object->_remove_column($key);\n // $removed = TRUE;\n //\t\t\t}\n //\t\t}\n if ($added or $removed) {\n // var_dump($this->object->_table_columns);\n $this->object->lookup_columns();\n // var_dump($added, $removed);\n }\n }", "public function add_columns($columns)\r\n\t{\r\n\t\tforeach ($columns as $column) {\r\n\t\t\t$this->add_column($column);\r\n\t\t}\r\n\t}", "public function addColumn( $table, $definition )\n\t{\n\t\treturn $this->query( \"ALTER TABLE `{$this->prefix}{$this->escape_string( $table )}` ADD COLUMN {$this->compileColumnDefinition( $definition )}\" );\n\t}", "public function addColumn($table, $column, $type)\n {\n $this->db->createCommand()->addColumn($table, $column, $type)->execute();\n if ($type instanceof ColumnSchemaBuilder && $type->comment !== null) {\n $this->db->createCommand()->addCommentOnColumn($table, $column, $type->comment)->execute();\n }\n }", "function columns($table) {\r\n \tstatic $tables;\r\n\r\n \tif (!isset($tables[$table])) {\r\n\t \t$columns = $this->column_definitions($table);\r\n\r\n\t \tforeach($columns as $column) {\r\n\t \t\t$result[$column['Field']] = new MysqlColumn(\r\n\t \t\t\t$column['Field'],\r\n\t \t\t\t$column['Default'],\r\n\t \t\t\t$column['Type'],\r\n\t \t\t\t$column['Null'] == 'YES'\r\n\t \t\t);\r\n\r\n\t \t}\r\n\r\n \t\t$tables[$table] = $result;\r\n\r\n \t}\r\n\r\n \treturn $tables[$table];\r\n }", "protected function columns(Table $table)\n {\n $columns = [];\n\n foreach ($table->columns as $column) {\n $sql = $this->wrap($column) . ' ' . $this->type($column);\n $sql .= $this->unsigned($table, $column);\n $sql .= $this->charset($table, $column);\n $sql .= $this->collate($table, $column);\n $sql .= $this->nullable($table, $column);\n $sql .= $this->defaults($table, $column);\n $sql .= $this->incrementer($table, $column);\n $columns[] = $sql;\n }\n\n return $columns;\n }", "protected function add_user_columns($table, &$columns, &$headers) {\n global $CFG;\n if (!$table->is_downloading() && $CFG->grade_report_showuserimage) {\n $columns[] = 'picture';\n $headers[] = '';\n }\n //if (!$table->is_downloading()) {\n $columns[] = 'fullname';\n $headers[] = get_string('firstname').', '.get_string('lastname');\n //} else {\n // $columns[] = 'lastname';\n // $headers[] = get_string('lastname');\n // $columns[] = 'firstname';\n // $headers[] = get_string('firstname');\n //}\n\n // When downloading, some extra fields are always displayed (because\n // there's no space constraint) so do not include in extra-field list.\n //$extrafields = get_extra_user_fields($this->context,\n // $table->is_downloading() ? array('institution', 'department', 'email') : array());\n $extrafields = get_extra_user_fields($this->context,\n $table->is_downloading() ? array('email') : array());\n foreach ($extrafields as $field) {\n $columns[] = $field;\n $headers[] = get_user_field_name($field);\n }\n\n if ($table->is_downloading()) {\n // $columns[] = 'institution';\n // $headers[] = get_string('institution');\n\n //$columns[] = 'department';\n //$headers[] = get_string('department');\n\n $columns[] = 'email';\n $headers[] = get_string('email');\n }\n }", "public function addColumn(Table $table, Column $column) {\n $suffix = '';\n if($column->getAutoIncrement()) {\n $suffix = 'PRIMARY KEY';\n }\n $sql = sprintf(config('sql.column.add'), $table->getName(), $this->column($column), $suffix);\n $sql .= \"\\n\";\n return $sql;\n }", "private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n foreach ($this->_query->getFields() as $field) {\n $this->columns->add($field, null, $field);\n }\n }", "function addColumns($columns)\n {\n if (is_array($columns)) {\n foreach ($columns as $column) {\n if (!isset($this->columns_list[$column])) {\n $this->columns[] = $column;\n $this->columns_list[$column] = 1;\n }\n }\n }\n else {\n if (!isset($this->columns_list[$columns])) {\n $this->columns[] = $columns;\n $this->columns_list[$columns] = 1;\n }\n }\n }", "public function getTableColumns()\n\t{\n\t}", "function columns($table)\n{\n\treturn $this->drv->columns($table);\n}", "public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_LASTNAME));\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_FIRSTNAME));\n\n $showEmail = Configuration::getInstance()->get_setting(array('Chamilo\\Core\\User', 'show_email_addresses'));\n\n if($showEmail)\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_EMAIL));\n }\n\n $this->add_column(new SortableStaticTableColumn('progress'));\n $this->add_column(new SortableStaticTableColumn('completed'));\n $this->add_column(new SortableStaticTableColumn('started'));\n\n if($this->getCurrentTreeNode()->supportsScore())\n {\n $this->add_column(new StaticTableColumn(self::COLUMN_LAST_SCORE));\n }\n }", "protected function columns(Table $table)\n {\n $columns = [];\n\n foreach ($table->columns as $column) {\n $sql = $this->wrap($column) . ' ' . $this->type($column);\n $sql .= $this->nullable($table, $column);\n $sql .= $this->defaults($table, $column);\n $sql .= $this->incrementer($table, $column);\n $columns[] = $sql;\n }\n\n return $columns;\n }", "public function add_column($tablename, $vararray) {\n try {\n $str = \"ALTER TABLE `\".$tablename.\"`\\n\tADD \";\n $fixed = false;\n foreach($vararray as $row) {\n if ($fixed) $str .= \", \";\n if ($row['name'] == \"id\" || $row['name'] == \"status\") {\n $row['name'] = $tablename.\"_\".$row['name']; // change name\n }\n $str .= \" `\".$row['name'].\"` \".$row['type'];\n if ($row['notnull']) $str .= \" NOT NULL\";\n if ($row['default']) $str .= \" DEFAULT '\".$row['default'].\"'\";\n $str .= \" AFTER `\".$row['position'].\"` \";\n $fixed = true;\n }\n $str .= \";\\nCOMMIT;\\n\";\n //echo $str.\"<br>\";\n $result = $this->conn->query($str);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n\n }", "protected function addColumn($table, $column, $alias)\n {\n if(!$this->checkColumn($table, $column, $alias)){\n array_push($this->columns, new Column($column, $alias, $table));\n }\n }", "public function setColumns($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Area120\\Tables\\V1alpha1\\ColumnDescription::class);\n $this->columns = $arr;\n\n return $this;\n }", "public function getColumns($table)\n {\n if ($table instanceof Table)\n $table = $table->name();\n\n return Singleton::get(\n 'database.columns.' . $table,\n function () use ($table) {\n return $this->schemaManager->listTableColumns($table);\n });\n }", "public function setTableColumns($columns)\n {\n $this->tableColumns = $columns;\n }", "function addColumn($column)\n {\n $this->addColumns($column);\n }", "public function createTable(Table $table, array $columns = [], array $indexes = []);", "public function create_columns()\n {\n $this->assertTrue(\n Schema::hasColumns('logs', [\n 'id',\n 'user_id',\n 'log',\n 'day',\n 'created_at',\n 'updated_at',\n ])\n );\n }", "function tableColumns($sSchema, $sTable) {\r\n require_once \"Column.class.inc\";\r\n $aColumn = [];\r\n\r\n $sSql = $this->aSql[$this->aValues['sgbd']]['getTableColumns'];\r\n $aSQLParams = array(\r\n 'sSchema' => array('value' => $sSchema, 'type' => 'column_name'),\r\n 'sTable' => array('value' => $sTable, 'type' => 'column_name')\r\n );\r\n\r\n $oResult = $this->oBd->executeWithParams($sSql, $aSQLParams);\r\n if (!empty($oResult)) {\r\n while ($aObject = $this->oBd->ligneSuivante($oResult)) {\r\n if ($aObject['data_type'] != 'SDO_GEOMETRY' && $aObject['data_type'] != 'geometry') {\r\n array_push($aColumn, $aObject['column_name']);\r\n }\r\n }\r\n foreach ($this->aSelectedFields as $fields) {\r\n if (strpos($fields, \"(\") != FALSE && strpos($fields, \")\") != FALSE && strpos(strtolower($fields), \" as \") != FALSE) {\r\n array_push($aColumn, $fields);\r\n }\r\n }\r\n }\r\n $oResult = $this->oBd->fermeResultat();\r\n return $aColumn;\r\n }", "public function add_column($column)\r\n\t{\r\n\t\t$this->table_fields[] = $column;\r\n\t}", "private function genColAddScripts($table, $columns)\n {\n $query = \"\";\n $i = 0;\n foreach ($columns as $col) {\n $stmt = $this->getTableColStmt($this->conn1, $table, $col);\n if ($stmt) {\n $query .= \"\\nADD `$col` $stmt\";\n if ($i < count($columns) - 1) {\n $query .= \",\";\n }\n }\n $i++;\n }\n return $query;\n }", "public function admin_table_columns($_columns)\n {\n }", "public function insert($tableId, Google_Service_Fusiontables_Column $postBody, $optParams = array())\n {\n $params = array('tableId' => $tableId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('insert', array($params), \"Google_Service_Fusiontables_Column\");\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n $this->allColumns[$i] = $column;\n continue;\n }\n $this->columns[$i] = $column;\n $this->allColumns[$i] = $column;\n }\n }", "function listColumns($tablename);", "public function table_columns($table)\n\t{\n\t\tif ($table instanceof Database_Identifier)\n\t\t{\n\t\t\t$schema = $table->namespace;\n\t\t\t$table = $table->name;\n\t\t}\n\t\telseif (is_array($table))\n\t\t{\n\t\t\t$schema = $table;\n\t\t\t$table = array_pop($schema);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$schema = explode('.', $table);\n\t\t\t$table = array_pop($schema);\n\t\t}\n\n\t\tif (empty($schema))\n\t\t{\n\t\t\t$schema = $this->_config['connection']['database'];\n\t\t}\n\n\t\t$result =\n\t\t\t'SELECT column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, numeric_precision, numeric_scale, collation_name,'\n\t\t\t.' column_type, column_key, extra, privileges, column_comment'\n\t\t\t.' FROM information_schema.columns'\n\t\t\t.' WHERE table_schema = '.$this->quote_literal($schema).' AND table_name = '.$this->quote_literal($this->table_prefix().$table);\n\n\t\t$result = $this->execute_query($result)->as_array('column_name');\n\n\t\tforeach ($result as & $column)\n\t\t{\n\t\t\tif ($column['data_type'] === 'enum' OR $column['data_type'] === 'set')\n\t\t\t{\n\t\t\t\t$open = strpos($column['column_type'], '(');\n\t\t\t\t$close = strpos($column['column_type'], ')', $open);\n\n\t\t\t\t// Text between parentheses without single quotes\n\t\t\t\t$column['options'] = explode(\"','\", substr($column['column_type'], $open + 2, $close - 3 - $open));\n\t\t\t}\n\t\t\telseif (strlen($column['column_type']) > 8)\n\t\t\t{\n\t\t\t\t// Test for UNSIGNED or UNSIGNED ZEROFILL\n\t\t\t\tif (substr_compare($column['column_type'], 'unsigned', -8) === 0\n\t\t\t\t\tOR substr_compare($column['column_type'], 'unsigned', -17, 8) === 0)\n\t\t\t\t{\n\t\t\t\t\t$column['data_type'] .= ' unsigned';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function listColumn($tableId, $optParams = array())\n {\n $params = array('tableId' => $tableId);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_Fusiontables_ColumnList\");\n }", "abstract protected function fetchColumnDefsDb(string $table);", "public function addColumn($key, $value = null)\n {\n $this->columns[] = [$key, $value];\n return $this;\n }", "public function add(Table $table, Magic $command)\n {\n $columns = implode(', ', array_map(function ($column) {\n return 'ADD ' . $column;\n }, $this->columns($table)));\n\n return 'ALTER TABLE ' . $this->wrap($table) . ' ' . $columns;\n }", "public function list_columns($table, $like = null, $add_prefix = true)\n\t{\n\t\t// Quote the table name\n\t\t$table = (bool)($add_prefix) ? $this->quoteTable($table) : $table;\n\n\t\tif (is_string($like))\n\t\t\t// Search for column names\n\t\t\t$result = $this->query(Database::SELECT, 'SHOW FULL COLUMNS FROM '.$table.' LIKE '.$this->quote($like), false);\n\t\telse\n\t\t\t// Find all column names\n\t\t\t$result = $this->query(Database::SELECT, 'SHOW FULL COLUMNS FROM '.$table, false);\n\n\n\t\t$count = 0;\n\t\t$columns = array();\n\n\t\tforeach ($result as $row)\n\t\t{\n\t\t\t/**\n\t\t\t * @var $type string\n\t\t\t * @var $length string|null\n\t\t\t */\n\t\t\tlist($type, $length) = $this->parseType($row['Type']);\n\n\t\t\t$column = $this->getDataType($type);\n\t\t\t$column['column_name'] = $row['Field'];\n\t\t\t$column['column_default'] = $row['Default'];\n\t\t\t$column['data_type'] = $type;\n\t\t\t$column['is_nullable'] = ($row['Null'] == 'YES');\n\t\t\t$column['ordinal_position'] = ++$count;\n\t\t\t$column['comment'] = $row['Comment'];\n\t\t\t$column['extra'] = $row['Extra'];\n\t\t\t$column['key'] = $row['Key'];\n\t\t\t$column['privileges'] = $row['Privileges'];\n\n\t\t\t$r = array();\n\t\t\tif (!isset($column['type']))\n\t\t\t\t$r[] = $column;\n\n\t\t\tif (isset($column['type']))\n\t\t\t{\n\t\t\t\tswitch ($column['type'])\n\t\t\t\t{\n\t\t\t\t\tcase 'float':\n\t\t\t\t\t\tif (isset($length))\n\t\t\t\t\t\t\tlist($column['numeric_precision'], $column['numeric_scale']) = explode(',', $length);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\tif (isset($length))\n\t\t\t\t\t\t\t// MySQL attribute\n\t\t\t\t\t\t\t$column['display'] = $length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\tswitch ($column['data_type'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'binary':\n\t\t\t\t\t\t\tcase 'varbinary':\n\t\t\t\t\t\t\t\t$column['character_maximum_length'] = $length;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'char':\n\t\t\t\t\t\t\tcase 'varchar':\n\t\t\t\t\t\t\t\t$column['character_maximum_length'] = $length;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t\tcase 'tinytext':\n\t\t\t\t\t\t\tcase 'mediumtext':\n\t\t\t\t\t\t\tcase 'longtext':\n\t\t\t\t\t\t\t\t$column['collation_name'] = $row['Collation'];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'enum':\n\t\t\t\t\t\t\tcase 'set':\n\t\t\t\t\t\t\t\t$column['collation_name'] = $row['Collation'];\n\t\t\t\t\t\t\t\t$column['options'] = explode('\\',\\'', substr($length, 1, -1));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$columns[$row['Field']] = $column;\n\t\t}\n\n\t\treturn $columns;\n\t}", "public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(Right::class_name(), Right::PROPERTY_NAME));\n $this->add_column(new DataClassPropertyTableColumn(Right::class_name(), Right::PROPERTY_DESCRIPTION));\n }", "static public function getTableColumns($table='services') {\n return DB::getSchemaBuilder()->getColumnListing($table);\n }", "public function tableColAddition($colName, $type, $paramaters = array()) {\r\n $this->colAdd[$colName] = array(\r\n \"type\" => $type,\r\n \"cols\" => $paramaters\r\n );\r\n return $this;\r\n }", "public function addColumns( $value){\n return $this->_add(3, $value);\n }", "public function createTable($tableName, array $columns);", "function add_table( Modyllic_Schema_Table $table ) {\n $this->add['tables'][$table->name] = $table;\n }", "public function addColumn(\n $tablename, \n $fieldDefs\n )\n {\n $this->tableName = $tablename;\n $sql = $this->getHelper()->addColumnSQL($this->tableName, $fieldDefs);\n if ($this->getHelper()->isFieldArray($fieldDefs)){\n foreach ($fieldDefs as $fieldDef) $columns[] = $fieldDef['name'];\n $columns = implode(\",\", $columns);\n } \n else \n $columns = $fieldDefs['name'];\n\n $msg = \"Error adding column(s) \".$columns.\" on table: \".$this->tableName. \":\";\n $this->query($sql,true,$msg);\n }", "public function verifyAlterTableAddColumnSql()\n {\n $id = new Integer('id', ['size' => Size::big(), 'autoIncrement' => true]);\n $name = new Text('name', ['size' => Size::small()]);\n $username = new Varchar('username', '255');\n\n $expected = \"ALTER TABLE users ADD (\";\n $expected .= \"username VARCHAR(255) NOT NULL\";\n $end = \")\";\n\n $ddl = new AlterTable('users');\n $ddl->setAdapter($this->_adapter);\n $ddl->addColumn($username);\n $this->assertEquals($expected.$end, $ddl->getQueryString());\n\n $expected .= ', ';\n $expected .= \"name VARCHAR(255) NOT NULL\";\n $ddl->addColumn($name);\n $this->assertEquals($expected.$end, $ddl->getQueryString());\n }", "protected function _configureColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n $this->_sourceColumns = $this->columns;;\n\n $columnsByKey = [];\n foreach ($this->columns as $column) {\n $columnKey = $this->_getColumnKey($column);\n for ($j = 0; true; $j++) {\n $suffix = ($j) ? '_' . $j : '';\n $columnKey .= $suffix;\n if (!array_key_exists($columnKey, $columnsByKey)) {\n break;\n }\n }\n $columnsByKey[$columnKey] = $column;\n }\n\n $this->columns = $columnsByKey;\n }", "public function addColumns($columns) {\n $this->columns = array_values(array_unique(array_merge($this->columns,$columns)));\n return $this;\n }", "public function initialize_columns()\n {\n $this->add_column(new DataClassPropertyTableColumn(User::class_name(), User::PROPERTY_LASTNAME));\n \n parent::initialize_columns();\n }", "public function columns(string $table): array\n {\n return [\n 'query' => 'PRAGMA table_info(' . $this->tableName($table) . ')',\n 'bindings' => [],\n ];\n }", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n continue;\n }\n $this->columns[$i] = $column;\n }\n }", "public function get_columns($table){\n return $this->query(\"SHOW COLUMNS FROM {$table}\")->results();\n }", "function getAllColumns($table){\n\t\t$types=sqlite_fetch_column_types($table,$this->id,SQLITE_ASSOC);\n\t\t$columns=array();\n\t\tforeach($types as $column=>$type){\n\t\t\t$columns[$column]=array(\n\t\t\t\t\"name\"=>$column,\n\t\t\t\t\"key\"=>&$row['Key'],\n\t\t\t\t\"type\"=>&$types[$column],\n\t\t\t\t\"default\"=>&$row['Default'],\n\t\t\t\t\"comment\"=>&$row['Comment']\n\t\t\t\t);\n\t\t}\n\t\treturn $columns;\n\t}", "abstract public function list_columns($table, $like = NULL, $add_prefix = TRUE);", "abstract public function columnListQuery($table);", "public function describeColumns($table, $schema=null){ }", "public function describeColumns($table, $schema=null){ }", "function getTableColumns($sSchema, $sTable) {\r\n require_once \"Column.class.inc\";\r\n\r\n $sSql = $this->aSql[$this->aValues['sgbd']]['getTableColumns'];\r\n $aSQLParams = array(\r\n 'sSchema' => array('value' => $sSchema, 'type' => 'column_name'),\r\n 'sTable' => array('value' => $sTable, 'type' => 'column_name')\r\n );\r\n\r\n $oPDOresult = $this->oBd->executeWithParams($sSql, $aSQLParams);\r\n if ($this->oBd->enErreur()) {\r\n $oError = new VitisError(1, $this->oBd->getBDMessage());\r\n $aXmlRacineAttribute['status'] = 0;\r\n $sMessage = $oError->asDocument('', 'vitis', $this->aValues['sEncoding'], True, $aXmlRacineAttribute, $this->aValues['sSourceEncoding'], $this->aValues['output']);\r\n } else {\r\n while ($aColumn = $this->oBd->ligneSuivante($oPDOresult))\r\n array_push($this->aObjects, new Column($aColumn));\r\n }\r\n }", "public function getTableColumns()\n {\n $tableColumns = $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n return $tableColumns;\n }", "public function listColumns(string $table)\n {\n static $columns = [];\n\n if (isset($columns[$table])) {\n return $columns[$table];\n }\n\n $schema = $this->fetchDatabase();\n $result = $this->originConn->fetchAll(\"SELECT table_name, column_name, column_default\n FROM information_schema.columns\n WHERE table_schema = '{$schema}'\n AND table_name = '{$table}'\n \");\n\n foreach ($result as $column) {\n $columns[$column['table_name']][] = $column['column_name'];\n }\n\n return $columns[$table];\n }", "public function getTableColumns() {\n return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n }", "public function addColumn(ColumnInterface $column);", "public function get_columns($table)\n\t{\n\t\treturn $this->driver_query($this->sql->column_list($this->prefix_table($table)), FALSE);\n\t}", "public function setTableDefinition()\n {\n foreach ($this->_columns as $column) {\n $this->hasColumn($column['name'], $column['type'], $column['length'], $column['options']);\n }\n }", "protected function alterTable($conn=null) {\n\t\tif ($conn == null) $conn = DB::Connect();\t// provide a default connection if none given\n\n\t\tforeach ($this->columns as $idx => $column) {\n\t\t\t$field = $this->fields[$idx];\n\t\t\t$type = $this->getFieldType($this->$field);\n\t\t\t$ALTER_QUERY = \"ALTER TABLE $this->table ADD $column $type\";\n\t\t\t\n\t\t\t// HACK: Ignore existing columns\n\t\t\t// How? We ignore exceptions with phrase \"duplicate\" in them\n\t\t\ttry{\n\t\t\t\t$conn->exec($ALTER_QUERY);\n\t\t\t} catch (PDOException $e) {\n\t\t\t\tif (strstr($e->getMessage(), \"duplicate\") === FALSE)\n\t\t\t\t\tthrow $e;\n\t\t\t}\n\t\t}\n\t}", "public function addColumn($table, $column, $type, $default) {\n global $wpdb;\n $table = $wpdb->prefix . $table;\n if (!empty($default)) {\n $wpdb->query(\"ALTER TABLE {$table} ADD COLUMN {$column} {$type} DEFAULT \\\"{$default}\\\";\");\n } else {\n $wpdb->query(\"ALTER TABLE {$table} ADD COLUMN {$column} {$type};\");\n }\n }", "public function setColumns()\r\n\t{\r\n\t\t$columns = array_filter($this->getRules(), function($rule) {\r\n\t\t\tif($rule instanceof ColumnInterface) {\r\n\t\t\t\treturn $rule;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$columns = array_map(function(ColumnInterface $rule) {\r\n\t\t\treturn $rule->getTitle();\r\n\t\t}, $columns);\r\n\r\n\t\t$this->columns = $columns;\r\n\t}", "public function addColumn(VcsStats_Report_Element_Table_Column $column)\n {\n $this->_columns[] = $column;\n return $this;\n }", "public static function getColumns($table){\n\t\t// get all the column into the table\n\t\t$query = DB::select('column_name')->from('information_schema.columns')->where_open()\n\t\t->where('table_schema', 'fuel_dev')\n\t\t->and_where('table_name', $table)\n\t\t->where_close()\n\t\t->execute()->as_array();\n\n\t\tforeach($query as $k=>$v)\n\t\t\t$columns[$k] = $v['column_name'];\n\t\treturn $columns;\n\t}", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n $this->addColumn('attribute_code', array(\n 'header' => Mage::helper('eav')->__('Attribute Code'),\n 'sortable' => true,\n 'index' => 'attribute_code'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header' => Mage::helper('eav')->__('Attribute Label'),\n 'sortable' => true,\n 'index' => 'frontend_label'\n ));\n }", "protected function removeColumns()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $columns = $this->ask('Enter your desired columns separated by space');\n $this->checkInput($columns);\n $separatedColumns = explode(' ', $columns);\n $this->service->removeColumns($table, $separatedColumns);\n }", "public function getTableColumns() { return $this->table->getColumns(); }", "function maybe_add_column($table_name, $column_name, $create_ddl)\n {\n }" ]
[ "0.7467415", "0.70388407", "0.70241934", "0.70017916", "0.6883557", "0.6875775", "0.6822655", "0.68137884", "0.6812548", "0.679596", "0.6772826", "0.674675", "0.67367554", "0.6659544", "0.6541379", "0.6540402", "0.6483149", "0.6439386", "0.6376375", "0.63597906", "0.62862283", "0.6282354", "0.62327445", "0.6226445", "0.6223658", "0.6198246", "0.61169904", "0.6116829", "0.61079395", "0.61014646", "0.60941786", "0.6090333", "0.60794795", "0.60482746", "0.6029488", "0.60242456", "0.60128635", "0.59911543", "0.59911364", "0.59854615", "0.5951223", "0.5949583", "0.59346646", "0.59333515", "0.5930553", "0.5921328", "0.5901585", "0.58862346", "0.58750606", "0.5853873", "0.5842654", "0.583418", "0.5833932", "0.5831658", "0.58290356", "0.5822203", "0.58156323", "0.5814663", "0.5803411", "0.57891923", "0.5785794", "0.57827246", "0.5777728", "0.57762414", "0.57719237", "0.57674265", "0.57590634", "0.57579464", "0.57455516", "0.57304657", "0.5727796", "0.5722231", "0.57199746", "0.5713311", "0.57091", "0.57071155", "0.5705893", "0.5702547", "0.5698793", "0.5693675", "0.56792754", "0.5665034", "0.56311625", "0.56311625", "0.56219393", "0.56170213", "0.56168413", "0.56101006", "0.56042624", "0.5587231", "0.55775124", "0.55701727", "0.5562857", "0.5562844", "0.55594397", "0.5543356", "0.55162185", "0.55149746", "0.55109406", "0.55005497" ]
0.8248925
0
addColumn() Factory method creating a Column object based on a row from the 'show columns from ' MySQL query result.
public function getColumnFromRow($row, Table $table) { $name = $row['Field']; $is_nullable = ($row['Null'] == 'YES'); $autoincrement = (strpos($row['Extra'], 'auto_increment') !== false); $size = null; $precision = null; $scale = null; $sqlType = false; $desc = $row['Comment']; $regexp = '/^ (\w+) # column type [1] [\(] # ( ?([\d,]*) # size or size, precision [2] [\)] # ) ?\s* # whitespace (\w*) # extra description (UNSIGNED, CHARACTER SET, ...) [3] $/x'; if (preg_match($regexp, $row['Type'], $matches)) { $nativeType = $matches[1]; if ($matches[2]) { if (($cpos = strpos($matches[2], ',')) !== false) { $size = (int) substr($matches[2], 0, $cpos); $precision = $size; $scale = (int) substr($matches[2], $cpos + 1); } else { $size = (int) $matches[2]; } } if ($matches[3]) { $sqlType = $row['Type']; } foreach (self::$defaultTypeSizes as $type => $defaultSize) { if ($nativeType == $type && $size == $defaultSize && $scale === null) { $size = null; continue; } } } elseif (preg_match('/^(\w+)\(/', $row['Type'], $matches)) { $nativeType = $matches[1]; if ($nativeType == 'enum') { $sqlType = $row['Type']; } } else { $nativeType = $row['Type']; } //BLOBs can't have any default values in MySQL $default = preg_match('~blob|text~', $nativeType) ? null : $row['Default']; $propelType = $this->getMappedPropelType($nativeType); if (!$propelType) { $propelType = Column::DEFAULT_TYPE; $sqlType = $row['Type']; $this->warn("Column [" . $table->getName() . "." . $name . "] has a column type (" . $nativeType . ") that Propel does not support."); } // Special case for TINYINT(1) which is a BOOLEAN if (PropelTypes::TINYINT === $propelType && 1 === $size) { $propelType = PropelTypes::BOOLEAN; } $column = new Column($name); $column->setTable($table); $column->setDomainForType($propelType); if ($sqlType) { $column->getDomain()->replaceSqlType($sqlType); } $column->getDomain()->replaceSize($size); $column->getDomain()->replaceScale($scale); if ($default !== null) { if ($propelType == PropelTypes::BOOLEAN) { if ($default == '1') { $default = 'true'; } if ($default == '0') { $default = 'false'; } } if (in_array($default, array('CURRENT_TIMESTAMP'))) { $type = ColumnDefaultValue::TYPE_EXPR; } else { $type = ColumnDefaultValue::TYPE_VALUE; } $column->getDomain()->setDefaultValue(new ColumnDefaultValue($default, $type)); } $column->setAutoIncrement($autoincrement); $column->setNotNull(!$is_nullable); if ($this->addVendorInfo) { $vi = $this->getNewVendorInfoObject($row); $column->addVendorInfo($vi); } if ($desc){ if(!$this->isUtf8($desc)) $desc = utf8_encode($desc); $column->setDescription($desc); } return $column; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function toColumn($row)\n {\n $columnName = $row['COLUMN_NAME'];\n $autoIncrement = strpos($row['EXTRA'], 'auto_increment') !== false;\n $isNullable = strtoupper($row['IS_NULLABLE']) === 'YES';\n $defaultValue = $this->unquote($row['COLUMN_DEFAULT']);\n if ((is_null($defaultValue) || $defaultValue === 'NULL') && $isNullable) {\n $defaultValue = ObjectModel::DEFAULT_NULL;\n }\n if ($defaultValue && strtolower($defaultValue) === 'current_timestamp()') {\n $defaultValue = ObjectModel::DEFAULT_CURRENT_TIMESTAMP;\n }\n $column = new ColumnSchema($columnName);\n $column->setDataType($row['COLUMN_TYPE']);\n $column->setAutoIncrement($autoIncrement);\n $column->setNullable($isNullable);\n $column->setDefaultValue($defaultValue);\n $column->setCharset(new DatabaseCharset($row['CHARACTER_SET_NAME'], $row['COLLATION_NAME']));\n return $column;\n }", "public function newColumn($name)\n\t{\n\t\t// TODO: More options directly in this method\n\t\t\n\t\t$c = new Db_Descriptor_Column();\n\t\t$c->setColumn($name);\n\t\t\n\t\treturn $c;\n\t}", "abstract public static function columnData();", "public function columnFactory()\n {\n return $this->columnFactory;\n }", "public function getColumnDefinition($column){ }", "private function createDataRowForColumns(){\n\t\t$DataRows = [];\n\t\tforeach (\\DB::select('show columns from ' . $this->model->getTable() ) as $column)\n\t\t\t$DataRows[] = (new DataRowColumn)->setModel($this->model)->setField($column->Field)->fillModel();\n\n\t\t$this->DataType->dataRows()->saveMany($DataRows);\n\t}", "protected function _prepareColumns()\n {\n $this->addColumn('hourbelt_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'hourbelt_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Franja'),\n 'index' => 'name',\n ));\n\n $this->addColumn('start', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Inicio'),\n 'index' => 'start',\n ));\n\n $this->addColumn('finish', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Hora Fin'),\n 'index' => 'finish',\n ));\n\n return parent::_prepareColumns();\n }", "protected function _createColumnQuery()\n\t{\n\t\n\t}", "public function testAddingSingleColumn()\n {\n $queryBuilder = new AugmentingQueryBuilder();\n $queryBuilder->addColumnValues(['name' => 'dave']);\n $this->assertEquals(['name' => 'dave'], $queryBuilder->getColumnNamesToValues());\n }", "abstract protected function columns();", "protected function generateColumns()\n\t{\n\t\tforeach ($this->dataSource->getColumns() as $name) {\n\t\t\t$this->addColumn($name);\n\t\t}\n\t}", "protected function setUpOldColumn()\n {\n return new Column('foo', Type::getType(Type::STRING));\n }", "abstract public function add_column($table_name, $column_name, $params);", "abstract protected function makeColumn(string $table, DoctrineDBALColumn $column): Column;", "public function createColumn($name, array $options = []);", "public function get(string $name): ColumnInterface;", "public function addColumn()\n {\n if ($this->name || $this->timestamps) {\n $this->columns[] = [\n 'column' => $this->name,\n 'length' => $this->length,\n 'dataType' => $this->dataType,\n 'nullable' => $this->nullable,\n 'unsigned' => $this->unsigned,\n 'pk' => $this->pk,\n 'timestamps' => $this->timestamps,\n 'autoIncrement' => $this->autoIncrement,\n 'default' => $this->default,\n 'comment' => $this->comment,\n 'unique' => $this->unique,\n ];\n $this->reset();\n }\n if ($this->foreignKey) {\n $this->columns[] = [\n 'foreignKey' => $this->foreignKey,\n 'references' => $this->references,\n 'on' => $this->on,\n 'onUpdate' => $this->onUpdate,\n 'onDelete' => $this->onDelete,\n ];\n $this->reset();\n }\n }", "abstract protected function makeCustomColumn(string $table, DoctrineDBALColumn $column): CustomColumn;", "private function getColumnObject()\n {\n if(!is_object($this->colObj) && !($this->colObj instanceof Columns)) {\n $this->colObj = GeneralUtility::makeInstance('PITS\\\\Snowbabel\\\\Record\\\\Columns', $this->confObj);\n }\n }", "protected function createColumn($column)\n\t{\n\t\t$c=new CCubridColumnSchema;\n\t\t$c->name=$column['Field'];\n\t\t$c->rawName=$this->quoteColumnName($c->name);\n\t\t$c->allowNull=$column['Null']==='YES';\n\t\t$c->isPrimaryKey=strpos($column['Key'],'PRI')!==false;\n\t\t$c->isForeignKey=false;\n\t\t$c->init($column['Type'],$column['Default']);\n\t\t$c->autoIncrement=strpos(strtolower($column['Extra']),'auto_increment')!==false;\n\n\t\treturn $c;\n\t}", "public function addColumn()\n {\n $input = Request::onlyLegacy('name', 'board_id', 'sort_order');\n\n $validator = Validator::make($input, ProductionBoardColumn::getRules());\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $this->service->getById($input['board_id']);\n try {\n $column = $this->service->saveColumn($input['name'], $input['board_id'], $input);\n\n return ApiResponse::success([\n 'message' => trans('response.success.saved', ['attribute' => 'Column']),\n 'column' => $this->response->item($column, new ProductionBoardColumnTransformer)\n ]);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "protected function createColumn()\n\t{\n\n\t\t$columnString = sprintf('`%s` %s',\n\t\t\t $this->getColumnName(),\n\t\t\t $this->getColumnType()\n\t\t );\n\n\t\treturn $columnString;\n\n\t}", "public function addColumn(ColumnInterface $column);", "function addColumn($table, $name, $type);", "public function testColumnWithClosure()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->column('column', function ($create) {});\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertArrayHasKey('columns', $array);\n $this->assertCount(1, $array['columns']);\n $this->assertArrayHasKey('name', $array['columns'][0]);\n $this->assertArrayHasKey('columnBuilder', $array['columns'][0]);\n $this->assertEquals('column', $array['columns'][0]['name']);\n $this->assertInstanceOf(ColumnBuilder::class, $array['columns'][0]['columnBuilder']);\n }", "protected function _prepareColumns()\n {\n $this->addColumn('recipetype_id', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('ID'),\n 'width' => '50px',\n 'index' => 'recipetype_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('recomiendo_recipes')->__('Nombre Clasificación'),\n 'index' => 'name',\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('ID',\n array(\n 'header'=> $this->__('ID'),\n 'width' => '50px',\n 'index' => 'ID'\n )\n );\n\n\n $this->addColumn('browser',\n array(\n 'header'=> $this->__('Browser Data'),\n 'width' => '50px',\n 'index' => 'browser',\n 'renderer' => 'Mage_Osc_Block_Renderers_Browser'\n )\n );\n\n\n $this->addColumn('quote_id',\n array(\n 'header'=> $this->__('ID do Carrinho'),\n 'width' => '50px',\n 'index' => 'quote_id'\n )\n );\n\n\n $this->addColumn('order_id',\n array(\n 'header'=> $this->__('ID do Pedido'),\n 'width' => '50px',\n 'index' => 'order_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Order'\n )\n );\n\n\n $this->addColumn('customer_id',\n array(\n 'header'=> $this->__('Cliente'),\n 'width' => '50px',\n 'index' => 'customer_id',\n 'renderer' => 'Mage_Osc_Block_Renderers_Customer'\n )\n );\n\n\n $this->addColumn('clickedfo',\n array(\n 'header'=> $this->__('Quantidade de Cliques'),\n 'width' => '50px',\n 'index' => 'clickedfo'\n )\n );\n\n\n $this->addColumn('payment_method',\n array(\n 'header'=> $this->__('Método de Pagamento'),\n 'width' => '50px',\n 'index' => 'payment_method'\n )\n );\n\n\n return parent::_prepareColumns();\n }", "public function getColumnConfig();", "protected function createColumn($column)\n {\n $c = new ColumnSchema(['name' => $column['name']]);\n $c->rawName = $this->quoteColumnName($c->name);\n $c->allowNull = $column['is_nullable'] == '1';\n $c->isPrimaryKey = $column['is_primary_key'] == '1';\n $c->isUnique = $column['is_unique'] == '1';\n $c->isIndex = $column['constraint_name'] !== null;\n $c->dbType = $column['type'];\n if ($column['precision'] !== '0') {\n if ($column['scale'] !== '0') {\n // We have a numeric datatype\n $c->precision = (int)$column['precision'];\n $c->scale = (int)$column['scale'];\n } else {\n $c->size = (int)$column['precision'];\n }\n } else {\n $c->size = ($column['max_length'] !== '-1') ? (int)$column['max_length'] : null;\n }\n $c->autoIncrement = ($column['is_identity'] === '1');\n $c->comment = (isset($column['Comment']) ? ($column['Comment'] === null ? '' : $column['Comment']) : '');\n\n $c->extractFixedLength($column['type']);\n $c->extractMultiByteSupport($column['type']);\n $c->extractType($column['type']);\n if (isset($column['default_definition'])) {\n $c->extractDefault($column['default_definition']);\n }\n\n return $c;\n }", "public function create()\r\n\t{\r\n\t\t// If the table is loaded it can't be created\r\n\t\tif($this->loaded())\r\n\t\t{\r\n\t\t\tthrow new Kohana_Exception('Unable to create loaded column :col', array(\r\n\t\t\t\t'col' => $this->name\r\n\t\t\t));\r\n\t\t}\r\n\t\t\r\n\t\t// Alter the table\r\n\t\tDB::alter($this->table->name)\r\n\t\t\t->add($this->compile())\r\n\t\t\t->execute($this->table->database);\r\n\t}", "protected function _prepareColumns()\n {\n $this->addColumn('ticket_id', array(\n 'header' => Mage::helper('inchoo_supportticket')->__('ID'),\n 'width' => '80px',\n 'index' => 'ticket_id'\n ));\n $this->addColumn('subject', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Subject'),\n 'type'=> 'text',\n 'width' => '300px',\n 'index' => 'subject',\n 'escape' => true\n ));\n $this->addColumn('content', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Content'),\n 'type' => 'text',\n 'index' => 'content',\n 'escape' => true\n ));\n $this->addColumn('status', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Status'),\n 'type'=> 'text',\n 'width' => '200px',\n 'index' => 'status',\n 'escape' => true\n ));\n $this->addColumn('created_at', array(\n 'header'=> Mage::helper('inchoo_supportticket')->__('Created at'),\n 'type' => 'text',\n 'width' => '170px',\n 'index' => 'created_at',\n ));\n return parent::_prepareColumns();\n }", "protected function _prepareColumns()\n {\n $this->addColumn('solutionpartner_id', array(\n 'header' => Mage::helper('solutionpartner')->__('ID'),\n 'align' =>'right',\n 'width' => '50px',\n 'index' => 'solutionpartner_id',\n ));\n\n $this->addColumn('name', array(\n 'header' => Mage::helper('solutionpartner')->__('Name'),\n 'align' =>'left',\n 'index' => 'name',\n ));\n\n $this->addColumn('email', array(\n 'header' => Mage::helper('solutionpartner')->__('Email'),\n 'align' =>'left',\n 'index' => 'email',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_customer',\n ));\n\n $this->addColumn('website', array(\n 'header' => Mage::helper('solutionpartner')->__('Website'),\n 'align' => 'left',\n 'index' => 'website',\n 'renderer' => 'solutionpartner/adminhtml_solutionpartner_renderer_website',\n ));\n\n $this->addColumn('country', array(\n 'header' => Mage::helper('solutionpartner')->__('Country'),\n 'align' => 'left',\n 'index' => 'country',\n 'type' => 'options',\n 'options' => Mage::helper('solutionpartner')->getCountryList(),\n ));\n\n $this->addColumn('number_qtys', array(\n 'header' => Mage::helper('solutionpartner')->__('Order Qty'),\n 'align' => 'center',\n 'index' => 'number_qtys',\n 'filter_index' => 'count(order.entity_id)',\n 'type' => 'number',\n 'filter_condition_callback' => array($this, '_filterTotalProductsCallback'),\n // 'renderer' => 'partner/adminhtml_partner_renderer_orderquantity',\n ));\n\n// $this->addColumn('cumulative_amount', array(\n// 'header' => Mage::helper('solutionpartner')->__('Accumulated Revenue'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n//\n// $this->addColumn('cumulative_amount_history', array(\n// 'header' => Mage::helper('solutionpartner')->__('Revenue History'),\n// 'type' => 'price',\n// 'index' => 'cumulative_amount_history',\n// 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n// ));\n\n $this->addColumn('registered_date', array(\n 'header' => Mage::helper('solutionpartner')->__('Registered Date'),\n 'align' => 'left',\n 'index' => 'registered_date',\n 'type' => 'datetime'\n ));\n\n $this->addColumn('status', array(\n 'header' => Mage::helper('solutionpartner')->__('Status'),\n 'align' => 'left',\n 'width' => '80px',\n 'index' => 'status',\n 'type' => 'options',\n 'options' => array(\n 1 => 'Enabled',\n 2 => 'Disabled',\n ),\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('solutionpartner')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('solutionpartner')->__('Edit'),\n 'url' => array('base'=> '*/*/edit'),\n 'field' => 'id'\n )),\n 'filter' => false,\n 'sortable' => false,\n 'index' => 'stores',\n 'is_system' => true,\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('solutionpartner')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('solutionpartner')->__('XML'));\n\n return parent::_prepareColumns();\n }", "abstract public function tableColumns();", "protected function getNewColumn()\n {\n return $this->newColumn;\n }", "function buildColumn($column) {\n $name = $type = null;\n $column = array_merge(array('null' => true), $column);\n extract($column);\n\n if (empty($name) || empty($type)) {\n trigger_error(__('Column name or type not defined in schema', true), E_USER_WARNING);\n return null;\n }\n\n if (!isset($this->columns[$type])) {\n trigger_error(sprintf(__('Column type %s does not exist', true), $type), E_USER_WARNING);\n return null;\n }\n\n $real = $this->columns[$type];\n $out = $this->name($name) . ' ' . $real['name'];\n if (isset($column['key']) && $column['key'] == 'primary' && $type == 'integer') {\n return $this->name($name) . ' ' . $this->columns['primary_key']['name'];\n }\n return parent::buildColumn($column);\n }", "public function addColumn(ColumnInterface $column)\r\n\t{\r\n\t\t$this->addrule($column);\r\n\t\treturn $this;\r\n\t}", "public function getColumn($name)\n\t{\n\t\treturn new Mig_Object_Column($this->_info[$name]);\n\t}", "public function getColumn($name)\r\n {\r\n }", "protected function _prepareColumns()\n\t{\n\t\t$this->addColumn('id',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('ID'),\n\t\t\t\t\t\t'align' =>'right',\n\t\t\t\t\t\t'width' => '50px',\n\t\t\t\t\t\t'index' => 'id'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\t$this->addColumn('name',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Name'),\n\t\t\t\t\t\t'index' => 'name'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('description',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Description'),\n\t\t\t\t\t\t'index' => 'description'\n\t\t\t\t)\n\t\t);\n\t\t\n\t\t$this->addColumn('percentage',\n\t\t\t\tarray(\n\t\t\t\t\t\t'header'=> $this->__('Percentage'),\n\t\t\t\t\t\t'index' => 'percentage'\n\t\t\t\t)\n\t\t);\n\t\t \n\t\treturn parent::_prepareColumns();\n\t}", "public function newColumnChart()\n {\n return $this->newChart('column');\n }", "abstract protected function columns(): array;", "public function createColumn($column){\n $url = $this->urlWrapper() . URLResources::COLUMN;\n $sdValidator = new ColumnValidator($column);\n if ($sdValidator->validator()) {\n return $this->makeRequest($url, \"POST\", 1, $column);\n }\n }", "function maybe_add_column($table_name, $column_name, $create_ddl)\n {\n }", "public function addColumn(ColumnReflection $column)\n\t{\n\t\t$this->columns[$column->getName()] = $column;\n\n\t\tif ( !$column->exists() ) {\n\t\t\t$this->driver->addColumn($column);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getColumn() { return $this->column; }", "function yy_r36(){ $this->_retvalue = new SQL\\AlterTable\\AddColumn($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "protected function createColumn($column)\n\t{\n\t\t$c=new CSqliteColumnSchema;\n\t\t$c->name=$column['name'];\n\t\t$c->rawName=$this->quoteColumnName($c->name);\n\t\t$c->allowNull=!$column['notnull'];\n\t\t$c->isPrimaryKey=$column['pk']!=0;\n\t\t$c->isForeignKey=false;\n\t\t$c->init(strtolower($column['type']),$column['dflt_value']);\n\t\treturn $c;\n\t}", "public function addColumn($name, $options)\n\t{\n\t\treturn $this->_adapter->addColumn($this->_identifier, $name, $options);\n\t}", "public function withDataType(DataTypeInterface $type): ColumnInterface;", "protected function _prepareColumns()\n {\n $this->addColumn('increment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'increment_id',\n 'filter_index' => 'main_table.increment_id',\n 'type' => 'text',\n ));\n $this->addColumn('shipment_id', array(\n 'header' => Mage::helper('sales')->__('Shipment #'),\n 'index' => 'entity_id',\n 'filter_index' => 'main_table.entity_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('canpar_shipment_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Shipment #'),\n 'index' => 'canpar_shipment_id',\n 'filter_index' => 'ch_shipment.shipment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('manifest_id', array(\n 'header' => Mage::helper('sales')->__('Canpar Manifest #'),\n 'index' => 'manifest_id',\n 'renderer' => 'canparmodule/adminhtml_canparshipment_renderer_manifestId',\n 'filter_index' => 'ch_shipment.manifest_id',\n ));\n\n $this->addColumn('created_at', array(\n 'header' => Mage::helper('sales')->__('Date Shipped'),\n 'index' => 'created_at',\n 'filter_index' =>'main_table.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('order_increment_id', array(\n 'header' => Mage::helper('sales')->__('Order #'),\n 'index' => 'order_increment_id',\n 'filter_index'=> 'o.increment_id',\n 'type' => 'text',\n ));\n\n $this->addColumn('order_created_date', array(\n 'header' => Mage::helper('sales')->__('Order Date'),\n 'index' => 'order_created_date',\n 'filter_index' =>'o.created_at',\n 'type' => 'datetime',\n ));\n\n $this->addColumn('total_qty', array(\n 'header' => Mage::helper('sales')->__('Total Qty'),\n 'index' => 'total_qty',\n 'type' => 'number',\n ));\n\n $this->addColumn('action',\n array(\n 'header' => Mage::helper('sales')->__('Action'),\n 'width' => '50px',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('sales')->__('View'),\n 'url' => array('base'=>'*/sales_shipment/view'),\n 'field' => 'shipment_id'\n )\n ),\n 'filter' => false,\n 'sortable' => false,\n 'is_system' => true\n ));\n\n $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV'));\n $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel XML'));\n\n return parent::_prepareColumns();\n }", "public function column($field)\n\t{\n\t\tif (!isset($field['type'])) {\n\t\t\t$field['type'] = 'string';\n\t\t}\n\n\t\tif (!isset($field['name'])) {\n\t\t\tthrow new InvalidArgumentException(\"Column name not defined.\");\n\t\t}\n\n\t\tif (!isset($this->_columns[$field['type']])) {\n\t\t\tthrow new UnexpectedValueException(\"Column type `{$field['type']}` does not exist.\");\n\t\t}\n\n\t\t$field += $this->_columns[$field['type']];\n\n\t\t$field += [\n\t\t\t'name' => null,\n\t\t\t'type' => null,\n\t\t\t'length' => null,\n\t\t\t'precision' => null,\n\t\t\t'default' => null,\n\t\t\t'null' => null\n\t\t];\n\n\t\t$isNumeric = preg_match('/^(integer|float|boolean)$/', $field['type']);\n\t\tif ($isNumeric && $field['default'] === '') {\n\t\t\t$field['default'] = null;\n\t\t}\n\t\t$field['use'] = strtolower($field['use']);\n\t\treturn $this->_buildColumn($field);\n\t}", "public function columns()\n {\n $this->addColumn();\n return $this->columns;\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n $this->addColumn('attribute_code', array(\n 'header' => Mage::helper('eav')->__('Attribute Code'),\n 'sortable' => true,\n 'index' => 'attribute_code'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header' => Mage::helper('eav')->__('Attribute Label'),\n 'sortable' => true,\n 'index' => 'frontend_label'\n ));\n }", "public static function addColumn1($newCol, $type, $require, $choices){\n\t\t//this allows us to add column.\n\t\t//self::$db_fields = array_slice($db_fields, 0, $col, true) + array($newCol)\n\t\t//\t\t+ array_slice($db_fields, $col, count($db_fields) -1, true); //incorporate after for now add to end.\n\t\t\n\t\t//assume $newCol must be typed like lower case and with underscore cant start with number etc. (can't contain number? safer)\n\t\t// or catch error and say, invalid column name... try again.\n\t\t\n\t\t$last_element = end(self::$db_fields);\n\t\t\n\t\t//adds new column to db fields\n\t\t$temp = self::$db_fields;\n\t\tarray_push($temp, $newCol);\n\t\tself::$db_fields = $temp;\n\t\t\n\t\t//adds new required to column\n\t\t$temp = self::$required;\n\t\tarray_push($temp, $newCol);\n\t\tself::$required = $temp;\n\t\t\n\t\t//adds new data type to column\n\t\t$temp = self::$data_types;\n\t\tarray_push($temp, $newCol);\n\t\tself::$data_types = $temp;\n\t\t\n\t\t//create new attribute on the fly for each member\n\t\t//do now and have to do for each member.\n\t\tglobal $database;\n\t\t$sql = \"SELECT 'members_id' FROM members1\";\n\t\t//$result = Member::find_by_sql($sql);\n\t\t$result = $database->query($sql);\n\t\t//foreach($result as $attribute=>$value){\n\t\t\n\t\twhile($row = $database->fetch_array($result)){\n\t\t\t$id = $row['members_id'];\n\t\t\t$select = Member::find_by_id($id);\n\t\t\t$select->addAttribute($newCol, \"\");\n\t\t}\n\t\t\n\t\t//change database\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_column` VARCHAR(45) NOT NULL DEFAULT \\'default\\' AFTER `additional_info`'; //[puts default value in\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_nonnull` VARCHAR(45) NOT NULL AFTER `test_null`'; leaves column blank\n\t\t//$sql = \"ALTER TABLE `members1` ADD `test_null` VARCHAR(45) NULL AFTER `test_column`\"; //null column puts Null as entry.\n\t\t\n\t\t$data_value;\n\t\tif($type == \"Enum\"){ //ALTER TABLE `members1` ADD `enum_test` ENUM('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `yep`;\n\t\t\t$temp = self::$enum_list;\n\t\t\tarray_push($temp, $newCol);\n\t\t\tself::$enum_list = $temp;\n\t\t\t\n\t\t\t$data_value = \"ENUM('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse if($type == \"Set\"){ //ALTER TABLE `members1` ADD `enum_test` SET('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `yep`;\n\t\t\t$temp = self::$set_list;\n\t\t\tarray_push($temp, $newCol);\n\t\t\tself::$set_list = $temp;\n\t\t\t\n\t\t\t$data_value = \"SET('hello','goodbye') CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse{\n\t\t\techo \" error has definitely occured\";\n\t\t}\n\t\t//sql syntax would need to add values from choices array to database.\n\t\t$sql = \"ALTER TABLE \".self::$table_name.\" \"; \n\t\t$sql .= \" ADD '{$newCol}' {$data_value} \";\n\t\t\n\t\tif($database->query($sql)){\n\t\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t} \n\t\t\n\t\t\n\t}", "public static function columns()\n {\n return filterColumnByRole([\n 'plot_ref' => trans('system.code'),\n 'plot_name' => trans_title('plots'),\n 'user.name' => trans_title('users'),\n 'city.city_name' => trans_title('cities'),\n 'plot_percent_cultivated_land' => sections('plots.cultivated_land'),\n 'plot_real_area' => sections('plots.real_area'),\n 'plot_start_date' => sections('plots.start_date'),\n 'plot_active' => trans('persona.contact.active'),\n 'plot_green_cover' => sections('plots.green_cover'),\n 'plot_pond' => sections('plots.pond'),\n 'plot_road' => sections('plots.road'),\n ],\n $roleFilter = Credentials::isAdmin(),\n $newColumns = ['client.client_name' => trans_title('clients')],//Admits multiple arrays\n $addInPosition = 3\n );\n }", "public function create_columns()\n {\n $this->assertTrue(\n Schema::hasColumns('logs', [\n 'id',\n 'user_id',\n 'log',\n 'day',\n 'created_at',\n 'updated_at',\n ])\n );\n }", "public function testColumnWithoutClosure()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->column('column');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(ColumnBuilder::class, $return);\n $this->assertArrayHasKey('columns', $array);\n $this->assertCount(1, $array['columns']);\n $this->assertArrayHasKey('name', $array['columns'][0]);\n $this->assertArrayHasKey('columnBuilder', $array['columns'][0]);\n $this->assertEquals('column', $array['columns'][0]['name']);\n $this->assertInstanceOf(ColumnBuilder::class, $array['columns'][0]['columnBuilder']);\n }", "public function add_column( $cols ) {\n\t\t$cols['wp_capabilities'] = __( 'Role', 'wp-custom-user-list-table' );\n\t\t$cols[ 'blogname' ] = __( 'Site Name', 'wp-custom-user-list-table' );\n\t\t$cols[ 'primary_blog' ] = __( 'Site ID', 'wp-custom-user-list-table' );\n\t\treturn $cols;\n\t}", "public function addColumns()\n {\n add_filter( 'manage_edit-' . $this->post_type . '_columns', array($this, 'editColumns') ) ; // Add or Remove a Column\n add_action( 'manage_' . $this->post_type . '_posts_custom_column', array($this, 'manageColumns') ); //Show and Modify Column Data\n add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortableColumns') ); // Flags sortable Columns\n add_action( 'load-edit.php', array($this, 'loadSortColumns') );\n }", "public function getColumns() {\n\n\n if (!$this->columns) {\n $this->columns = array();\n for ($i = 0; $i < $this->statement->columnCount(); $i++) {\n try {\n $columnMeta = $this->statement->getColumnMeta($i);\n\n if ($columnMeta) {\n\n // Fall back to varchar\n $columnType = self::NATIVE_SQL_MAPPINGS[$columnMeta[\"native_type\"]] ?? TableColumn::SQL_VARCHAR;\n $lengthDivisor = self::LENGTH_COLUMN_DIVISORS[$columnMeta[\"native_type\"]] ?? null;\n\n if ($columnType == TableColumn::SQL_BLOB && $columnMeta[\"len\"] > 300000)\n $columnType = TableColumn::SQL_LONGBLOB;\n\n // Record decimal types for later\n if ($columnType == TableColumn::SQL_REAL || $columnType == TableColumn::SQL_DOUBLE || $columnType == TableColumn::SQL_DECIMAL || $columnType == TableColumn::SQL_FLOAT) {\n $this->decimalColumns[] = $columnMeta[\"name\"];\n }\n\n\n $this->columns[] = new ResultSetColumn($columnMeta[\"name\"], $columnType,\n $lengthDivisor ? $columnMeta[\"len\"] / $lengthDivisor : null, $lengthDivisor ? $columnMeta[\"precision\"] : null);\n\n } else {\n $this->columns[] = new ResultSetColumn(\"column\" . ($i + 1), TableColumn::SQL_VARCHAR);\n }\n\n } catch (\\PDOException $e) {\n }\n }\n }\n return $this->columns;\n }", "public function addColumn($column)\n {\n if(!$column instanceof Column)\n throw new Exception('please enter parameter instance of IColumn');\n\n $column->setTable($this);\n $column->setTarget($this->targetColumn);\n $column->init();\n $this->columns[$column->getName()] = $column;\n\n $this->targetColumn = $this->targetColumn + 1;\n return $column;\n }", "function foool_partner_add_column($columns){\n\n $custom_columns = array();\n foreach($columns as $key => $title) {\n\n if ($key=='title') {\n $custom_columns['thumb'] = 'Visuel';\n $custom_columns[$key] = $title;\n } else { \n $custom_columns[$key] = $title;\n }\n }\n return $custom_columns;\n}", "function register_columns() {\n\n\t\t$this->columns = array(\n\t 'cb' => '<input type=\"checkbox\" />',\n\t 'title' => __( 'Name', 'sudoh' ),\n\t 'example-column' => __( 'Example Column', 'sudoh' ),\n\t 'thumbnail' => __( 'Thumbnail', 'sudoh' )\n\t );\n\n\t return $this->columns;\n\n\t}", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n continue;\n }\n $this->columns[$i] = $column;\n }\n }", "public function getColumn(): string;", "public function addColumn($tableName, $schemaName, $column){ }", "final public function col():Col\n {\n return $this->table()->col($this->col);\n }", "protected function getColumns(): array\n {\n if (is_null(self::$_columns)) {\n self::$_columns = parent::addColumns();\n }\n return self::$_columns;\n }", "protected function get_column_info()\n {\n }", "protected function get_column_info()\n {\n }", "protected function _prepareColumns()\n {\n $this->addColumn(\n 'in_worksheets',\n array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_worksheets',\n 'values'=> $this->_getSelectedWorksheets(),\n 'align' => 'center',\n 'index' => 'entity_id'\n )\n );\n $this->addColumn(\n 'ws_name',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Worksheet Name'),\n 'align' => 'left',\n 'index' => 'ws_name',\n 'renderer' => 'bs_worksheet/adminhtml_helper_column_renderer_relation',\n 'params' => array(\n 'id' => 'getId'\n ),\n 'base_link' => 'adminhtml/worksheet_worksheet/edit',\n )\n );\n $this->addColumn(\n 'ws_code',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Worksheet Code'),\n 'align' => 'left',\n 'index' => 'ws_code',\n )\n );\n $this->addColumn(\n 'position',\n array(\n 'header' => Mage::helper('bs_worksheet')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n )\n );\n return parent::_prepareColumns();\n }", "public function addColumn($name, $title, $type = 'text', $primary = 0, $hide = 0, $order = '', $fieldname = '', $format = ''){\n if(!empty($name) && !empty($title)){\n $fieldname = ($fieldname == ''?$name:$fieldname);\n $this->_cols[] = array(\t'name' => $name,\n 'title' => $title,\n 'type' => $type,\n 'primary' => $primary,\n 'hidden' => $hide,\n 'order' => $order,\n 'orderactive' => 0,\n 'orderdir' => 'DESC',\n 'fieldName' => $fieldname,\n\t\t\t\t\t\t\t\t\t\t'format' => $format);\n if($hide == 0){\n $this->_colspan(1);\n }\n }\n }", "public static function addColumn($newCol, $type, $require){\n\t\t//this allows us to add column.\n\t\t//self::$db_fields = array_slice($db_fields, 0, $col, true) + array($newCol)\n\t\t//\t\t+ array_slice($db_fields, $col, count($db_fields) -1, true); //incorporate after for now add to end.\n\t\t\n\t\t//assume $newCol must be typed like lower case and with underscore cant start with number etc. (can't contain number? safer)\n\t\t// or catch error and say, invalid column name... try again.\n\t\t\n\t\t$last_element = end(self::$db_fields);\n\t\t\n\t\t//adds new column to db fields\n\t\t$temp = self::$db_fields;\n\t\tarray_push($temp, $newCol);\n\t\tself::$db_fields = $temp;\n\t\t\n\t\t//adds new required to column\n\t\t$temp = self::$required;\n\t\tarray_push($temp, $newCol);\n\t\tself::$required = $temp;\n\t\t\n\t\t//adds new data type to column\n\t\t$temp = self::$data_types;\n\t\tarray_push($temp, $newCol);\n\t\tself::$data_types = $temp;\n\t\t\n\t\t//create new attribute on the fly for each member\n\t\t//do now and have to do for each member.\n\t\tglobal $database;\n\t\t$sql = \"SELECT 'members_id' FROM members1\";\n\t\t//$result = Member::find_by_sql($sql);\n\t\t$result = $database->query($sql);\n\t\t//foreach($result as $attribute=>$value){\n\t\t\n\t\twhile($row = $database->fetch_array($result)){\n\t\t\t$id = $row['members_id'];\n\t\t\t$select = Member::find_by_id($id);\n\t\t\t$select->addAttribute($newCol, \"\"); //default attribute value??\n\t\t}\n\t\t\n\t\t//change database\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_column` VARCHAR(45) NOT NULL DEFAULT \\'default\\' AFTER `additional_info`'; //[puts default value in\n\t\t//$sql = 'ALTER TABLE `members1` ADD `test_nonnull` VARCHAR(45) NOT NULL AFTER `test_null`'; leaves column blank\n\t\t//$sql = \"ALTER TABLE `members1` ADD `test_null` VARCHAR(45) NULL AFTER `test_column`\"; //null column puts Null as entry.\n\t\t\n\t\t$data_value;\n\t\tif($type == \"Text\"){\n\t\t\t$data_value = \"TEXT CHARACTER SET utf8 COLLATE utf8_general_ci \"; //$sql = 'ALTER TABLE `members1` ADD `hilarious` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `primate`';\n\t\t}\n\t\telse if($type == \"Single\"){\n\t\t\t$data_value = \"VARCHAR(45) CHARACTER SET utf8 COLLATE utf8_general_ci \";\n\t\t}\n\t\telse if($type == \"Integer\"){\n\t\t\t$data_value = \"INT(11)\"; //if int not null it defaults to 0.\n\t\t}\n\t\telse if($type == \"Date\"){\n\t\t\t$data_value = \"DATE\"; //ALTER TABLE `members1` ADD `enum_test` DATE NOT NULL AFTER `yep`; //defaults to 0000-00-00 //year month day.\n\t\t}\n\t\telse{\n\t\t\techo \" error has definitely occured\";\n\t\t}\n\t\t\n\t\tif($require == 1){\n\t\t\n\t\t\t$sql = \"ALTER TABLE `\".self::$table_name.\"` \"; \n\t\t\t$sql .= \" ADD `{$newCol}` {$data_value} NOT NULL AFTER `\".$last_element.\"` \";\n\t\t}\n\t\telse{\n\t\t\t\t\t\n\t\t\t$sql = \"ALTER TABLE `\".self::$table_name.\"` \"; \n\t\t\t$sql .= \" ADD `{$newCol}` {$data_value} NULL AFTER `\".$last_element.\"` \";\n\t\t}\n\t\techo \"{$sql}\";\n\t\tif($database->query($sql)){\n\t\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t} \n\t\t\n\t}", "abstract public static function get_column_name(): string;", "public function add_column($column_name, $type = NULL, $options = array())\n\t{\n\t\t$col = new Table_Column($column_name, $type, $options);\n\t\t$this->columns[] = $col;\n\n\t\treturn $this;\n\t}", "abstract public function listColumns();", "protected function createColumn($column)\n {\n $c = new ColumnSchema;\n\n $c->name = strtolower(rtrim($column['fname']));\n// $c->rawName = $this->quoteColumnName($c->name);\n $c->allowNull = $column['fnull'] !== '1';\n $c->isPrimaryKey = $column['fprimary'];\n// $c->isForeignKey = false;\n $c->size = (int) $column['flength'];\n $c->scale = (int) $column['fscale'];\n $c->precision = (int) $column['fprecision'];\n $c->autoIncrement = $column['fautoinc'] === '1';\n $defaultValue = null;\n if (!empty($column['fdefault'])) {\n\n // remove whitespace, 'DEFAULT ' prefix and surrounding single quotes; all optional\n if (preg_match(\"/\\s*(DEFAULT\\s+){0,1}('(.*)'|(.*))\\s*/i\", $column['fdefault'], $parts)) {\n $defaultValue = array_pop($parts);\n }\n\n // handle escaped single quotes like in \"funny''quoted''string\"\n $defaultValue = str_replace('\\'\\'', '\\'', $defaultValue);\n }\n if ($defaultValue === null) {\n $defaultValue = $column['fdefault_value'];\n }\n\n $type = \"\";\n\n $baseTypes = array(\n 7 => 'SMALLINT',\n 8 => 'INTEGER',\n 16 => 'INT64',\n 9 => 'QUAD',\n 10 => 'FLOAT',\n 11 => 'D_FLOAT',\n 17 => 'BOOLEAN',\n 27 => 'DOUBLE',\n 12 => 'DATE',\n 13 => 'TIME',\n 35 => 'TIMESTAMP',\n 261 => 'BLOB',\n 37 => 'VARCHAR',\n 14 => 'CHAR',\n 40 => 'CSTRING',\n 45 => 'BLOB_ID',\n );\n\n if (array_key_exists((int) $column['fcodtype'], $baseTypes)) {\n $type = $baseTypes[(int) $column['fcodtype']];\n }\n\n switch ((int) $column['fcodtype']) {\n case 7:\n case 8:\n switch ((int) $column['fcodsubtype']) {\n case 1:\n $type = 'NUMERIC';\n break;\n case 2:\n $type = 'DECIMAL';\n break;\n }\n break;\n case 12:\n case 13:\n case 35:\n $c->size=19;\n break;\n case 16:\n switch ((int) $column['fcodsubtype']) {\n case 1:\n $type = 'NUMERIC';\n break;\n case 2:\n $type = 'DECIMAL';\n break;\n default :\n $type = 'BIGINT';\n break;\n }\n break;\n case 261:\n switch ((int) $column['fcodsubtype']) {\n case 1:\n $type = 'TEXT';\n break;\n }\n break;\n }\n\n $c->init(rtrim($type), $defaultValue);\n\n return $c;\n }", "protected function _prepareColumns()\n {\n $this->addColumn($this->_productIdField, array(\n 'header' => $this->_getHelper()->__('ID'),\n 'sortable' => true,\n 'index' => $this->_productIdField,\n 'width' => 60,\n ));\n\n $this->addColumn('title', array(\n 'header' => $this->_getHelper()->__('Title'),\n 'index' => 'title'\n ));\n\n $this->addColumn('set_title', array(\n 'header' => $this->_getHelper()->__('Attachments Set'),\n 'index' => 'set_title',\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareSetUrl')\n ));\n\n $this->addColumn('file_url', array(\n 'header' => $this->_getHelper()->__('Download'),\n 'index' => 'download',\n 'sortable' => false,\n 'filter' => false,\n 'width' => 150,\n 'frame_callback' => array($this, 'prepareFileUrl')\n ));\n\n $this->addColumn('type', array(\n 'header' => $this->_getHelper()->__('Type'),\n 'index' => 'type',\n 'filter' => false,\n 'width' => 50,\n 'frame_callback' => array($this, 'prepareType')\n ));\n\n $this->addColumn('updated_at', array(\n 'header' => $this->_getHelper()->__('Updated'),\n 'type' => 'date',\n 'index' => 'updated_at',\n 'width' => 150,\n ));\n\n return Mage_Adminhtml_Block_Widget_Grid::_prepareColumns();\n }", "function add_columns( $columns ) {\n\t$columns['layout'] = 'Layout';\n\treturn $columns;\n}", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "protected function initColumns()\n {\n if (empty($this->columns)) {\n $this->guessColumns();\n }\n\n foreach ($this->columns as $i => $column) {\n if (is_string($column)) {\n $column = $this->createDataColumn($column);\n } else {\n $column = Yii::createObject(array_merge([\n 'class' => $this->dataColumnClass ?: DataColumn::className(),\n 'grid' => $this,\n ], $column));\n }\n if (!$column->visible) {\n unset($this->columns[$i]);\n $this->allColumns[$i] = $column;\n continue;\n }\n $this->columns[$i] = $column;\n $this->allColumns[$i] = $column;\n }\n }", "public function addColumn($columnTitle, $columnName = null)\n {\n if (!is_null($columnName)) {\n $column = new Column($this->postType, $columnName, $columnTitle);\n } else {\n $column = new Column($this->postType, $columnTitle);\n }\n\n $this->columns[] = $column;\n\n return $column;\n }", "public function addColumns( $value){\n return $this->_add(3, $value);\n }", "protected function addColumns()\n {\n parent::addColumns();\n\n foreach ($this->config['fields'] as $key => $values) {\n\n switch ($values['type']) {\n case 'text':\n $this->table->addColumn($key, 'string', array('length' => 256, 'default' => ''));\n break;\n case 'textarea':\n case 'select':\n $this->table->addColumn($key, 'text', array('default' => ''));\n break;\n case 'checkbox':\n $this->table->addColumn($key, 'boolean', array('default' => 0));\n break;\n default:\n $this->table->addColumn($key, 'text', array('default' => ''));\n }\n\n }\n }", "private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }", "private function _setColumns()\n {\n $this->columns = new Pike_Grid_DataSource_Columns();\n\n foreach ($this->_query->getFields() as $field) {\n $this->columns->add($field, null, $field);\n }\n }", "protected function _prepareColumns()\n {\n\n $this->addColumn(\n 'entity_id',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Id'),\n 'index' => 'entity_id',\n 'type' => 'number'\n )\n );\n\n $this->addColumn(\n 'in_docwisements',\n array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_docwisements',\n 'values'=> $this->_getSelectedDocwisements(),\n 'align' => 'center',\n 'index' => 'entity_id'\n )\n );\n\n $this->addColumn(\n 'doc_name',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Name'),\n 'align' => 'left',\n 'index' => 'doc_name',\n )\n );\n\n\n $this->addColumn(\n 'doc_type',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Document Type'),\n 'index' => 'doc_type',\n 'type' => 'options',\n 'options' => Mage::helper('bs_docwise')->convertOptions(\n Mage::getModel('bs_docwise/docwisement_attribute_source_doctype')->getAllOptions(false)\n )\n\n )\n );\n $this->addColumn(\n 'doc_date',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Date'),\n 'index' => 'doc_date',\n 'type'=> 'date',\n\n )\n );\n\n $this->addColumn(\n 'download',\n array(\n 'header' => Mage::helper('bs_docwise')->__('View/Download'),\n 'type' =>'text',\n 'renderer' => 'bs_docwise/adminhtml_helper_column_renderer_download',\n\n 'filter' => false,\n 'sortable' => false,\n )\n );\n\n $this->addColumn(\n 'position',\n array(\n 'header' => Mage::helper('catalog')->__('Position'),\n 'name' => 'position',\n 'width' => 60,\n 'type' => 'number',\n 'validate_class' => 'validate-number',\n 'index' => 'position',\n 'editable' => true,\n )\n );\n $this->addColumn(\n 'action',\n array(\n 'header' => Mage::helper('bs_docwise')->__('Action'),\n 'width' => '100',\n 'type' => 'action',\n 'getter' => 'getId',\n 'actions' => array(\n array(\n 'caption' => Mage::helper('bs_docwise')->__('Edit'),\n 'url' => array('base'=> '*/docwise_docwisement/edit'),\n 'field' => 'id'\n )\n ),\n 'filter' => false,\n 'is_system' => true,\n 'sortable' => false,\n )\n );\n }", "function addColumnData($heading, $fieldName) \n {\n $xmlRow = new XMLObject( XMLObject_ColumnList::XML_NODE_COL );\n $xmlRow->addElement(XMLObject_ColumnList::XML_ELEMENT_HEADING, $heading );\n $xmlRow->addElement(XMLObject_ColumnList::XML_ELEMENT_FIELDNAME, $fieldName );\n \n $this->addXMLObject( $xmlRow ); \n }", "protected function _prepareColumns()\n {\n/*\n $this->addColumn('version_number', array(\n 'header' => Mage::helper('gri_cms')->__('Version #'),\n 'width' => 100,\n 'index' => 'version_number',\n 'type' => 'options',\n 'options' => Mage::helper('gri_cms')->getVersionsArray($this->getPage())\n ));\n*/\n $this->addColumn('label', array(\n 'header' => Mage::helper('gri_cms')->__('Version Label'),\n 'index' => 'label',\n 'type' => 'options',\n 'options' => $this->getCollection()\n ->getAsArray('label', 'label')\n ));\n\n $this->addColumn('owner', array(\n 'header' => Mage::helper('gri_cms')->__('Owner'),\n 'index' => 'username',\n 'type' => 'options',\n 'options' => $this->getCollection()->getUsersArray(false),\n 'width' => 250\n ));\n\n $this->addColumn('access_level', array(\n 'header' => Mage::helper('gri_cms')->__('Access Level'),\n 'index' => 'access_level',\n 'type' => 'options',\n 'width' => 100,\n 'options' => Mage::helper('gri_cms')->getVersionAccessLevels()\n ));\n\n $this->addColumn('revisions', array(\n 'header' => Mage::helper('gri_cms')->__('Revisions Qty'),\n 'index' => 'revisions_count',\n 'type' => 'number'\n ));\n\n $this->addColumn('created_at', array(\n 'width' => 150,\n 'header' => Mage::helper('gri_cms')->__('Created At'),\n 'index' => 'created_at',\n 'type' => 'datetime',\n ));\n\n return parent::_prepareColumns();\n }", "protected function _prepareColumns() {\n $this->addColumn('period', array(\n 'header' => Mage::helper('webpos')->__('Period'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'period',\n 'width' => '100px',\n ));\n $this->addColumn('user', array(\n 'header' => Mage::helper('webpos')->__('User'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'index' => 'user',\n 'width' => '200px',\n ));\n $this->addColumn('totals_sales', array(\n 'header' => Mage::helper('webpos')->__('Sales Total'),\n 'align' => 'left',\n 'total' => 'sum',\n 'sortable' => false,\n 'filter' => false,\n 'width' => '100px',\n 'index' => 'totals_sales',\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n ));\n $this->addExportType('*/*/exportCsv', Mage::helper('webpos')->__('CSV'));\n $this->addExportType('*/*/exportXml', Mage::helper('webpos')->__('XML'));\n\n return parent::_prepareColumns();\n }", "static function getColumns()\n {\n }", "function getColumns() {return $this->_columns;}", "public static function add(string $title = ''): Column\n {\n return new static($title);\n }", "function tradeoff_column($definition)\n {\n return app(Models\\Problem\\Column::class)->setData($definition);\n }", "protected function _prepareColumns()\n {\n parent::_prepareColumns();\n\n\n $this->addColumn('attribute_code', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Code'),\n 'sortable'=>true,\n 'index'=>'attribute_code',\n 'width' => '22%'\n ));\n\n $this->addColumn('frontend_label', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Attribute Label'),\n 'sortable'=>true,\n 'index'=>'frontend_label',\n 'width' => '22%'\n ));\n\n $this->addColumn('translate_options', array(\n 'header'=>Mage::helper('strakertranslations_easytranslationplatform')->__('Translate Attribute Options'),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_TranslateOptions',\n 'align' => 'center',\n 'index' => 'frontend_input',\n 'sortable'=> false,\n 'type' => 'options',\n 'options' => [\n 'no' => Mage::helper('catalog')->__('No Options'),\n 'select' => Mage::helper('catalog')->__('Has Options')\n ],\n 'filter_condition_callback' => array($this, '_optionsFilter'),\n 'width' => '22%'\n ));\n\n $this->addColumn('is_visible', array(\n 'header'=>Mage::helper('catalog')->__('Visible'),\n 'sortable'=>true,\n 'index'=>'is_visible_on_front',\n 'type' => 'options',\n 'options' => array(\n '1' => Mage::helper('catalog')->__('Yes'),\n '0' => Mage::helper('catalog')->__('No'),\n ),\n 'align' => 'center',\n 'width' => '22%'\n ));\n\n $this->addColumn('version',\n array(\n 'header'=> Mage::helper('catalog')->__('Translated'),\n 'width' => '70px',\n 'index' => 'version',\n 'type' => 'options',\n 'options' => array(\n 'Translated' => Mage::helper('catalog')->__('Translated'),\n 'Not Translated' => Mage::helper('catalog')->__('Not Translated')\n ),\n 'renderer' => 'StrakerTranslations_EasyTranslationPlatform_Block_Adminhtml_Template_Grid_Renderer_Translated',\n 'filter_condition_callback' => array($this, '_versionFilter'),\n ));\n\n return $this;\n }" ]
[ "0.6563636", "0.65066826", "0.62653697", "0.6230475", "0.6183304", "0.6182499", "0.614719", "0.61201715", "0.6119434", "0.6106207", "0.607369", "0.60033995", "0.5947455", "0.59340316", "0.59175456", "0.5911465", "0.5899334", "0.5875888", "0.5873721", "0.5863077", "0.58567905", "0.5853822", "0.5809383", "0.58000183", "0.5799041", "0.5790939", "0.57878846", "0.57859015", "0.5763941", "0.57601076", "0.56878346", "0.5682496", "0.5678076", "0.56743073", "0.56734866", "0.56719184", "0.5653188", "0.56405157", "0.56307405", "0.56259376", "0.5625269", "0.562508", "0.56230986", "0.56140566", "0.5610223", "0.5605985", "0.55947936", "0.5594609", "0.5580025", "0.5578757", "0.55700094", "0.5569931", "0.5569533", "0.5569066", "0.5567869", "0.5563943", "0.5559401", "0.5552739", "0.55459654", "0.55453444", "0.5544708", "0.55403876", "0.55379343", "0.5535183", "0.5534425", "0.55299604", "0.5527425", "0.55146", "0.55035", "0.5502331", "0.54894274", "0.54817045", "0.5478248", "0.54769075", "0.547534", "0.546637", "0.54620075", "0.5459807", "0.54594886", "0.545121", "0.545121", "0.545121", "0.545121", "0.545121", "0.545121", "0.545121", "0.545052", "0.5450318", "0.54454094", "0.54402", "0.5434036", "0.54339844", "0.5419426", "0.5409068", "0.5409008", "0.5406942", "0.5402061", "0.54005873", "0.5400522", "0.53999317", "0.53971124" ]
0.0
-1
Return True if $string is utf8
protected function isUtf8( $string) { return preg_match('%^(?: [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 )*$%xs', $string); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_utf8($string) {\n\t// From http://w3.org/International/questions/qa-forms-utf-8.html\n\treturn preg_match('%^(?:\n\t\t[\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n\t\t| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n\t)*$%xs', $string);\n}", "function isUtf8($string) {\n if (function_exists(\"mb_check_encoding\") && is_callable(\"mb_check_encoding\")) {\n return mb_check_encoding($string, 'UTF8');\n }\n\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs', $string);\n\n }", "function is_well_formed_utf8($string)\n{\n if ( empty($string) ) {\n return true;\n }\n // iconv is the fastest and best way to check this but it\n // might not be installed\n // The comments in this blog post will explain what is going on\n // http://www.sitepoint.com/blogs/2006/08/09/scripters-utf-8-survival-guide-slides/\n // Please note that we are validating, not cleaning, the input\n if ( function_exists('iconv') ) {\n return iconv('UTF-8', 'UTF-8', $string) == $string;\n }\n // Falling back to slower regexp if iconv is not available\n // When the u-flag is used, the string must be well formed or\n // nothing will match\n return preg_match('/^.{1}/us', $string) == 1;\n}", "function isUtf8($string) {\n\tif (function_exists(\"mb_check_encoding\") && is_callable(\"mb_check_encoding\")) {\n\t\treturn mb_check_encoding($string, 'UTF8');\n\t}\n\treturn preg_match('%^(?:\n\t\t [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n\t\t| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n\t)*$%xs', $string);\n}", "function mb_is_utf8($string) { \n\treturn mb_detect_encoding($string, 'UTF-8') === 'UTF-8';\n}", "function is_utf8($string) {\n\treturn !strlen(\n\tpreg_replace(\n\t ',[\\x09\\x0A\\x0D\\x20-\\x7E]' # ASCII\n\t. '|[\\xC2-\\xDF][\\x80-\\xBF]' # non-overlong 2-byte\n\t. '|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]' # excluding overlongs\n\t. '|[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}' # straight 3-byte\n\t. '|\\xED[\\x80-\\x9F][\\x80-\\xBF]' # excluding surrogates\n\t. '|\\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}' # planes 1-3\n\t. '|[\\xF1-\\xF3][\\x80-\\xBF]{3}' # planes 4-15\n\t. '|\\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}' # plane 16\n\t. ',sS',\n\t'', $string));\n}", "public static function isUnicode(string $string): bool\n {\n return mb_check_encoding($string, 'UTF-8');\n }", "function isUTF8($str) {\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] // ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] // non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] // excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} // straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] // excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} // planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} // planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} // plane 16\n )*$%xs', $str);\n }", "function isUTF8($str) {\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] // ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] // non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] // excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} // straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] // excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} // planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} // planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} // plane 16\n )*$%xs', $str);\n }", "function isUTF8($string){\r\n\tif (is_array($string)){\r\n\t\t$enc = implode('', $string);\r\n\t\treturn @!((ord($enc[0]) != 239) && (ord($enc[1]) != 187) && (ord($enc[2]) != 191));\r\n\t}else{\r\n\t\treturn (utf8_encode(utf8_decode($string)) == $string);\r\n\t}\r\n}", "public static function isUTF8String($string) {\n $sample = @iconv('utf-8', 'utf-8', $string);\n\n if (md5($sample) == md5($string))\n return true;\n else\n return false;\n }", "function isUTF8 ($string) {\n $c=0; $b=0;\n $bits=0;\n $len=strlen($string);\n for($i=0; $i<$len; $i++){\n $c=ord($string[$i]);\n if($c > 128){\n if(($c >= 254)) return false;\n elseif($c >= 252) $bits=6;\n elseif($c >= 248) $bits=5;\n elseif($c >= 240) $bits=4;\n elseif($c >= 224) $bits=3;\n elseif($c >= 192) $bits=2;\n else return false;\n if(($i+$bits) > $len) return false;\n while($bits > 1){\n $i++;\n $b=ord($string[$i]);\n if($b < 128 || $b > 191) return false;\n $bits--;\n }\n }\n }\n return true;\n }", "protected function getStrIsUtf8 ($str) {\n\t\treturn !mb_check_encoding($str, 'ASCII') && mb_check_encoding($str, 'UTF-8');\n\t}", "function seems_utf8($str)\n {\n }", "public static function isUtf16Be($string) {}", "abstract public function hasUTF();", "function _validate_utf8($text) {\n if (strlen($text) == 0) {\n return TRUE;\n }\n return (preg_match('/^./us', $text) == 1);\n}", "public function isUTF8() {\r\n if (preg_match('!!u', $this->contents)) return true;\r\n return false;\r\n }", "function is_utf8($str) {\n $c=0; $b=0;\n $bits=0;\n $len=strlen($str);\n for($i=0; $i<$len; $i++){\n $c=ord($str[$i]);\n if($c > 128){\n if(($c >= 254)) return false;\n elseif($c >= 252) $bits=6;\n elseif($c >= 248) $bits=5;\n elseif($c >= 240) $bits=4;\n elseif($c >= 224) $bits=3;\n elseif($c >= 192) $bits=2;\n else return false;\n if(($i+$bits) > $len) return false;\n while($bits > 1){\n $i++;\n $b=ord($str[$i]);\n if($b < 128 || $b > 191) return false;\n $bits--;\n }\n }\n }\n return true;\n}", "function checkEncoding($str, $encoding);", "function validate_utf8($text) {\n if (strlen($text) == 0) {\n return TRUE;\n }\n return (preg_match('/^./us', $text) == 1);\n}", "public function utf8_Validate($string)\n {\n $output=$string;\n if (!preg_match('!!u', $string)) {\n $output = utf8_encode($string);\n }\n return $output;\n }", "function utf8_validate($str) {\n static $regex = <<<'END'\n/^(?:\n [\\x00-\\x7F]\n | [\\xC2-\\xDF][\\x80-\\xBF]\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF]\n | [\\xE1-\\xEC\\xEE-\\xEF][\\x80-\\xBF]{2}\n | \\xED[\\x80-\\x9F][\\x80-\\xBF]\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]\n | [\\xF1-\\xF3][\\x80-\\xBF]{3}\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}\n)*$/x\nEND;\n return preg_match($regex, $str) === 1;\n}", "function ValidateUtf8($text) {\n if (strlen($text) == 0) {\n return TRUE;\n }\n return (preg_match('/^./us', $text) == 1);\n }", "protected static function isUTF8($text)\n {\n /*\n Based on http://w3.org/International/questions/qa-forms-utf-8.html,\n but rewritten to avoid a dependency on PCRE.\n\n Also, the regular expression in the post above seems to limit\n valid inputs to printable characters (for compatibility reasons?).\n See also section 2.2 of http://www.w3.org/TR/xml11 and section 2.2\n of http://www.w3.org/TR/xml/ for a possible explanation.\n\n The code below does not suffer from such limitations.\n */\n $len = strlen($text);\n $res = true;\n for ($i = 0; $i < $len; $i++) {\n // U+0000 - U+007F\n $byte1 = ord($text[$i]);\n if ($byte1 >= 0 && $byte1 <= 0x7F) {\n continue;\n }\n\n // Look for 2nd byte\n if (++$i >= $len) {\n return false;\n }\n $byte2 = ord($text[$i]);\n\n // U+0080 - U-07FF\n if ($byte1 >= 0xC2 && $byte1 <= 0xDF) {\n if ($byte2 >= 0x80 && $byte2 <= 0xBF) {\n continue;\n }\n return false;\n }\n\n // Look for 3nd byte\n if (++$i >= $len) {\n return false;\n }\n $byte3 = ord($text[$i]);\n\n // U+0800 - U+0FFF\n if ($byte1 == 0xE0) {\n if ($byte2 >= 0xA0 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF) {\n continue;\n }\n return false;\n }\n\n // U+1000 - U+CFFF & U+E000 - U+FFFF\n if ($byte1 >= 0xE1 && $byte1 <= 0xEF && $byte1 !== 0xED) {\n if ($byte2 >= 0x80 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF) {\n $codepoint = (($byte1 & 0x0F) << 12) + (($byte2 & 0x3F) << 6) + ($byte3 & 0x3F);\n if (($codepoint >= 0xE000 && $codepoint <= 0xF8FF) || // Private range\n ($codepoint >= 0xFDD0 && $codepoint <= 0xFDEF) || // Non-characters\n $codepoint == 0xFFFE || $codepoint == 0xFFFF) { // Non-characters\n $res = null;\n }\n continue;\n }\n return false;\n }\n\n // U+D000 - U+D7FF\n if ($byte1 == 0xED) {\n if ($byte2 >= 0x80 && $byte2 <= 0x9F &&\n $byte3 >= 0x80 && $byte3 <= 0xBF) {\n continue;\n }\n return false;\n }\n\n // Look for 4nd byte\n if (++$i >= $len) {\n return false;\n }\n $byte4 = ord($text[$i]);\n\n // U+10000 - U+3FFFF\n if ($byte1 == 0xF0) {\n if ($byte2 >= 0x90 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF &&\n $byte4 >= 0x80 && $byte4 <= 0xBF) {\n $codepoint = (($byte1 & 0x07) << 18) +\n (($byte2 & 0x3F) << 12) +\n (($byte3 & 0x3F) << 6) +\n ($byte4 & 0x3F);\n // Non-characters Reserved range\n if ($codepoint == 0x1FFFE || $codepoint == 0x1FFFF || $codepoint >= 0x2FFFE) {\n $res = null;\n }\n continue;\n }\n return false;\n }\n\n // U+40000 - U+FFFFF\n if ($byte1 >= 0xF1 && $byte1 <= 0xF3) {\n if ($byte2 >= 0x80 && $byte2 <= 0xBF &&\n $byte3 >= 0x80 && $byte3 <= 0xBF &&\n $byte4 >= 0x80 && $byte4 <= 0xBF) {\n $codepoint = (($byte1 & 0x07) << 18) +\n (($byte2 & 0x3F) << 12) +\n (($byte3 & 0x3F) << 6) +\n ($byte4 & 0x3F);\n // Reserved range Non characters & private ranges\n if ($codepoint < 0xE0000 || $codepoint >= 0xEFFFE) {\n $res = null;\n }\n continue;\n }\n return false;\n }\n\n // U+100000 - U+10FFFF\n if ($byte1 == 0xF4) {\n if ($byte2 >= 0x80 && $byte2 <= 0x8F &&\n $byte3 >= 0x80 && $byte3 <= 0xBF &&\n $byte4 >= 0x80 && $byte4 <= 0xBF) {\n // This part contains only non-characters & private ranges.\n $res = null;\n continue;\n }\n return false;\n }\n\n // Byte #1 contained an invalid value.\n return false;\n }\n\n // No decoding error detected, but the given input may contain\n // non-characters/reserved characters, depending on the value of $res.\n return $res;\n }", "public static function seems_utf8(string $str): bool {\n $length = strlen($str);\n for ($i = 0; $i < $length; $i++) {\n $c = ord($str[$i]);\n if ($c < 0x80)\n $n = 0;# 0bbbbbbb\n elseif (($c & 0xE0) == 0xC0)\n $n = 1;# 110bbbbb\n elseif (($c & 0xF0) == 0xE0)\n $n = 2;# 1110bbbb\n elseif (($c & 0xF8) == 0xF0)\n $n = 3;# 11110bbb\n elseif (($c & 0xFC) == 0xF8)\n $n = 4;# 111110bb\n elseif (($c & 0xFE) == 0xFC)\n $n = 5;# 1111110b\n else\n return false;# Does not match any model\n for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?\n if (( ++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))\n return false;\n }\n }\n return true;\n }", "public static function isNotUtf8Charset() {}", "public static function is_utf8mb4($string)\n {\n if (max(array_map('ord', str_split($string))) >= 240){\n return true;\n }\n return false;\n }", "function seems_utf8($str)\n {\n $length = strlen($str);\n for ($i = 0; $i < $length; $i++) {\n $c = ord($str[$i]);\n if ($c < 0x80) $n = 0; # 0bbbbbbb\n elseif (($c & 0xE0) == 0xC0) $n = 1; # 110bbbbb\n elseif (($c & 0xF0) == 0xE0) $n = 2; # 1110bbbb\n elseif (($c & 0xF8) == 0xF0) $n = 3; # 11110bbb\n elseif (($c & 0xFC) == 0xF8) $n = 4; # 111110bb\n elseif (($c & 0xFE) == 0xFC) $n = 5; # 1111110b\n else return false; # Does not match any model\n for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?\n if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))\n return false;\n }\n }\n return true;\n }", "public static function isUTF8($value = '')\n {\n return utf8_encode(utf8_decode($value)) === $value;\n }", "public static function isUTF8($value = '')\n {\n return utf8_encode(utf8_decode($value)) === $value;\n }", "function seems_utf8($str)\n{\n\t$str_len = strlen($str);\n\tfor ($i = 0; $i < $str_len; ++$i)\n\t{\n\t\tif (ord($str[$i]) < 0x80) continue; # 0bbbbbbb\n\t\telse if ((ord($str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb\n\t\telse if ((ord($str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb\n\t\telse if ((ord($str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb\n\t\telse if ((ord($str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb\n\t\telse if ((ord($str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b\n\t\telse return false; # Does not match any model\n\n\t\tfor ($j = 0; $j < $n; ++$j) # n bytes matching 10bbbbbb follow ?\n\t\t{\n\t\t\tif ((++$i == strlen($str)) || ((ord($str[$i]) & 0xC0) != 0x80))\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function is_unicode($data) {\n if (strlen($data) !== strlen(utf8_decode($data))) {\n return true;\n } else {\n return false;\n }\n}", "function seems_utf8($str) {\r\n\t mbstring_binary_safe_encoding();\r\n\t $length = strlen($str);\r\n\t reset_mbstring_encoding();\r\n\t for ($i=0; $i < $length; $i++) {\r\n\t\t$c = ord($str[$i]);\r\n\t\tif ($c < 0x80) $n = 0; # 0bbbbbbb\r\n\t\telseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb\r\n\t\telseif (($c & 0xF0) == 0xE0) $n=2; # 1110bbbb\r\n\t\telseif (($c & 0xF8) == 0xF0) $n=3; # 11110bbb\r\n\t\telseif (($c & 0xFC) == 0xF8) $n=4; # 111110bb\r\n\t\telseif (($c & 0xFE) == 0xFC) $n=5; # 1111110b\r\n\t\telse return false; # Does not match any model\r\n\t\tfor ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\r\n\t\t if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))\r\n\t\t\treturn false;\r\n\t\t}\r\n\t }\r\n\t return true;\r\n\t}", "public function isUtf8()\n\t{\n\t\treturn strtolower($this->_mail->getMail()->getCharset())=='utf-8';\n\t}", "function seems_utf8($str) {\n\tmbstring_binary_safe_encoding();\n\t$length = strlen($str);\n\treset_mbstring_encoding();\n\tfor ($i=0; $i < $length; $i++) {\n\t\t$c = ord($str[$i]);\n\t\tif ($c < 0x80) $n = 0; # 0bbbbbbb\n\t\telseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb\n\t\telseif (($c & 0xF0) == 0xE0) $n=2; # 1110bbbb\n\t\telseif (($c & 0xF8) == 0xF0) $n=3; # 11110bbb\n\t\telseif (($c & 0xFC) == 0xF8) $n=4; # 111110bb\n\t\telseif (($c & 0xFE) == 0xFC) $n=5; # 1111110b\n\t\telse return false; # Does not match any model\n\t\tfor ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\n\t\t\tif ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))\n\t\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "protected function isUTF8 ( $s )\n\t{\n\t\treturn preg_match('%(?:\n\t [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n\t |\\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n\t |[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n\t |\\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n\t |\\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n\t |[\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n\t |\\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n\t )+%xs', $s);\n\t}", "public function isUTF()\n {\n return $this->utf;\n }", "protected function IsUtf8($word) {\n\t\tif (preg_match ( \"/^([\" . chr ( 228 ) . \"-\" . chr ( 233 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}){1}/\", $word ) == true || preg_match ( \"/([\" . chr ( 228 ) . \"-\" . chr ( 233 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}){1}$/\", $word ) == true || preg_match ( \"/([\" . chr ( 228 ) . \"-\" . chr ( 233 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}[\" . chr ( 128 ) . \"-\" . chr ( 191 ) . \"]{1}){2,}/\", $word ) == true) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function seemsUtf8($string)\n {\n for ($i = 0; $i < strlen($string); $i++) {\n if (ord($string[$i]) < 0x80) {\n // 0bbbbbbb\n continue;\n }\n\n if ((ord($string[$i]) & 0xE0) == 0xC0) {\n // 110bbbbb\n $n = 1;\n } elseif ((ord($string[$i]) & 0xF0) == 0xE0) {\n // 1110bbbb\n $n = 2;\n } elseif ((ord($string[$i]) & 0xF8) == 0xF0) {\n // 11110bbb\n $n = 3;\n } elseif ((ord($string[$i]) & 0xFC) == 0xF8) {\n // 111110bb\n $n = 4;\n } elseif ((ord($string[$i]) & 0xFE) == 0xFC) {\n // 1111110b\n $n = 5;\n } else {\n // Does not match any model\n return false;\n }\n\n // n bytes matching 10bbbbbb follow ?\n for ($j = 0; $j < $n; $j++) {\n if ((++$i == strlen($string)) || ((ord($string[$i]) & 0xC0) != 0x80)) {\n return false;\n }\n }\n }\n\n return true;\n }", "private function seems_utf8( $str ) {\n\t\t$this->mbstring_binary_safe_encoding();\n\t\t$length = strlen( $str );\n\t\t$this->reset_mbstring_encoding();\n\t\tfor ( $i = 0; $i < $length; $i++ ) {\n\t\t\t$c = ord( $str[ $i ] );\n\t\t\tif ( $c < 0x80 ) {\n\t\t\t\t$n = 0; // 0bbbbbbb\n\t\t\t} elseif ( ( $c & 0xE0 ) == 0xC0 ) {\n\t\t\t\t$n = 1; // 110bbbbb\n\t\t\t} elseif ( ( $c & 0xF0 ) == 0xE0 ) {\n\t\t\t\t$n = 2; // 1110bbbb\n\t\t\t} elseif ( ( $c & 0xF8 ) == 0xF0 ) {\n\t\t\t\t$n = 3; // 11110bbb\n\t\t\t} elseif ( ( $c & 0xFC ) == 0xF8 ) {\n\t\t\t\t$n = 4; // 111110bb\n\t\t\t} elseif ( ( $c & 0xFE ) == 0xFC ) {\n\t\t\t\t$n = 5; // 1111110b\n\t\t\t} else {\n\t\t\t\treturn false; // Does not match any model.\n\t\t\t}\n\t\t\tfor ( $j = 0; $j < $n; $j++ ) { // n bytes matching 10bbbbbb follow ?\n\t\t\t\tif ( ( ++$i == $length ) || ( ( ord( $str[ $i ] ) & 0xC0 ) != 0x80 ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function isUTF16($string){\n $result = false;\n $length = strlen($string);\n if ($length >= 2) {\n $byte1 = ord($string);\n $byte2 = ord(substr($string, 1, 1));\n if ($byte1 === 0xFF // BOM (little-endian)\n && $byte2 === 0xFE) {\n $result = true;\n } else if ($byte1 === 0xFE // BOM (big-endian)\n && $byte2 === 0xFF) {\n $result = true;\n } else {\n $null = chr(0x00);\n $pos = strpos($string, $null);\n if ($pos === false) {\n $result = false; // Non ASCII (omit)\n } else {\n $next = substr($string, $pos + 1, 1); // BE\n $prev = substr($string, $pos - 1, 1); // LE\n if ((strlen($next) > 0 && ord($next) > 0x00 && ord($next) < 0x80)\n || (strlen($prev) > 0 && ord($prev) > 0x00 && ord($prev) < 0x80)) {\n $pos = strlen($string) - 1;\n $next = substr($string, $pos + 1, 1); // BE\n $prev = substr($string, $pos - 1, 1); // LE\n if (strlen($next) > 0) {\n if (ord($next) > 0x00 && ord($next) < 0x80) {\n $result = true;\n } else {\n $result = false;\n }\n } else if (strlen($prev) > 0) {\n if (ord($prev) > 0x00 && ord($prev) < 0x80) {\n $result = true;\n } else {\n $result = false;\n }\n }\n }\n }\n }\n }\n return $result;\n }", "function seems_utf8($Str) {\r\n\tfor ($i=0; $i<strlen($Str); $i++) {\r\n\t\tif (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\r\n\t\telseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb\r\n\t\telseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb\r\n\t\telseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb\r\n\t\telseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb\r\n\t\telseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b\r\n\t\telse return false; # Does not match any model\r\n\t\tfor ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\r\n\t\t\tif ((++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80))\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "private function detect_encoding( $str ) {\r\n }", "function isUTF16BE($string){\n $result = false;\n $length = strlen($string);\n if ($length >= 2) {\n $byte1 = ord($string);\n $byte2 = ord(substr($string, 1, 1));\n if ($byte1 === 0xFE // BOM\n && $byte2 === 0xFF) {\n $result = true;\n } else {\n $pos = strpos($string, chr(0x00));\n if ($pos === false) {\n $result = false; // Non ASCII..\n } else {\n $byte = substr($string, $pos + 1, 1);\n if (strlen($byte) > 0 && ord($byte) < 0x80) {\n $result = true;\n }\n }\n }\n }\n return $result;\n }", "private static function detect_encoding($string)\n {\n $fallback = rcube::get_instance()->config->get('default_charset', 'ISO-8859-1'); // fallback to Latin-1\n\n return rcube_charset::detect($string, $fallback);\n }", "private function check_utf8_support() {\n\t\treturn 'utf-8' === strtolower( get_bloginfo( 'charset' ) );\n\t}", "function isUTF32($string){\n $result = false;\n $length = strlen($string);\n if ($length >= 4) {\n $byte1 = ord($string);\n $byte2 = ord(substr($string, 1, 1));\n $byte3 = ord(substr($string, 2, 1));\n $byte4 = ord(substr($string, 3, 1));\n if ($byte1 === 0x00 && $byte2 === 0x00 // BOM (big-endian)\n && $byte3 === 0xFE && $byte4 === 0xFF) {\n $result = true;\n } else if ($byte1 === 0xFF && $byte2 === 0xFE // BOM (little-endian)\n && $byte3 === 0x00 && $byte4 === 0x00) {\n $result = true;\n } else {\n $pos = strpos($string, chr(0x00));\n if ($pos === false) {\n $result = false; // Non ASCII (omit)\n } else {\n $next = substr($string, $pos, 4); // Must be (BE)\n if (strlen($next) === 4) {\n $bytes = array_values(unpack('C4', $next));\n if (isset($bytes[0], $bytes[1], $bytes[2], $bytes[3])) {\n if ($bytes[0] === 0x00 && $bytes[1] === 0x00) {\n if ($bytes[2] === 0x00) {\n $result = $bytes[3] >= 0x09 && $bytes[3] <= 0x7F;\n } else if ($bytes[2] > 0x00 && $bytes[2] < 0xFF) {\n $result = $bytes[3] > 0x00 && $bytes[3] <= 0xFF;\n }\n }\n }\n }\n }\n }\n }\n return $result;\n }", "function is_simple_string($string){\n\t\treturn $string == remove_special_chars($string);\n\t}", "function utf8($str)\n{\n if(mb_detect_encoding($str) == \"UTF-8\" && mb_check_encoding($str,\"UTF-8\")) return $str;\n else return utf8_encode($str);\n}", "function seems_utf8($Str) { # by bmorel at ssi dot fr\n $length = strlen($Str);\n for ($i = 0; $i < $length; $i++) {\n if (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\n elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n = 1; # 110bbbbb\n elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n = 2; # 1110bbbb\n elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n = 3; # 11110bbb\n elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n = 4; # 111110bb\n elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n = 5; # 1111110b\n else return false; # Does not match any model\n for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?\n if ((++$i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80))\n return false;\n }\n }\n return true;\n}", "static public function ValidateUTF8($string)\n {\n $pop_10s = 0;\n\n $unicode_char = 0;\n\n for ($i=0; isset($string[$i]); $i++) {\n $c = ord($string[$i]);\n if ($pop_10s) {\n # Check if following chars in multibytes are not 10xxxxxx\n if (($c & 0xC0) != 0x80) {\n throw new Exception\\BadUTF8('Following characters must be 10xxxxxx');\n } else {\n $unicode_char <<= 6;\n $unicode_char |= $c & 0x3F;\n --$pop_10s;\n }\n } else if (($c & 0x7F) == $c) {\n # single ASCII char\n $unicode_char = 0;\n\n /*\n I tried mosquitto, it accepts \\0 when publishing Message, no connection is closed.\n No exception will be thrown here.\n\n MQTT-1.5.3-2\n A UTF-8 encoded string MUST NOT include an encoding of the null character U+0000.\n If a receiver (Server or Client) receives a Control Packet containing U+0000 it MUST\n close the Network Connection.\n\n */\n continue;\n } else if (($c & 0xFE) == 0xFC) {\n # leading 1111110x\n $pop_10s = 5;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x01;\n } else if (($c & 0xFC) == 0xF8) {\n # leading 111110xx\n $pop_10s = 4;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x03;\n } else if (($c & 0xF8) == 0xF0) {\n # leading 11110xxx\n $pop_10s = 3;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x07;\n } else if (($c & 0xF0) == 0xE0) {\n # leading 1110xxxx\n $pop_10s = 2;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x0F;\n } else if (($c & 0xE0) == 0xC0) {\n # leading 110xxxxx\n $pop_10s = 1;\n\n $unicode_char = 0;\n $unicode_char |= $c & 0x1F;\n } else {\n throw new Exception\\BadUTF8('Bad leading characters');\n }\n\n if ($unicode_char >= 0xD800 && $unicode_char <= 0xDFFF) {\n /*\n MQTT-1.5.3.1\n The character data in a UTF-8 encoded string MUST be well-formed UTF-8 as defined\n by the Unicode specification [Unicode] and restated in RFC 3629 [RFC3629]. In\n particular this data MUST NOT include encodings of code points between U+D800 and\n U+DFFF. If a Server or Client receives a Control Packet containing ill-formed UTF-8\n it MUST close the Network Connection [MQTT-1.5.3-1].\n\n */\n throw new Exception\\BadUTF8('U+D800 ~ U+DFFF CAN NOT be used in UTF-8');\n }\n }\n\n if ($pop_10s) {\n throw new Exception\\BadUTF8('Missing UTF-8 following characters');\n }\n\n return true;\n }", "private function is_uft8($value): bool {\n return str_starts_with(strtolower($value), '=?utf-8?');\n }", "public static function pcre_utf8_support(): bool\n {\n /** @noinspection PhpUsageOfSilenceOperatorInspection */\n return (bool) @\\preg_match('//u', '');\n }", "function bom_utf8($texte) {\n\treturn (substr($texte, 0,3) == chr(0xEF).chr(0xBB).chr(0xBF));\n}", "public static function isCharacterEncodingValid(string $name): bool;", "public function _isTextString($string)\n {\n $tokens = token_get_all(\"<?\" .\"php {$string}; ?\" . \">\");\n\n if (is_array(@$tokens[1])) {\n if ($tokens[1][0] == T_CONSTANT_ENCAPSED_STRING) {\n return true;\n }\n }\n\n return false;\n }", "public function is_ascii($str)\n {\n return (preg_match('/[^\\x00-\\x7F]/S', $str) == 0);\n }", "public static function validateUtf8OctetSequences($string)\n\t{\n\t\treturn Main\\Text\\Encoding::detectUtf8($string, false);\n\t}", "private function isText($string)\n {\n if (preg_match('~[A-Za-z:/,]~', $string)) {\n return true;\n }\n return false;\n }", "public static function seems_utf8($Str) {\n\t\tfor ($i=0; $i<strlen($Str); $i++) {\n\t\t\tif (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\n\t\t\telseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb\n\t\t\telseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb\n\t\t\telseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb\n\t\t\telseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb\n\t\t\telseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b\n\t\t\telse return false; # Does not match any model\n\t\t\tfor ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\n\t\t\t\tif ((++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80))\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function test_pcre_unicode() {\n\tstatic $pcre_ok = 0;\n\n\tif (!$pcre_ok) {\n\t\t$s = \" \".chr(195).chr(169).\"t\".chr(195).chr(169).\" \";\n\t\tif (preg_match(',\\W\\w\\w\\w\\W,uS', $s)) $pcre_ok = 1;\n\t\telse $pcre_ok = -1;\n\t}\n\treturn $pcre_ok == 1;\n}", "private function _utf8check( $Str )\r\n\t{\r\n\t\tfor ($i=0; $i<strlen($Str); $i++)\r\n\t\t{\r\n\t\tif ( ord($Str[$i]) < 0x80 ) continue; # 0bbbbbbb\r\n\t\telseif ( (ord($Str[$i]) & 0xE0) == 0xC0 ) $n=1; # 110bbbbb\r\n\t\telseif ( (ord($Str[$i]) & 0xF0) == 0xE0 ) $n=2; # 1110bbbb\r\n\t\telseif ( (ord($Str[$i]) & 0xF8) == 0xF0 ) $n=3; # 11110bbb\r\n\t\telseif ( (ord($Str[$i]) & 0xFC) == 0xF8 ) $n=4; # 111110bb\r\n\t\telseif ( (ord($Str[$i]) & 0xFE) == 0xFC ) $n=5; # 1111110b\r\n\t\telse return false; # Does not match any model\r\n\t\t\r\n\t\tfor ( $j=0; $j<$n; $j++ )\r\n\t\t{ # n bytes matching 10bbbbbb follow ?\r\n\t\t\tif ( (++$i == strlen($Str)) || ((ord($Str[$i]) & 0xC0) != 0x80) )\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private function detect_encoding($str) {\n return mb_detect_encoding( $str, 'UTF-8,ISO-8859-15,ISO-8859-1,cp1251,KOI8-R' );\n }", "public function CharacterCheck($string=\"\"){\n\t\t if (preg_match('/[\\'^£$%&*0-9()}{@#~?><>,|=_+¬-]/', $string))\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn true;\n\t\t}", "static public function stringToUtf8($string) {\n if ($GLOBALS['LANG']->charSet == '' || $GLOBALS['LANG']->charSet == 'iso-8859-1') {\n return utf8_encode($string);\n } else {\n return $string;\n }\n\t}", "public static function is8bit($string, $charset = 'utf-8')\n {\n /**\n * Don't use \\240 in ranges.\n * Sometimes RH 7.2 doesn't like it.\n * Don't use \\200-\\237 for iso-8859-x charsets. This ranges\n * stores control symbols in those charsets.\n * Use preg_match instead of ereg in order to avoid problems\n * with mbstring overloading\n */\n if (preg_match(\"/^iso-8859/i\", $charset)) {\n $needle = '/\\240|[\\241-\\377]/';\n } else {\n $needle = '/[\\200-\\237]|\\240|[\\241-\\377]/';\n }\n return preg_match(\"$needle\", $string);\n }", "public static function utf8Sanitize($string)\r\n {\r\n Preconditions::checkIsString($string, '$string must be string');\r\n $out = @iconv(\"UTF-8\", \"UTF-8//IGNORE\", $string);\r\n if ($string != $out) {\r\n $out = \"Warning: String not shown for security reasons: \" .\r\n \"String contains invalid utf-8 charactes.\";\r\n }\r\n return $out;\r\n }", "public function utf8_force($string){\r\n if (preg_match('%^(?:\r\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\r\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\r\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\r\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\r\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\r\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\r\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\r\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\r\n )*$%xs', $string))\r\n return $string;\r\n else\r\n return iconv('CP1252', 'UTF-8', $string);\r\n }", "function wp_check_invalid_utf8( $string, $strip = false ) {\n\t$string = (string) $string;\n\n\tif ( 0 === strlen( $string ) ) {\n\t\treturn '';\n\t}\n\n\t// Store the site charset as a static to avoid multiple calls to get_option()\n\tstatic $is_utf8;\n\tif ( !isset( $is_utf8 ) ) {\n\t\t$is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );\n\t}\n\tif ( !$is_utf8 ) {\n\t\treturn $string;\n\t}\n\n\t// Check for support for utf8 in the installed PCRE library once and store the result in a static\n\tstatic $utf8_pcre;\n\tif ( !isset( $utf8_pcre ) ) {\n\t\t$utf8_pcre = @preg_match( '/^./u', 'a' );\n\t}\n\t// We can't demand utf8 in the PCRE installation, so just return the string in those cases\n\tif ( !$utf8_pcre ) {\n\t\treturn $string;\n\t}\n\n\t// preg_match fails when it encounters invalid UTF8 in $string\n\tif ( 1 === @preg_match( '/^./us', $string ) ) {\n\t\treturn $string;\n\t}\n\n\t// Attempt to strip the bad chars if requested (not recommended)\n\tif ( $strip && function_exists( 'iconv' ) ) {\n\t\treturn iconv( 'utf-8', 'utf-8', $string );\n\t}\n\n\treturn '';\n}", "function find_special($string){\r\n\t$string = utf8_decode($string);\r\n\tfor($i = 0; $i < strlen($string); $i++){\r\n\t\t$o = ord(substr($string, $i, 1));\r\n\t\tif($o >= 192 && $o <= 255){\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t}\r\n\treturn FALSE;\r\n}", "public static function is_ascii($str)\n\t{\n\t\tif (is_array($str)) {\n\t\t\t$str = implode($str);\n\t\t}\n\n\t\treturn ! preg_match('/[^\\x00-\\x7F]/S', $str);\n\t}", "function detectByMBString($encoding, $string){\n $result = false;\n $charset = $this->getEncodingName($encoding, 'mbstring');\n if (0 !== strcasecmp($charset, 'BINARY')) {\n if ($charset == null && $encoding != null) {\n $detect = @mb_detect_encoding($string, $encoding, true);\n } else {\n $detect = mb_detect_encoding($string, $charset, true);\n }\n $result = is_string($detect) && strlen($detect);\n }\n if (!$result) {\n $result = $this->detectEncodingHelper($charset, $string, false);\n }\n return $result;\n }", "function validateLatin($string)\n {\n $result = false;\n\n if (preg_match(\"/^[\\w\\d\\s.,-]*$/\", $string)) {\n $result = true;\n }\n\n return $result;\n }", "public static function isPunycode(string $string): bool\n {\n return (strpos($string, 'xn--') === 0);\n }", "function wp_check_invalid_utf8($text, $strip = \\false)\n {\n }", "public static function alpha($str, $utf8 = FALSE)\r\n {\r\n return ($utf8 === TRUE)\r\n ? (bool) preg_match('/^\\pL++$/uD', (string) $str)\r\n : ctype_alpha((string) $str);\r\n }", "function wp_check_invalid_utf8( $string, $strip = false ) {\r\n\t$string = (string) $string;\r\n\r\n\tif ( 0 === strlen( $string ) ) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\t// Store the site charset as a static to avoid multiple calls to get_option()\r\n\tstatic $is_utf8 = null;\r\n\tif ( ! isset( $is_utf8 ) ) {\r\n\t\t$is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );\r\n\t}\r\n\tif ( ! $is_utf8 ) {\r\n\t\treturn $string;\r\n\t}\r\n\r\n\t// Check for support for utf8 in the installed PCRE library once and store the result in a static\r\n\tstatic $utf8_pcre = null;\r\n\tif ( ! isset( $utf8_pcre ) ) {\r\n\t\t$utf8_pcre = @preg_match( '/^./u', 'a' );\r\n\t}\r\n\t// We can't demand utf8 in the PCRE installation, so just return the string in those cases\r\n\tif ( ! $utf8_pcre ) {\r\n\t\treturn $string;\r\n\t}\r\n\r\n\t// preg_match fails when it encounters invalid UTF8 in $string\r\n\tif ( 1 === @preg_match( '/^./us', $string ) ) {\r\n\t\treturn $string;\r\n\t}\r\n\r\n\t// Attempt to strip the bad chars if requested (not recommended)\r\n\tif ( $strip && function_exists( 'iconv' ) ) {\r\n\t\treturn iconv( 'utf-8', 'utf-8', $string );\r\n\t}\r\n\r\n\treturn '';\r\n}", "private function checkIsUnicode($message)\n {\n $gsm_greek_character_ascii_value = ',132,133,134,135,137,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,166,167,168,169,172,177,178,182,184,185,188,191,194,195,206,226,130,172,';\n\n $string_length = strlen($message);\n for ($counter = 0; $counter < $string_length; $counter++) {\n $character_code = ord($message[$counter]);\n if($character_code > 127 && !preg_match('#,'.$character_code.',#', $gsm_greek_character_ascii_value)) {\n return true;\n }\n }\n return false;\n }", "public function has8bitChars($text)\n {\n return (boolean)preg_match('/[\\x80-\\xFF]/', $text);\n }", "function oc_check_invalid_utf8( $string, $strip = false ) {\n $string = (string) $string;\n if ( 0 === strlen( $string ) ) {\n return '';\n }\n // Store the site charset as a static to avoid multiple calls to get_option()\n static $is_utf8;\n if ( !isset( $is_utf8 ) ) {\n $is_utf8 = in_array( get_bloginfo( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );\n }\n if ( !$is_utf8 ) {\n return $string;\n }\n // Check for support for utf8 in the installed PCRE library once and store the result in a static\n static $utf8_pcre;\n if ( !isset( $utf8_pcre ) ) {\n $utf8_pcre = @preg_match( '/^./u', 'a' );\n }\n // We can't demand utf8 in the PCRE installation, so just return the string in those cases\n if ( !$utf8_pcre ) {\n return $string;\n }\n // preg_match fails when it encounters invalid UTF8 in $string\n if ( 1 === @preg_match( '/^./us', $string ) ) {\n return $string;\n }\n // Attempt to strip the bad chars if requested (not recommended)\n if ( $strip && function_exists( 'iconv' ) ) {\n return iconv( 'utf-8', 'utf-8', $string );\n }\n return '';\n}", "function valid_unicode($i)\n {\n }", "function setup_is_unicodedb() {\n $rs = $this->db->Execute(\"SELECT parameter, value FROM nls_database_parameters where parameter = 'NLS_CHARACTERSET'\");\n if ($rs && !$rs->EOF) {\n $encoding = $rs->fields['value'];\n if (strtoupper($encoding) == 'AL32UTF8') {\n return true;\n }\n }\n return false;\n }", "function hasSpecialCharacters( $string ) {\n return preg_match('/[^a-zA-Z\\d]/', $string);\n}", "public static function string_has_bom(string $str): bool\n {\n foreach (self::$BOM as $bom_string => &$bom_byte_length) {\n if (\\strncmp($str, $bom_string, $bom_byte_length) === 0) {\n return true;\n }\n }\n\n return false;\n }", "function OnlyLatin($string) {\n return (empty($string) || preg_replace(\"/[\\d\\w]+/i\", '', $string) != '') ? FALSE : $string;\n}", "function detectEncodingHelper($charset, $string, $default = false){\n $result = false;\n switch (strtoupper($charset)) {\n case 'ASCII':\n $result = $this->isASCII($string);\n break;\n case 'JIS':\n case 'ISO-2022-JP':\n $result = $this->isJIS($string);\n break;\n case 'UTF-16':\n $result = $this->isUTF16($string);\n break;\n case 'UTF-16BE':\n $result = $this->isUTF16BE($string);\n break;\n case 'UTF-16LE':\n $result = $this->isUTF16LE($string);\n break;\n case 'UTF-32':\n $result = $this->isUTF32($string);\n break;\n case 'BINARY':\n $result = $this->isBinary($string);\n break;\n default:\n $result = $default;\n break;\n }\n return $result;\n }", "static public function checkString($s){\n if (ctype_lower($s) || ctype_upper($s) || ctype_alpha($s)){\n return false;\n }\n return true;\n }", "public function isCharCovered($char, $encoding = 'UTF-16BE') {}", "public static function is_utf32($str, bool $check_if_string_is_binary = true)\n {\n // init\n $str = (string) $str;\n $str_chars = [];\n\n // fix for the \"binary\"-check\n if ($check_if_string_is_binary !== false && self::string_has_bom($str)) {\n $check_if_string_is_binary = false;\n }\n\n if (\n $check_if_string_is_binary\n &&\n !self::is_binary($str, true)\n ) {\n return false;\n }\n\n if (self::$SUPPORT['mbstring'] === false) {\n /**\n * @psalm-suppress ImpureFunctionCall - this is only a warning\n */\n \\trigger_error('UTF8::is_utf32() without mbstring may did not work correctly', \\E_USER_WARNING);\n }\n\n $str = self::remove_bom($str);\n\n $maybe_utf32le = 0;\n $test = \\mb_convert_encoding($str, 'UTF-8', 'UTF-32LE');\n if ($test) {\n $test2 = \\mb_convert_encoding($test, 'UTF-32LE', 'UTF-8');\n $test3 = \\mb_convert_encoding($test2, 'UTF-8', 'UTF-32LE');\n if ($test3 === $test) {\n $str_chars = self::count_chars($str, true, false);\n foreach (self::count_chars($test3) as $test3char => &$test3charEmpty) {\n if (\\in_array($test3char, $str_chars, true)) {\n ++$maybe_utf32le;\n }\n }\n unset($test3charEmpty);\n }\n }\n\n $maybe_utf32be = 0;\n $test = \\mb_convert_encoding($str, 'UTF-8', 'UTF-32BE');\n if ($test) {\n $test2 = \\mb_convert_encoding($test, 'UTF-32BE', 'UTF-8');\n $test3 = \\mb_convert_encoding($test2, 'UTF-8', 'UTF-32BE');\n if ($test3 === $test) {\n if ($str_chars === []) {\n $str_chars = self::count_chars($str, true, false);\n }\n foreach (self::count_chars($test3) as $test3char => &$test3charEmpty) {\n if (\\in_array($test3char, $str_chars, true)) {\n ++$maybe_utf32be;\n }\n }\n unset($test3charEmpty);\n }\n }\n\n if ($maybe_utf32be !== $maybe_utf32le) {\n if ($maybe_utf32le > $maybe_utf32be) {\n return 1;\n }\n\n return 2;\n }\n\n return false;\n }", "public static function detect($string) {\n if (!ereg(\"[\\x80-\\xFF]\", $string) && !ereg(\"\\x1B\", $string))\n return 'US-ASCII';\n\n if (!ereg(\"[\\x80-\\xFF]\", $string) && ereg(\"\\x1B\", $string))\n return 'ISO-2022-JP';\n\n if (preg_match(\"/^([\\x01-\\x7F]|[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF][\\x80-\\xBF])+$/\", $string) == 1)\n return 'UTF-8';\n\n if (preg_match(\"/^([\\x01-\\x7F]|\\x8E[\\xA0-\\xDF]|\\x8F[xA1-\\xFE][\\xA1-\\xFE]|[\\xA1-\\xFE][\\xA1-\\xFE])+$/\", $string) == 1)\n return 'EUC-JP';\n\n if (preg_match(\"/^([\\x01-\\x7F]|[\\xA0-\\xDF]|[\\x81-\\xFC][\\x40-\\xFC])+$/\", $string) == 1)\n return 'Shift_JIS';\n\n return 'ISO-8859-1';\n }", "public static function sanitizeUTF8($string)\n\t{\n\t\t$output = preg_replace('/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u', '', $string);\n\t\tif (is_null($output))\n\t\t{\n\t\t\t$output = \"\";\n\t\t\tif (empty($string))\n\t\t\t{\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\t$length = strlen($string);\n\t\t\tfor ($i = 0; $i < $length; $i++)\n\t\t\t{\n\t\t\t\t$current = ord($string{$i});\n\t\t\t\tif (($current == 0x9) ||\n\t\t\t\t\t($current == 0xA) ||\n\t\t\t\t\t($current == 0xD) ||\n\n\t\t\t\t\t(($current >= 0x28) && ($current <= 0xD7FF)) ||\n\t\t\t\t\t(($current >= 0xE000) && ($current <= 0xFFFD)) ||\n\t\t\t\t\t(($current >= 0x10000) && ($current <= 0x10FFFF))\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$output .= chr($current);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output .= \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "function str_to_utf8( $string ) {\n\n // Check if mbstring is installed, if not, run old way\n if ( !function_exists( 'mb_convert_encoding' ) )\n return ( ( preg_match( '!!u', $string ) ) ? $string : utf8_encode( $string ) );\n\n // Convert encoding from XXX to UTF-8\n $string = mb_convert_encoding( $string, \"UTF-8\" );\n\n // Escape special characters\n htmlspecialchars( $string, ENT_QUOTES, 'UTF-8' );\n $string = html_entity_decode( $string );\n\n // Return modified - UTF-8 string\n return $string;\n\n }", "public function has8bitChars($text)\n {\n }", "function detectByIConv($encoding, $string){\n $result = false;\n $charset = $this->getEncodingName($encoding, 'iconv');\n if ($charset == null) {\n $charset = $encoding;\n }\n if ($charset != null) {\n $this->hasError = false;\n if (0 !== strcasecmp($charset, 'BINARY')) {\n if ($this->isPHP5) {\n set_error_handler(array($this, 'iconvErrorHandler'), E_ALL);\n } else {\n set_error_handler(array(&$this, 'iconvErrorHandler'));\n }\n iconv($charset, 'UTF-16', $string); // maybe UTF-16 is proper\n restore_error_handler();\n }\n if (!$this->hasError) {\n $result = $this->detectEncodingHelper($charset, $string, true);\n }\n }\n return $result;\n }", "function mk_utf8($string) {\n\t\treturn (is_utf8($string) ? $string : utf8_encode($string));\n\t}", "public function isUtf8Mode()\n {\n return $this->_isUtf8Mode;\n }", "private function check_multibyte_support() {\n\t\tif ( function_exists( 'mb_strlen' ) &&\n\t\t\t function_exists( 'mb_strtolower' ) &&\n\t\t\t function_exists( 'mb_substr' ) &&\n\t\t\t function_exists( 'mb_detect_encoding' ) ) {\n\t\t\treturn true;\n\t\t } else {\n\t\t \treturn false;\n\t\t }\n\t}", "function is_binary($string){\n return preg_match('~[^\\x20-\\x7E\\t\\r\\n]~', $string) > 0;\n}", "private function isJSONString($string)\n\t{\n\t\tjson_decode($string);\n\t\treturn (json_last_error() == JSON_ERROR_NONE);\n\t}" ]
[ "0.8246563", "0.82114255", "0.815192", "0.81254894", "0.8098558", "0.8076237", "0.80390424", "0.7905916", "0.7905916", "0.7880297", "0.7847589", "0.7797154", "0.7768131", "0.7750702", "0.7686666", "0.767923", "0.760964", "0.75800604", "0.7569473", "0.75653577", "0.75454026", "0.74877644", "0.7485625", "0.73552316", "0.73375106", "0.7302069", "0.7251391", "0.7218441", "0.7195609", "0.7195395", "0.7195395", "0.7188513", "0.71864897", "0.71453255", "0.71448106", "0.71378464", "0.7118141", "0.71115166", "0.708165", "0.70807487", "0.7012296", "0.69661826", "0.69533837", "0.69486904", "0.69144815", "0.69089186", "0.6863973", "0.6861661", "0.684854", "0.6839058", "0.67730486", "0.67637366", "0.67576164", "0.6732554", "0.66902286", "0.6657999", "0.6634996", "0.6593136", "0.65524215", "0.6516064", "0.6493206", "0.6484415", "0.6472329", "0.6470849", "0.6462944", "0.6431712", "0.6386615", "0.6357692", "0.63364935", "0.6322286", "0.63194543", "0.6292307", "0.62879163", "0.6282803", "0.62826395", "0.62740856", "0.6273256", "0.6255922", "0.62486774", "0.6243085", "0.6232977", "0.62290215", "0.6204333", "0.6189295", "0.6146452", "0.6144189", "0.61414766", "0.61334676", "0.6126555", "0.6118402", "0.6113635", "0.6080411", "0.60726583", "0.60666424", "0.6061932", "0.60576475", "0.6057064", "0.6044573", "0.5967844", "0.5957746" ]
0.8026985
7
Load foreign keys for this table.
protected function addForeignKeys(Table $table) { $database = $table->getDatabase(); $stmt = $this->dbh->query("SHOW CREATE TABLE `" . $table->getName() . "`"); $row = $stmt->fetch(PDO::FETCH_NUM); $foreignKeys = array(); // local store to avoid duplicates // Get the information on all the foreign keys $regEx = '/CONSTRAINT `([^`]+)` FOREIGN KEY \((.+)\) REFERENCES `([^`]*)` \((.+)\)(.*)/'; if (preg_match_all($regEx, $row[1], $matches)) { $tmpArray = array_keys($matches[0]); foreach ($tmpArray as $curKey) { $name = $matches[1][$curKey]; $rawlcol = $matches[2][$curKey]; $ftbl = $matches[3][$curKey]; $rawfcol = $matches[4][$curKey]; $fkey = $matches[5][$curKey]; $lcols = array(); foreach (preg_split('/`, `/', $rawlcol) as $piece) { $lcols[] = trim($piece, '` '); } $fcols = array(); foreach (preg_split('/`, `/', $rawfcol) as $piece) { $fcols[] = trim($piece, '` '); } //typical for mysql is RESTRICT $fkactions = array( 'ON DELETE' => ForeignKey::RESTRICT, 'ON UPDATE' => ForeignKey::RESTRICT, ); if ($fkey) { //split foreign key information -> search for ON DELETE and afterwords for ON UPDATE action foreach (array_keys($fkactions) as $fkaction) { $result = null; preg_match('/' . $fkaction . ' (' . ForeignKey::CASCADE . '|' . ForeignKey::SETNULL . ')/', $fkey, $result); if ($result && is_array($result) && isset($result[1])) { $fkactions[$fkaction] = $result[1]; } } } $localColumns = array(); $foreignColumns = array(); $foreignTable = $database->getTable($ftbl, true); foreach ($fcols as $fcol) { $foreignColumns[] = $foreignTable->getColumn($fcol); } foreach ($lcols as $lcol) { $localColumns[] = $table->getColumn($lcol); } if (!isset($foreignKeys[$name])) { $fk = new ForeignKey($name); $fk->setForeignTableCommonName($foreignTable->getCommonName()); $fk->setForeignSchemaName($foreignTable->getSchema()); $fk->setOnDelete($fkactions['ON DELETE']); $fk->setOnUpdate($fkactions['ON UPDATE']); $table->addForeignKey($fk); $foreignKeys[$name] = $fk; } for ($i = 0; $i < count($localColumns); $i++) { $foreignKeys[$name]->addReference($localColumns[$i], $foreignColumns[$i]); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}", "abstract protected function loadTableForeignKeys(string $tableName): array;", "protected function addForeignKeys()\n {\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(InitiativeRecord::tableName(), 'id'),\n InitiativeRecord::tableName(),\n 'id',\n ElementRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'elementId'),\n TargetRecord::tableName(),\n 'elementId',\n InitiativeRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'userId'),\n TargetRecord::tableName(),\n 'userId',\n UserRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n }", "public function dropForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\t// Does the table exist?\n\t\tif (blx()->db->getSchema()->getTable('{{'.$table.'}}'))\n\t\t{\n\t\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t\t{\n\t\t\t\t$otherModel = new $config[1];\n\t\t\t\t$otherTable = $otherModel->getTableName();\n\n\t\t\t\t// Does the other table exist?\n\t\t\t\tif (blx()->db->getSchema()->getTable('{{'.$otherTable.'}}'))\n\t\t\t\t{\n\t\t\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\t\t\t\t\tblx()->db->createCommand()->dropForeignKey($fkName, $table);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getForeignKeys(){\n \n }", "protected function addForeignKeyConstraints()\n {\n \n \n }", "protected function addForeignKeyConstraints()\n {\n $sApptTableName = $this->tablePrefix .'bm_appointment';\n \n $this->table->addForeignKeyConstraint($sApptTableName, ['appointment_id'], ['appointment_id'], [\"onDelete\" => \"CASCADE\"], null);\n \n $sSurchargeTableName = $this->tablePrefix .'bm_order_surcharge';\n \n $this->table->addForeignKeyConstraint($sSurchargeTableName, ['surcharge_id'], ['surcharge_id'], [\"onDelete\" => \"CASCADE\"], null);\n\n }", "public function getForeignKeys()\n {\n return $this->parentTable->getColumnForeignKeys($this->name);\n }", "protected function _checkForeignKeysReverseCascade() {}", "public function getForeignKeys()\n {\n if ($this->foreign_keys_cache === null) {\n $query = $this->db_instance->query('SELECT table_name, column_name, referenced_table_name, referenced_column_name from information_schema.key_column_usage where referenced_table_name is not null');\n $foreign_keys_a = $query->result_array();\n $this->foreign_keys_cache = array();\n\n foreach ($foreign_keys_a as $key) {\n foreach ($key as $key_key => $key_value){\n $key[strtolower($key_key)] = $key_value;\n }\n $this->foreign_keys_cache[$key['table_name']][$key['column_name']] = array($key['referenced_table_name'], $key['referenced_column_name']);\n }\n }\n\n return $this->foreign_keys_cache;\n }", "protected function setUpForeignKey()\n {\n $this->getOldTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldTable()->createColumn('bar', Type::STRING, array('length' => 50));\n $this->getOldTable()->createPrimaryKey(array('foo'), 'pk');\n\n $this->getOldForeignKeyTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldForeignKeyTable()->createColumn('bar', Type::STRING, array('length' => 50));\n $this->getOldForeignKeyTable()->createForeignKey(\n array('foo'),\n 'foo',\n array('foo'),\n ForeignKey::RESTRICT,\n ForeignKey::RESTRICT,\n 'fk_foo'\n );\n\n $this->createOldForeignKeyTable();\n }", "abstract protected function addForeignKeys(&$script);", "public function listForeignKeys()\n {\n $tables = $this->schema->listTables();\n $foreignKeys = [];\n foreach ($tables as $table) {\n foreach ($table->getForeignKeys() as $foreignKey) {\n array_push($foreignKeys, $foreignKey);\n }\n }\n\n return $foreignKeys;\n }", "private function createRemainingForeignConstraints(): void\n\t{\n\t\tSchema::table('albums', function (Blueprint $table) {\n\t\t\t$table->foreign('cover_id')\n\t\t\t\t->references('id')->on('photos')\n\t\t\t\t->onUpdate('CASCADE')\n\t\t\t\t->onDelete('SET NULL');\n\t\t});\n\t}", "public static function getResolveForeignIdFields();", "public function listForeignKeys($table) {\r\n\t\tswitch ($this->getDbtype()) {\r\n\t\t\tcase 'mysql':\r\n\t\t\t\t$meta = array();\r\n\t\t\t\tforeach ($this->loadKeys() as $info) {\r\n\t\t\t\t\tif ($info['table_name'] === $table) {\r\n\t\t\t\t\t\t$meta[] = array(\r\n\t\t\t\t\t\t\t'table' => $info['table_name'],\r\n\t\t\t\t\t\t\t'column' => $info['column_name'],\r\n\t\t\t\t\t\t\t'referenced_table' => $info['referenced_table_name'],\r\n\t\t\t\t\t\t\t'referenced_column' => $info['referenced_column_name'],\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\treturn $meta;\r\n\t\t\tcase 'pgsql':\r\n\t\t\t\tlist($schema, $table) = stristr($table, '.') ? explode(\".\", $table) : array('public', $table);\r\n\t\t\t\t$result = $this->query(\r\n\t\t\t\t\t\t\"SELECT kcu.column_name AS column_name, ccu.table_name AS referenced_table_name, ccu.column_name AS referenced_column_name \r\n FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name\r\n JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name WHERE constraint_type = 'FOREIGN KEY' \r\n AND tc.table_name='\" . $table . \"' AND tc.table_schema = '\" . $schema . \"'\");\r\n\t\t\t\t$result->setFetchMode(PDO::FETCH_ASSOC);\r\n\t\t\t\t$meta = array();\r\n\t\t\t\tforeach ($result as $row) {\r\n\t\t\t\t\t$meta[] = array(\r\n\t\t\t\t\t\t'table' => $table,\r\n\t\t\t\t\t\t'column' => $row['column_name'],\r\n\t\t\t\t\t\t'referenced_table' => $row['referenced_table_name'],\r\n\t\t\t\t\t\t'referenced_column' => $row['referenced_column_name'],\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\treturn $meta;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'sqlite':\r\n\t\t\t\t$sql = \"PRAGMA foreign_key_list(\" . $this->quote($table) . \")\";\r\n\t\t\t\t$result = $this->query($sql);\r\n\t\t\t\t$result->setFetchMode(PDO::FETCH_ASSOC);\r\n\t\t\t\t$meta = array();\r\n\t\t\t\tforeach ($result as $row) {\r\n\t\t\t\t\t$meta[] = array(\r\n\t\t\t\t\t\t'table' => $table,\r\n\t\t\t\t\t\t'column' => $row['from'],\r\n\t\t\t\t\t\t'referenced_table' => $row['table'],\r\n\t\t\t\t\t\t'referenced_column' => $row['to'],\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\treturn $meta;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception('Unsupported database : ' . $this->getDbtype());\r\n\t\t}\r\n\t}", "public function getTableForeignKeys(string $table)\n {\n $status = $this->status($table);\n if(!\\adminer\\fk_support($status))\n {\n return null;\n }\n\n // From table.inc.php\n $foreign_keys = \\adminer\\foreign_keys($table);\n $main_actions = [\n \\adminer\\lang('Add foreign key'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n \\adminer\\lang('Source'),\n \\adminer\\lang('Target'),\n \\adminer\\lang('ON DELETE'),\n \\adminer\\lang('ON UPDATE'),\n ];\n\n if(!$foreign_keys)\n {\n $foreign_keys = [];\n }\n $details = [];\n // From table.inc.php\n foreach($foreign_keys as $name => $foreign_key)\n {\n $target = '';\n if(\\array_key_exists('db', $foreign_key) && $foreign_key['db'] != '')\n {\n $target .= '<b>' . \\adminer\\h($foreign_key['db']) . '</b>.';\n }\n if(\\array_key_exists('ns', $foreign_key) && $foreign_key['ns'] != '')\n {\n $target .= '<b>' . \\adminer\\h($foreign_key['ns']) . '</b>.';\n }\n $target = \\adminer\\h($foreign_key['table']) .\n '(' . \\implode(', ', \\array_map('\\\\adminer\\\\h', $foreign_key['target'])) . ')';\n $details[] = [\n 'name' => \\adminer\\h($name),\n 'source' => '<i>' . \\implode('</i>, <i>',\n \\array_map('\\\\adminer\\\\h', $foreign_key['source'])) . '</i>',\n 'target' => $target,\n 'on_delete' => \\adminer\\h($foreign_key['on_delete']),\n 'on_update' => \\adminer\\h($foreign_key['on_update']),\n ];\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "public function getForeignKeys()\n {\n $return = [];\n $table = $this->getName();\n\n /** @var Base $call */\n foreach ($this->getGenericCalls() as $call) {\n if (isset($call->on) && $call->on !== $table) {\n $return[(string)$call->on] = $call;\n } // if\n } // foreach\n\n return $return;\n }", "public function enableForeignKeyConstraints($connection);", "function get_tables_fk()\n\t{\n\t\t$tables_fk\t=\tarray();\n\t\t$fields\t\t=\t$this->_get_fields();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\t$column_name\t= $field->name;\n\t\t\tif ( strpos( $column_name, '_id_' ) != 0 )\n\t\t\t{\n\t\t\t\t$words\t\t\t\t\t\t=\texplode( \"_id_\", $column_name );\n\t\t\t\t$table_name\t\t\t\t\t=\t$words[0];\n\t\t\t\t$key\t\t\t\t\t\t=\t$words[0].'_'.$words[1];\n\t\t\t\t$tables_fk[ $key ]->column_name\t\t\t=\t$column_name;\n\t\t\t\t$tables_fk[ $key ]->table_name\t\t\t=\t$table_name;\n\t\t\t}\n\t\t\telseif ( strpos( $column_name, '_id' ) != 0 )\n\t\t\t{\n\t\t\t\t$table_name\t\t\t\t\t=\tstr_replace( \"_id\", \"\", $column_name );\n\t\t\t\t$key\t\t\t\t\t\t=\t$table_name;\n\t\t\t\t$tables_fk[ $key ]->column_name\t\t\t=\t$column_name;\n\t\t\t\t$tables_fk[ $key ]->table_name\t\t\t=\t$table_name;\n\t\t\t}\n\t\t}\n\t\treturn $tables_fk;\n\t}", "protected function findConstraints($table)\n\t{\n\t\t$foreignKeys=array();\n\t\t$sql=\"PRAGMA foreign_key_list({$table->rawName})\";\n\t\t$keys=$this->getDbConnection()->createCommand($sql)->queryAll();\n\t\tforeach($keys as $key)\n\t\t{\n\t\t\t$column=$table->columns[$key['from']];\n\t\t\t$column->isForeignKey=true;\n\t\t\t$foreignKeys[$key['from']]=array($key['table'],$key['to']);\n\t\t}\n\t\t$table->foreignKeys=$foreignKeys;\n\t}", "protected function _checkForeignKeysRestrict() {}", "public function hasForeignKey($tableName, $columns, $constraint = null);", "function prot_setFKDefaults( $raFK = array() )\r\n /*********************************************\r\n With no args, this is the same as Clear()\r\n Args of \"table\"=>\"fk key\" cause those foreign keys to be set in the relation, and foreign data to be\r\n retrieved for non-base tables. This is especially useful for creating an \"empty\" row in a form that\r\n displays read-only data from a parent row.\r\n */\r\n {\r\n $this->Clear();\r\n\r\n // Leave _dbValSnap cleared because it's only used in updates to the base row, which is not set by this method.\r\n\r\n\r\n // N.B. only implemented for one level of indirection from the base table.\r\n // Traversal or really smart joins required to fetch data for a second-level row e.g. grandparent\r\n // We are assuming that the fk_* column name is not aliased (i.e. Field['col']==Field['alias']=='fk_'.$tableName\r\n foreach( $raFK as $tableName => $fkKey ) {\r\n $this->_values['fk_'.$tableName] = $fkKey;\r\n\r\n if( @$this->kfrdef['ver'] == 2 ) {\r\n if( ($a = $this->kfrel->raTableN2A[$tableName]) && ($t = $this->kfrdef['Tables'][$a]) ) {\r\n $raSelFields = array();\r\n foreach( $t['Fields'] as $f ) {\r\n $raSelFields[] = \"$a.{$f['col']} as {$f['alias']}\";\r\n }\r\n $ra = $this->kfrel->kfdb->QueryRA( \"SELECT \".implode(\",\",$raSelFields).\" FROM {$t['Table']} $a\"\r\n .\" WHERE $a._key='$fkKey'\" );\r\n // array_merge is easier, but KFDB returns duplicate entries in $ra[0],$ra[1],...\r\n foreach( $t['Fields'] as $f ) {\r\n $this->_values[$f['alias']] = $ra[$f['alias']];\r\n }\r\n }\r\n } else {\r\n foreach( $this->kfrel->kfrdef['Tables'] as $t ) {\r\n if( $t['Table'] != $tableName ) continue;\r\n $raSelFields = array();\r\n foreach( $t['Fields'] as $f ) {\r\n $raSelFields[] = $t['Alias'].\".\".$f['col'].\" as \".$f['alias'];\r\n }\r\n $ra = $this->kfrel->kfdb->QueryRA( \"SELECT \".implode(\",\",$raSelFields).\" FROM \".$t['Table'].\" \".$t['Alias'].\r\n \" WHERE \".$t['Alias'].\"._key=$fkKey\" );\r\n // array_merge is easier, but KFDB returns duplicate entries in $ra[0],$ra[1],...\r\n foreach( $t['Fields'] as $f ) {\r\n $this->_values[$f['alias']] = $ra[$f['alias']];\r\n }\r\n }\r\n }\r\n }\r\n }", "public function getForeignReferList()\n\t{\n\t\treturn Yii::app()->db->createCommand()->select('code as key, printable_name as title')->from(self::tableName())->queryAll();\n\t}", "public function hasForeignKey($columns, $constraint = null)\r\n {\r\n }", "protected static function getForeignKeys(string $tableName) : \\TheCodingMachine\\TDBM\\Schema\\ForeignKeys\n {\n if ($tableName === 'products') {\n if (self::$foreignKeys === null) {\n self::$foreignKeys = new ForeignKeys([\n 'from__company_id__to__table__companies__columns__id' => [\n 'foreignTable' => 'companies',\n 'localColumns' => [\n 'company_id'\n ],\n 'foreignColumns' => [\n 'id'\n ]\n ]\n ]);\n }\n return self::$foreignKeys;\n }\n return parent::getForeignKeys($tableName);\n }", "protected function deleteInvalidAttributeValuesForeignKeys()\n {\n $this->deleteInvalidForeignKey('atAddress', 'avID', 'AttributeValues', 'avID');\n $this->deleteInvalidForeignKey('atBoolean', 'avID', 'AttributeValues', 'avID');\n $this->deleteInvalidForeignKey('atDateTime', 'avID', 'AttributeValues', 'avID');\n $this->deleteInvalidForeignKey('atDefault', 'avID', 'AttributeValues', 'avID');\n $this->deleteInvalidForeignKey('atFile', 'avID', 'AttributeValues', 'avID');\n $this->deleteInvalidForeignKey('atNumber', 'avID', 'AttributeValues', 'avID');\n $this->deleteInvalidForeignKey('atSocialLinks', 'avID', 'AttributeValues', 'avID');\n }", "public function onSetUp(): void\n {\n $this->getConnection()->executeStatement('SET foreign_key_checks = 0');\n\n parent::onSetUp();\n\n $this->getConnection()->executeStatement('SET foreign_key_checks = 1');\n }", "public function getTableForeignKeys(string $name, bool $refresh = false): array\n {\n return $this->getTableMetadata($name, 'foreignKeys', $refresh);\n }", "public function foreignConstraint();", "static public function enableForeignKeyConstraints()\n {\n return self::call(__FUNCTION__ , func_get_args());\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 }", "static function reset_foreignKeyChecks() {\r\n global $db;\r\n \r\n $query = \"SET FOREIGN_KEY_CHECKS=1\";\r\n\r\n $statement = $db->prepare($query);\r\n \r\n if ($statement == FALSE) {\r\n display_db_error($db->error);\r\n }\r\n \r\n $success = $statement->execute();\r\n\r\n if ($success) {\r\n $statement->close();\r\n } else {\r\n display_db_error($db->error);\r\n }\r\n }", "protected function _checkForeignKeysReverseRestrict() {}", "public function enableForeignKeyConstraints()\n {\n return $this->getConnection()->statement(\n $this->grammar->compileEnableForeignKeyConstraints()\n );\n }", "protected function getForeignKeys($src)\n\t{\n\t\t$matches = array();\n\t\t$brackets = '\\(([^\\)]+)\\)';\n\t\t$find = \"/FOREIGN\\s+KEY\\s+{$brackets}\\s+REFERENCES\\s+([^\\(]+){$brackets}/i\";\n\t\tif(preg_match($find, $src, $matches))\n\t\t{\n\t\t\t$keys = preg_split('/,\\s+/', $matches[1]);\n\t\t\t$fkeys = array();\n\t\t\tforeach(preg_split('/,\\s+/', $matches[3]) as $i => $fkey)\n\t\t\t\t$fkeys[$keys[$i]] = $fkey;\n\t\t\treturn array('table' => str_replace('\"','',$matches[2]), 'keys' => $fkeys);\n\t\t}\n\t}", "protected function addForeignKeys(DOMXPath $rootPath)\n {\n $fields = $this->getFields();\n $idMap = array_flip(array_map(function (MigrationField $field) {\n return $field->getId();\n }, $fields));\n\n /** @var MigrationField $field */\n foreach ($fields as $name => $field) {\n $usedId = $field->getId();\n $indexNodes = $this->getForeignKeysForField($field, $rootPath);\n\n if ($indexNodes && $indexNodes->length) {\n /** @var \\DOMNode $indexNode */\n foreach ($indexNodes as $indexNode) {\n $call = new ForeignKey();\n\n $call\n ->foreign($field->getName())\n ->references('id')\n ->on(\n $rootPath->evaluate(\n 'string(.//link[@type=\"object\" and @struct-name=\"db.mysql.Table\" ' .\n 'and @key=\"referencedTable\"])',\n $indexNode\n )\n );\n\n if ($rule = $rootPath->evaluate('string(./value[@key=\"deleteRule\"])', $indexNode)) {\n $call->onDelete(strtolower($rule));\n } // if\n\n if ($rule = $rootPath->evaluate('string(./value[@key=\"updateRule\"])', $indexNode)) {\n $call->onUpdate(strtolower($rule));\n } // if\n\n $call->isForMany((int)$rootPath->evaluate('number(./value[@key=\"many\"])', $indexNode) === 1);\n } // foreach\n\n $this->addGenericCall($call);\n } // if\n } // foreach\n\n return $this;\n }", "public function addForeignKeys($setup)\n {\n /**\n * Add foreign keys for table wk_amazon_mapped_product\n */\n $setup->getConnection()->addForeignKey(\n $setup->getFkName(\n 'wk_amazon_mapped_product',\n 'magento_pro_id',\n 'catalog_product_entity',\n 'entity_id'\n ),\n $setup->getTable('wk_amazon_mapped_product'),\n 'magento_pro_id',\n $setup->getTable('catalog_product_entity'),\n 'entity_id',\n \\Magento\\Framework\\DB\\Ddl\\Table::ACTION_CASCADE\n );\n\n /**\n * Add foreign keys for table wk_amazon_maped_order\n */\n $setup->getConnection()->addForeignKey(\n $setup->getFkName(\n 'wk_amazon_maped_order',\n 'mage_amz_account_id',\n 'wk_amazon_accounts',\n 'entity_id'\n ),\n $setup->getTable('wk_amazon_maped_order'),\n 'mage_amz_account_id',\n $setup->getTable('wk_amazon_accounts'),\n 'entity_id',\n \\Magento\\Framework\\DB\\Ddl\\Table::ACTION_CASCADE\n );\n }", "public function addForeignKey($tableName, $schemaName, $reference){ }", "public function boot()\n {\n if (DB::connection() instanceof \\Illuminate\\Database\\SQLiteConnection) {\n Schema::enableForeignKeyConstraints();\n }\n }", "function getForeignKeysToModel($model)\n {\n $keys = array();\n foreach ($this->_cols as $col=>$val) {\n $field = new $val['type']();\n if ($field->type == 'foreignkey' and $val['model'] == $model) {\n $keys[$col] = $val;\n }\n }\n return $keys;\n }", "public function testAddingForeignKeys()\n\t{\n\t\tR::nuke();\n\t\t\n\t\t$sql = 'CREATE TABLE book ( id INTEGER PRIMARY KEY AUTOINCREMENT ) ';\n\t\t\n\t\tR::exec( $sql );\n\t\t\n\t\t$sql = 'CREATE TABLE page ( id INTEGER PRIMARY KEY AUTOINCREMENT, book_id INTEGER ) ';\n\t\t\n\t\tR::exec( $sql );\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 0 );\n\t\t\n\t\t$writer = R::getWriter();\n\t\t\n\t\t$writer->addFK('page', 'book', 'book_id', 'id', TRUE);\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 1 );\n\t\t\n\t\t$writer->addFK('page', 'book', 'book_id', 'id', TRUE);\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 1 );\n\t\t\n\t\t$writer->addFK('page', 'book', 'book_id', 'id', FALSE);\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 1 );\n\t\t\n\t\tR::nuke();\n\t\t\n\t\t$sql = 'CREATE TABLE book ( id INTEGER PRIMARY KEY AUTOINCREMENT ) ';\n\t\t\n\t\tR::exec( $sql );\n\t\t\n\t\t$sql = 'CREATE TABLE page ( id INTEGER PRIMARY KEY AUTOINCREMENT, book_id INTEGER ) ';\n\t\t\n\t\tR::exec( $sql );\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 0 );\n\t\t\n\t\t$writer = R::getWriter();\n\t\t\n\t\t$writer->addFK('page', 'book', 'book_id', 'id', FALSE);\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 1 );\n\t\t\n\t\t$writer->addFK('page', 'book', 'book_id', 'id', TRUE);\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 1 );\n\t\t\n\t\t$writer->addFK('page', 'book', 'book_id', 'id', FALSE);\n\t\t\n\t\tasrt( count( R::getAll(' PRAGMA foreign_key_list(\"page\") ') ), 1 );\n\t\t\n\t}", "protected function findConstraints($table)\n\t{\n\t\t$schemas=$this->getDbConnection()->getPdoInstance()->cubrid_schema(PDO::CUBRID_SCH_IMPORTED_KEYS,$table->name);\n\n\t\tforeach($schemas as $schema)\n\t\t{\n\t\t\t$table->foreignKeys[$schema[\"FKCOLUMN_NAME\"]]=array($schema[\"PKTABLE_NAME\"],$schema[\"PKCOLUMN_NAME\"]);\n\t\t\tif(isset($table->columns[$schema[\"FKCOLUMN_NAME\"]]))\n\t\t\t\t$table->columns[$schema[\"FKCOLUMN_NAME\"]]->isForeignKey=true;\n\t\t}\n\t}", "protected function nullifyInvalidForeignKeys()\n {\n $this->output(t('Fixing records with invalid foreign keys...'));\n // Fix orphans of Packages\n $this->nullifyInvalidForeignKey('AttributeSets', 'pkgID', 'Packages', 'pkgID');\n // Fix orphans of Files\n $this->nullifyInvalidForeignKey('atFile', 'fID', 'Files', 'fID');\n // Fix orphans of Users\n $this->nullifyInvalidForeignKey('Files', 'uID', 'Users', 'uID');\n // Fix orphans of AttributeKeyCategories\n $this->nullifyInvalidForeignKey('AttributeSets', 'akCategoryID', 'AttributeKeyCategories', 'akCategoryID');\n // Fix orphans of FileStorageLocations\n $this->nullifyInvalidForeignKey('Files', 'fslID', 'FileStorageLocations', 'fslID');\n }", "public function getForeignTable()\n {\n return $this->foreignTable;\n }", "public function listForeignKeysOnTable(string $tableName)\n {\n $allForeignKeys = $this->listForeignKeys();\n\n $foreignKeysOnTable = [];\n\n foreach ($allForeignKeys as $foreignKey) {\n if ($foreignKey->getForeignTableName() === $tableName) {\n array_push($foreignKeysOnTable, $foreignKey);\n }\n }\n\n return $foreignKeysOnTable;\n }", "protected function addServiceForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('ds_service');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_organization'),\n ['organization_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_business_unit'),\n ['business_unit_owner_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n }", "protected static function bootSoftDeleteRelated()\n {\n static::deleting(\n function ($model) {\n if (!empty($relations = $model->getRelations())) {\n foreach ($relations as $key => $value) {\n $model->{$key}()->delete();\n }\n }\n }\n );\n }", "public function getForeignKeysInfo($fullTable)\n {\n list($db, $_table) = $this->explodeTable($fullTable);\n\n $db = addcslashes($db, \"'\");\n $_table = addcslashes($_table, \"'\");\n\n\n $ret = [];\n\n $rows = $this->query(\"\nselect \nCOLUMN_NAME,\nREFERENCED_TABLE_SCHEMA, \nREFERENCED_TABLE_NAME,\nREFERENCED_COLUMN_NAME\n \nfrom information_schema.KEY_COLUMN_USAGE k \ninner join information_schema.TABLE_CONSTRAINTS t on t.CONSTRAINT_NAME=k.CONSTRAINT_NAME\nwhere k.TABLE_SCHEMA = '$db'\nand k.TABLE_NAME = '$_table'\nand CONSTRAINT_TYPE = 'FOREIGN KEY'\n\n\")->fetchAll(\\PDO::FETCH_ASSOC);\n\n\n foreach ($rows as $row) {\n $ret[$row['COLUMN_NAME']] = [\n \"referenced_schema\" => $row['REFERENCED_TABLE_SCHEMA'],\n \"referenced_table\" => $row['REFERENCED_TABLE_NAME'],\n \"referenced_column\" => $row['REFERENCED_COLUMN_NAME'],\n ];\n }\n\n return $ret;\n }", "public function addForeignKey($columns, $referencedTable, $referencedColumns = ['id'], $options = [])\r\n {\r\n }", "protected function findConstraints($table)\n {\n // Zoggo - Converted sql to use join syntax\n $sql = 'SELECT\n c.rdb$relation_name AS ftable,\n d.rdb$field_name AS ffield,\n e.rdb$field_name AS lfield\n FROM\n rdb$ref_constraints b\n join rdb$relation_constraints a on a.rdb$constraint_name=b.rdb$constraint_name\n join rdb$relation_constraints c on b.rdb$const_name_uq=c.rdb$constraint_name\n join rdb$index_segments d on c.rdb$index_name=d.rdb$index_name\n join rdb$index_segments e on a.rdb$index_name=e.rdb$index_name\n WHERE\n a.rdb$constraint_type=\\'FOREIGN KEY\\' AND\n a.rdb$relation_name=upper(\\'' . $table->name . '\\') ';\n\n try {\n $fkeys = $this->db->createCommand($sql)->queryAll();\n } catch (Exception $e) {\n return false;\n }\n\n\n foreach ($fkeys as $fkey) {\n // Zoggo - Added strtolower here to guarantee that values are\n // returned lower case. Otherwise gii generates wrong code.\n\n $key = strtolower(rtrim($fkey['lfield']));\n $table->foreignKeys[$key] = array(strtolower(rtrim($fkey['ftable'])), strtolower(rtrim($fkey['ffield'])));\n\n if (isset($table->columns[$key])) {\n $table->columns[$key]->isForeignKey = true;\n }\n }\n }", "public function getForeignEntityNames()\n {\n return $this->foreignEntityNames;\n }", "public function getSuppressedForeignKeys(): array\n {\n return $this->suppressedForeignKeys;\n }", "public function testForeignKeysWithSQLite()\n\t{\n\t\t$book = R::dispense( 'book' );\n\t\t$page = R::dispense( 'page' );\n\t\t$cover = R::dispense( 'cover' );\n\n\t\tlist( $g1, $g2 ) = R::dispense( 'genre', 2 );\n\n\t\t$g1->name = '1';\n\t\t$g2->name = '2';\n\n\t\t$book->ownPage = array( $page );\n\n\t\t$book->cover = $cover;\n\n\t\t$book->sharedGenre = array( $g1, $g2 );\n\n\t\tR::store( $book );\n\n\t\t$fkbook = R::getAll( 'pragma foreign_key_list(book)' );\n\t\t$fkgenre = R::getAll( 'pragma foreign_key_list(book_genre)' );\n\t\t$fkpage = R::getAll( 'pragma foreign_key_list(page)' );\n\n\t\tasrt( $fkpage[0]['from'], 'book_id' );\n\t\tasrt( $fkpage[0]['to'], 'id' );\n\t\tasrt( $fkpage[0]['table'], 'book' );\n\n\t\tasrt( count( $fkgenre ), 2 );\n\n\t\tif ( $fkgenre[0]['from'] == 'book' ) {\n\t\t\tasrt( $fkgenre[0]['to'], 'id' );\n\t\t\tasrt( $fkgenre[0]['table'], 'book' );\n\t\t}\n\n\t\tif ( $fkgenre[0]['from'] == 'genre' ) {\n\t\t\tasrt( $fkgenre[0]['to'], 'id' );\n\t\t\tasrt( $fkgenre[0]['table'], 'genre' );\n\t\t}\n\n\t\tasrt( $fkbook[0]['from'], 'cover_id' );\n\t\tasrt( $fkbook[0]['to'], 'id' );\n\t\tasrt( $fkbook[0]['table'], 'cover' );\n\t}", "protected function createOldForeignKeyTable()\n {\n $this->createOldTable();\n\n $this->setUpNewForeignKeyTable();\n $this->getSchemaManager()->createTable($this->getOldForeignKeyTable());\n }", "protected function addOroProcessTriggerForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('oro_process_trigger');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_process_definition'),\n ['definition_name'],\n ['name'],\n ['onUpdate' => null, 'onDelete' => 'CASCADE']\n );\n }", "public function getForeignKey();", "protected function addOroLanguageForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('oro_language');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_organization'),\n ['organization_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_user'),\n ['user_owner_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n }", "public function testForeignKeyWithOnDelete()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->foreignKey('column', 'table', 'id', 'cascade');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'constraints' => [\n [\n 'type' => 'foreignKey',\n 'name' => null,\n 'columns' => ['column'],\n 'referenceTable' => 'table',\n 'referenceColumns' => ['id'],\n 'onDelete' => 'cascade',\n 'onUpdate' => null,\n ]\n ],\n ], $array);\n }", "public function getForeignKey($name);", "public function initialize()\r\n {\r\n $this->belongsTo('encuesta_personalId', 'Personal', 'personal_id', array('alias' => 'Personal'));\r\n $this->belongsTo('encuesta_alojamientoId', 'Alojamiento', 'alojamiento_id', array('alias' => 'Alojamiento'));\r\n $this->belongsTo('encuesta_recepcionId', 'Recepcion', 'recepcion_id', array('alias' => 'Recepcion'));\r\n $this->belongsTo('encuesta_unidadId', 'Unidad', 'unidad_id', array('alias' => 'Unidad'));\r\n $this->belongsTo('encuesta_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\r\n $this->belongsTo('encuesta_sorteoId', 'Sorteo', 'sorteo_id', array('alias' => 'Sorteo'));\r\n }", "private function _createForeignKeysFromRecords($records)\n\t{\n\t\tforeach ($records as $record)\n\t\t{\n\t\t\tCraft::log('Adding foreign keys for record:'. get_class($record));\n\t\t\t$record->addForeignKeys();\n\t\t}\n\t}", "protected function addOroWorkflowTransTriggerForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('oro_workflow_trans_trigger');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_workflow_definition'),\n ['workflow_name'],\n ['name'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n }", "protected function addOroWorkflowTransTriggerForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('oro_workflow_trans_trigger');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_workflow_definition'),\n ['workflow_name'],\n ['name'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n }", "public function hasMany($class, $foreignKey = null, $localKey = null);", "private function Load()\n\t{\n\t\t$sql = \"show tables\";\n\t\t$rs = $this->Server->Connection->Select($sql);\n\t\t\n\t\t// first pass load all the tables. this will initialize each object. we have to\n\t\t// do this first so that we can correctly determine and store \"Set\" information\n\t\twhile ($row = $this->Server->Connection->Next($rs))\n\t\t{\n\t\t\t$this->Tables[$row[\"Tables_in_\" . $this->Name]] = new DBTable($this,$row);\n\t\t}\n\t\t\n\t\t// now load all the keys and constraints for each table\n\t\tforeach ($this->Tables as $table)\n\t\t{\n\t\t\t$table->LoadKeys();\n\t\t}\n\n\t\t$this->Server->Connection->Release($rs);\n\t\t\n\t\t$sql = \"show table status from `\" . $this->Name . \"`\";\n\t\t$rs2 = $this->Server->Connection->Select($sql);\n\t\t\n\t\t// load the extra data\n\t\twhile ($row = $this->Server->Connection->Next($rs2))\n\t\t{\n\t\t\t$this->Tables[$row[\"Name\"]]->Engine = $row[\"Engine\"]; \n\t\t\t$this->Tables[$row[\"Name\"]]->Comment = $row[\"Comment\"];\n\t\t}\n\t\t$this->Server->Connection->Release($rs2);\n\t}", "public function loadRelated()\n {\n return;\n }", "protected function prepareForeignConstraint(DOMElement $table, DOMXPath $xpath, Table $schemaTable)\n {\n $foreignKeys = $xpath->query(sprintf('/database/table[@name=\"%s\"]/foreign', $table->getAttribute('name')));\n\n /** @var DOMElement $foreignKey */\n foreach ($foreignKeys as $foreignKey) {\n $foreignTable = $foreignKey->getAttribute('foreignTable');\n $references = $foreignKey->getElementsByTagName('reference');\n\n /** @var DOMElement $reference */\n foreach ($references as $reference) {\n $localColumn = $reference->getAttribute('local');\n $foreignColumn = $reference->getAttribute('foreign');\n $constraintName = sprintf(\n '%s_%s_%s_%s_foreign',\n $table->getAttribute('name'),\n $foreignTable,\n $localColumn,\n $foreignColumn\n );\n\n $schemaTable->addConstraint(\n $constraintName,\n [\n 'type' => 'foreign',\n 'columns' => [$localColumn],\n 'references' => [$foreignTable, $foreignColumn],\n 'update' => $foreignKey->getAttribute('onUpdate'),\n 'delete' => $foreignKey->getAttribute('onDelete')\n ]\n );\n }\n }\n }", "protected function addOroWorkflowScopesForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('oro_workflow_scopes');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_scope'),\n ['scope_id'],\n ['id'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_workflow_definition'),\n ['workflow_name'],\n ['name'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n }", "protected function addServiceActivationForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('ds_service_activation');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_organization'),\n ['organization_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_business_unit'),\n ['business_unit_owner_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_user'),\n ['user_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('ds_service'),\n ['service_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n }", "public function testForeignKeyConstraints()\n {\n $xml = '<table name=\"test\"><constraints>\n <foreign-key ref-table=\"asset_type\" name=\"asset_type_fk1\" on-delete=\"CASCADE\">\n <column references=\"type_code\">parent_type</column>\n </foreign-key>\n </constraints></table>';\n\n $queryXml = new DOMDocument();\n $queryXml->loadXML($xml);\n $table = $queryXml->getElementsByTagName('table')->item(0);\n $expected = array(\n 'FOREIGN-KEYS' => array(\n 0 => array(\n 'name' => 'asset_type_fk1',\n 'table' => '',\n 'on-delete' => 'CASCADE',\n 'COLUMNS' => array (\n 0 => array(\n 'name' => 'parent_type',\n 'references' => 'type_code',\n ),\n ),\n ),\n ),\n );\n\n $retVal = DALSchemaParser::getTableConstraints($table);\n\n PHPUnit_Framework_Assert::assertEquals($expected, $retVal);\n\n }", "static function set_noForeignKeyChecks() {\r\n global $db;\r\n \r\n $query = \"SET FOREIGN_KEY_CHECKS=0\";\r\n\r\n $statement = $db->prepare($query);\r\n\r\n if ($statement == FALSE) {\r\n display_db_error($db->error);\r\n }\r\n \r\n $success = $statement->execute();\r\n\r\n if ($success) {\r\n $statement->close();\r\n } else {\r\n display_db_error($db->error);\r\n }\r\n }", "protected function dropForeignKeys(MysqlAdapter $firstConnection, MysqlAdapter $secondConnection)\n {\n foreach ($firstConnection->getTables() as $tableName) {\n foreach ($firstConnection->getForeignKeys($tableName) as $keyInfo) {\n if (in_array($keyInfo['REF_TABLE_NAME'], $secondConnection->getTables())) {\n $firstConnection->dropForeignKey($keyInfo['TABLE_NAME'], $keyInfo['FK_NAME']);\n }\n }\n }\n $firstConnection->query('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function setForeignKeyChecks($state);", "public function actionAddForeignKeysForRecord($args)\n\t{\n\t\t$record = $this->_getRecord($args[0]);\n\t\t$belongsToRelations = $record->getBelongsToRelations();\n\n\t\tif ($belongsToRelations)\n\t\t{\n\t\t\t$table = $record->getTableName();\n\n\t\t\techo \"\\n// Add foreign keys to craft_{$table}\\n\";\n\n\t\t\tforeach ($belongsToRelations as $name => $config)\n\t\t\t{\n\t\t\t\t$otherModelClass = $config[1];\n\t\t\t\t$otherModel = new $otherModelClass('install');\n\t\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t\t$otherPk = $otherModel->primaryKey();\n\n\t\t\t\tif (isset($config['onDelete']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (empty($config['required']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$onDelete = BaseRecord::SET_NULL;\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$onDelete = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (isset($config['onUpdate']))\n\t\t\t\t{\n\t\t\t\t\t$onUpdate = $config['onUpdate'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onUpdate = null;\n\t\t\t\t}\n\n\t\t\t\techo 'craft()->db->createCommand()->addForeignKey(' .\n\t\t\t\t\t$this->_varExport($table).', ' .\n\t\t\t\t\t$this->_varExport($config[2]).', ' .\n\t\t\t\t\t$this->_varExport($otherTable).', ' .\n\t\t\t\t\t$this->_varExport($otherPk).', ' .\n\t\t\t\t\t$this->_varExport($onDelete).', ' .\n\t\t\t\t\t$this->_varExport($onUpdate).\");\\n\";\n\t\t\t}\n\t\t}\n\n\t\treturn 1;\n\t}", "public function addforeign($table,$coloum,$reltable,$key)\n\t{\n\t\tglobal $database;\n\t\t$sql=\"ALTER TABLE \" .$table. \" ADD FOREIGN KEY (\".$coloum.\") REFERENCES \".$reltable.\"(\".$key.\")\";\n\t $database->query($sql);\n\t}", "private static function _getForeignKeyConstraints(DomElement $parent)\n {\n // Foreign key constraints.\n $fks = $parent->getElementsByTagName('foreign-key');\n\n $foreignKeys = array();\n foreach ($fks as $fk) {\n $current = array();\n $current['name'] = $fk->getAttribute('name');\n $current['table'] = $fk->getAttribute('foreign-table');\n $onDelete = $fk->getAttribute('on-delete');\n if ($onDelete === '') {\n $onDelete = 'NO ACTION';\n }\n\n $current['on-delete'] = $onDelete;\n $current['COLUMNS'] = array();\n\n $columns = $fk->getElementsByTagName('column');\n foreach ($columns as $column) {\n $col['name'] = $column->nodeValue;\n $col['references'] = $column->getAttribute('references');\n $current['COLUMNS'][] = $col;\n }\n\n $foreignKeys[] = $current;\n }//end foreach\n\n return $foreignKeys;\n\n }", "public function buildForeignKeys(Doctrine_Table $table)\n {\n $fk = array();\n\n foreach ((array) $table->getIdentifier() as $column) {\n $def = $table->getDefinitionOf($column);\n\n unset($def['autoincrement']);\n unset($def['sequence']);\n unset($def['primary']);\n\n $col = $column;\n\n //$def['primary'] = true;\n $fk[$col] = $def;\n }\n return $fk;\n }", "public function initialize()\n {\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('alias' => 'Datospersonales'));\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('foreignKey' => true));\n }", "protected function addBtsIssueForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('bts_issue');\n $table->addForeignKeyConstraint(\n $schema->getTable('bts_issue_resolution'),\n ['resolution_id'],\n ['id'],\n ['onDelete' => null, 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('bts_issue_priority'),\n ['priority_id'],\n ['id'],\n ['onDelete' => null, 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('bts_issue'),\n ['parent_id'],\n ['id'],\n ['onDelete' => null, 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_user'),\n ['assignee_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_user'),\n ['reporter_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_organization'),\n ['organization_id'],\n ['id'],\n ['onDelete' => 'SET NULL', 'onUpdate' => null]\n );\n }", "protected function addOroWorkflowDefinitionForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('oro_workflow_definition');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_workflow_step'),\n ['start_step_id'],\n ['id'],\n ['onUpdate' => null, 'onDelete' => 'SET NULL']\n );\n }", "public function onDeleteCascade()\n {\n return $this->onDelete(ForeignKeyMode::CASCADE);\n }", "public function isForeignKey()\n {\n\treturn false;\n }", "protected function loadConstraintDataKeys($schema) {\r\n\t\tif (isset ( $this->data ['constraint_keys'] [$schema] )) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->prepareDataHierarchy ( 'constraint_keys', $schema );\r\n\t}", "protected function loadPrimaryKeys()\n {\n $identifier = $this->getTable()->getIdentifier();\n if (is_array($identifier))\n {\n foreach ($identifier as $_key)\n {\n $this->primaryKey[] = new sfDoctrineAdminColumn($_key);\n }\n } else {\n $this->primaryKey[] = new sfDoctrineAdminColumn($identifier);\n }\n\n if (!empty($this->primaryKeys))\n {\n throw new sfException('You cannot use the admin generator on a model which does not have any primary keys defined');\n }\n }", "protected function addServiceTitleForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('ds_service_title');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_fallback_localization_val'),\n ['localized_value_id'],\n ['id'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('ds_service'),\n ['service_id'],\n ['id'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n }", "public function initialize()\n {\n $this->hasMany('informacion_id', 'Informacionadicional', 'informacion_id', array('alias' => 'Informacionadicional'));\n $this->belongsTo('informacion_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\n }", "public function initialize()\n {\n \t$this->belongsTo('id_verificacion', 'CobVerificacion', 'id_verificacion', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_actadocumentacion', 'CobActadocumentacionDatos', 'id_actadocumentacion', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('id_usuario', 'IbcUsuario', 'id_usuario', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->belongsTo('estado', 'IbcReferencia', 'id_referencia', array(\n \t\t\t'reusable' => true\n \t));\n \t$this->hasMany('id_actadocumentacion', 'CobActadocumentacionPersona', 'id_actadocumentacion', array(\n \t\t\t'foreignKey' => array(\n \t\t\t\t\t'message' => 'El acta no puede ser eliminada porque existen beneficiarios asociados a ésta'\n \t\t\t)\n \t));\n }", "protected function addForeignKey($fields, $referencedTable='', $referencedFields='', $options=array()){\n\t\tEntityManager::addForeignKey(get_class($this), $fields, $referencedTable, $referencedFields, $options);\n\t}", "public static function getForeignKeysInfo($table, $schema = null, $resolve = false)\n {\n $ret = [];\n if (null === $schema) {\n $schema = self::getDatabase();\n }\n if (false !== ($rows = QuickPdo::fetchAll(\"\nselect \nCOLUMN_NAME,\nREFERENCED_TABLE_SCHEMA, \nREFERENCED_TABLE_NAME,\nREFERENCED_COLUMN_NAME\n \nfrom information_schema.KEY_COLUMN_USAGE k \ninner join information_schema.TABLE_CONSTRAINTS t on t.CONSTRAINT_NAME=k.CONSTRAINT_NAME\nwhere k.TABLE_SCHEMA = '$schema'\nand k.TABLE_NAME = '$table'\nand CONSTRAINT_TYPE = 'FOREIGN KEY'\n\"))\n ) {\n foreach ($rows as $row) {\n $ret[$row['COLUMN_NAME']] = [$row['REFERENCED_TABLE_SCHEMA'], $row['REFERENCED_TABLE_NAME'], $row['REFERENCED_COLUMN_NAME']];\n }\n }\n\n\n if (true === $resolve) {\n foreach ($ret as $col => $info) {\n $db = $info[0];\n $table = $info[1];\n $column = $info[2];\n self::getResolvedForeignKeyInfo($db, $table, $column);\n $ret[$col] = [\n $db,\n $table,\n $column,\n ];\n }\n }\n\n return $ret;\n }", "public function belongsToForeign($table, $foreign = null, $local = null, $name = null, $onUpdate = null, $onDelete = null)\n {\n // Determine the Name of the Foreign Key\n if(is_null($foreign)) {\n $foreign = Str::singular($table) . '_id';\n }\n\n // Determine the Name of the Local Key\n if(is_null($local)) {\n $local = 'id';\n }\n\n // Determine the Update Constraint\n if(is_null($onUpdate)) {\n $onUpdate = $this->getConfig('belongsTo.onUpdate');\n }\n\n // Determine the Delete Constraint\n if(is_null($onDelete)) {\n $onDelete = $this->getConfig('belongsTo.onDelete');\n }\n\n // Define the Reference\n return $this->foreign($foreign, $name, $table)->references($local)->onUpdate($onUpdate)->onDelete($onDelete);\n }", "protected function addOroWorkflowStepForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('oro_workflow_step');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_workflow_definition'),\n ['workflow_name'],\n ['name'],\n ['onUpdate' => null, 'onDelete' => 'CASCADE']\n );\n }", "function toggleForeignKeys($enable)\n\t{\n\t\t$this->query(\"SET FOREIGN_KEY_CHECKS = \".($enable ? 1 : 0));\n\t}", "protected function addServiceButtonForeignKeys(Schema $schema)\n {\n $table = $schema->getTable('ds_service_button');\n $table->addForeignKeyConstraint(\n $schema->getTable('oro_fallback_localization_val'),\n ['localized_value_id'],\n ['id'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n $table->addForeignKeyConstraint(\n $schema->getTable('ds_service'),\n ['service_id'],\n ['id'],\n ['onDelete' => 'CASCADE', 'onUpdate' => null]\n );\n }", "public function getDownSQL()\n {\n return array(\n 'propel' => '\n SET FOREIGN_KEY_CHECKS = 1;\n ',\n );\n }", "public function listTableForeignKeys($table, $database = null)\n {\n return array();\n }", "public function dropForeignKey($columns, $constraint = null)\r\n {\r\n \r\n }", "function getFkTables($db,$schema,$table){\n\t\tglobal $misc;\n\t\t$driver = $misc->getDatabaseAccessor($db);\n\t\t\n\t\t$sql =\"SELECT cc.table_name FROM information_schema.table_constraints tc,\"\n\t\t\t. \"information_schema.constraint_column_usage cc,\"\n\t\t\t. \"information_schema.key_column_usage kc\"\n\t\t\t. \" WHERE tc.constraint_type='FOREIGN KEY' AND tc.table_schema='{$schema}'\"\n\t\t\t. \" AND tc.table_name='{$table}' \"\n\t\t\t. \" AND tc.constraint_name=cc.constraint_name\"\n\t\t\t. \" AND kc.constraint_name = cc.constraint_name\"\n\t\t\t. \" AND kc.table_schema='{$schema}'\"\n\t\t\t. \" AND kc.table_name='{$table}' AND kc.column_name='{$this->name}'\";\n\t\t\n\t\treturn $driver->selectField($sql,\"table_name\");\n\t}", "public function initialize()\n {\n $this->belongsTo('id_segmentation', 'Entities\\Segmentation', 'id', array('foreignKey' => true, 'alias' => 'Segmentation'));\n $this->belongsTo('id_factor_network', 'Entities\\FactorNetwork', 'id', array('foreignKey' => true, 'alias' => 'FactorNetwork'));\n }" ]
[ "0.7096613", "0.708457", "0.6915462", "0.6823926", "0.66371024", "0.6456478", "0.63342464", "0.6310916", "0.62942225", "0.59746057", "0.5945659", "0.59015155", "0.58410895", "0.58003855", "0.5790453", "0.57866085", "0.57639486", "0.5752092", "0.57282627", "0.5667816", "0.56552595", "0.56225973", "0.5611113", "0.55573183", "0.55481803", "0.5533894", "0.5527285", "0.5458959", "0.5418373", "0.54144615", "0.5393322", "0.53641415", "0.5359395", "0.53558326", "0.53549844", "0.5348386", "0.5346155", "0.5324508", "0.53218037", "0.5319975", "0.5304047", "0.5291125", "0.526456", "0.5248185", "0.5224482", "0.5211872", "0.5204625", "0.5197958", "0.5194022", "0.5193491", "0.51883996", "0.5171864", "0.5155904", "0.513126", "0.5129964", "0.5126585", "0.5126252", "0.51149476", "0.51112986", "0.5081532", "0.50713235", "0.5058055", "0.5052923", "0.5048966", "0.5048966", "0.5044045", "0.5033347", "0.50294006", "0.50234324", "0.5022237", "0.5016093", "0.5013931", "0.5012805", "0.50098145", "0.50055546", "0.50030345", "0.50023955", "0.50014114", "0.4993959", "0.49807423", "0.49712917", "0.49537286", "0.49498743", "0.49485773", "0.49457324", "0.49351665", "0.49308145", "0.49263045", "0.49130523", "0.49101964", "0.48968747", "0.48965234", "0.488911", "0.48821157", "0.48772162", "0.4876188", "0.48751017", "0.48745817", "0.4873109", "0.48719472" ]
0.65552783
5
Load indexes for this table
protected function addIndexes(Table $table) { $stmt = $this->dbh->query("SHOW INDEX FROM `" . $table->getName() . "`"); // Loop through the returned results, grouping the same key_name together // adding each column for that key. $indexes = array(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $colName = $row["Column_name"]; $name = $row["Key_name"]; if ($name == "PRIMARY") { continue; } if (!isset($indexes[$name])) { $isUnique = ($row["Non_unique"] == 0); if ($isUnique) { $indexes[$name] = new Unique($name); } else { $indexes[$name] = new Index($name); } if ($this->addVendorInfo) { $vi = $this->getNewVendorInfoObject($row); $indexes[$name]->addVendorInfo($vi); } $table->addIndex($indexes[$name]); } $indexes[$name]->addColumn($table->getColumn($colName)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _loadIndex () \n {\n $this->_enterSection('_loadIndex');\n \n $index = array();\n \n $a = strcspn ($this->_options['dsn'], ':');\n $proto = substr ($this->_options['dsn'], 0, $a);\n $path = substr ($this->_options['dsn'], $a + 3);\n\n switch ($proto) {\n case 'file' : \n $f = sprintf($path, $this->_indexName);\n $data = '';\n if ($fp = @fopen ($f,'r')) {\n $this->_enterSection('_loadIndex (acquiring read lock)');\n flock($fp, LOCK_SH);\n $this->_leaveSection('_loadIndex (acquiring read lock)');\n $this->_enterSection('_loadIndex (reading data)');\n while (!feof($fp)) {\n $data .= fread ($fp, 0xFFFF);\n }\n fclose ($fp);\n $this->_leaveSection('_loadIndex (reading data)');\n }\n \n $this->_enterSection('_loadIndex (unserializing/uncompressing)');\n if ($data) {\n if ($this->_options['gz_level']) {\n $index = unserialize(gzuncompress($data));\n } else {\n $index = unserialize($data);\n }\n }\n $this->_leaveSection('_loadIndex (unserializing/uncompressing)');\n break;\n }\n $this->_index = $index;\n \n $this->_leaveSection('_loadIndex');\n }", "abstract protected function loadTableIndexes(string $tableName): array;", "protected static function initIndexes()\n {\n static::$indexes = [];\n foreach (static::$indexesConf as $name => &$index) {\n if (!isset($index['type'])) {\n $index['type'] = 'Generic';\n }\n $index['name'] = $name;\n $index['modelClass'] = static::class;\n\n $class = ClassFinder::getNamespace(\\Zer0\\Model\\Indexes\\AbstractIndex::class) . '\\\\' . $index['type'];\n\n static::$indexes[$name] = new $class($index);\n }\n }", "private function processIndexes()\n {\n foreach ($this->indexes as $index) {\n foreach ($index->columns as $indexColumn) {\n $indexColumnName = $indexColumn['name'];\n if (!array_key_exists(strtolower($indexColumnName), $this->columns)) {\n throw new RuntimeException(\"Key column '$indexColumnName' doesn't exist in table\");\n }\n }\n }\n\n // figure out all sequences of columns covered by non-FK indexes\n foreach ($this->indexes as $index) {\n if ($index->type !== 'FOREIGN KEY') {\n foreach ($index->getCovers() as $cover) {\n $lookup = implode('\\0', $cover);\n $this->covers[$lookup] = true;\n }\n }\n }\n\n $indexes = [];\n $foreigns = [];\n $ibfkCounter = 0;\n\n foreach ($this->indexes as $index) {\n if ($index->type === 'FOREIGN KEY') {\n if ($this->addIndexForForeignKey) {\n // TODO - doesn't correctly deal with indexes like foo(10)\n $lookup = implode('\\0', $index->getColumns());\n if (!array_key_exists($lookup, $this->covers)) {\n $newIndex = new IndexDefinition();\n $newIndex->type = 'KEY';\n $newIndex->columns = $index->columns;\n if (!is_null($index->constraint)) {\n $newIndex->name = $index->constraint;\n } elseif (!is_null($index->name)) {\n $newIndex->name = $index->name;\n }\n $indexes[] = $newIndex;\n }\n }\n\n $foreign = new IndexDefinition();\n if (is_null($index->constraint)) {\n $foreign->constraint = $this->name . '_ibfk_' . ++$ibfkCounter;\n } else {\n $foreign->constraint = $index->constraint;\n }\n $foreign->type = 'FOREIGN KEY';\n $foreign->columns = $index->columns;\n $foreign->reference = $index->reference;\n $foreigns[] = $foreign;\n } else {\n $indexes[] = $index;\n }\n }\n\n // now synthesise names for any unnamed indexes,\n // and collect indexes by type\n $usedName = [];\n $keyTypes = [\n 'PRIMARY KEY',\n 'UNIQUE KEY',\n 'KEY',\n 'FULLTEXT KEY',\n 'FOREIGN KEY',\n ];\n $indexesByType = array_fill_keys($keyTypes, []);\n foreach ($indexes as $index) {\n $name = $index->name;\n if ($index->type === 'PRIMARY KEY') {\n $name = 'PRIMARY';\n } elseif (is_null($name)) {\n $base = $index->columns[0]['name'];\n $name = $base;\n $i = 1;\n while (isset($usedName[$name])) {\n $name = $base . '_' . ++$i;\n }\n $index->name = $name;\n } elseif (array_key_exists(strtolower($name), $usedName)) {\n throw new RuntimeException(\"Duplicate key name '$name'\");\n }\n $index->name = $name;\n $usedName[strtolower($name)] = true;\n\n $indexesByType[$index->type][] = $index;\n }\n\n if (count($indexesByType['PRIMARY KEY']) > 1) {\n throw new RuntimeException(\"Multiple PRIMARY KEYs defined\");\n }\n\n foreach ($indexesByType['PRIMARY KEY'] as $pk) {\n foreach ($pk->columns as $indexColumn) {\n $column = $this->columns[strtolower($indexColumn['name'])];\n if ($column->nullable) {\n $column->nullable = false;\n if (is_null($column->default)) {\n $column->default = $column->getUninitialisedValue();\n }\n }\n }\n }\n\n $this->indexes = [];\n foreach (array_reduce($indexesByType, 'array_merge', []) as $index) {\n $this->indexes[$index->name] = $index;\n }\n foreach ($foreigns as $foreign) {\n $this->foreigns[$foreign->constraint] = $foreign;\n }\n }", "public function defineIndexes()\n\t{\n\t\treturn array();\n\t}", "public function readIndexes($tableName, $resource);", "function indexes($table)\n{\n\treturn $this->drv->indexes($table);\n}", "public function indexes()\r\n {\r\n return $this->indexes;\r\n }", "public function testLoad()\r\n\t{\r\n\t\t// Load table\r\n\t\t$table = Table::model()->findByPk(array(\r\n\t\t\t'TABLE_SCHEMA' => 'indextest',\r\n\t\t\t'TABLE_NAME' => 'table1',\r\n\t\t));\r\n\r\n\t\t// Check index count\r\n\t\t$this->assertEquals(4, count($table->indices));\r\n\r\n\t\t// Check index 1\r\n\t\t$index = $table->indices[0];\r\n\t\t$this->assertEquals($table->TABLE_NAME, $index->table->TABLE_NAME);\r\n\t\t$this->assertEquals('PRIMARY', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('PRIMARY', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[1];\r\n\t\t$this->assertEquals('unique', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('UNIQUE', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[2];\r\n\t\t$this->assertEquals('index', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('INDEX', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[3];\r\n\t\t$this->assertEquals('fulltext', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('FULLTEXT', $index->getType());\r\n\t}", "public function getAllIndexes()\n {\n return $this->indexes;\n }", "protected function load()\n\t{\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "function get_table_indexes($db, $table, $cnx='', $reload=false, $mode='mysql'){\n\tif($mode!=='mysql') exit('only mysql index mode developed');\n\tglobal $get_table_indexes, $dbTypeArray;\n\tif(!$cnx)$cnx=C_MASTER;\n\tif($get_table_indexes[$db][$table] && !$reload){\n\t\treturn $get_table_indexes[$db][$table];\n\t}else{\n\t\t$fl=__FILE__;\n\t\t$ln=__LINE__+1;\n\t\tob_start();\n\t\t$result=q(\"SHOW INDEXES FROM `$db`.`$table`\", $cnx, ERR_ECHO, O_DO_NOT_REMEDIATE);\n\t\t$err=ob_get_contents();\n\t\tob_end_clean();\n\t\tif($err)return false;\n\t\t\n\t\t$typeFlip = array_flip($dbTypeArray);\n\t\t$inCompound=false;\n\t\twhile($v=mysqli_fetch_array($result,MYSQLI_ASSOC)){\n\t\t\t$w++;\n\t\t\t@extract($v);\n\t\t\tif($buffer==$Key_name){\n\t\t\t\t//duplicate part of a key\n\t\t\t\tif(!$inCompound){\n\t\t\t\t\t$multiIdx[$Key_name][]=$singleIdx[count($singleIdx)-1];\n\t\t\t\t\tunset($singleIdx[count($singleIdx)-1]);\n\t\t\t\t\t//next two lines overcome \"bug\" in php: just cause I unset the highest element, this will not reset the next index assigned when I say $singleIdx[]=.. later on.\n\t\t\t\t\t$clr=$singleIdx;\n\t\t\t\t\t$singleIdx=$clr;\n\t\t\t\t}\n\t\t\t\t$multiIdx[$Key_name][]=$v;\n\t\t\t\t$inCompound=true;\n\t\t\t}else{\n\t\t\t\t$singleIdx[]=$v;\n\t\t\t\t$buffer=$Key_name;\n\t\t\t\t$inCompound=false;\n\t\t\t}\n\t\t}\n\t\t//set $singleIdx as assoc for reference\n\t\tif(count($singleIdx)){\n\t\t\tforeach($singleIdx as $v) $a[strtolower($v['Column_name'])]=$v;\n\t\t\t$singleIdx=$a;\n\t\t}\n\t\t//store compound keys as XML\n\t\tif($multiIdx){\n\t\t\t$compoundKey='';\n\t\t\tforeach($multiIdx as $n=>$v){\n\t\t\t\t$ci.='<compoundKey Key_name=\"'.$n.'\" Column_count=\"'.count($v).'\"';\n\t\t\t\t$i=0;\n\t\t\t\tforeach($v as $w){\n\t\t\t\t\t$i++;\n\t\t\t\t\tif($i==1)$ci.=' Non_unique=\"'.$w['Non_unique'].'\">'.\"\\n\";\n\t\t\t\t\t$ci.='<keyColumn Seq_in_index=\"'.$w['Seq_in_index'].'\" Column_name=\"'.$w['Column_name'].'\" Sub_part=\"'.$w['Sub_part'].'\" Comment=\"'.htmlentities($w['Comment']).'\">'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$ci.='</compoundKey>';\n\t\t\t}\n\t\t}\n\t\t$get_table_indexes[$db][$table]=array('singleIdx'=>$singleIdx, 'multiIdx'=>$multiIdx, 'compoundXML'=>$ci);\n\t\treturn $get_table_indexes[$db][$table];\n\t}\n}", "private function getDbIndexes()\n\t{\n\t\t$r = $this->source->query(\"SHOW INDEXES FROM `{$this->table}`\");\n\t\treturn $r;\n\t}", "public static function createAllTableIndexes()\n {\n $result = true;\n \n // tdo_lists\n// if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_list_deleted_index on tdo_lists(deleted)\") == false)\n// $result = false;\n \n // tdo_list_memberships\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_list_membership_userid_index on tdo_list_memberships(userid(10))\") == false)\n $result = false;\n\n // tdo_user_sessions\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_user_sessions_userid_index on tdo_user_sessions(userid(10))\") == false)\n $result = false;\n\n \n // tdo_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_listid_index on tdo_tasks(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_parentid_index on tdo_tasks(parentid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_duedate_index on tdo_tasks(duedate)\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tasks_timestamp_index on tdo_tasks(timestamp)\") == false)\n $result = false;\n\n \n //tdo_completed_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_listid_index on tdo_completed_tasks(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_parentid_index on tdo_completed_tasks(parentid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_completiondate_index on tdo_completed_tasks(completiondate)\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_completed_tasks_timestamp_index on tdo_completed_tasks(timestamp)\") == false)\n $result = false;\n\n \n //tdo_deleted_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_deleted_tasks_listid_index on tdo_deleted_tasks(listid(10))\") == false)\n $result = false;\n\t\t\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_deleted_tasks_parentid_index on tdo_deleted_tasks(parentid(10))\") == false)\n $result = false;\n\n \n //tdo_archived_tasks\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_tasks_listid_index on tdo_archived_tasks(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_tasks_timestamp_index on tdo_archived_tasks(timestamp)\") == false)\n $result = false;\n\n \n // tdo_taskitos\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_taskitos_parentid_index on tdo_taskitos(parentid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_taskitos_timestamp_index on tdo_taskitos(timestamp)\") == false)\n $result = false;\n\n // tdo_archived_taskitos\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_taskitos_parentid_index on tdo_archived_taskitos(parentid(10))\") == false)\n $result = false;\n \n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_archived_taskitos_timestamp_index on tdo_archived_taskitos(timestamp)\") == false)\n $result = false;\n \n // tdo_tag_assignments\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_tag_assignments_taskid_index on tdo_tag_assignments(taskid(10))\") == false)\n $result = false;\n \n // tdo_contexts\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_contexts_context_timestamp_index on tdo_contexts(context_timestamp)\") == false)\n $result = false;\n\n // tdo_context_assignments\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_context_assignments_userid_index on tdo_context_assignments(userid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_context_assignments_taskid_index on tdo_context_assignments(taskid(10))\") == false)\n $result = false;\n\n // tdo_comments\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_comments_itemid_index on tdo_comments(itemid(10))\") == false)\n $result = false;\n \n // tdo_task_notifications\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_task_notifications_taskid_index on tdo_task_notifications(taskid(10))\") == false)\n $result = false;\n\n // tdo_change_log\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_change_log_listid_index on tdo_change_log(listid(10))\") == false)\n $result = false;\n\n if(TDOTableManager::createGenericIndex(\"CREATE INDEX tdo_change_log_itemid_index on tdo_change_log(itemid(10))\") == false)\n $result = false;\n \n return $result;\n }", "public function getIndexes()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW INDEX FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "public function getIndexes()\n {\n\treturn $this->indexes;\n }", "public function buildIndex();", "public function _INDEX()\n\t{\n\t\t\n\t}", "public function getIndexes()\n {\n return $this->indexes;\n }", "function masterAllIndexes() {\n $this->db_master->executeSQL(\"SELECT \" . $this->idx_master . \" from \" . $this->db_master->database . \".\" . $this->table_master);\n }", "public function getAllIndexes() {\n return array_merge(\n [ $this->primaryKeys, ],\n $this->uniqueKeys,\n $this->indexes\n );\n }", "function getIndexes($table) {\n return mysql_query(sprintf('SHOW INDEX FROM %s', $table));\n }", "private function __createIndex() {\n $lock_file = $this->getTmpPath('lock.dat');\n\n if (file_exists($lock_file)) return false;\n file_put_contents($lock_file, '');\n\n\n\t\tif (function_exists('ignore_user_abort'))\n\t\t\tignore_user_abort();\n\t\tif (function_exists('set_time_limit'))\n\t\t\tset_time_limit(180);\n\n\n\t\t$this->Model->truncateTable();\n\t\tforeach ($this->tables as $table) {\n\t\t\t$className = $this->Register['ModManager']->getModelNameFromModule($table);\n\t\t\t$Model = new $className;\n\t\t\t\n\t\t\tfor ($i = 1; $i < 10000; $i++) {\n\t\t\t\t$records = $Model->getCollection(array(), array('limit' => 100, 'page' => $i));\n\t\t\t\tif (empty($records)) break;\n\n\n\t\t\t\tif (count($records) && is_array($records)) {\n\t\t\t\t\tforeach ($records as $rec) {\n\n\t\t\t\t\t\tswitch ($table) {\n\t\t\t\t\t\t\tcase 'news':\n\t\t\t\t\t\t\tcase 'stat':\n\t\t\t\t\t\t\tcase 'loads':\n\t\t\t\t\t\t\t\t$text = $rec->getTitle() . ' ' . $rec->getMain() . ' ' . $rec->getTags();\n\t\t\t\t\t\t\t\tif (mb_strlen($text) < $this->minInputStr || !is_string($text))\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$entity_view = '/view/';\n\t\t\t\t\t\t\t\t$module = $table;\n\t\t\t\t\t\t\t\t$entity_id = $rec->getId();\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'posts':\n\t\t\t\t\t\t\t\t$text = $rec->getMessage();\n\t\t\t\t\t\t\t\t$entity_view = '/view_theme/';\n\t\t\t\t\t\t\t\t$module = 'forum';\n\t\t\t\t\t\t\t\t$entity_id = $rec->getId_theme();\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'themes':\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$text = $rec->gettitle() . ' ' . $rec->getMain() . ' ' . $rec->getTags();\n\t\t\t\t\t\t\t\tif (mb_strlen($text) < $this->minInputStr || !is_string($text))\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$entity_view = '/view/';\n\t\t\t\t\t\t\t\t$module = $table;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t//we must update record if an exists\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'index' => $text,\n\t\t\t\t\t\t\t'entity_id' => $entity_id,\n\t\t\t\t\t\t\t'entity_title' => $rec->getTitle(),\n\t\t\t\t\t\t\t'entity_table' => $table,\n\t\t\t\t\t\t\t'entity_view' => $entity_view,\n\t\t\t\t\t\t\t'module' => $module,\n\t\t\t\t\t\t\t'date' => new Expr('NOW()'),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$entity = new SearchEntity($data);\n\t\t\t\t\t\t$entity->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n unlink($lock_file);\n\t}", "function slaveAllIndexes() {\n $this->db_slave->executeSQL(\"SELECT \" . $this->idx_slave . \" from \" . $this->db_slave->database . \".\" . $this->table_slave);\n }", "public function getIndexList() {\n return self::$indexes;\n }", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "function initIndexing(PDO $db) {\n\n // delete everything before reset indexing\n $dir = opendir($this->path);\n while($file = readdir($dir)) {\n if($file != \".\" && $file!=\"..\" && $file != \"indexing\" && $file!=\"dbfastcache\" && file_exists($this->path.DIRECTORY_SEPARATOR.$file)) {\n @unlink($this->path.DIRECTORY_SEPARATOR.$file);\n clearstatcache(TRUE, $this->path.DIRECTORY_SEPARATOR.$file);\n }\n }\n $db->exec('drop table if exists \"balancing\"');\n $db->exec('CREATE TABLE \"balancing\" (\"keyword\" VARCHAR PRIMARY KEY NOT NULL UNIQUE, \"db\" INTEGER)');\n $db->exec('CREATE INDEX \"db\" ON \"balancing\" (\"db\")');\n $db->exec('CREATE UNIQUE INDEX \"lookup\" ON \"balacing\" (\"keyword\")');\n }", "public function indexes()\n {\n return array_merge(parent::indexes(), array(\n 'userId' => array(\n 'key' => array(\n 'userId' => \\EMongoCriteria::SORT_ASC,\n ),\n 'unique' => true,\n ),\n ));\n }", "public function indexes()\n {\n if (isset($this->options['indexes'])) {\n return array_intersect_key(static::$indexes, $this->options['indexes']);\n }\n return static::$indexes;\n }", "public function getModelIndexes($model)\n {\n\treturn $this->query('select [name] from [indexes] where [table] = %s', $model->getTableName() );\n }", "public function enableIndexing()\n {\n $this->setConfig('autoIndex', true);\n }", "public function indexes()\n {\n return CMap::mergeArray(parent::indexes(), array(\n 'points' => array(\n // key array holds list of fields for index\n // you may define multiple keys for index and multikey indexes\n // each key must have a sorting direction SORT_ASC or SORT_DESC\n 'key' => array(\n 'points.location' => CMongoCriteria::INDEX_2D,\n ),\n ),\n ));\n }", "function index($model) {\n\t\t$index = array();\n\t\t$table = $this->fullTableName($model);\n\t\tif ($table) {\n\t\t\t$indexes = $this->query('SHOW INDEX FROM ' . $table);\n\t\t\tif (isset($indexes[0]['STATISTICS'])) {\n\t\t\t\t$keys = Set::extract($indexes, '{n}.STATISTICS');\n\t\t\t} else {\n\t\t\t\t$keys = Set::extract($indexes, '{n}.0');\n\t\t\t}\n\t\t\tforeach ($keys as $i => $key) {\n\t\t\t\tif (!isset($index[$key['Key_name']])) {\n\t\t\t\t\t$col = array();\n\t\t\t\t\t$index[$key['Key_name']]['column'] = $key['Column_name'];\n\t\t\t\t\t$index[$key['Key_name']]['unique'] = intval($key['Non_unique'] == 0);\n\t\t\t\t} else {\n\t\t\t\t\tif (!is_array($index[$key['Key_name']]['column'])) {\n\t\t\t\t\t\t$col[] = $index[$key['Key_name']]['column'];\n\t\t\t\t\t}\n\t\t\t\t\t$col[] = $key['Column_name'];\n\t\t\t\t\t$index[$key['Key_name']]['column'] = $col;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $index;\n\t}", "public function get_indexes($table)\n\t{\n\t\treturn $this->driver_query($this->sql->index_list($this->prefix_table($table)), FALSE);\n\t}", "public function describeIndexes($table, $schema=null){ }", "public function optimizeIndex()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n $this->index->optimize();\n }", "function &getIndexes(){\n\t\treturn array();\n\t}", "public function checkTableIndex(){\n\t\t$db = $this->db;\n\t\t\n\t\t$sql = \"SELECT * FROM dataset WHERE table_num <= 1\";\n\t\t\n\t\t$result = $db->fetchAll($sql, 2);\n\t\t\n\t\tforeach($result AS $row){\n\t\t\t$cacheID = $row[\"cache_id\"];\n\t\t\t$tableId = OpenContext_TableOutput::tableID_toURL($cacheID);\n\t\t\t$noid = $row[\"noid\"];\n\t\t\t$created = $row[\"created_on\"];\n\t\t\t\n\t\t\tif(!stristr($tableId, \"http://\")){\n\t\t\t\t$host = OpenContext_OCConfig::get_host_config();\n\t\t\t\t$tableId = $host.\"/tables/\".$tableId;\n\t\t\t}\n\t\t\t\n\t\t\t$sql = \"SELECT * FROM noid_bindings WHERE itemUUID = '$cacheID' LIMIT 1\";\n\t\t\t$resultB = $db->fetchAll($sql, 2);\n\t\t\t\n\t\t\tif(!$resultB){\n\t\t\t\t$data = array(\"noid\" => $noid,\n\t\t\t\t\t\t\t \"itemType\" => \"table\",\n\t\t\t\t\t\t\t \"itemUUID\" => $cacheID,\n\t\t\t\t\t\t\t \"itemURI\" => $tableId,\n\t\t\t\t\t\t\t \"public\" => 0,\n\t\t\t\t\t\t\t \"solr_indexed\" => 0\n\t\t\t\t\t\t\t );\n\t\t\t\t$db->insert(\"noid_bindings\", $data);\n\t\t\t}\n\t\t\t\n\t\t}//end loop\n\t\n\t}", "abstract protected function getIndexTableFields();", "protected function setUpIndex()\n {\n $this->getOldTable()->createColumn('foo', Type::STRING, array('length' => 50));\n $this->getOldTable()->createColumn('bar', Type::STRING, array('length' => 50));\n\n $this->getOldTable()->createIndex(array('foo'), false, 'idx_foo');\n\n $this->createOldTable();\n }", "public function indexes($table, $like = '') {\n\t\t$builder = DB_SQL::select($this->data_source)\n\t\t\t->column('t1.NAME', 'schema')\n\t\t\t->column('t0.NAME', 'table')\n\t\t\t->column('t2.NAME', 'index')\n\t\t\t->column('t4.NAME', 'column')\n\t\t\t->column('t3.KEY_ORDINAL', 'seq_index')\n\t\t\t->column('t2.IS_PRIMARY_KEY', 'primary')\n\t\t\t->column('t2.IS_UNIQUE', 'unique')\n\t\t\t->from('SYS.TABLES', 't0')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, 'SYS.SCHEMAS', 't1')\n\t\t\t->on('t1.SCHEMA_ID', DB_SQL_Operator::_EQUAL_TO_, 't0.SCHEMA_ID')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, 'SYS.INDEXES', 't2')\n\t\t\t->on('t2.OBJECT_ID', DB_SQL_Operator::_EQUAL_TO_, 't0.OBJECT_ID')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, 'SYS.INDEX_COLUMNS', 't3')\n\t\t\t->on('t3.OBJECT_ID', DB_SQL_Operator::_EQUAL_TO_, 't0.OBJECT_ID')\n\t\t\t->on('t3.INDEX_ID', DB_SQL_Operator::_EQUAL_TO_, 't2.INDEX_ID')\n\t\t\t->join(DB_SQL_JoinType::_LEFT_, 'SYS.COLUMNS', 't4')\n\t\t\t->on('t4.OBJECT_ID', DB_SQL_Operator::_EQUAL_TO_, 't0.OBJECT_ID')\n\t\t\t->on('t4.COLUMN_ID', DB_SQL_Operator::_EQUAL_TO_, 't3.COLUMN_ID')\n\t\t\t->where('t0.NAME', DB_SQL_Operator::_EQUAL_TO_, $table)\n\t\t\t->where('t2.IS_DISABLED', DB_SQL_Operator::_EQUAL_TO_, 0)\n\t\t\t->order_by(DB_SQL::expr('UPPER([t1].[NAME])'))\n\t\t\t->order_by(DB_SQL::expr('UPPER([t0].[NAME])'))\n\t\t\t->order_by(DB_SQL::expr('UPPER([t2].[NAME])'))\n\t\t\t->order_by('t3.KEY_ORDINAL');\n\n\t\tif ( ! empty($like)) {\n\t\t\t$builder->where('t2.NAME', DB_SQL_Operator::_LIKE_, $like);\n\t\t}\n\n\t\treturn $builder->query();\n\t}", "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }", "public function import()\n {\n $this->initializeApplication();\n\n if ($this->alwaysRefreshIndex) {\n $this->deleteIndices();\n }\n\n if (!$this->indicesExist()) {\n $import = $this->getImport();\n $import->doImport($this->indexPrefix, null, $this->logger);\n }\n\n $this->destroyApplication();\n }", "protected function getTableIndexes(Connection $connection, $table, &$definition) {\n // Note, this query doesn't support ordering, so that is worked around\n // below by keying the array on Seq_in_index.\n $query = $connection->query(\"SHOW INDEX FROM {\" . $table . \"}\");\n while (($row = $query->fetchAssoc()) !== FALSE) {\n $index_name = $row['Key_name'];\n $column = $row['Column_name'];\n // Key the arrays by the index sequence for proper ordering (start at 0).\n $order = $row['Seq_in_index'] - 1;\n\n // If specified, add length to the index.\n if ($row['Sub_part']) {\n $column = [$column, $row['Sub_part']];\n }\n\n if ($index_name === 'PRIMARY') {\n $definition['primary key'][$order] = $column;\n }\n elseif ($row['Non_unique'] == 0) {\n $definition['unique keys'][$index_name][$order] = $column;\n }\n else {\n $definition['indexes'][$index_name][$order] = $column;\n }\n }\n }", "function getElasticSearchIndexes() {\n\n return 'pdb'.',' . 'geo'.',' . 'dbgap' .','. 'lincs' .','. 'arrayexpress'.','. 'gemma'.',' . 'sra'.','.'bioproject' .','.'clinicaltrials'.',' . 'dryad' .','\n .'cvrg'.','.'dataverse' .','.'neuromorpho'.','.'peptideatlas'.','.'ctn'.','.'cia'.','.'mpd'.','.'niddkcr'.','.'physiobank'.','.'proteomexchange'.','.'openfmri'.','.'nursadatasets'.','\n .'yped'.','.'cil'.','.'icpsr'.','.'gdc'.','.'bmrb'.','.'swissprot'.','.'clinvar'.','.'retina'.','.'emdb'.','.'epigenomics'.','.'nitrcir'.','.'neurovaultatlases'.','.'neurovaultcols'.','\n .'neurovaultnidm'.','.'rgd'.','.'datacitebgi'.','.'datacitemorphobank'.','.'vectorbase'.','.'datacitegnd'.','.'datacitepeerj'.','.'datacitezenodo'.','.'omicsdi'.','.'datacitesbgrid'\n .','.'simtk'.','.'datacitecxidb'.','.'datacitebils'.','.'dataciteada'.','.'dataciteukda'.','.'dataciteadaptive'.','.'datacitemit'.','.'datacitectsi'.','.'datacitefdz'\n .','.'datacitembf'.','.'datacitenimh'.','.'datacitejhu'.','.'datacitecandi'.','.'datacitelshtm'.','.'datacitedatabrary'.','.'immport'.','.'datacitesdscsg'.','.'datacitecrcns'\n .','.'nsrr'.','.'lsdb'.','.'naturedata'.','.'genenetwork'.','.'ndarpapers'.','.'datacitethieme'.','.'datacitefigshare'.','.'dataciteccdc'.','.'wormbase'.','.'gtexldacc'.','.'metabolomics';\n\n}", "public function getIndexNodes(): array\n {\n return $this->organize()->indexes;\n }", "public static function load_battle_index(){\n\n // Otherwise, continue normally\n global $db;\n\n // Create the index as an empty array\n $db->INDEX['BATTLES'] = array();\n\n // Default the battles index to an empty array\n $mmrpg_battles_index = array();\n\n // Define the cache file name and path given everything we've learned\n $cache_file_name = 'cache.battles.json';\n $cache_file_path = MMRPG_CONFIG_CACHE_PATH.'indexes/'.$cache_file_name;\n // Check to see if a file already exists and collect its last-modified date\n if (file_exists($cache_file_path)){ $cache_file_exists = true; $cache_file_date = date('Ymd-Hi', filemtime($cache_file_path)); }\n else { $cache_file_exists = false; $cache_file_date = '00000000-0000'; }\n\n // LOAD FROM CACHE if data exists and is current, otherwise continue so index can refresh and replace\n if (MMRPG_CONFIG_CACHE_INDEXES && $cache_file_exists && $cache_file_date >= MMRPG_CONFIG_CACHE_DATE){\n\n // Pull the battle index markup from the JSON file and decompress\n $cache_file_markup = file_get_contents($cache_file_path);\n $mmrpg_battles_index = json_decode($cache_file_markup, true);\n\n } else {\n\n // Indexing the battle data files and collect the generated markup\n $mmrpg_battles_index = rpg_battle::index_battle_data(false);\n $battles_cache_markup = json_encode($mmrpg_battles_index);\n\n // Write the index to a cache file, if caching is enabled\n if (MMRPG_CONFIG_CACHE_INDEXES === true){\n // Write the index to a cache file, if caching is enabled\n $this_cache_file = fopen($cache_file_path, 'w');\n fwrite($this_cache_file, $battles_cache_markup);\n fclose($this_cache_file);\n }\n\n }\n\n // Loop through the battles and index them after serializing\n foreach ($mmrpg_battles_index AS $token => $array){ $db->INDEX['BATTLES'][$token] = json_encode($array); }\n $db->INDEX['BATTLES_RAW'] = $db->INDEX['BATTLES'];\n\n // Additionally, include any dynamic session-based battles\n if (!empty($_SESSION['GAME']['values']['battle_index'])){\n // The session-based battles exist, so merge them with the index\n $db->INDEX['BATTLES'] = array_merge($db->INDEX['BATTLES'], $_SESSION['GAME']['values']['battle_index']);\n }\n\n // Return true on success\n return true;\n\n }", "function &getTableIndexList($moduleID)\n{\n $mdb2 =& GetMDB2();\n $mdb2->loadModule('Manager');\n $mdb2->loadModule('Reverse', null, true);\n\n //get both table constraints and indexes\n static $indexes = array();\n\n if(!isset($indexes[$moduleID])){\n //unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableConstraints($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n $temp_indexes = array();\n foreach($temp_raw_indexes as $index_name){\n //if('PRIMARY' != $index_name){\n $temp_indexes[$index_name] = true;\n //}\n }\n\n //non-unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableIndexes($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n foreach($temp_raw_indexes as $index_name){\n $temp_indexes[$index_name] = false;\n }\n\n $indexes[$moduleID] = $temp_indexes;\n }\n\n return $indexes[$moduleID];\n}", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }", "public function getIndexes(string $entity): array;", "public function enable_tab_indexes( $enable = true ) {\n\t\t\n\t\t$this->render_tab_indexes = $enable;\n\t\t\n\t}", "abstract protected function makeIndex(string $table, DoctrineDBALIndex $index): Index;", "public function createIndex(): void;", "public function loadClassMetadata(LoadClassMetadataEventArgs $args): void\n\t{\n\t\t$classMetadata = $args->getClassMetadata();\n\n\t\tif (($reflectionClass = $classMetadata->getReflectionClass()) === null ||\n\t\t\t!$reflectionClass->implementsInterface(SlugInterface::class)\n\t\t)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$name = 'IDX_SLUG';\n\n\t\tif (!(isset($classMetadata->table['indexes'][$name])))\n\t\t{\n\t\t\t$classMetadata->table['indexes'][$name] = [\n\t\t\t\t'columns' => [\n\t\t\t\t\t'slug'\n\t\t\t\t]\n\t\t\t];\n\t\t}\n\t}", "public function findIndexes(string $tableName): array\n {\n $tableName = Craft::$app->getDb()->getSchema()->getRawTableName($tableName);\n $table = Craft::$app->getDb()->getSchema()->getTableSchema($tableName);\n $indexes = [];\n\n $rows = $this->getIndexInformation($table);\n\n foreach ($rows as $row) {\n $column = $row['columnname'];\n\n if (!empty($column) && $column[0] === '\"') {\n // postgres will quote names that are not lowercase-only\n // https://github.com/yiisoft/yii2/issues/10613\n $column = substr($column, 1, -1);\n }\n\n $indexes[$row['indexname']]['columns'][] = $column;\n $indexes[$row['indexname']]['unique'] = (bool)$row['isunique'];\n }\n\n return $indexes;\n }", "protected function getIndexes() {\n $server_indices = array();\n $indices = search_api_index_load_multiple(FALSE);\n foreach ($indices as $index) {\n if ($index->server == $this->server->machine_name) {\n $server_indices[] = $index;\n }\n }\n return $server_indices;\n }", "public function loadDataFiles($path, $index, $type);", "function create_index()\n\t{\n\t\tinclude_once(dirname(__FILE__) . '/../../include/class/adodb/adodb.inc.php');\n\t\t$conn = &ADONewConnection($_SESSION['db_type']);\n\t\t$conn->PConnect($_SESSION['db_server'], $_SESSION['db_user'], $_SESSION['db_password'], $_SESSION['db_database']);\n\t\t$config['table_prefix'] = $_SESSION['table_prefix'] . $_SESSION['or_install_lang'] . '_';\n\t\t$config['table_prefix_no_lang'] = $_SESSION['table_prefix'];\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_user_name ON \" . $config['table_prefix'] . \"userdb (userdb_user_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_active ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_active);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_user ON \" . $config['table_prefix'] . \"listingsdb (userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_name ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_name);\";\n\t\t// CHANGED: blob or text fields can only index a max of 255 (mysql) and you have to specify\n\t\tif ($_SESSION['db_type'] == 'mysql') {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_value ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_value(255));\";\n\t\t}else {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_value ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_value);\";\n\t\t}\n\t\t$sql_insert[] = \"CREATE INDEX idx_images_listing_id ON \" . $config['table_prefix'] . \"listingsimages (listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_searchable ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_searchable);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_mlsexport ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_mlsexport);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_listing_id ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_field_type ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_field_type);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_browse ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_display_on_browse);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_field_name ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_field_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_rank ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_search_rank ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_search_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_images_rank ON \" . $config['table_prefix'] . \"listingsimages (listingsimages_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_forgot_email ON \" . $config['table_prefix_no_lang'] . \"forgot (forgot_email);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_classformelements_class_id ON \" . $config['table_prefix_no_lang'] . \"classformelements (class_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classformelements_listingsformelements_id ON \" . $config['table_prefix_no_lang'] . \"classformelements (listingsformelements_id);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_classlistingsdb_class_id ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (class_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classlistingsdb_listingsdb_id ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (listingsdb_id);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_class_rank ON \" . $config['table_prefix'] . \"class (class_rank);\";\n\t\t//Add indexes for userdbelements tables\n\t\t// CHANGED: blob or text fields can only index a max of 255 (mysql) and you have to specify\n\t\tif ($_SESSION['db_type'] == 'mysql') {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_value ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_value(255));\";\n\t\t}else {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_value ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_value);\";\n\t\t}\n\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_name ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_userdb_userid ON \" . $config['table_prefix'] . \"userdbelements (userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_listfieldmashup ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_id ,listingsdb_active,userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_fieldmashup ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_name,listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classfieldmashup ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (listingsdb_id ,class_id);\";\n\t\t// ADDED foreach to run through array with errorchecking to see if something went wrong\n\t\twhile (list($elementIndexValue, $elementContents) = each($sql_insert)) {\n\t\t\t$recordSet = $conn->Execute($elementContents);\n\t\t\tif ($recordSet === false) {\n\t\t\t\tif ($_SESSION['devel_mode'] == 'no') {\n\t\t\t\t\tdie (\"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\");\n\t\t\t\t}else {\n\t\t\t\t\techo \"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo 'Indexes Created<br />';\n\t}", "public function listIndexes() : array\n {\n // see here:\n // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html\n\n $url = $this->getHostUrlString() . '/_stats';\n $request = new \\GuzzleHttp\\Psr7\\Request('GET', $url);\n $response = $this->sendWithCredentials($request);\n\n $httpcode = $response->getStatusCode();\n $result = (string)$response->getBody();\n if ($httpcode < 200 || $httpcode > 299)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::READ_FAILED);\n\n $result = json_decode($result, true);\n\n $indexes = [];\n\n if (isset($result['indices']))\n {\n $indices = $result['indices'];\n foreach ($indices as $index_name => $index_info)\n {\n // only show indices that aren't hidden\n //if (substr($index_name, 0, 1) === '.')\n // continue;\n\n // TODO: include other information from the stats\n $indexes[] = array('name' => $index_name,\n 'path' => '/' . $index_name,\n 'size' => null,\n 'modified' => null,\n 'hash' => '', // TODO: available?\n 'type' => 'FILE');\n }\n }\n\n return $indexes;\n }", "abstract public function loadAll();", "public function buildIndexes() {\n\t\t$return = array();\n\t\t$indexes = array(\n\t\t\t\"work\" => __DIR__.'/../content/work',\n\t\t\t\"authors\" => __DIR__.'/../content/authors',\n\t\t\t\"tags\" => __DIR__.'/../content/tags'\n\t\t);\n\t\tforeach ($indexes as $type => $location) {\n\t\t\tforeach(glob($location . '/*.json') as $file) {\n\t\t\t\t$entry = json_decode(file_get_contents($file),true);\n\t\t\t\tif ($entry) {\n\t\t\t\t\t$key = str_replace(array('.json',$location.'/'),'',$file);\n\t\t\t\t\t$return[$type][$key] = $entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// move author details\n\t\t$details = $return['authors'];\n\t\tunset($return['authors']);\n\t\t$return['authors']['details'] = $details;\n\n\t\t// add author details and permalink to work\n\t\tforeach ($return['work'] as $key => &$entry) {\n\t\t\t$entry['permalink'] = $this->root_url . '/view/' . $entry['id'];\n\t\t\tif (is_array($return['authors']['details'][$entry['author_id']])) {\n\t\t\t\t$entry['author_name'] = $return['authors']['details'][$entry['author_id']]['name'];\n\t\t\t\t$entry['author_byline'] = $return['authors']['details'][$entry['author_id']]['byline'];\n\t\t\t}\n\t\t}\n\n\t\t// sort work to newest-first\n\t\tuasort($return['work'], array(\"Harvard\", \"sortIndex\"));\n\n\t\t// do tag stuff\n\t\t$details = $return['tags'];\n\t\tunset($return['tags']);\n\t\t$return['tags']['details'] = $details;\n\t\t$tag_list = array();\n\t\t$tag_index = array();\n\t\t$author_index = array();\n\t\tif (is_array($return['work'])) {\n\t\t\tforeach ($return['work'] as $work) {\n\t\t\t\t$author_index[$work['author_id']][] = $work['id'];\n\t\t\t\tif (is_array($work['tags'])) {\n\t\t\t\t\tif (count($work['tags'])) {\n\t\t\t\t\t\tforeach ($work['tags'] as $tag) {\n\t\t\t\t\t\t\t$tag_index[$tag][] = $work['id'];\n\t\t\t\t\t\t\t$tag_list[] = $tag;\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$tag_list = array_unique($tag_list); // trim tags to unique\n\t\tsort($tag_list); // alphabetize\n\n\t\t// format the tag list for mustache iteration\n\t\t$tmp_array = array();\n\t\tforeach ($tag_list as $tag) {\n\t\t\t$tmp_array[]['tag'] = $tag;\n\t\t}\n\t\t$tag_list = $tmp_array;\n\n\t\t$return['tags']['count'] = count($tag_list);\n\t\t$return['tags']['list'] = $tag_list;\n\t\t$return['tags']['index'] = $tag_index;\n\n\t\t$return['authors']['index'] = $author_index;\n\n\t\tforeach ($return as $type => $data) {\n\t\t\tfile_put_contents(__DIR__.'/../content/_generated_'.$type.'.json',json_encode($data));\n\t\t}\n\t\treturn $return;\n\t}", "public function collectionsWithIndexAttributeAreIndexed()\n {\n $entityWithIndexedRelation = new Fixtures\\EntityWithIndexedRelation();\n for ($i = 0; $i < 3; $i++) {\n $annotatedIdentitiesEntity = new Fixtures\\AnnotatedIdentitiesEntity();\n $annotatedIdentitiesEntity->setAuthor('Author' . ((string) $i));\n $annotatedIdentitiesEntity->setTitle('Author' . ((string) $i));\n $entityWithIndexedRelation->getAnnotatedIdentitiesEntities()->add($annotatedIdentitiesEntity);\n }\n\n $entityWithIndexedRelation->setRelatedIndexEntity('test', new Fixtures\\RelatedIndexEntity());\n\n $this->persistenceManager->add($entityWithIndexedRelation);\n $this->persistenceManager->persistAll();\n $id = $this->persistenceManager->getIdentifierByObject($entityWithIndexedRelation);\n\n // Reset persistence manager to make sure fresh instances will be created\n $this->persistenceManager->clearState();\n unset($entityWithIndexedRelation);\n\n $entityWithIndexedRelation = $this->persistenceManager->getObjectByIdentifier($id, Fixtures\\EntityWithIndexedRelation::class);\n for ($i = 0; $i < 3; $i++) {\n self::assertArrayHasKey('Author' . (string) $i, $entityWithIndexedRelation->getAnnotatedIdentitiesEntities());\n }\n self::assertArrayNotHasKey(0, $entityWithIndexedRelation->getAnnotatedIdentitiesEntities());\n\n self::assertArrayHasKey('test', $entityWithIndexedRelation->getRelatedIndexEntities());\n self::assertArrayNotHasKey(0, $entityWithIndexedRelation->getRelatedIndexEntities());\n self::assertInstanceOf(Fixtures\\RelatedIndexEntity::class, $entityWithIndexedRelation->getRelatedIndexEntities()->get('test'));\n }", "protected function addIndex()\n {\n $sitemapIndexHeader = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n . ($this->includeGeneratorInfo ? $this::$generatorInfo : '')\n . '<sitemapindex xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"'\n . ' xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9'\n . ' http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd\"'\n . ' xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">'\n . '</sitemapindex>';\n $this->indexes[] = [\n 'xml' => new \\SimpleXMLElement($sitemapIndexHeader),\n 'filename' => '',\n ];\n }", "public function getIndexes() \n {\n \n if (!count($this->indexes)) {\n /** \n * If a prefix has been set, use that with a wild card.\n * If a prefix has not been set use some wildcards while \n * diregarding elastic system indexes with \"-.*\"\n */\n return !strlen(config('scout.prefix')) ? '*,-.*' : config('scout.prefix') . '*';\n }\n return implode(',', $this->indexes);\n }", "public function getDeclaredIndexes($include_extra = FALSE) {\n $indexes = array(\n 'indexes' => isset($this->schema['indexes']) ? $this->schema['indexes'] : array(),\n 'unique keys' => isset($this->schema['unique keys']) ? $this->schema['unique keys'] : array(),\n );\n if ($include_extra) {\n /** @var ExtraIndex $index */\n foreach ($this->getExtraIndexes() as $index) {\n $type = $index->getType() == 'UNIQUE' ? 'unique keys' : 'indexes';\n $indexes[$type][$index->getIndexName()] = $index->getSchema();\n }\n }\n return $indexes;\n }", "public function index(IndexableEntity $entity);", "private function _createSearchIndexTable()\n\t{\n\t\tCraft::log('Creating the searchindex table.');\n\n\t\t// Taking the scenic route here so we can get to MysqlSchema's $engine argument\n\t\t$table = craft()->db->addTablePrefix('searchindex');\n\n\t\t$columns = array(\n\t\t\t'elementId' => DbHelper::generateColumnDefinition(array('column' => ColumnType::Int, 'null' => false)),\n\t\t\t'attribute' => DbHelper::generateColumnDefinition(array('column' => ColumnType::Varchar, 'maxLength' => 25, 'null' => false)),\n\t\t\t'fieldId' => DbHelper::generateColumnDefinition(array('column' => ColumnType::Int, 'null' => false)),\n\t\t\t'locale' => DbHelper::generateColumnDefinition(array('column' => ColumnType::Locale, 'null' => false)),\n\t\t\t'keywords' => DbHelper::generateColumnDefinition(array('column' => ColumnType::Text, 'null' => false)),\n\t\t);\n\n\t\tcraft()->db->createCommand()->setText(craft()->db->getSchema()->createTable($table, $columns, null, 'MyISAM'))->execute();\n\n\t\t// Give it a composite primary key\n\t\tcraft()->db->createCommand()->addPrimaryKey('searchindex', 'elementId,attribute,fieldId,locale');\n\n\t\t// Add the FULLTEXT index on `keywords`\n\t\tcraft()->db->createCommand()->setText('CREATE FULLTEXT INDEX ' .\n\t\t\tcraft()->db->quoteTableName(craft()->db->getIndexName('searchindex', 'keywords')).' ON ' .\n\t\t\tcraft()->db->quoteTableName($table).' ' .\n\t\t\t'('.craft()->db->quoteColumnName('keywords').')'\n\t\t)->execute();\n\n\t\tCraft::log('Finished creating the searchindex table.');\n\t}", "protected function loadKeys($connection)\n {\n $constraintResult = $connection->executeS('\n SELECT t.TABLE_NAME, t.CONSTRAINT_TYPE, t.CONSTRAINT_NAME\n FROM information_schema.TABLE_CONSTRAINTS t\n WHERE t.TABLE_SCHEMA = ' . $this->database . $this->addTablesRestriction('t')\n );\n $constraints = [];\n foreach ($constraintResult as $row) {\n $key = $row['TABLE_NAME'] .'|' . $row['CONSTRAINT_NAME'];\n if (isset($constraints[$key])) {\n throw new PrestaShopException('Duplicate constraint ' . $key);\n }\n $constraints[$key] = $row['CONSTRAINT_TYPE'];\n }\n\n $keys = $connection->executeS('\n SELECT s.TABLE_NAME, s.INDEX_NAME, s.COLUMN_NAME, s.SUB_PART\n FROM information_schema.STATISTICS s\n WHERE s.TABLE_SCHEMA = ' . $this->database . $this->addTablesRestriction('s') . '\n ORDER BY s.TABLE_NAME, s.INDEX_NAME, s.SEQ_IN_INDEX'\n );\n foreach ($keys as $row) {\n $tableName = $row['TABLE_NAME'];\n $keyName = $row['INDEX_NAME'];\n $table = $this->schema->getTable($tableName);\n $key = $table->getKey($keyName);\n if (! $key) {\n $constraintKey = $tableName . '|' . $keyName;\n $constraintType = isset($constraints[$constraintKey]) ? $constraints[$constraintKey] : null;\n $key = new TableKey($this->getKeyType($constraintType), $keyName);\n $table->addKey($key);\n }\n $key->addColumn($row['COLUMN_NAME'], $row['SUB_PART']);\n }\n }", "static public function addNewIndexes(Adapter $db, TableDef $tableDef) {\n $indexDef = $tableDef->getDbIndexes();\n $tableName = $tableDef->getName();\n $tableSchema = $tableDef->getSchema();\n\n $newIndexes = [];\n foreach ($indexDef as $index) {\n $newIndexes[$index->getName()] = $index;\n }\n\n $myIndexes = [];\n $current = $db->describeIndexes($tableName, $tableSchema);\n foreach ($current as $index) {\n $myIndexes[$index->getName()] = $index;\n }\n\n foreach ($indexDef as $newIndex) {\n $newIndexName = $newIndex->getName();\n\n if (!isset($myIndexes[$newIndexName])) {\n if ($newIndexName == 'PRIMARY') {\n $db->addPrimaryKey($tableName, $tableSchema, $newIndex);\n } else {\n $db->addIndex($tableName, $tableSchema, $newIndex);\n }\n }\n }\n }", "public function run()\n {\n DB::table('tyre_load_indices')->insert([\n 'index' => '144', 'load' => 2800\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '145', 'load' => 2900\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '146', 'load' => 3000\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '147', 'load' => 3075\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '148', 'load' => 3150\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '149', 'load' => 3250\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '150', 'load' => 3350\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '151', 'load' => 3450\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '152', 'load' => 3550\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '153', 'load' => 3650\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '154', 'load' => 3750\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '155', 'load' => 3875\n ]);\n DB::table('tyre_load_indices')->insert([\n 'index' => '156', 'load' => 4000\n ]);\n \n }", "public function getIndex();", "public function getIndex();", "public function getIndex();", "public function getIndexing(): array {\n\t\treturn $this->_indexing;\n\t}", "function loadIniFiles()\n {\n \n $ff = HTML_FlexyFramework::get();\n $ff->generateDataobjectsCache(true);\n $this->dburl = parse_url($ff->database);\n \n \n $dbini = 'ini_'. basename($this->dburl['path']);\n \n \n $iniCache = isset( $ff->PDO_DataObject) ? $ff->PDO_DataObject['schema_location'] : $ff->DB_DataObject[$dbini];\n if (!file_exists($iniCache)) {\n return;\n }\n \n $this->schema = parse_ini_file($iniCache, true);\n $this->links = parse_ini_file(preg_replace('/\\.ini$/', '.links.ini', $iniCache), true);\n \n\n \n }", "function indexInfo( $table, $index, $fname = __METHOD__ );", "private function getIndexes(string $table): array\n {\n $mappedIndexes = [];\n /** @var CubridSchema|MssqlSchema|MysqlSchema|OciSchema|PgsqlSchema|SqliteSchema $schema */\n $schema = $this->db->getSchema();\n\n foreach ($schema->getTableIndexes($table, true) as $index) {\n if ($index->isPrimary === false) {\n $mappedIndex = new Index();\n $mappedIndex->setName($index->name);\n $mappedIndex->setUnique($index->isUnique);\n $mappedIndex->setColumns($index->columnNames);\n\n $mappedIndexes[$index->name] = $mappedIndex;\n }\n }\n\n return $mappedIndexes;\n }", "function define_indexes()\n {\n\t\tif( !isset($this->input['st']) )\n\t\t{\n\t\t\t$this->input['st'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['t']) )\n\t\t{\n\t\t\t$this->input['t'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['p']) )\n\t\t{\n\t\t\t$this->input['p'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['pid']) )\n\t\t{\n\t\t\t$this->input['pid'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['gopid']) )\n\t\t{\n\t\t\t$this->input['gopid'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['L']) )\n\t\t{\n\t\t\t$this->input['L'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['f']) )\n\t\t{\n\t\t\t$this->input['f'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['cal_id']) )\n\t\t{\n\t\t\t$this->input['cal_id'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['code']) )\n\t\t{\n\t\t\t$this->input['code'] = '';\n\t\t}\n\t\t\n\t\tif( !isset($this->input['CODE']) )\n\t\t{\n\t\t\t$this->input['CODE'] = '';\n\t\t}\n\t}", "public function buildIndex()\n {\n // Build family trees for album/folder hierarchies.\n foreach ($this->albums as $album) {\n $is_orphan = true;\n foreach ($album->getParentIds() as $parentId) {\n if ($this->hasId($parentId)) {\n $is_orphan = false;\n $this->parent_children[$parentId][] = $album;\n $this->child_parents[$album->getId()] = $this->get($parentId);\n }\n if ($is_orphan) {\n $this->orphans[$album->getId()] = $album;\n }\n }\n }\n }", "public function getTableIndexes(string $table)\n {\n if(!\\adminer\\support('indexes'))\n {\n return null;\n }\n\n // From table.inc.php\n $indexes = \\adminer\\indexes($table);\n $main_actions = [\n 'create' => \\adminer\\lang('Alter indexes'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n \\adminer\\lang('Type'),\n \\adminer\\lang('Column'),\n ];\n\n $details = [];\n // From adminer.inc.php\n if(!$indexes)\n {\n $indexes = [];\n }\n foreach($indexes as $name => $index) {\n \\ksort($index['columns']); // enforce correct columns order\n $print = [];\n foreach($index['columns'] as $key => $val)\n {\n $value = '<i>' . \\adminer\\h($val) . '</i>';\n if(\\array_key_exists('lengths', $index) &&\n \\is_array($index['lengths']) &&\n \\array_key_exists($key, $index['lengths']))\n {\n $value .= '(' . $index['lengths'][$key] . ')';\n }\n if(\\array_key_exists('descs', $index) &&\n \\is_array($index['descs']) &&\n \\array_key_exists($key, $index['descs']))\n {\n $value .= ' DESC';\n }\n $print[] = $value;\n }\n $details[] = [\n 'name' => \\adminer\\h($name),\n 'type' => $index['type'],\n 'desc' => \\implode(', ', $print),\n ];\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "function getIndexInfo($table)\n {\n $query = 'SELECT ' .\n '(SELECT relname FROM pg_class WHERE oid=indexrelid) AS key_name, ' .\n '* FROM pg_index ' .\n 'WHERE indrelid=(SELECT oid FROM pg_class WHERE relname=\\'%s\\') ' .\n 'AND indisprimary=\\'f\\' AND indisunique=\\'f\\' ' .\n 'ORDER BY indrelid, indexrelid';\n $sql = sprintf($query, $table);\n return $this->fetchQueryData($sql);\n }", "public function describeIndexes( $table, $schema = null )\n\t{\n\n\t\t$indexes = [];\n $dialect = $this->_dialect;\n\n //Get the SQL to describe a table\n $sql = $dialect->describeIndexes($table, $schema);\n\n //Get the describe\n $describe = $this->fetchAll($sql, Db::FETCH_ASSOC);\n foreach ($describe as $index) {\n $keyName = $index[\"Key_name\"];\n $indexType = $index[\"Index_type\"];\n\n if (!isset($indexes[$keyName])) {\n $indexes[$keyName] = [];\n }\n\n if (!isset($indexes[$keyName][\"columns\"])) {\n $columns = [];\n\t\t\t} else {\n $columns = $indexes[$keyName][\"columns\"];\n\t\t\t}\n\n $columns[] = $index[\"Column_name\"];\n\t\t\t$indexes[$keyName][\"columns\"] = $columns;\n if ($keyName == \"PRIMARY\") {\n $indexes[$keyName][\"type\"] = \"PRIMARY\";\n\t\t\t} elseif ($indexType == \"FULLTEXT\") {\n $indexes[$keyName][\"type\"] = \"FULLTEXT\";\n\t\t\t} elseif ($index[\"Non_unique\"] == 0) {\n $indexes[$keyName][\"type\"] = \"UNIQUE\";\n\t\t\t} else {\n $indexes[$keyName][\"type\"] = null;\n\t\t\t}\n\n }\n $indexObjects = [];\n foreach ($indexes as $name => $value) {\n $indexObjects[$name] = new Index($name, $value[\"columns\"], $value[\"type\"]);\n\t\t}\n\t\treturn $indexObjects;\n\t}", "protected function dropIndexes()\n {\n echo \"Dropping indexes\\n\";\n /** @var TableMigration $table */\n foreach ($this->tables as $table) {\n $table->dropIndexes();\n }\n }", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getFileIndexRepository() {}", "protected function getIndex()\n\t{ \n /*\n $sm = $this->account->getServiceManager();\n $dbh = $sm->get(\"Db\");\n $this->dbh = $dbh;\n\t\treturn new \\Netric\\EntityQuery\\Index\\Pgsql($this->account, $dbh);\n * \n */\n $this->dbh = $this->account->getServiceManager()->get(\"Db\");\n return new \\Netric\\EntityQuery\\Index\\Pgsql($this->account);\n\t}", "public function getTableIndexes(string $name, bool $refresh = false): array\n {\n return $this->getTableMetadata($name, 'indexes', $refresh);\n }", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }", "public function addIndex($tableName, $schemaName, $index){ }", "public function reindexAll()\n {\n\n //@todo: indexers should be dynamically injected. Probable via `$this->getIndeces()`\n /** @var St_SphinxSearch_Model_Fulltext $fulltextIndex */\n $fulltextIndex = Mage::getModel('st_sphinxsearch/fulltext');\n\n $fulltextIndex->rebuildIndex();\n\n return;\n /** @var Mage_Core_Model_Resource $resourceSingleton */\n $resourceSingleton = Mage::getSingleton('core/resource');\n\n /** @var Varien_Db_Adapter_Interface $writeAdapater */\n $writeAdapater = $resourceSingleton->getConnection('core_write');\n\n /** @var Varien_Db_Adapter_Interface $readAdapter */\n $readAdapter = $resourceSingleton->getConnection('core_read');\n\n /** @var string $tableName */\n $tableName = $readAdapter->getTableName('st_sphinxsearch_fulltext_tmp');\n\n /** @var Mage_CatalogSearch_Model_Resource_Indexer_Fulltext $indexerFulltext */\n $indexerFulltext = Mage::getResourceModel('catalogsearch/indexer_fulltext');\n\n $fulltextTableName = $indexerFulltext->getTable('fulltext');\n\n $sql = \"CREATE TABLE IF NOT EXISTS `$tableName` LIKE `$fulltextTableName`\";\n\n $writeAdapater->query($sql);\n $t=1;\n }", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public static function getTableIndexes(DomElement $table)\n {\n $indexesTag = $table->getElementsByTagName('indexes')->item(0);\n $idx = array();\n\n if ($indexesTag !== NULL) {\n $indexes = $indexesTag->getElementsByTagName('index');\n foreach ($indexes as $index) {\n $current = array();\n $current['name'] = $index->getAttribute('name');\n $current['COLUMNS'] = array();\n\n $columns = $index->getElementsByTagName('column');\n foreach ($columns as $column) {\n $current['COLUMNS'][] = $column->nodeValue;\n }\n\n $idx[] = $current;\n }\n }\n\n return $idx;\n\n }", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}" ]
[ "0.71990836", "0.7036284", "0.69462615", "0.63912946", "0.6386377", "0.63234544", "0.6232588", "0.6178712", "0.61711293", "0.6169851", "0.61435425", "0.6134349", "0.6096153", "0.60655224", "0.6041068", "0.6023945", "0.5987166", "0.598426", "0.59827846", "0.5958947", "0.5956389", "0.5856067", "0.584234", "0.5770613", "0.57697046", "0.57695115", "0.5750634", "0.5723903", "0.5706157", "0.5689356", "0.5685477", "0.56809187", "0.56621546", "0.5628249", "0.55262303", "0.5516837", "0.54903466", "0.54892296", "0.54718864", "0.54528475", "0.5387537", "0.5386651", "0.5340882", "0.5322607", "0.53108156", "0.5304296", "0.529523", "0.5288423", "0.5287534", "0.5282494", "0.52765596", "0.5273279", "0.524848", "0.5239923", "0.5235849", "0.52357423", "0.5209684", "0.5209048", "0.51912606", "0.518764", "0.5162694", "0.5133927", "0.51324964", "0.5130676", "0.5128081", "0.5121707", "0.5104262", "0.5101738", "0.50964874", "0.50913614", "0.50913525", "0.50913525", "0.50913525", "0.5090256", "0.50791585", "0.50734067", "0.50618", "0.50613284", "0.50605327", "0.5056557", "0.5054958", "0.5054556", "0.50517744", "0.5033057", "0.5033057", "0.5031339", "0.5031339", "0.5031339", "0.5028284", "0.50224215", "0.5018007", "0.5012857", "0.49945024", "0.49904636", "0.49904636", "0.49904636", "0.49903315", "0.49899057", "0.49890003", "0.49890003" ]
0.5910412
21
Loads the primary key for this table.
protected function addPrimaryKey(Table $table) { $stmt = $this->dbh->query("SHOW KEYS FROM `" . $table->getName() . "`"); // Loop through the returned results, grouping the same key_name together // adding each column for that key. while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { // Skip any non-primary keys. if ($row['Key_name'] !== 'PRIMARY') { continue; } $name = $row["Column_name"]; $table->getColumn($name)->setPrimaryKey(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 }", "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 }", "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 PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}", "public function PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}", "public function primary_key()\n\t{\n\t\treturn $this->primary_key;\n\t}", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "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 static function primaryKey()\n {\n return static::PRIMARY_KEY;\n }", "protected function loadPrimaryKeys()\n {\n $identifier = $this->getTable()->getIdentifier();\n if (is_array($identifier))\n {\n foreach ($identifier as $_key)\n {\n $this->primaryKey[] = new sfDoctrineAdminColumn($_key);\n }\n } else {\n $this->primaryKey[] = new sfDoctrineAdminColumn($identifier);\n }\n\n if (!empty($this->primaryKeys))\n {\n throw new sfException('You cannot use the admin generator on a model which does not have any primary keys defined');\n }\n }", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "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 }", "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 }", "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 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 }", "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_activ' => $this->iid_activ, 'id_asignatura' => $this->iid_asignatura, 'id_nom' => $this->iid_nom);\n }\n return $this->aPrimary_key;\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 }", "abstract function getPrimaryKey();", "public function getPrimaryKey()\r\n\t{\r\n\t\treturn $this->primaryKey;\r\n\t}", "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 getPrimaryKey()\n {\n return $this->primaryKey;\n }", "public function primaryKey()\n {\n return $this->set('primary_key', true);\n }", "public static function primaryKey()\n {\n $obj = new PrimaryKey();\n $obj->type = 'int';\n $obj->size = 10;\n $obj->auto_increment = true;\n $obj->primary_key = true;\n\n return $obj;\n }", "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 function getPrimaryKey() {\n\t\treturn $this->_key_primary->name;\n\t}", "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 }", "public static function primaryKey() {\n return (new static)->getKeyName();\n }", "public function getPrimaryKey()\n {\n if ($this->_primaryKey === null) {\n $schema = $this->getSchema();\n $key = $schema->getPrimaryKey();\n if (count($key) === 1) {\n $key = $key[0];\n }\n $this->_primaryKey = $key;\n }\n\n return $this->_primaryKey;\n }", "public static function primaryKey()\n {\n return 'id';\n }", "function primary_key()\r\n\t{\r\n\t\treturn 'key';\r\n\t}", "function PrimaryKey ( $cPrimaryKey=null )\n{\n if ( isset($cPrimaryKey) ) {\n $cPrimaryKey = $this->_FixCase_($cPrimaryKey);\n if ( $this->_PrimaryKeyStr != $cPrimaryKey || $this->_inLoading_ ) {\n $this->_PrimaryKeyStr = $cPrimaryKey;\n if ( $this->KeyName() == '' ) $this->KeyName($cPrimaryKey);\n }\n return true;\n } else {\n return $this->_PrimaryKeyStr;\n }\n}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->_rowKey;\n\t}", "public function getPk()\n {\n return $this->{static::primaryKey()};\n }", "public function primaryKey()\n {\n return $this->data[static::$primaryKey] ?? null;\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 }", "protected function discoverPrimaryKey(): void\n {\n if ($this->primaryKey !== null) {\n return;\n }\n\n $key = auth()->id();\n if ($key === null) {\n $key = session()->getId();\n }\n\n $this->setPrimaryKey($key);\n }", "function get_primary_key_column()\n {\n return $this->object->_primary_key_column;\n }", "function get_primary_key_column()\n {\n return $this->_primary_key_column;\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 json_primary_key($table_name){\n\t\tif( in_array( $table_name, array_keys(Model_Kiwi::$kiwi_pk_hash))){\n\t\t\treturn Model_Kiwi::$kiwi_pk_hash[ $table_name ];\n\t\t}\n\t\treturn Model_Kiwi::singularize($table_name) . '_id';\n\t}", "public function preparePrimaryKeyName()\n {\n $this->primaryKeyName = $this->getOption('primary');\n\n if (empty($this->primaryKeyName)) {\n $this->primaryKeyName = 'id';\n }\n }", "public function getPrimaryKeyName()\n {\n return self::$primary_key_name;\n }", "public function getPrimaryKey()\n\t{\n $indexes = $this->getIndexes();\n\n foreach ($indexes as $index){\n if ($index['Key_name'] == \"PRIMARY\"){\n return $index;\n }\n }\n\n \t\t\n\t}", "public function getTablePrimaryKey()\n {\n return 'p.id';\n }", "public function getPrimaryKey()\n {\n return $this->getPothnbr();\n }", "public function getPrimaryKey() {\n return $this->_data->getDeepValue('indexes/primary/columns/0', null);\n }", "public static function getPrimaryKey()\n {\n return self::getRepo()->getPrimaryKey();\n }", "public function getPrimaryKey()\n {\n return $this->getSekolahId();\n }", "abstract public function primaryKey(): string;", "function getPrimaryKey() {\n\t\treturn $this->_ID;\n\t}", "function getPrimaryKey() {\n\t\treturn $this->_ID;\n\t}", "function getPrimaryKey() {\n\t\treturn $this->_ID;\n\t}", "public static function primaryKey()\n {\n return ['_id'];\n }", "public function getPrimaryKeyName()\n {\n return $this->primaryKeyName;\n }", "public function setPrimaryKey($key) {\n $this->primaryKey = $key;\n }", "public function primaryKeyForTable(Table $table)\n {\n // Execute the query directly\n $result = $this->client->query(\"SHOW KEYS FROM $table->name WHERE Key_name = 'PRIMARY'\");\n\n // If no results are returned, return null\n if ($result === false) {\n return;\n }\n\n // Fetch the query results\n $data = $result->fetch_assoc();\n\n // Return the field name\n return $data['Column_name'];\n }", "public function getPrimaryKey()\n {\n return $this->getid();\n }", "public function get_primary_column()\n {\n }", "public function setPrimaryKey($primaryKey);", "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 }", "public function getPrimary(){\n return $this->primaryKey;\n }", "public function getIdKey();", "public function getPrimaryKey()\n {\n return $this->getId();\n }", "public function getPrimaryKey()\n {\n return $this->getId();\n }", "public function getPrimaryKey()\n {\n return $this->getId();\n }", "public function getPrimaryKey()\n {\n return $this->getId();\n }", "public function getPrimaryKey()\n {\n return $this->getId();\n }", "public function PK($table_name){\n $PK = DB::select('SELECT FNC_GETPK(\"'.$table_name.'\");');\n foreach ($PK as $value) {\n $result = $value;\n }\n foreach ($result as $id) {\n $result = $id; // primary key\n }\n\n return $id;\n }", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getId();\n\t}", "public static function primaryKey()\n {\n return ['id'];\n }", "public static function primaryKey()\n {\n return ['id'];\n }", "public function getPrimaryKey()\n\t{\n\t\treturn $this->name;\n\t}", "public function getPrimaryKeyField()\n\t{\n\t\treturn $this->primaryKey;\n\t}", "public function getPrimaryKeyColumn() : string\n {\n return $this->primaryKey;\n }", "public function getPrimaryKey()\n {\n return $this->getArticleId();\n }", "public function primaryKey()\n {\n return '_id';\n }", "protected function findPrimaryKey($table)\n {\n $kcu = 'INFORMATION_SCHEMA.KEY_COLUMN_USAGE';\n $tc = 'INFORMATION_SCHEMA.TABLE_CONSTRAINTS';\n if (isset($table->catalogName)) {\n $kcu = $table->catalogName . '.' . $kcu;\n $tc = $table->catalogName . '.' . $tc;\n }\n\n $sql = <<<EOD\n\t\tSELECT k.column_name field_name\n\t\t\tFROM {$this->quoteTableName($kcu)} k\n\t\t LEFT JOIN {$this->quoteTableName($tc)} c\n\t\t ON k.table_name = c.table_name\n\t\t AND k.constraint_name = c.constraint_name\n\t\t WHERE c.constraint_type ='PRIMARY KEY'\n\t\t \t AND k.table_name = :table\n\t\t\t\tAND k.table_schema = :schema\nEOD;\n $primary =\n $this->selectColumn($sql, [':table' => $table->tableName, ':schema' => $table->schemaName]);\n switch (count($primary)) {\n case 0: // No primary key on table\n $primary = null;\n break;\n case 1: // Only 1 primary key\n $primary = $primary[0];\n $cnk = strtolower($primary);\n if (isset($table->columns[$cnk])) {\n $table->columns[$cnk]->isPrimaryKey = true;\n if ((ColumnSchema::TYPE_INTEGER === $table->columns[$cnk]->type) &&\n $table->columns[$cnk]->autoIncrement\n ) {\n $table->columns[$cnk]->type = ColumnSchema::TYPE_ID;\n }\n }\n break;\n default:\n if (is_array($primary)) {\n foreach ($primary as $key) {\n $cnk = strtolower($key);\n if (isset($table->columns[$cnk])) {\n $table->columns[$cnk]->isPrimaryKey = true;\n }\n }\n }\n break;\n }\n $table->primaryKey = $primary;\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 getPrimaryKey(phpDataMapper_Model_Row $row)\n\t{\n\t\t$pkField = $this->getPrimaryKeyField();\n\t\treturn $row->$pkField;\n\t}", "function _lookup_primary_key_column()\n {\n $key = $this->_wpdb()->get_row(\"SHOW INDEX FROM {$this->get_table_name()} WHERE Key_name='PRIMARY'\", ARRAY_A);\n if (!$key) {\n throw new Exception(\"Please specify the primary key for {$this->get_table_name()}\");\n }\n return $key['Column_name'];\n }", "public function primaryKey($class = null) {\n\t\tif (!$class) {\n\t\t\t$class = $this->currentPathClass();\n\t\t}\n\t\t\n\t\t$model = ClassRegistry::init($class);\n\t\tif ($model) {\n\t\t\treturn $model->primaryKey;\n\t\t}\n\n\t\treturn $this->Form->primaryKey();\n\t}", "protected abstract function getPrimaryKeyName();", "public function schemaPK() {\n return $this->primaryKeyArray;\n }", "public function schemaPK() {\n return $this->primaryKeyArray;\n }", "public static function _getPK(){\n return (property_exists(get_called_class(), '_pk') ? static::$_pk : 'id');\n }", "abstract protected function loadTablePrimaryKey(string $tableName): ?Constraint;", "protected function get_primary_column_name()\n {\n }", "protected function get_primary_column_name()\n {\n }" ]
[ "0.7992905", "0.7992905", "0.7576453", "0.738196", "0.733795", "0.733795", "0.7222193", "0.7198702", "0.7198702", "0.7198702", "0.7132186", "0.70934826", "0.70882547", "0.7077313", "0.7077313", "0.7068622", "0.7052326", "0.7027347", "0.70218617", "0.69620526", "0.6932819", "0.69280213", "0.69217885", "0.6909745", "0.69043523", "0.6884619", "0.6852341", "0.68495536", "0.6818478", "0.6813122", "0.6801401", "0.6799468", "0.6793791", "0.6770764", "0.676947", "0.67593056", "0.6735675", "0.670515", "0.66938615", "0.6682416", "0.6682355", "0.66690385", "0.6663847", "0.665303", "0.665303", "0.66418266", "0.66417074", "0.6634436", "0.65644336", "0.6562204", "0.6543779", "0.6531255", "0.6516947", "0.6513547", "0.65091336", "0.65079254", "0.65079254", "0.65079254", "0.6500036", "0.6490043", "0.6472911", "0.645859", "0.64480495", "0.6408062", "0.640588", "0.63996124", "0.6391334", "0.63635707", "0.6362427", "0.6362427", "0.6362427", "0.6362427", "0.6362427", "0.6353464", "0.6343534", "0.6343534", "0.6343534", "0.6343534", "0.6343534", "0.6343534", "0.6343534", "0.6343534", "0.6329454", "0.6329454", "0.632663", "0.6316202", "0.6312399", "0.6311835", "0.6309716", "0.63041574", "0.628806", "0.62626934", "0.6249537", "0.6243585", "0.623876", "0.62138027", "0.62138027", "0.6206822", "0.6205196", "0.6201246", "0.6201246" ]
0.0
-1
Adds vendorspecific info for table.
protected function addTableVendorInfo(Table $table) { $stmt = $this->dbh->query("SHOW TABLE STATUS LIKE '" . $table->getName() . "'"); $row = $stmt->fetch(PDO::FETCH_ASSOC); if (!$this->addVendorInfo) { //since we depend on `Engine` in the MysqlPlatform, we have always extract this vendor information $row = array('Engine' => $row['Engine']); } $vi = $this->getNewVendorInfoObject($row); $table->addVendorInfo($vi); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function add_vendor_info_in_product_summery() {\n include_once dirname( __FILE__ ) . '/templates/vendor-info.php';\n }", "function cmst_vendor_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"mst_vendor\"] = new cmst_vendor();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'mst_vendor', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "function addeditvendor( $ketObj )\n{\n\t//vendor table array\n\t$strimp = createtable(\"ketechvp\");\n\t$VendorCityArray = explode( \"/\",$_POST['vcity'] );\n\t\n\t$VendorAreaArray = explode( \"/\",$_POST['varea'] );\n\t\n\t/*echo \"<pre>\";\n\tprint_r( $VendorCityArray );\n\tprint_r( $VendorAreaArray );\n\tdie();*/\n\t\n\t$ketechVendor['vname'] =\t$_POST['vname'];\n\t$ketechVendor['vaddress'] =\tstrtolower( $_POST['vaddress'] );\n\t$ketechVendor['vmail'] =\t$_POST['vemail'];\n\t$ketechVendor['vphone']\t =\t$_POST['vphone'];\n\t$ketechVendor['vcname'] =\t$_POST['vcname'];\n\t$ketechVendor['vcaddress'] =\t$_POST['vcaddress'];\n\t$ketechVendor['vcmail'] =\t$_POST['vcemail'];\n\t$ketechVendor['vcphone'] =\t$_POST['vcphone'];\n\t$ketechVendor['varea'] =\t$VendorAreaArray['1'];\n\t$ketechVendor['vareaid'] =\t$VendorAreaArray['0'];\n\t$ketechVendor['vcity'] =\t$VendorCityArray['1'];\n\t$ketechVendor['vcityid'] =\t$VendorCityArray['0'];\n\t$hidvid\t\t\t\t =\t $_POST['hidvid'];\n\t\n\t//usertable array\n\t$ketechUser['uname'] =\t$_POST['vname'];\n\t$ketechUser['uaddress'] =\tstrtolower( $_POST['vaddress'] );\n\t$ketechUser['uemail'] =\t$_POST['vemail'];\n\t$ketechUser['uphone']\t =\t$_POST['vphone'];\n\t$ketechUser['upassword'] = substr($_POST['vphone'],6);\n\t$ketechUser['urole'] =\t 'vendor';\n\t$ketechUser['ucity'] =\t $VendorCityArray['1'];\n\t$ketechUser['ucityid'] = $VendorCityArray['0'];\n\t$ketechUser['uarea'] =\t $VendorAreaArray['1'];\n\t$ketechUser['uareaid'] = $VendorAreaArray['0'];\n\t$hiduid\t =\t$_POST['hiduid'];\n\t\n\t\n\t//$allSet = $ketObj->runquery( \"SELECT\", \"*\", \"ketechprod\", array(), \"\" );\n\tif( isset( $hiduid ) && $hiduid > 0 && isset( $hiduid ) && $hiduid > 0 )\n\t{\n\t\t /*echo \"<pre>\";\n print_r( $_POST );\n die();*/\n\t\t$allSet = $ketObj->runquery( \"UPDATE\", \"\", \"ketechvendor\", $ketechVendor, \"WHERE id=\".$hidvid );\n\t\t$allSet = $ketObj->runquery( \"UPDATE\", \"\", \"ketechuser\", $ketechUser, \"WHERE id=\".$hiduid );\n\t\t\n\t}else\n\t{\n\t\t$allSet = $ketObj->runquery( \"INSERT\", \"*\", \"ketechuser\", $ketechUser );\n\t\t$ketechVendor['uid'] =\tmysql_insert_id();\n\t\t\n\t\t$allSet = $ketObj->runquery( \"INSERT\", \"*\", \"ketechvendor\", $ketechVendor );\n\t\t$subkey = \tmysql_insert_id();\n\t\t$querycreatetable = \"CREATE TABLE IF NOT EXISTS ketechvp_\".$subkey.\" (\".$strimp.\")\";\n\t\t$querycreatetable = \"CREATE TABLE IF NOT EXISTS ketechord_\".$subkey.\" (\".$strimp.\")\";\n\t\tmysql_query( $querycreatetable );\n\t\t/*echo $querycreatetable;\n\t\tdie();*/\n\t}\n\t\t\n\t header( \"Location: index.php?v=\".$_POST['c'].\"&f=\".$_POST['f'] );\n\n}", "public function vendors()\n {\n return $this->morphedByMany('App\\Models\\Event\\Person\\EventVendor', 'persona', 'pivot_persona_org', 'organization_id', 'persona_id');\n }", "function generator_decla_vider_tables($nom_meta_base_version) {\n\n\teffacer_meta($nom_meta_base_version);\n}", "private function endonuclease_vendors() {\r\n\r\n $vendors = array(\r\n \"AarI\" => \"F\",\r\n \"AasI\" => \"F\",\r\n \"AatI\" => \"O\",\r\n \"AatII\" => \"AFGIKMNORV\",\r\n \"AbsI\" => \"I\",\r\n \"AccI\" => \"ABGJKMNORSUWX\",\r\n \"AccII\" => \"AJK\",\r\n \"AccIII\" => \"GJKRW\",\r\n \"Acc16I\" => \"IV\",\r\n \"Acc36I\" => \"I\",\r\n \"Acc65I\" => \"FGINRVW\",\r\n \"AccB1I\" => \"IV\",\r\n \"AccB7I\" => \"IRV\",\r\n \"AccBSI\" => \"IV\",\r\n \"AciI\" => \"N\",\r\n \"AclI\" => \"INV\",\r\n \"AclWI\" => \"I\",\r\n \"AcoI\" => \"I\",\r\n \"AcsI\" => \"IMV\",\r\n \"AcuI\" => \"IN\",\r\n \"AcvI\" => \"QX\",\r\n \"AcyI\" => \"JM\",\r\n \"AdeI\" => \"F\",\r\n \"AfaI\" => \"AK\",\r\n \"AfeI\" => \"IN\",\r\n \"AfiI\" => \"V\",\r\n \"AflII\" => \"AJKNO\",\r\n \"AflIII\" => \"GMNSW\",\r\n \"AgeI\" => \"JNR\",\r\n \"AhdI\" => \"N\",\r\n \"AhlI\" => \"IV\",\r\n \"AjiI\" => \"F\",\r\n \"AjnI\" => \"I\",\r\n \"AjuI\" => \"F\",\r\n \"AleI\" => \"N\",\r\n \"AlfI\" => \"F\",\r\n \"AloI\" => \"F\",\r\n \"AluI\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"AluBI\" => \"I\",\r\n \"AlwI\" => \"N\",\r\n \"Alw21I\" => \"F\",\r\n \"Alw26I\" => \"FR\",\r\n \"Alw44I\" => \"FJMORS\",\r\n \"AlwNI\" => \"N\",\r\n \"Ama87I\" => \"IV\",\r\n \"Aor13HI\" => \"K\",\r\n \"Aor51HI\" => \"AK\",\r\n \"ApaI\" => \"ABFGIJKMNOQRSUVWX\",\r\n \"ApaLI\" => \"AKNU\",\r\n \"ApeKI\" => \"N\",\r\n \"ApoI\" => \"N\",\r\n \"AscI\" => \"GNW\",\r\n \"AseI\" => \"JNO\",\r\n \"AsiGI\" => \"IV\",\r\n \"AsiSI\" => \"N\",\r\n \"AspI\" => \"M\",\r\n \"Asp700I\" => \"M\",\r\n \"Asp718I\" => \"M\",\r\n \"AspA2I\" => \"IV\",\r\n \"AspEI\" => \"M\",\r\n \"AspLEI\" => \"IV\",\r\n \"AspS9I\" => \"IV\",\r\n \"AssI\" => \"U\",\r\n \"AsuC2I\" => \"I\",\r\n \"AsuHPI\" => \"IV\",\r\n \"AsuNHI\" => \"IV\",\r\n \"AvaI\" => \"ABGJMNORSUWX\",\r\n \"AvaII\" => \"AGJKMNRSWY\",\r\n \"AviII\" => \"M\",\r\n \"AvrII\" => \"N\",\r\n \"AxyI\" => \"J\",\r\n \"BaeI\" => \"N\",\r\n \"BalI\" => \"AJKR\",\r\n \"BamHI\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"BanI\" => \"NORU\",\r\n \"BanII\" => \"AGKMNOQRSWX\",\r\n \"BanIII\" => \"O\",\r\n \"BarI\" => \"I\",\r\n \"BasI\" => \"U\",\r\n \"BauI\" => \"F\",\r\n \"BbeI\" => \"AK\",\r\n \"BbrPI\" => \"MO\",\r\n \"BbsI\" => \"N\",\r\n \"BbuI\" => \"R\",\r\n \"BbvI\" => \"N\",\r\n \"Bbv12I\" => \"IV\",\r\n \"BbvCI\" => \"N\",\r\n \"BccI\" => \"N\",\r\n \"BceAI\" => \"N\",\r\n \"BcgI\" => \"N\",\r\n \"BciVI\" => \"N\",\r\n \"BclI\" => \"FGJMNORSUWY\",\r\n \"BcnI\" => \"FK\",\r\n \"BcuI\" => \"F\",\r\n \"BdaI\" => \"F\",\r\n \"BfaI\" => \"N\",\r\n \"BfiI\" => \"F\",\r\n \"BfmI\" => \"F\",\r\n \"BfrI\" => \"MO\",\r\n \"BfuI\" => \"F\",\r\n \"BfuAI\" => \"N\",\r\n \"BfuCI\" => \"N\",\r\n \"BglI\" => \"AFGHIJKMNOQRSUVWXY\",\r\n \"BglII\" => \"ABFGHIJKMNOQRSUVWXY\",\r\n \"BisI\" => \"I\",\r\n \"BlnI\" => \"AKMS\",\r\n \"BlpI\" => \"N\",\r\n \"BlsI\" => \"I\",\r\n \"BmcAI\" => \"V\",\r\n \"Bme18I\" => \"IV\",\r\n \"Bme1390I\" => \"F\",\r\n \"Bme1580I\" => \"N\",\r\n \"BmeRI\" => \"V\",\r\n \"BmeT110I\" => \"K\",\r\n \"BmgBI\" => \"N\",\r\n \"BmgT120I\" => \"K\",\r\n \"BmiI\" => \"V\",\r\n \"BmrI\" => \"N\",\r\n \"BmrFI\" => \"V\",\r\n \"BmtI\" => \"INV\",\r\n \"BmuI\" => \"I\",\r\n \"BoxI\" => \"F\",\r\n \"BpiI\" => \"F\",\r\n \"BplI\" => \"F\",\r\n \"BpmI\" => \"IN\",\r\n \"Bpu10I\" => \"FINV\",\r\n \"Bpu14I\" => \"IV\",\r\n \"Bpu1102I\" => \"AFK\",\r\n \"BpuAI\" => \"M\",\r\n \"BpuEI\" => \"N\",\r\n \"BpuMI\" => \"V\",\r\n \"BpvUI\" => \"V\",\r\n \"BsaI\" => \"N\",\r\n \"Bsa29I\" => \"I\",\r\n \"BsaAI\" => \"N\",\r\n \"BsaBI\" => \"N\",\r\n \"BsaHI\" => \"N\",\r\n \"BsaJI\" => \"N\",\r\n \"BsaMI\" => \"GR\",\r\n \"BsaWI\" => \"N\",\r\n \"BsaXI\" => \"N\",\r\n \"Bsc4I\" => \"I\",\r\n \"Bse1I\" => \"IV\",\r\n \"Bse8I\" => \"IV\",\r\n \"Bse21I\" => \"IV\",\r\n \"Bse118I\" => \"IV\",\r\n \"BseAI\" => \"CM\",\r\n \"BseBI\" => \"C\",\r\n \"BseCI\" => \"C\",\r\n \"BseDI\" => \"F\",\r\n \"Bse3DI\" => \"IV\",\r\n \"BseGI\" => \"F\",\r\n \"BseJI\" => \"F\",\r\n \"BseLI\" => \"F\",\r\n \"BseMI\" => \"F\",\r\n \"BseMII\" => \"F\",\r\n \"BseNI\" => \"F\",\r\n \"BsePI\" => \"IV\",\r\n \"BseRI\" => \"N\",\r\n \"BseSI\" => \"F\",\r\n \"BseXI\" => \"F\",\r\n \"BseX3I\" => \"IV\",\r\n \"BseYI\" => \"N\",\r\n \"BsgI\" => \"N\",\r\n \"Bsh1236I\" => \"F\",\r\n \"Bsh1285I\" => \"F\",\r\n \"BshFI\" => \"C\",\r\n \"BshNI\" => \"F\",\r\n \"BshTI\" => \"F\",\r\n \"BshVI\" => \"V\",\r\n \"BsiEI\" => \"N\",\r\n \"BsiHKAI\" => \"N\",\r\n \"BsiHKCI\" => \"QX\",\r\n \"BsiSI\" => \"C\",\r\n \"BsiWI\" => \"MNO\",\r\n \"BsiYI\" => \"M\",\r\n \"BslI\" => \"GNW\",\r\n \"BslFI\" => \"I\",\r\n \"BsmI\" => \"JMNOSW\",\r\n \"BsmAI\" => \"N\",\r\n \"BsmBI\" => \"N\",\r\n \"BsmFI\" => \"N\",\r\n \"BsnI\" => \"V\",\r\n \"Bso31I\" => \"IV\",\r\n \"BsoBI\" => \"N\",\r\n \"Bsp13I\" => \"IV\",\r\n \"Bsp19I\" => \"IV\",\r\n \"Bsp68I\" => \"F\",\r\n \"Bsp119I\" => \"F\",\r\n \"Bsp120I\" => \"F\",\r\n \"Bsp143I\" => \"F\",\r\n \"Bsp1286I\" => \"JKNR\",\r\n \"Bsp1407I\" => \"FK\",\r\n \"Bsp1720I\" => \"IV\",\r\n \"BspACI\" => \"I\",\r\n \"BspANI\" => \"X\",\r\n \"BspCNI\" => \"N\",\r\n \"BspDI\" => \"N\",\r\n \"BspEI\" => \"N\",\r\n \"BspFNI\" => \"I\",\r\n \"BspHI\" => \"N\",\r\n \"BspLI\" => \"F\",\r\n \"BspLU11I\" => \"M\",\r\n \"BspMI\" => \"N\",\r\n \"BspMAI\" => \"X\",\r\n \"BspOI\" => \"F\",\r\n \"BspPI\" => \"F\",\r\n \"BspQI\" => \"N\",\r\n \"BspTI\" => \"F\",\r\n \"BspT104I\" => \"K\",\r\n \"BspT107I\" => \"K\",\r\n \"BspTNI\" => \"QX\",\r\n \"BspXI\" => \"GW\",\r\n \"BsrI\" => \"N\",\r\n \"BsrBI\" => \"N\",\r\n \"BsrDI\" => \"N\",\r\n \"BsrFI\" => \"N\",\r\n \"BsrGI\" => \"N\",\r\n \"BsrSI\" => \"R\",\r\n \"BssAI\" => \"C\",\r\n \"BssECI\" => \"I\",\r\n \"BssHII\" => \"AJKMNOQRSX\",\r\n \"BssKI\" => \"N\",\r\n \"BssMI\" => \"V\",\r\n \"BssNI\" => \"V\",\r\n \"BssNAI\" => \"IV\",\r\n \"BssSI\" => \"N\",\r\n \"BssT1I\" => \"IV\",\r\n \"Bst6I\" => \"IV\",\r\n \"Bst98I\" => \"R\",\r\n \"Bst1107I\" => \"FKM\",\r\n \"BstACI\" => \"I\",\r\n \"BstAPI\" => \"IN\",\r\n \"BstAUI\" => \"IV\",\r\n \"BstBI\" => \"N\",\r\n \"Bst2BI\" => \"IV\",\r\n \"BstBAI\" => \"IV\",\r\n \"Bst4CI\" => \"IV\",\r\n \"BstC8I\" => \"I\",\r\n \"BstDEI\" => \"IV\",\r\n \"BstDSI\" => \"IV\",\r\n \"BstEII\" => \"GHJMNORSUW\",\r\n \"BstENI\" => \"IV\",\r\n \"BstF5I\" => \"IV\",\r\n \"BstFNI\" => \"IV\",\r\n \"BstH2I\" => \"IV\",\r\n \"BstHHI\" => \"IV\",\r\n \"BstKTI\" => \"I\",\r\n \"BstMAI\" => \"IV\",\r\n \"BstMBI\" => \"IV\",\r\n \"BstMCI\" => \"IV\",\r\n \"BstMWI\" => \"I\",\r\n \"BstNI\" => \"N\",\r\n \"BstNSI\" => \"IV\",\r\n \"BstOI\" => \"R\",\r\n \"BstPI\" => \"K\",\r\n \"BstPAI\" => \"IV\",\r\n \"BstSCI\" => \"I\",\r\n \"BstSFI\" => \"I\",\r\n \"BstSLI\" => \"I\",\r\n \"BstSNI\" => \"IV\",\r\n \"BstUI\" => \"N\",\r\n \"Bst2UI\" => \"IV\",\r\n \"BstV1I\" => \"I\",\r\n \"BstV2I\" => \"IV\",\r\n \"BstXI\" => \"AFGHIJKMNOQRVWX\",\r\n \"BstX2I\" => \"IV\",\r\n \"BstYI\" => \"N\",\r\n \"BstZI\" => \"R\",\r\n \"BstZ17I\" => \"N\",\r\n \"Bsu15I\" => \"F\",\r\n \"Bsu36I\" => \"NR\",\r\n \"BsuRI\" => \"FI\",\r\n \"BsuTUI\" => \"X\",\r\n \"BtgI\" => \"N\",\r\n \"BtgZI\" => \"N\",\r\n \"BtrI\" => \"IV\",\r\n \"BtsI\" => \"N\",\r\n \"BtsCI\" => \"N\",\r\n \"BtuMI\" => \"V\",\r\n \"BveI\" => \"F\",\r\n \"Cac8I\" => \"N\",\r\n \"CaiI\" => \"F\",\r\n \"CciNI\" => \"IV\",\r\n \"CelII\" => \"M\",\r\n \"CfoI\" => \"MRS\",\r\n \"CfrI\" => \"F\",\r\n \"Cfr9I\" => \"FO\",\r\n \"Cfr10I\" => \"FGKO\",\r\n \"Cfr13I\" => \"AFO\",\r\n \"Cfr42I\" => \"F\",\r\n \"ClaI\" => \"ABHKMNRSU\",\r\n \"CpoI\" => \"AFK\",\r\n \"CseI\" => \"F\",\r\n \"CspI\" => \"OR\",\r\n \"Csp6I\" => \"F\",\r\n \"Csp45I\" => \"OR\",\r\n \"CspAI\" => \"C\",\r\n \"CspCI\" => \"N\",\r\n \"CviAII\" => \"N\",\r\n \"CviJI\" => \"QX\",\r\n \"CviKI-1\" => \"N\",\r\n \"CviQI\" => \"N\",\r\n \"DdeI\" => \"BGMNORSW\",\r\n \"DinI\" => \"V\",\r\n \"DpnI\" => \"BEFGMNRSW\",\r\n \"DpnII\" => \"N\",\r\n \"DraI\" => \"ABFGIJKMNOQRSUVWXY\",\r\n \"DraII\" => \"GMW\",\r\n \"DraIII\" => \"GIMNVW\",\r\n \"DrdI\" => \"N\",\r\n \"DriI\" => \"I\",\r\n \"DseDI\" => \"IV\",\r\n \"EaeI\" => \"AKMN\",\r\n \"EagI\" => \"GNW\",\r\n \"Eam1104I\" => \"F\",\r\n \"Eam1105I\" => \"FK\",\r\n \"EarI\" => \"N\",\r\n \"EciI\" => \"N\",\r\n \"Ecl136II\" => \"F\",\r\n \"EclHKI\" => \"R\",\r\n \"EclXI\" => \"MS\",\r\n \"Eco24I\" => \"F\",\r\n \"Eco31I\" => \"F\",\r\n \"Eco32I\" => \"F\",\r\n \"Eco47I\" => \"FO\",\r\n \"Eco47III\" => \"FGMORW\",\r\n \"Eco52I\" => \"FKO\",\r\n \"Eco57I\" => \"F\",\r\n \"Eco72I\" => \"F\",\r\n \"Eco81I\" => \"AFKO\",\r\n \"Eco88I\" => \"F\",\r\n \"Eco91I\" => \"F\",\r\n \"Eco105I\" => \"FO\",\r\n \"Eco130I\" => \"F\",\r\n \"Eco147I\" => \"F\",\r\n \"EcoICRI\" => \"IRV\",\r\n \"Eco57MI\" => \"F\",\r\n \"EcoNI\" => \"N\",\r\n \"EcoO65I\" => \"K\",\r\n \"EcoO109I\" => \"AFJKN\",\r\n \"EcoP15I\" => \"N\",\r\n \"EcoRI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"EcoRII\" => \"FJMOS\",\r\n \"EcoRV\" => \"ABCGHIJKMNOQRSUVWXY\",\r\n \"EcoT14I\" => \"K\",\r\n \"EcoT22I\" => \"AKO\",\r\n \"EcoT38I\" => \"J\",\r\n \"EgeI\" => \"I\",\r\n \"EheI\" => \"FO\",\r\n \"ErhI\" => \"IV\",\r\n \"Esp3I\" => \"F\",\r\n \"FaeI\" => \"I\",\r\n \"FalI\" => \"I\",\r\n \"FaqI\" => \"F\",\r\n \"FatI\" => \"IN\",\r\n \"FauI\" => \"IN\",\r\n \"FauNDI\" => \"IV\",\r\n \"FbaI\" => \"AK\",\r\n \"FblI\" => \"IV\",\r\n \"Fnu4HI\" => \"N\",\r\n \"FokI\" => \"AGIJKMNQRVWX\",\r\n \"FriOI\" => \"IV\",\r\n \"FseI\" => \"AN\",\r\n \"FspI\" => \"JNO\",\r\n \"FspAI\" => \"F\",\r\n \"FspBI\" => \"F\",\r\n \"Fsp4HI\" => \"I\",\r\n \"GlaI\" => \"I\",\r\n \"GluI\" => \"I\",\r\n \"GsuI\" => \"F\",\r\n \"HaeII\" => \"GJKMNORSW\",\r\n \"HaeIII\" => \"ABGHIJKMNOQRSUWXY\",\r\n \"HapII\" => \"AK\",\r\n \"HgaI\" => \"IN\",\r\n \"HhaI\" => \"ABFGJKNORUWY\",\r\n \"Hin1I\" => \"FKO\",\r\n \"Hin1II\" => \"F\",\r\n \"Hin4I\" => \"F\",\r\n \"Hin6I\" => \"F\",\r\n \"HinP1I\" => \"N\",\r\n \"HincII\" => \"ABFGHJKNOQRUWXY\",\r\n \"HindII\" => \"IMSV\",\r\n \"HindIII\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"HinfI\" => \"ABCFGHIJKMNOQRUVWXY\",\r\n \"HpaI\" => \"ABCGHIJKMNOQRSUVWX\",\r\n \"HpaII\" => \"BFGIMNOQRSUVWX\",\r\n \"HphI\" => \"FN\",\r\n \"Hpy8I\" => \"F\",\r\n \"Hpy99I\" => \"N\",\r\n \"Hpy188I\" => \"N\",\r\n \"Hpy188III\" => \"N\",\r\n \"HpyAV\" => \"N\",\r\n \"HpyCH4III\" => \"N\",\r\n \"HpyCH4IV\" => \"N\",\r\n \"HpyCH4V\" => \"N\",\r\n \"HpyF3I\" => \"F\",\r\n \"HpyF10VI\" => \"F\",\r\n \"Hsp92I\" => \"R\",\r\n \"Hsp92II\" => \"R\",\r\n \"HspAI\" => \"IV\",\r\n \"ItaI\" => \"M\",\r\n \"KasI\" => \"N\",\r\n \"KpnI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"Kpn2I\" => \"F\",\r\n \"KspI\" => \"MS\",\r\n \"Ksp22I\" => \"IV\",\r\n \"Ksp632I\" => \"M\",\r\n \"KspAI\" => \"F\",\r\n \"Kzo9I\" => \"I\",\r\n \"LguI\" => \"F\",\r\n \"LweI\" => \"F\",\r\n \"MabI\" => \"I\",\r\n \"MaeI\" => \"M\",\r\n \"MaeII\" => \"M\",\r\n \"MaeIII\" => \"M\",\r\n \"MalI\" => \"I\",\r\n \"MamI\" => \"M\",\r\n \"MbiI\" => \"F\",\r\n \"MboI\" => \"ABCFGKNQRUWXY\",\r\n \"MboII\" => \"AFGIJKNOQRVWX\",\r\n \"MfeI\" => \"N\",\r\n \"MflI\" => \"K\",\r\n \"MhlI\" => \"IV\",\r\n \"MlsI\" => \"F\",\r\n \"MluI\" => \"ABFGHIJKMNOQRSUVWX\",\r\n \"MluNI\" => \"MS\",\r\n \"MlyI\" => \"N\",\r\n \"Mly113I\" => \"I\",\r\n \"MmeI\" => \"NX\",\r\n \"MnlI\" => \"FGINQVWX\",\r\n \"Mph1103I\" => \"F\",\r\n \"MreI\" => \"F\",\r\n \"MroI\" => \"MO\",\r\n \"MroNI\" => \"IV\",\r\n \"MroXI\" => \"IV\",\r\n \"MscI\" => \"BNO\",\r\n \"MseI\" => \"BN\",\r\n \"MslI\" => \"N\",\r\n \"MspI\" => \"AFGHIJKMNOQRSUVWXY\",\r\n \"Msp20I\" => \"IV\",\r\n \"MspA1I\" => \"INRV\",\r\n \"MspCI\" => \"C\",\r\n \"MspR9I\" => \"I\",\r\n \"MssI\" => \"F\",\r\n \"MunI\" => \"FKM\",\r\n \"MvaI\" => \"AFGKMOSW\",\r\n \"Mva1269I\" => \"F\",\r\n \"MvnI\" => \"M\",\r\n \"MvrI\" => \"U\",\r\n \"MwoI\" => \"N\",\r\n \"NaeI\" => \"ACKMNORU\",\r\n \"NarI\" => \"GJMNOQRUWX\",\r\n \"NciI\" => \"GJNORSW\",\r\n \"NcoI\" => \"ABCFGHJKMNOQRSUWXY\",\r\n \"NdeI\" => \"ABFGJKMNQRSWXY\",\r\n \"NdeII\" => \"GJMRSW\",\r\n \"NgoMIV\" => \"NR\",\r\n \"NheI\" => \"ABFGJKMNORSUW\",\r\n \"NlaIII\" => \"GNW\",\r\n \"NlaIV\" => \"GNW\",\r\n \"NmeAIII\" => \"N\",\r\n \"NmuCI\" => \"F\",\r\n \"NotI\" => \"ABCFGHJKMNOQRSUWXY\",\r\n \"NruI\" => \"ABCGIJKMNOQRSUWX\",\r\n \"NsbI\" => \"FK\",\r\n \"NsiI\" => \"BGHJMNRSUW\",\r\n \"NspI\" => \"MN\",\r\n \"NspV\" => \"JO\",\r\n \"OliI\" => \"F\",\r\n \"PacI\" => \"GNOW\",\r\n \"PaeI\" => \"F\",\r\n \"PaeR7I\" => \"N\",\r\n \"PagI\" => \"F\",\r\n \"PalAI\" => \"I\",\r\n \"PasI\" => \"F\",\r\n \"PauI\" => \"F\",\r\n \"PceI\" => \"IV\",\r\n \"PciI\" => \"IN\",\r\n \"PciSI\" => \"I\",\r\n \"PctI\" => \"IV\",\r\n \"PdiI\" => \"F\",\r\n \"PdmI\" => \"F\",\r\n \"PfeI\" => \"F\",\r\n \"Pfl23II\" => \"F\",\r\n \"PflFI\" => \"N\",\r\n \"PflMI\" => \"N\",\r\n \"PfoI\" => \"F\",\r\n \"PhoI\" => \"N\",\r\n \"PinAI\" => \"BM\",\r\n \"PleI\" => \"N\",\r\n \"Ple19I\" => \"I\",\r\n \"PmaCI\" => \"AK\",\r\n \"PmeI\" => \"GNW\",\r\n \"PmlI\" => \"N\",\r\n \"PpiI\" => \"F\",\r\n \"PpsI\" => \"I\",\r\n \"Ppu21I\" => \"F\",\r\n \"PpuMI\" => \"NO\",\r\n \"PscI\" => \"F\",\r\n \"PshAI\" => \"AKN\",\r\n \"PshBI\" => \"K\",\r\n \"PsiI\" => \"IN\",\r\n \"Psp5II\" => \"F\",\r\n \"Psp6I\" => \"I\",\r\n \"Psp1406I\" => \"FK\",\r\n \"Psp124BI\" => \"IV\",\r\n \"PspCI\" => \"IV\",\r\n \"PspEI\" => \"IV\",\r\n \"PspGI\" => \"N\",\r\n \"PspLI\" => \"I\",\r\n \"PspN4I\" => \"I\",\r\n \"PspOMI\" => \"INV\",\r\n \"PspPPI\" => \"I\",\r\n \"PspXI\" => \"IN\",\r\n \"PsrI\" => \"I\",\r\n \"PstI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"PsuI\" => \"F\",\r\n \"PsyI\" => \"F\",\r\n \"PvuI\" => \"ABFGKMNOQRSUWXY\",\r\n \"PvuII\" => \"ABCFGHIJKMNORSUVWXY\",\r\n \"RcaI\" => \"M\",\r\n \"RgaI\" => \"I\",\r\n \"RigI\" => \"I\",\r\n \"RsaI\" => \"BCFGHIJMNOQRSVWXY\",\r\n \"RsaNI\" => \"I\",\r\n \"RseI\" => \"F\",\r\n \"RsrII\" => \"MNQX\",\r\n \"Rsr2I\" => \"IV\",\r\n \"SacI\" => \"AFGHJKMNOQRSUWX\",\r\n \"SacII\" => \"AGHJKNOQRWX\",\r\n \"SalI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"SanDI\" => \"E\",\r\n \"SapI\" => \"N\",\r\n \"SatI\" => \"F\",\r\n \"Sau96I\" => \"GJMNOUW\",\r\n \"Sau3AI\" => \"AGHJKMNOQRSUWX\",\r\n \"SbfI\" => \"INV\",\r\n \"ScaI\" => \"ABCFGJKMNOQRSWX\",\r\n \"SchI\" => \"F\",\r\n \"ScrFI\" => \"JMNOS\",\r\n \"SdaI\" => \"F\",\r\n \"SduI\" => \"F\",\r\n \"SetI\" => \"I\",\r\n \"SexAI\" => \"MN\",\r\n \"SfaNI\" => \"INV\",\r\n \"SfcI\" => \"N\",\r\n \"SfiI\" => \"ACFGIJKMNOQRSUVWX\",\r\n \"SfoI\" => \"N\",\r\n \"Sfr274I\" => \"IV\",\r\n \"Sfr303I\" => \"IV\",\r\n \"SfuI\" => \"M\",\r\n \"SgfI\" => \"R\",\r\n \"SgrAI\" => \"MN\",\r\n \"SgrBI\" => \"C\",\r\n \"SgrDI\" => \"F\",\r\n \"SgsI\" => \"F\",\r\n \"SinI\" => \"GQRWX\",\r\n \"SlaI\" => \"C\",\r\n \"SmaI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"SmiI\" => \"FIKV\",\r\n \"SmiMI\" => \"IV\",\r\n \"SmlI\" => \"N\",\r\n \"SmoI\" => \"F\",\r\n \"SmuI\" => \"F\",\r\n \"SnaBI\" => \"ACKMNR\",\r\n \"SpeI\" => \"ABGHJKMNOQRSUWX\",\r\n \"SphI\" => \"ABCGHIJKMNOQRSVWX\",\r\n \"SrfI\" => \"EO\",\r\n \"Sse9I\" => \"IV\",\r\n \"Sse8387I\" => \"AK\",\r\n \"SseBI\" => \"C\",\r\n \"SsiI\" => \"F\",\r\n \"SspI\" => \"ABCFGIJKMNOQRSUVWX\",\r\n \"SstI\" => \"BC\",\r\n \"SstII\" => \"B\",\r\n \"StrI\" => \"U\",\r\n \"StuI\" => \"ABJKMNQRSUX\",\r\n \"StyI\" => \"CJMNRS\",\r\n \"StyD4I\" => \"N\",\r\n \"SwaI\" => \"GJMNSW\",\r\n \"TaaI\" => \"F\",\r\n \"TaiI\" => \"F\",\r\n \"TaqI\" => \"ABCFGIJKMNOQRSUVWXY\",\r\n \"TaqII\" => \"QX\",\r\n \"TasI\" => \"F\",\r\n \"TatI\" => \"F\",\r\n \"TauI\" => \"F\",\r\n \"TfiI\" => \"N\",\r\n \"TliI\" => \"N\",\r\n \"Tru1I\" => \"F\",\r\n \"Tru9I\" => \"GIMRVW\",\r\n \"TseI\" => \"N\",\r\n \"TsoI\" => \"F\",\r\n \"Tsp45I\" => \"N\",\r\n \"Tsp509I\" => \"N\",\r\n \"TspDTI\" => \"X\",\r\n \"TspEI\" => \"O\",\r\n \"TspGWI\" => \"X\",\r\n \"TspMI\" => \"N\",\r\n \"TspRI\" => \"N\",\r\n \"TstI\" => \"F\",\r\n \"Tth111I\" => \"GIKNQRVWX\",\r\n \"Van91I\" => \"AFKM\",\r\n \"Vha464I\" => \"IV\",\r\n \"VneI\" => \"IV\",\r\n \"VpaK11BI\" => \"K\",\r\n \"VspI\" => \"FIRV\",\r\n \"XagI\" => \"F\",\r\n \"XapI\" => \"F\",\r\n \"XbaI\" => \"ABCFGHIJKMNOQRSUVWXY\",\r\n \"XceI\" => \"F\",\r\n \"XcmI\" => \"N\",\r\n \"XhoI\" => \"ABFGHJKMNOQRSUWXY\",\r\n \"XhoII\" => \"GMRW\",\r\n \"XmaI\" => \"INRUV\",\r\n \"XmaCI\" => \"M\",\r\n \"XmaJI\" => \"F\",\r\n \"XmiI\" => \"F\",\r\n \"XmnI\" => \"GNRUW\",\r\n \"XspI\" => \"K\",\r\n \"ZraI\" => \"INV\",\r\n \"ZrmI\" => \"I\",\r\n \"Zsp2I\" => \"IV\"\r\n );\r\n return $vendors;\r\n }", "function cv_vider_tables($nom_meta_base_version) {\n\teffacer_meta($nom_meta_base_version);\n\n\t// Effacer la config\n\teffacer_meta('cv');\n}", "public function addVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->addVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\n }", "public function getVendors()\n {\n return $this->hasMany(Vendor::className(), ['vendor_id' => 'vendor_id'])->viaTable('ven_balance', ['currency_id' => 'currency_id']);\n }", "public function add_vendor_metaboxes()\n {\n add_meta_box('_andmoraho_vendor_contact_person-0', _('Contact Person'), array( $this, 'andmoraho_vendor_contact_person_metabox_callback'), 'vendor', 'normal', 'high');\n add_meta_box('_andmoraho_vendor_email-1', _('Email'), array( $this, 'andmoraho_vendor_email_metabox_callback'), 'vendor', 'normal', 'high');\n add_meta_box('_andmoraho_vendor_phone-2', _('Phone'), array( $this, 'andmoraho_vendor_phone_metabox_callback'), 'vendor', 'normal', 'high');\n add_meta_box('_andmoraho_vendor_url-3', _('URL'), array( $this, 'andmoraho_vendor_url_metabox_callback'), 'vendor', 'normal', 'high');\n }", "public function testDestiny2GetVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function SetVendorData()\n\t{\n\t\tif(isset($_REQUEST['vendorid'])) {\n\t\t\t$this->vendor = $this->LoadVendorById($_REQUEST['vendorid']);\n\t\t}\n\t\telse if(isset($GLOBALS['PathInfo'][1]) && $GLOBALS['PathInfo'][1] != '') {\n\t\t\t$this->vendor = $this->LoadVendorByFriendlyName($GLOBALS['PathInfo'][1]);\n\t\t}\n\n\t\t// Viewing the products that belong to a specific vendor\n\t\tif((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] == 'products') || (isset($_REQUEST['action']) && $_REQUEST['action'] == 'products')) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'products';\n\t\t}\n\n\t\t// Viewing a specific page\n\t\telse if((isset($GLOBALS['PathInfo'][2]) && $GLOBALS['PathInfo'][2] != '') || isset($_REQUEST['pageid'])) {\n\t\t\t//\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\n\t\t\t$this->displaying = 'page';\n\t\t}\n\n\t\t// Viewing vendor profile\n\t\telse if(isset($GLOBALS['PathInfo'][1]) || isset($_REQUEST['vendorid'])) {\n\t\t\tif(!is_array($this->vendor)) {\n\t\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\t}\n\t\t\t$this->displaying = 'profile';\n\t\t}\n\n\t\t// Otherwise, just showing a list of vendors\n\t\telse {\n\t\t\t$this->displaying = 'vendors';\n\t\t}\n\t}", "public function ShowVendors()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors')\n\t\t\t)\n\t\t);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.GetLang('Vendors'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendors');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function getVendorList() {\n $vendors = $this->couponServices_model->fetchVendors();\n\n $vendor_options = array();\n $vendor_options[\"\"] = \"-- Select vendor --\";\n foreach ($vendors as $company) {\n $vendor_options[$company['vendorId']] = $company['vendorName'];\n }\n return $vendor_options;\n }", "public function installVendorForms()\n {\n $allowedAttributes = [\n 'public_name',\n 'shop_url',\n 'created_at',\n 'status',\n 'group',\n 'name',\n 'gender',\n 'profile_picture',\n 'email',\n 'contact_number',\n 'company_name',\n 'about',\n 'company_logo',\n 'company_banner',\n 'company_address',\n 'support_number',\n 'support_email',\n ];\n\n $typeId = $this->vendorModel->getEntityTypeId();\n\n $vendorAttributes = $this->attributeFactory->create()->getCollection()\n ->addFieldToFilter('entity_type_id', ['eq' => $typeId])\n //->addFieldToFilter('attribute_code',['in'=>$allowedAttributes))\n ->setOrder('attribute_id', 'ASC');\n\n foreach ($vendorAttributes as $attribute) {\n $sortOrder = array_keys($allowedAttributes, $attribute->getAttributeCode());\n $sortOrder = isset($sortOrder[0]) ? $sortOrder[0] : 0;\n $visibility = in_array($attribute->getAttributeCode(), $allowedAttributes) ? 1 : 0;\n $data[] = [\n 'attribute_id' => $attribute->getId(),\n 'attribute_code' => $attribute->getAttributeCode(),\n 'is_visible' => $visibility,\n 'sort_order' => $sortOrder,\n 'store_id' => 0\n ];\n }\n\n if (!empty($data)) {\n $this->form->insertMultiple($data);\n }\n }", "protected function addVirtualColumns()\n {\n \n }", "function getVendors(){\n $datarow = NULL;\n try\n {\n $db = new Database();\n $db->connect();\n \n $sql = \"SELECT userid,firstname,lastname,category,categorycode,phonenumber,email,agebracket,country,countrycode,gender,town,userstatus,xikilaaccount,bancoaccount,wantbancoaccount,creationdate FROM registration \".\n \"where userstatus=:userstatus\";\n $params = array(\":userstatus\" => 1);\n $results = $db->runSelect($sql,$params);\n \n if ($results != null){\n $datarow = $results;\n }\t\t\n }\n catch(PDOException $ex) {\n echo $ex->getMessage();\n }\n return $datarow;\n }", "function get_vendors($debug = false) {\n\t\t$q = (new QueryBuilder())->table('vendors');\n\t\t$q->where('shipfrom', '');\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'Vendor');\n\t\t\treturn $sql->fetchAll();\n\t\t}\n\t}", "private function createVendorsModel(array $vendors): void\n {\n foreach ($vendors as $vendor) {\n $vendorDetails = $this->splitIntoVendorsAndFoodItems($vendor);\n $oVendor = new Vendor(...$this->splitVendor($vendorDetails[0]));\n foreach (array_slice($vendorDetails, 1) as $foodItem) {\n $foodItemFormatted = $this->splitFoodItem($foodItem);\n $oFoodItem = new FoodItem(...$foodItemFormatted);\n $oVendor->addFoodItem($oFoodItem);\n }\n $this->mVendors->addVendor($oVendor);\n }\n }", "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 GetNewVendorsDataNoti()\n {\n $this->db->select('*,city.city_name,area.area_name');\n $this->db->from('vendor');\n $this->db->join('city','city.city_id=vendor.city_id','left');\n $this->db->join('area','area.area_id=vendor.area_id','left');\n $this->db->where('vendor.verified',0);\n //$this->db->where($condition);\n $query = $this->db->get();\n return $query->result(); \n }", "function _getNewVendors() {\n\n $this->resetResponse();\n\n $newVendors = $this->model->getNewVendors()->result();\n \n if ($newVendors) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $newVendors;\n\n } else {\n $this->_status = FALSE;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n\n return $this->getResponse();\n }", "public function insert($vendor);", "private function populatePaymentTable()\n {\n $preset = $this->getPaymentInfo()->brands;\n\n foreach ($preset as $brand => $value) {\n $this->db->query(\n \"INSERT INTO `\" . DB_PREFIX . \"mundipagg_payments`\n (brand_name, is_enabled, installments_up_to, installments_without_interest, interest)\n VALUES ('\" .\n $brand . \"', \" .\n $value->enabled . \", \" .\n $value->installmentsUpTo . \", \" .\n $value->installmentsWithoutInterest . \", \" .\n $value->interest . \"\n );\"\n );\n }\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 getActivatedVendors();", "public function add_vendor($ins, $vendor_type='default')\n\t{\n\t\t// No vendor_name?\n\t\tif (!isset($ins['vendor_name']) or $ins['vendor_name'] == '')\n\t\t{\n\t\t\t$ins['vendor_name']\t\t\t\t= 'Новый поставщик';\n\t\t}\n\t\t\n\t\t// No delivery_days?\n\t\tif (!isset($ins['delivery_days']) or $ins['delivery_days'] == '')\n\t\t{\n\t\t\t$ins['delivery_days']\t\t\t= '0';\n\t\t}\n\t\t\n\t\t// No price_correction?\n\t\tif (!isset($ins['price_correction']) or $ins['price_correction'] == '')\n\t\t{\n\t\t\t$ins['price_correction']\t= '1.00';\n\t\t}\n\t\t\n\t\t// No Structure id?\n\t\tif (!isset($ins['structure_id']) or $ins['structure_id'] == '')\n\t\t{\n\t\t\t$ins['structure_id']\t\t\t= '1';\n\t\t}\n\t\t\n\t\tif (empty($ins['struct_art_number']))\n\t\t\t$ins['struct_art_number'] = 1;\n\t\t\t\n\t\tif (empty($ins['struct_sup_brand']))\n\t\t\t$ins['struct_sup_brand'] = 2;\n\t\t\t\n\t\tif (empty($ins['struct_description']))\n\t\t\t$ins['struct_description'] = 3;\n\t\t\t\n\t\tif (empty($ins['struct_qty']))\n\t\t\t$ins['struct_qty'] = 4;\n\t\t\t\n\t\tif (empty($ins['struct_price']))\n\t\t\t$ins['struct_price'] = 5;\n\t\t\t\n\t\tif (empty($ins['orderemail']))\n\t\t\t$ins['orderemail'] = NULL;\n\t\t\t\n\t\tif (empty($data['ordername']))\n\t\t\t$data['ordername'] = NULL;\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t// Compile insert\n\t\t$insert = array\n\t\t(\n\t\t\t'vendor_name'\t\t\t\t\t=> $ins['vendor_name'],\n\t\t\t'delivery_days'\t\t\t\t=> preg_replace('#\\D#', '', $ins['delivery_days']),\n\t\t\t'price_correction'\t\t=> $ins['price_correction'],\n\t\t\t'vendor_type'\t\t\t\t\t=> $vendor_type,\n\t\t\t'structure_id'\t\t\t\t=> $ins['structure_id'],\n\t\t\t'struct_art_number'\t\t=> $ins['struct_art_number'],\n\t\t\t'struct_sup_brand'\t\t=> $ins['struct_sup_brand'],\n\t\t\t'struct_description'\t=> $ins['struct_description'],\n\t\t\t'struct_qty'\t\t\t\t\t=> $ins['struct_qty'],\n\t\t\t'struct_price'\t\t\t\t=> $ins['struct_price'],\n\t\t\t'last_update'\t\t\t\t\t=> 0,\n\t\t\t'api_key1'\t\t\t\t\t\t=> $ins['api_key1'],\n\t\t\t'api_key2'\t\t\t\t\t\t=> $ins['api_key2'],\n\t\t\t'orderemail'\t\t\t\t\t=> $ins['orderemail'],\n\t\t\t'ordername'\t\t\t\t\t\t=> $ins['ordername'],\n\t\t);\n\t\t\n\t\t// Set api_id if neccessary\n\t\tif ($ins['api_id'] != '0')\n\t\t{\n\t\t\t$insert['api_id'] = $ins['api_id'];\n\t\t}\n\t\t\n\t\t$this->db->insert('vendors', $insert);\n\t}", "public function addDefaultVendors($company, $owner)\n\t{\n\t\t$now = Carbon::now()->toDateTimeString();\n\t\t$vendorTypes = VendorTypes::where('company_id', 0)->pluck('id', 'name')->toArray();\n\n\t\t$defaulVendors = [\n\t\t\tVendorTypes::MEASUREMENTS => [\n\t\t\t\t'Eagleview',\n\t\t\t\t'Hover',\n\t\t\t\t'CoreLogic / Skymeasuure',\n\t\t\t],\n\t\t\tVendorTypes::OTHERS => [\n\t\t\t\t'Company Cam',\n\t\t\t],\n\t\t\tVendorTypes::SUPPLIERS => [\n\t\t\t\t'SRS',\n\t\t\t\t'ABC',\n\t\t\t],\n\t\t];\n\n\t\t$data = [];\n\t\tforeach ($vendorTypes as $type => $typeId) {\n\t\t\tif(!ine($defaulVendors, $typeId)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$vendors = $defaulVendors[$typeId];\n\n\t\t\tforeach ($vendors as $name) {\n\n\t\t\t\t$data[] = [\n\t\t\t\t\t'display_name' => $name,\n\t\t\t\t\t'company_id' => $company->id,\n\t\t\t\t\t'created_by' => $owner->id,\n\t\t\t\t\t'updated_by' => $owner->id,\n\t\t\t\t\t'type_id' => $typeId,\n\t\t\t\t\t'created_at' => $now,\n\t\t\t\t\t'updated_at' => $now,\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\tif(!empty($data)) {\n\t\t\tVendor::insert($data);\n\t\t}\n\t}", "public function setVendorInformation(?SecurityVendorInformation $value): void {\n $this->getBackingStore()->set('vendorInformation', $value);\n }", "public function updateVendor() {\n try {\n if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(\" Vendor Entity not initialized\");\n } else {\n $objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();\n $objVendor->vendor = $this->vendor;\n return $objVendor->updateVendor();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);\n }\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}", "abstract protected function prepareVendorProductData(int $vendorProductId);", "abstract protected function prepareVendorProductData(int $vendorProductId);", "public function getFieldsByVendorModuleAndTableName($vendor, $module, $tablename){\r\n\r\n\t\t$targetFile = Constants::EXT_DIR.DS.$vendor.DS.$module.Constants::MODULE_DB_TABLES_DIR.DS.$tablename.'.json';\r\n\r\n\t\tif(file_exists($targetFile) && is_file($targetFile)){\r\n\t\t\t$tableContent = file_get_contents($targetFile);\r\n\t\t\t$tableContent = json_decode($tableContent, true);\r\n\r\n\t\t\tif(json_last_error() == JSON_ERROR_NONE){\r\n\t\t\t\t$tableName = $this->getTableNameFromFileName($targetFile);\r\n\t\t\t\t$dbTableName = $this->_connection->getTablename($tableName);\r\n\r\n\t\t\t\t$isExist = $this->fetchTableName($dbTableName);\r\n\t\t\t\t$tableContent['is_installed'] = false;\r\n\t\t\t\tif($isExist){\r\n\t\t\t\t\t$tableContent['is_installed'] = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$tableContent['prefixed_tablename'] = $dbTableName;\r\n\r\n\t\t\t\t$fields = $tableContent['fields'];\r\n\t\t\t\tforeach ($fields as $key => $field) {\r\n\t\t\t\t\t$tableContent['fields'][$key]['is_installed'] = false;\r\n\t\t\t\t\t$isExist = $this->fetchColumnName($dbTableName, $field['name']);\r\n\r\n\t\t\t\t\tif($isExist){\r\n\t\t\t\t\t\t$tableContent['fields'][$key]['is_installed'] = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$installDataTarget = dirname($targetFile) . DS . $tablename.'_data.json';\r\n\t\t\t\t$tableContent['installation_data'] = null;\r\n\r\n\t\t\t\tif(file_exists($installDataTarget)){\r\n\t\t\t\t\t$installDataContent = file_get_contents($installDataTarget);\r\n\t\t\t\t\t$installDataContent = json_decode($installDataContent, true);\r\n\r\n\t\t\t\t\tif(json_last_error() == JSON_ERROR_NONE){\r\n\t\t\t\t\t\t$tableContent['installation_data'] = $installDataContent;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\treturn $tableContent;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getVendorData()\n {\n $ven = MasterVendor::latest()->get();\n return response([\n 'success' => true,\n 'message' => 'List All Vendor',\n 'data' => $ven\n ], 200);\n\n }", "public static function vendorItemsArr(){\n\t\treturn array(\"IANS\"=>array(array(\"name\"=>\"1 slice of cheese or pepperoni pizza\",\"cost\"=>5,\"code\"=>\"IANSSLICE1_\"),array(\"name\"=>\"Small Salad\",\"cost\"=>5,\"code\"=>\"IANSSALAD1_\"),array(\"name\"=>\"Premium Slice\",\"cost\"=>10,\"code\"=>\"IANSSLICE2_\")));\n\t}", "public function datatable_verifikasi_insurance_setup()\n\t{\n\t\t/* Array of database columns which should be read and sent back to DataTables. Use a space where\n\t\t * you want to insert a non-database field (for example a counter or static image)\n\t\t */\n\t\t$aColumns = array( '','mfi_account_insurance.account_insurance_no', 'mfi_cif.nama', 'mfi_product_insurance.product_name','mfi_account_insurance.benefit_value','mfi_account_insurance.premium_value','mfi_account_insurance.status_rekening','');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"WHERE (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sWhere = \"where mfi_account_insurance.status_rekening ='0'\";\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\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$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_verifikasi_insurance_setup($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_verifikasi_insurance_setup($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_verifikasi_insurance_setup(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\t$row[] = '<input type=\"checkbox\" value=\"'.$aRow['account_insurance_id'].'\" id=\"checkbox\" class=\"checkboxes\" >';\n\t\t\t$row[] = $aRow['account_insurance_no'];\n\t\t\t$row[] = $aRow['nama'];\n\t\t\t$row[] = $aRow['product_name'];\n\t\t\t$row[] = $aRow['benefit_value'];\n\t\t\t$row[] = $aRow['premium_value'];\n\t\t\t$row[] = $aRow['status_rekening'];\n\t\t\t$row[] = '<a href=\"javascript:;\" account_insurance_id=\"'.$aRow['account_insurance_id'].'\" id=\"link-edit\">Verifikasi</a>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "public function vendors2()\n {\n return $this->morphedByMany('Vendor', 'taggable', 'Taggable');\n }", "public function wp_varejoecom_shipping_company_table() : void\n {\n global $wpdb;\n require_once(ABSPATH. 'wp-admin/includes/upgrade.php');\n\n $tableName = $wpdb->prefix . $this->table_name;\n $charset_collate = $wpdb->get_charset_collate();\n\n $sql = \"CREATE TABLE $tableName(\n id INT AUTO_INCREMENT PRIMARY KEY,\n identifier INT NOT NULL,\n name VARCHAR(255) NOT NULL,\n cnpj VARCHAR(20) NOT NULL,\n status VARCHAR(100) NOT NULL\n )$charset_collate;\n \";\n maybe_create_table($tableName, $sql);\n }", "public function getvendorsAction()\n {\n \t\n \t$vendorsmodel= new Default_Model_Vendors();\n \t$vendorsdataArr=$vendorsmodel->getVendorsList();\n \n \t$opt='<option value=\\'\\'>Select Vendor</option>';\n \n \tif(sizeof($vendorsdataArr)>0){\n \t\t\n \t\tforeach($vendorsdataArr as $vendors)\n \t\t{\n \t\t\t$opt.=\"<option value='\".$vendors['id'].\"'>\".$vendors['name'].\"</option>\";\n \t\t}\n \t}\n \t\n \t\n \t \t\n \t$this->_helper->json(array('options'=>utf8_encode($opt)));\n \t\n \t\n }", "public function run()\n {\n $vendors = [\n [\n 'country_id' => 1,\n 'state_id' => 12,\n 'district_id' => 164,\n 'vendor_category_id' => 1,\n 'name' => 'Ganesha Operation',\n 'description' => 'Bimbel Ganesha Operation merupakan lembaga bimbingan belajar terbaik dan terbesar di Indonesia. Berdiri sejak 2 Mei 1984 di Kota Bandung, saat ini Ganesha Operation telah tersebar di 265 kota di Indonesia, mulai dari Aceh hingga Ambon.',\n 'logo' => 'https://ganeshaoperation.com/img/logo5.png',\n 'email' => '[email protected]',\n 'bank_account_number' => null,\n 'website' => 'https://ganeshaoperation.com/',\n 'address' => 'Jln. Purnawarman No. 36B Bandung',\n 'phone' => '+62 81806667660'\n ],\n [\n 'country_id' => 1,\n 'state_id' => 12,\n 'district_id' => 3,\n 'vendor_category_id' => 1,\n 'name' => 'Primagama',\n 'description' => 'Primagama adalah usaha jasa pendidikan luar sekolah yang bergerak dibidang bimbingan belajar, didirikan tahun 1982, tepatnya pada tanggal 10 Maret 1982 di Yogyakarta. Program Bimbingan Belajar Primagama memiliki pasar sangat luas (siswa 3,4,5,6 SD – 7,8,9 SMP, dan 10,11,12 SMA IPA/IPS) dengan target pendidikan adalah meningkatkan prestasi akademik di sekolah, Ujian Akhir Sekolah, Ujian Nasional , dan Sukses Ujian Masuk Perguruan Tinggi Negeri/Favorit serta sekolah kedinasan (bagi SMA/SMK).',\n 'logo' => 'https://www.primagama.co.id/assets/images/logo.svg',\n 'email' => '[email protected]',\n 'bank_account_number' => null,\n 'website' => 'https://www.primagama.co.id/',\n 'address' => 'Jl. HOS Cokroaminoto, Ruko Cokro Square Blok I No.124, Yogyakarta (55244), Indonesia.',\n 'phone' => '0274 - 619 853'\n ],\n [\n 'country_id' => 1,\n 'state_id' => 11,\n 'district_id' => 3,\n 'vendor_category_id' => 2,\n 'name' => 'Pintaria',\n 'description' => 'Pintaria merupakan portal pendidikan yang menawarkan produk kuliah S1/S2 dengan metode blended learning dan program kursus lainnya. Pintaria bekerjasama dengan kampus-kampus unggulan yang terakreditasi BAN-PT di Indonesia.',\n 'logo' => 'https://storage.googleapis.com/cdn-1.pintaria.com/pintaria/homepage-settings/assets/image/logo-pintaria-white.png',\n 'email' => '[email protected]',\n 'bank_account_number' => null,\n 'website' => 'https://pintaria.com/',\n 'address' => 'Komplek Ruko Sentra Arteri Mas. Jl. Sultan Iskandar Muda No. 10L. Kebayoran Lama, Jakarta 12241 – INDONESIA',\n 'phone' => '+6281382765493'\n ],\n ];\n\n foreach ($vendors as $vendor) {\n Vendor::create(array_merge($vendor, [\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]));\n };\n }", "function get_columns(){\n\n\t\t$columns = array(\n\t\t\t\t\t\t\t'code'\t\t\t=>\t__( 'Voucher Code', 'woovoucher' ),\n\t\t\t\t\t\t\t'product_info'\t=>\t__(\t'Product Information', 'woovoucher' ),\n\t\t\t\t\t\t\t'buyers_info'\t=>\t__(\t'Buyer\\'s Information', 'woovoucher' ),\n\t\t\t\t\t\t\t'order_info'\t=>\t__(\t'Order Information', 'woovoucher' ),\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'redeem_by'\t\t=>\t__(\t'Redeem Information', 'woovoucher' ),\n\t\t\t\t\t);\n\n\t\treturn apply_filters( 'woo_vou_used_add_column', $columns );\n\t}", "public function processVendor()\n {\n $directory=\"data/vendor\";\n set_time_limit(160);\n \n\n $files = File::allFiles($directory);\n\n foreach ($files as $file) {\n $file_exists=File_load::where('file_name', $file)\n ->where('type', 10)\n ->exists();\n if(!$file_exists){\n $count_insert=0;\n $count_update=0;\n \n $data = Excel::load($file)->toArray();\n foreach ($data as $row) {\n \n $data_value=$row;\n if (Vendor::where('vendor_number', '=', $data_value['vendornumber'])->count() > 0) {\n $vendor= Vendor::where('vendor_number', '=', $data_value['vendornumber'])->first();\n $vendor->name = $data_value['vendorname'];\n $budget_monthly->save();\n $count_update++;\n }else{\n $vendor=Vendor::create([\n 'vendor_number' => $data_value['vendornumber'],\n 'name' => $data_value['vendorname'],\n 'account_number' => \"\"\n ]); \n $count_insert++;\n } \n \n \n }\n\n File_load::create([\n 'file_name' => $file,\n 'type' => 10, \n 'count_insert'=> $count_insert,\n 'count_update'=> $count_update, \n ]);\n }\n } \n return \"Data Inserted\";\n }", "function admin_vendor_report(){\n\t\t\n\t\t$this->layout='backend/backend';\n\t\t$this->set(\"title_for_layout\",VENDOR_REPORT);\n\t\t$conditions = array(\"Vendor.is_deleted\"=>\"0\");\n\t\t\n\t\t$name = isset($this->params['url']['name'])?$this->params['url']['name']:(isset($this->params['named']['name'])?$this->params['named']['name']:\"\");\n\t\tif(trim($name) != \"\"){\n\t\t\t$conditions = array_merge($conditions ,array(\"Vendor.name like\"=>\"%\".trim($name).\"%\"));\n\t\t}\t\t\n\t\t\n\t\t$is_active = isset($this->params['url']['is_active'])?trim($this->params['url']['is_active']):(isset($this->params['named']['is_active'])?$this->params['named']['is_active']:\"\");\n\t\t\n\t\tif(trim($is_active) != \"\"){\n\t\t\t$conditions = array_merge($conditions ,array(\"Vendor.is_active\"=>$is_active));\n\t\t}\n\t\t\n\t\t$from = isset($this->params['url']['from'])?$this->params['url']['from']:(isset($this->params['named']['from'])?$this->params['named']['from']:\"\");\n\t\t$to = isset($this->params['url']['to'])?$this->params['url']['to']:(isset($this->params['named']['to'])?$this->params['named']['to']:\"\");\n \n\t\tif(trim($from) != \"\"){\n\t\t\t$from = $this->covertToSystemDate($from);\n\t\t\t$conditions = array_merge($conditions ,array(\"DATE_FORMAT(Vendor.modified,'%Y-%m-%d') >=\"=>trim($from)));\n\t\t}\n\t\tif(trim($to) != \"\"){\n\t\t\t$to = $this->covertToSystemDate($to);\n\t\t\t$conditions = array_merge($conditions ,array(\"DATE_FORMAT(Vendor.modified,'%Y-%m-%d') <=\"=>trim($to)));\n\t\t}\n\t\t\n\t\t$sort = isset($this->params['url']['sort'])?$this->params['url']['sort']:(isset($this->params['named']['sort'])?$this->params['named']['sort']:\"total_price\");\n\t\t$direction = isset($this->params['url']['direction'])?$this->params['url']['direction']:(isset($this->params['named']['direction'])?$this->params['named']['direction']:\"desc\");\n\t\t\n\t\t$field = array('Vendor.*','sum(CouponSale.price) AS total_price');\n\t\t$join_coupon_sell = array('table'=>'coupon_sales','alias'=>'CouponSale','forignKey'=>false,'type'=>'left','conditions'=>array('CouponSale.vendor_id = Vendor.id'));\n\t\t\n\t\t$this->paginate = array(\"fields\"=>$field,\"joins\"=>array($join_coupon_sell),\"conditions\"=>$conditions,\"limit\"=>VENDOR_LIMIT,'group' => 'Vendor.id','passit' => array(\"sort\"=>$sort,\"direction\"=>$direction));\n\t\t$vendor_data = $this->paginate('Vendor');\n\t\t$this->set('vendor_data',$vendor_data);\n\t\t\n\t\t$csv_export = isset($this->params['url']['export_to_csv'])?$this->params['url']['export_to_csv']:(isset($this->params['named']['export_to_csv'])?$this->params['named']['export_to_csv']:\"paginate\");\n\t\tif($csv_export==\"csv\"){\n\t\t $this->layout = \"\";\n\t\t $this->generate_vendor_report_csv($vendor_data);\n\t\t}\n\t\t\n\t\t$pdf_export = isset($this->params['url']['export_to_pdf'])?$this->params['url']['export_to_pdf']:(isset($this->params['named']['export_to_pdf'])?$this->params['named']['export_to_pdf']:\"paginate\");\n\t\tif($pdf_export == \"pdf\"){\n\t\t\t$this->layout = \"\";\n\t\t\t$this->generate_vendor_report_pdf($vendor_data);\n\t\t}\n\t\t\n\t}", "public function page_vendors() {\n $action = isset( $_GET['action'] ) ? $_GET['action'] : 'list';\n $id = isset( $_GET['id'] ) ? intval( $_GET['id'] ) : 0;\n\n switch ($action) {\n case 'view':\n $vendor = new \\WeDevs\\ERP\\People( $id );\n $template = dirname( __FILE__ ) . '/views/vendor/single.php';\n break;\n\n case 'edit':\n $template = dirname( __FILE__ ) . '/views/vendor/edit.php';\n break;\n\n case 'new':\n $template = dirname( __FILE__ ) . '/views/vendor/new.php';\n break;\n\n default:\n $template = dirname( __FILE__ ) . '/views/vendor/list.php';\n break;\n }\n\n if ( file_exists( $template ) ) {\n include $template;\n }\n }", "public function setVendor(string $vendor)\n {\n }", "public function addVendor(Vendor $vendor): void\n {\n $this->vendors[] = $vendor;\n }", "public function getVendorName(): string;", "function particularvendorlist($id)\n\t{\n\t\t$getParvendor=\"SELECT * from vendor where vendor_id = $id\";\n\t\t$vendor_data=$this->get_results( $getParvendor );\n\t\treturn $vendor_data;\n\t}", "public function testDestiny2GetPublicVendors()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function ss_options_install() {\n\n global $wpdb;\n\n $table_name = $wpdb->prefix . \"company\";\n $charset_collate = $wpdb->get_charset_collate();\n $sql = \"CREATE TABLE $table_name (\n `id` varchar(3) CHARACTER SET utf8 NOT NULL,\n `company_name` varchar(50) CHARACTER SET utf8 NOT NULL,\n\t\t `year_of_incorporation` varchar(50) CHARACTER SET utf8 NOT NULL,\n \t `industry` varchar(150) CHARACTER SET utf8 NOT NULL,\n\t\t\t`country` varchar(150) CHARACTER SET utf8 NOT NULL,\n\t\t\t`subsidiaries` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t\t\t`website` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t\t\t`CEO` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t\t\t`board_members` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t\t `key_investors` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t \t`asset_price` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t\t\t`mission_statements` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t\t\t`awards` varchar(300) CHARACTER SET utf8 NOT NULL,\n\t\t\t`about` varchar(300) CHARACTER SET utf8 NOT NULL,\n\n PRIMARY KEY (`id`)\n ) $charset_collate; \";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta($sql);\n}", "public function getVendorId() {}", "function generate_vendor_report_csv($vendor_data=array()){\n\t\t\n\t\tApp::import('Helper','csv');\n\t\t$csv = new csvHelper();\n\t\t$line = array('Vendor Name','Status','Total Sale(DKK)','Modified');\n\t\t$csv->addRow($line);\n\t\tif(!empty($vendor_data)){\n\t\t\t$status = array('Deactive','Active');\n\t\t\t\n\t\t\tforeach($vendor_data as $data){\n\t\t\t$sold_price = $data[0]['total_price'];\n\t\t\t$line = array(ucfirst($data['Vendor']['name']),$status[$data['Vendor']['is_active']],sprintf('%0.2f',$sold_price),$data['Vendor']['modified']);\n\t\t\t$csv->addRow($line);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $csv->render(\"vendor_report\".date(\"d/M/Y\"));\n\t\texit();\n\t}", "public static function showVendorsDetails($vendorId)\n { \n DB::enableQueryLog();\n\n $vendorTable = self::tableName();\n $query = self::getList()\n ->addSelect([\n Branch::tableName().'.restaurant_type',\n Branch::tableName().'.order_type',\n Branch::tableName().'.availability_status',\n Branch::tableName().'.approved_status', \n Branch::tableName().'.branch_id',\n DB::raw(\"group_concat( DISTINCT( \".BranchCategory::tableName().\".category_id) ) as category_ids\"),\n \n DB::raw(\"(SELECT group_concat(category_name) FROM category_lang AS CL LEFT JOIN branch_category AS BC ON BC.category_id = CL.category_id WHERE branch_id = B.branch_id and language_code = '\".App::getLocale().\"') as product_stock\"),\n\n DB::raw(\"group_concat( ( CL.category_name) ) as category_name\"),\n // DB::raw(\"group_concat( ( \".BranchCuisine::tableName().\".cuisine_id) ) as cuisine_id\"),\n // DB::raw(\"group_concat( ( CUL.cuisine_name) ) as cuisine_name\"),\n // DB::raw(\"group_concat( ( \".BranchDeliveryArea::tableName().\".delivery_area_id) ) as delivery_area_id\"),\n // DB::raw(\"group_concat( ( DAL.delivery_area_name) ) as delivery_area_name\"),\n ])\n ->leftjoin(Country::tableName(),\"$vendorTable.country_id\",Country::tableName().'.country_id')\n ->leftjoin(City::tableName(),\"$vendorTable.city_id\",City::tableName().'.city_id')\n ->leftjoin(Area::tableName(),\"$vendorTable.area_id\",Area::tableName().'.area_id')\n ->leftjoin(Branch::tableName(),\"$vendorTable.vendor_id\",Branch::tableName().'.vendor_id')\n ->leftjoin(BranchCategory::tableName(),Branch::tableName().'.branch_id',BranchCategory::tableName().'.branch_id')\n ->leftjoin(Category::tableName(),BranchCategory::tableName().'.category_id',Category::tableName().'.category_id')\n ->leftjoin(BranchCuisine::tableName(),Branch::tableName().'.branch_id',BranchCuisine::tableName().'.branch_id')\n ->leftjoin(Cuisine::tableName(),BranchCuisine::tableName().'.cuisine_id',Cuisine::tableName().'.cuisine_id')\n ->leftjoin(BranchDeliveryArea::tableName(),Branch::tableName().'.branch_id',BranchDeliveryArea::tableName().'.branch_id')\n ->leftjoin(DeliveryArea::tableName(),BranchDeliveryArea::tableName().'.delivery_area_id',DeliveryArea::tableName().'.delivery_area_id');\n CountryLang::selectTranslation($query,'CYL');\n CityLang::selectTranslation($query,'CTL');\n AreaLang::selectTranslation($query);\n BranchLang::selectTranslation($query);\n CategoryLang::selectTranslation($query);\n CuisineLang::selectTranslation($query,'CUL');\n DeliveryAreaLang::selectTranslation($query);\n $query->where([\"$vendorTable.vendor_key\" => $vendorId])\n ->groupBy(\"$vendorTable.vendor_id\"); \n \n $data = $query->first();\n// print_r(\n// DB::getQueryLog()\n// );\n// exit;\n return $data;\n }", "public function insertCustomerVendorTable()\n {\n $statusComplete=false;\n try {\n // run your code here\n foreach ($this->vendor_id as $key => $VID) {\n\n $this->row = $sqlSellOrderType = \"INSERT INTO `pish_customer_vendor` (`customer_id`, `vendor_id`,`order_id` ) VALUES ($this->hika_user_id,\" . $VID['id'] .\",\".$this->last_id. \")\";\n $result = $this->conn->query($sqlSellOrderType);\n if($result){\n $statusComplete =true;\n }else{\n $statusComplete = false;\n break;\n }\n\n }\n } catch (exception $e) {\n //code to handle the exception\n return false;\n }\n return $statusComplete;\n }", "public function testDestiny2GetVendor()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getFieldId()\n {\n \treturn 'product_vendor';\n }", "public function addVendor($body)\n {\n list($response, $statusCode, $httpHeader) = $this->addVendorWithHttpInfo ($body);\n return $response; \n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }", "function get_vendors_array()\n{\t\t\n$sql = 'SELECT vendors_id, vendors_name FROM vendors ORDER BY vendors_id';\n$sqlquery=mysql_query($sql);\n$i=0;\nwhile ($container= mysql_fetch_assoc($sqlquery))\n{\n$dbshiparray[$i]=$container;\n$i++;\n}\nreturn $dbshiparray;\n}", "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 }", "function _getActiveVendors() {\n $this->resetResponse();\n if ($this->ci->session->userdata('user_id') != null) {\n $archived = $this->ci->input->post('archived', true);\n\n $result = $this->model->getActiveVendors('*', array(\"person_type\" => Globals::PERSON_TYPE_VENDOR, \"person_archived\" => $archived))->result();\n\n if ($result) {\n $this->_status = true;\n $this->_message = '';\n $this->_rdata = $result;\n\n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('no_records_found');\n }\n \n } else {\n $this->_status = false;\n $this->_message = $this->ci->lang->line('invalid_user');\n \n }\n\n return $this->getResponse();\n }", "public function install()\n {\n $query = \"ALTER TABLE `\" . Common::prefixTable('log_visit') . \"` ADD `location_provider` VARCHAR(200) NULL\";\n\n // if the column already exist do not throw error. Could be installed twice...\n try {\n Db::exec($query);\n } catch (Exception $e) {\n if (!Db::get()->isErrNo($e, '1060')) {\n throw $e;\n }\n }\n }", "public function install_specifics()\n {\n global $PROBED_FORUM_CONFIG;\n $a = array();\n $a['name'] = 'mybb_table_prefix';\n $a['default'] = array_key_exists('sql_tbl_prefix', $PROBED_FORUM_CONFIG) ? $PROBED_FORUM_CONFIG['sql_tbl_prefix'] : 'mybb_';\n $a['description'] = do_lang('MOST_DEFAULT');\n $a['title'] = 'MyBB ' . do_lang('TABLE_PREFIX');\n return array($a);\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 function addThirdPartyVendor(Request $request){\n // return $request->all();\n\n if (isset($request->third_party_vendors)) {\n $restaurantThirdPartyVendors = RestaurantSettingsThirdPartyVendor::where('restaurant_id', Auth::guard('restaurantUser')->user()->restaurant_id)->get();\n\n for ($i = 0; $i < count($request->third_party_vendors); $i++) {\n\n //check for availability\n $status = false;\n\n foreach ($restaurantThirdPartyVendors as $key => $restaurantThirdPartyVendor) {\n if ($restaurantThirdPartyVendor->third_party_vendors_id == $request->third_party_vendors[$i]) {\n $status = true;\n\n }\n }\n\n if ($status == false) {\n $socialLink = new RestaurantSettingsThirdPartyVendor;\n $socialLink->third_party_vendors_id = $request->third_party_vendors[$i];\n $socialLink->restaurant_id = Auth::guard('restaurantUser')->user()->restaurant_id;\n $socialLink->user_id = Auth::guard('restaurantUser')->id();\n $socialLink->save();\n }\n\n }\n }\n\n return response()->json(['success'=> 'created successfully'], 200);\n\n\n }", "function bindVenueObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'Venues', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->venue_id))\r\n\t {\r\n\t $table->load( $this->venue_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t if (!array_key_exists($prop, $properties))\r\n\t\t {\r\n\t\t $this->$prop = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}", "function getVendorname(){\r\n return $this->vendorname;\r\n }", "function wc_veruspay_add_order_column_header( $columns ) {\n $wc_veruspay_new_columns = array();\n foreach ( $columns as $column_name => $column_info ) {\n\t\t$wc_veruspay_new_columns[ $column_name ] = $column_info;\n\t\tif ( 'order_status' == $column_name ) {\n\t\t\t$wc_veruspay_new_columns['verus_addr'] = __( 'Crypto Address', 'veruspay-verus-gateway' );\n\t\t}\n if ( 'order_total' == $column_name ) {\n $wc_veruspay_new_columns['verus_total'] = __( 'Crypto Total', 'veruspay-verus-gateway' );\n }\n }\n return $wc_veruspay_new_columns;\n}", "function eddenvato_add_id($columns) {\n //$columns['user_id'] = 'User ID';\n $columns['purchase_codes'] = 'Purchase Codes';\n return $columns;\n}", "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}", "protected function output_vendor_info( $refresh = false ) {\n\n\t\tif ( ! empty( $this->browser_args['vendor'] ) ):\n\n\t\t\t$vendor = $this->browser_args['vendor'];\n\n\t\t\t$defaults = array(\n\t\t\t\t'name' => '',\n\t\t\t\t'url' => '',\n\t\t\t\t'logo' => '',\n\t\t\t\t'avatar' => '',\n\t\t\t\t'social' => '',\n\t\t\t);\n\t\t\t$vendor = wp_parse_args( $vendor, $defaults );\n?>\n\t\t\t<div class=\"wp-shp-browser-vendor\">\n\n\t\t\t\t<script>\n\t\t\t\t\tjQuery(document).ready(function($) {\n\t\t\t\t\t\t$('.vendor-avatar, .bubble').on( 'hover', function(){\n\t\t\t\t\t\t\t$('.bubble').toggle();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t</script>\n\n\n\t\t\t\t<div class=\"bubble\">\n \t\t\t\t\t<?php echo __( \"Enjoying my plugins? Cool! Here's my complete list. I'm constantly working on new stuff so, follow me on Twitter for news.<br/><br/>I'm also a Web Developer and WordPress consultant. Contact me if you need custom development. Cheers!\" ); ?>\n\t\t\t\t</div>\n\n\t\t\t\t<?php echo html( 'a', array( 'href' => esc_url( $vendor['url'] ), 'rel' => 'nofollow' ), ( $vendor['avatar'] ? html( 'span class=\"vendor-avatar\"', get_avatar( $vendor['avatar'], 55 ) ) : ( $vendor['logo'] ? '<img class=\"vendor-logo\" src=\"' . esc_attr( $vendor['logo'] ) . '\">' : '' ) ) ); ?>\n\n\t\t\t\t<div class=\"wp-shp-browser-vendor-info\">\n\n\t\t\t\t\t<?php if ( ! $vendor['logo'] ): ?>\n\t\t\t\t\t\t<div class=\"wp-shp-browser-vendor-name\"><?php echo html( 'a', array( 'href' => esc_url( $vendor['url'] ), 'rel' => 'nofollow' ),$vendor['name'] ); ?></div>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t\t<?php if ( $vendor['social'] ): ?>\n\t\t\t\t\t\t<div class=\"wp-shp-browser-social\">\n\t\t\t\t\t\t\t<?php foreach( $vendor['social'] as $social_id => $url ): ?>\n\n\t\t\t\t\t\t\t\t<?php if ( ! $url ) continue; ?>\n\n\t\t\t\t\t\t\t\t<a href=\"<?php echo $url; ?>\" title=\"<?php echo $this->get_social( $social_id, 'description' ); ?>\"><div class=\"dashicons dashicons-<?php echo esc_attr( $social_id ); ?>\"></div></a>\n\n\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php endif; ?>\n\n\t\t\t\t</div>\n\t\t\t</div>\n<?php\n\t\tendif;\n\t}", "private function createViewManufacturer()\n {\n $this->addView('ListFabricanteSample', 'FabricanteSample', 'manufacturers', 'fas fa-tasks');\n $this->addSearchFields('ListFabricanteSample', ['codfabricante']);\n $this->addOrderBy('ListFabricanteSample', ['codfabricante'], 'reference');\n $this->addOrderBy('ListFabricanteSample', ['nombre'], 'name');\n $manufacturers = $this->codeModel::all('fabricantes', 'codfabricante', 'nombre');\n $this->addFilterSelect('ListFabricanteSample', 'codfabricante', 'manufacturer', 'codfabricante', $manufacturers);\n }", "public function update_vendor($id, $data)\n\t{\n\t\t// Unset, if neccessary\n\t\tif ($data['api_id'] == '0')\n\t\t\t$data['api_id'] = NULL;\n\t\t\n\t\tif (empty($data['orderemail']))\n\t\t\t$data['orderemail'] = NULL;\n\t\t\t\n\t\tif (empty($data['ordername']))\n\t\t\t$data['ordername'] = NULL;\n\t\t\n\t\t// Limit to this vendor_id\n\t\t$this->db->where('id', $id);\n\t\t\n\t\t// Perform an update\n\t\t$this->db->update('vendors', $data);\n\t}", "function VehicleDetails(){\n\t\tparent::getVehicleDetails();\n\t\t$this -> addVehicleDetails();\n\t}", "public function get_offering_by_vendor($id) {\n $this->db->select('business_services.*,business_services_details.service_type,business_services_details.description,business_services_details.price,business_services_details.duration,business_programs.type');\n $this->db->from('business_services');\n $this->db->join('business_services_details', 'business_services_details.service_id = business_services.id', 'left');\n $this->db->join('business_programs', 'business_programs.id = business_services.program_id', 'left');\n $this->db->where('business_programs.business_id', $id);\n $services_query = $this->db->get();\n $services_results = $services_query->result();\n\n foreach ($services_results as $key => $value) {\n $this->db->select('business_service_gallery.*');\n $this->db->from('business_service_gallery');\n $this->db->where('business_service_gallery.service_id', $value->id);\n $gallery_query = $this->db->get();\n $gallery_result = $gallery_query->result();\n\n if ($value->type == 'Packages') {\n $services['Packages'][] = $value;\n $services['Packages'][$key]->gallery = $gallery_result;\n } elseif ($value->type == 'Offerings') {\n $services['Offerings'][] = $value;\n $services['Offerings'][$key]->gallery = $gallery_result;\n } else {\n $services['Sessions'][] = $value;\n $services['Sessions'][$key]->gallery = $gallery_result;\n }\n }\n\n return $services;\n }", "protected function _getVendorCollection()\n {\n if (is_null($this->_vendorCollection)) {\n $queryText = $this->getQueryText();\n $vendorShoptable = $this->_resourceConnection->getTableName('ced_csmarketplace_vendor_shop');\n $this->_vendorCollection = $this->_collectionFactory->create();\n $this->_vendorCollection->addAttributeToSelect('*');\n //$this->_vendorCollection->getSelect()->join(['vendor_shop' => $vendorShoptable], 'e.entity_id=vendor_shop.vendor_id AND vendor_shop.shop_disable=' . Vshop::ENABLED, ['shop_disable']);\n\n $this->_vendorCollection->addAttributeToFilter('meta_keywords', ['like' => '%' . $queryText . '%']);\n if ($this->_csmarketplaceHelper->isSharingEnabled()) {\n $this->_vendorCollection->addAttributeToFilter('website_id', $this->_storeManager->getStore()->getWebsiteId());\n }\n\n if ($this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::MODULE_ENABLE)) {\n //------------------- Custom Filter----------------[START]\n\n $savedLocationFromSession = $this->_hyperlocalHelper->getShippingLocationFromSession();\n $filterType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_TYPE);\n $radiusConfig = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_RADIUS);\n $distanceType = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::DISTANCE_TYPE);\n $apiKey = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::API_KEY);\n $filterProductsBy = $this->_csmarketplaceHelper->getStoreConfig(HyperlocalHelper::FILTER_PRODUCTS_BY);\n\n if ($filterProductsBy == 'vendor_location' || $filterType == 'distance') {\n $vendorIds = [0];\n if ($savedLocationFromSession) {\n\n /** Filter Products By Vendor Location */\n if ($filterType == 'city_state_country') {\n\n //------------------- Filter By City,country & state----------------[START]\n $locationCollection = $this->_hyperlocalHelper->getFilteredlocationByCityStateCountry($savedLocationFromSession);\n if ($locationCollection) {\n $vendorIds = $locationCollection->getColumnValues('vendor_id');\n }\n\n //------------------- Filter By City,country & state----------------[END]\n } elseif ($filterType == 'zipcode' && isset($savedLocationFromSession['filterZipcode'])) {\n\n //------------------- Filter By Zipcode----------------[START]\n $resource = $this->_resourceConnection;\n $tableName = $resource->getTableName('ced_cshyperlocal_shipping_area');\n $this->zipcodeCollection->getSelect()->joinLeft($tableName, 'main_table.location_id = ' . $tableName . '.id', ['status', 'is_origin_address']);\n $this->zipcodeCollection->addFieldToFilter('main_table.zipcode', $savedLocationFromSession['filterZipcode'])\n ->addFieldToFilter('status', Shiparea::STATUS_ENABLED);\n $this->zipcodeCollection->getSelect()->where(\"`is_origin_address` IS NULL OR `is_origin_address` = '0'\");\n $vendorIds = $this->zipcodeCollection->getColumnValues('vendor_id');\n //------------------- Filter By Zipcode----------------[END]\n } elseif ($filterType == 'distance') {\n $tolat = $savedLocationFromSession['latitude'];\n $tolong = $savedLocationFromSession['longitude'];\n $vIds = [];\n if ($tolat != '' && $tolong != '') {\n $vendorCollection = $this->_collectionFactory->create();\n $vendorCollection->addAttributeToSelect('*');\n if ($vendorCollection->count()) {\n foreach ($vendorCollection as $vendor) {\n $distance = $this->_hyperlocalHelper->calculateDistancebyHaversine($vendor->getLatitude(), $vendor->getLongitude(), $tolat, $tolong);\n if ($distance <= $radiusConfig) {\n $vendorIds[] = $vendor->getId();\n }\n }\n }\n }\n }\n $this->_vendorCollection->addAttributeToFilter('entity_id', ['in' => $vendorIds]);\n }\n }\n //------------------- Custom Filter ----------------[END]\n }\n\n $this->prepareSortableFields();\n }\n return $this->_vendorCollection;\n }", "public function maybe_update_terms_price_table() {\n global $wpdb;\n\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.8', '<' ) ) {\n return;\n }\n\n $table = $wpdb->prefix . 'laterpay_terms_price';\n $columns = $wpdb->get_results( 'SHOW COLUMNS FROM ' . $table .';' );\n\n // before version 0.9.8 we had no 'revenue_model' column\n $is_up_to_date = false;\n $modified = false;\n foreach ( $columns as $column ) {\n if ( $column->Field === 'revenue_model' ) {\n $modified = strpos( strtolower( $column->Type ), 'enum' ) !== false;\n $is_up_to_date = true;\n }\n }\n\n $this->logger->info(\n __METHOD__,\n array(\n 'current_version' => $current_version,\n 'is_up_to_date' => $is_up_to_date,\n )\n );\n\n // if the table needs an update, add the 'revenue_model' column and set the current values to 'ppu'\n if ( ! $is_up_to_date ) {\n $wpdb->query( 'ALTER TABLE ' . $table . \" ADD revenue_model CHAR( 3 ) NOT NULL DEFAULT 'ppu';\" );\n }\n\n // change revenue model column data type to ENUM\n if ( ! $modified ) {\n $wpdb->query( 'ALTER TABLE ' . $table . \" MODIFY revenue_model ENUM('ppu', 'sis') NOT NULL DEFAULT 'ppu';\" );\n }\n }", "function tableInfo($table) {\r\n\t\t$res = $this->db->Execute($this->db->metaColumnsSQL);\r\n\t\t$info = $res->FetchRow();\r\n\t\t$newInfo = array('Typ' => $info['Engine'],\r\n\t\t\t\t\t\t 'Kodowanie' => $info['Collation'],\r\n\t\t\t\t\t\t 'Ilość rekordów' => $info['Rows'],\r\n\t\t\t\t\t\t 'Data utworzenia' => $info['Create_time'],\r\n\t\t\t\t\t\t 'Data ostatniej modyfikacji' => $info['Update_time'],\r\n\t\t\t\t\t\t 'Następny numer' => empty($info['Auto_increment']) ? 1 : $info['Auto_increment']\r\n\t\t\t\t\t\t);\r\n\t\treturn $newInfo;\r\n\t}", "public function productVendorLoad()\n\t{\n\t\t$product_id = $this->request->input('product_id');\n\t\t$locality_change_val = $this->request->input('locality_change_val');\n\t\t$selectVendorLocationIdQuery = DB::select(\"SELECT vendor_location_id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM product_vendor_locations\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE product_id = '$product_id'\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND id = '$locality_change_val'\");\n\n\t\t$selectVendorLocationId = $selectVendorLocationIdQuery[0]->vendor_location_id;\n\t\techo '<input type=\"hidden\" id=\"locality_val\" value=\"'.$selectVendorLocationId.'\">';\n\t}", "private function getTables() {\n\t\t$this->_vm_product = $this->getTable('vm_product');\n\t}", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "public function generateVendorCode()\n {\n $count = Sentinel::findRoleBySlug('vendor')->users()->with('roles')->count() + 1;\n // $count = User::count() + 1;\n\n if ($count < 10) {\n $c = '000' . $count;\n }elseif ($count >= 10 && $count < 100){\n $c = '00'.$count;\n }elseif ($count >= 100 && $count < 1000){\n $c = '0'.$count;\n }else{\n $c = $count;\n }\n return 'INVESTICA_' . date('Ymd') . '_' .$c;\n }", "protected function getVendorOrders() {\n\n\t\t$this->load->model('sale/vdi_order');\n\t\t$data = array();\n\n if (isset($this->request->request['filter_order_status'])) {\n //check input - should be list of integers\n if (1 === preg_match('/^[0-9,\\s]+$/',\n $this->request->request['filter_order_status'])) {\n $data['filter_order_status'] = $this->request->request['filter_order_status'];\n }\n }\n\n $result = array();\n $orderCount = $this->model_sale_vdi_order->getTotalOrders($data);\n $result['total_order_count'] = $orderCount;\n\n if (!isset($this->request->request['metaonly']) ||\n (\"true\" !== $this->request->request['metaonly'])) {\n $orders = $this->model_sale_vdi_order->getOrdersByOrderProductStatus($data);\n $result['orders'] = $orders;\n }\n\n\t\treturn $result;\n\t}", "public function __construct($andmoraho_vendors, $version)\n {\n $this->andmoraho_vendors = $andmoraho_vendors;\n $this->version = $version;\n }", "protected function provideTableClassNameMap(): void\n {\n $list = $this->tempMerge('tca.meta.classNameMap', 'tca.classNameMap');\n if (is_array($list)) {\n NamingUtil::$tcaTableClassNameMap = array_merge(NamingUtil::$tcaTableClassNameMap, $list);\n }\n }", "public function createTableJsonSchema($vendor, $module, $tableOptions){\r\n\t\t$tablename = $this->cleanName($tableOptions['tablename']);\r\n\r\n\t\tif( strtolower($tablename) == 'extension' || strtolower($tablename) == 'system_admin'){\r\n\t\t\tthrow new \\Exception('Table name \"extension\" or \"system_admin\" is reserved for Opoink use, please use another table name.', 406);\r\n\t\t}\r\n\r\n\t\t$targetFile = Constants::EXT_DIR.DS.$vendor.DS.$module.Constants::MODULE_DB_TABLES_DIR.DS.$tablename.'.json';\r\n\r\n\t\tif(file_exists($targetFile)){\r\n\t\t\tthrow new \\Exception(\"Database table \".$tablename.\" already exist\", 406);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$pk = $tablename . '_id';\r\n\t\t\tif(isset($tableOptions['primary_key']) && !empty($tableOptions['primary_key'])){\r\n\t\t\t\t$pk = $tableOptions['primary_key'];\r\n\t\t\t}\r\n\r\n\t\t\t$tableInfo = [\r\n\t\t\t\t'primary_key' => $pk,\r\n\t\t\t\t'fields' => [\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t\"name\" => $pk,\r\n\t\t\t\t\t\t\"type\" => \"BIGINT\",\r\n\t\t\t\t\t\t\"length\" => 20,\r\n\t\t\t\t\t\t\"attributes\" => \"auto_increment\",\r\n\t\t\t\t\t\t\"primary\" => true\r\n\t\t\t\t\t]\r\n\t\t\t\t],\r\n\t\t\t];\r\n\r\n\t\t\tif(isset($tableOptions['collation']) && !empty($tableOptions['collation'])){\r\n\t\t\t\t$tableInfo['collate'] = $tableOptions['collation'];\r\n\t\t\t\t$tableInfo['fields'][0]['collation'] = $tableOptions['collation'];\r\n\t\t\t}\r\n\t\t\tif(isset($tableOptions['storage_engine']) && !empty($tableOptions['storage_engine'])){\r\n\t\t\t\t$tableInfo['engine'] = $tableOptions['storage_engine'];\r\n\t\t\t}\r\n\r\n\t\t\t$tableContent = json_encode($tableInfo, JSON_PRETTY_PRINT);\r\n\r\n\t\t\t$this->_writer->setDirPath(dirname($targetFile))\r\n\t\t\t->setData($tableContent)\r\n\t\t\t->setFilename($tablename)\r\n\t\t\t->setFileextension('json')\r\n\t\t\t->write();\r\n\r\n\t\t\treturn $this->getAllInstalledAvailableStable();\r\n\t\t}\r\n\t}", "protected function _prepareColumns()\r\n {\r\n\t\t$this->addColumn('brand_id', array(\r\n\t\t\t'header' => Mage::helper('dynamic_brand')->__('ID'),\r\n\t\t\t'index' => 'brand_id',\r\n\t\t));\r\n\t //echo \"<pre>\";print_r($this->getOptionArray());die;\r\n /*$this->addColumn('brand_position', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Position'),\r\n 'align' => 'right',\r\n 'width' => '50px',\r\n 'index' => 'brand_position',\r\n 'type' => 'number',\r\n ));*/\r\n\r\n $this->addColumn('brand_name', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Brand Name'),\r\n 'index' => 'brand_name',\r\n ));\r\n $this->addColumn('sort_order', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Sort Order'),\r\n 'align' => 'left',\r\n 'index' => 'sort_order',\r\n ));\r\n $this->addColumn('url', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('URL'),\r\n 'index' => 'url',\r\n ));\r\n $this->addColumn(\"image\", array(\r\n \"header\" => Mage::helper(\"dynamic_brand\")->__(\"Image\"),\r\n \"index\" => \"image\",\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Image\",\r\n ));\r\n\r\n \r\n /*$this->addColumn('brand_title', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Title'),\r\n 'align' => 'left',\r\n 'index' => 'brand_title',\r\n ));\r\n\t\t\r\n \r\n\r\n $this->addColumn('brand_text', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Text'),\r\n 'align' => 'left',\r\n 'index' => 'brand_text',\r\n ));\r\n $this->addColumn('store_id', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Store View'),\r\n 'index' => 'store_id',\r\n 'type' => 'store',\r\n 'store_all' => true,\r\n 'store_view' => true,\r\n 'sortable' => true,\r\n //'filter_condition_callback' => array($this, '_filterStoreCondition'),\r\n\r\n ));*/\r\n \r\n\t\t/*\r\n $this->addColumn('brand_status', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Status'),\r\n 'align' => 'center',\r\n\t\t\t'type' \t\t=> 'options',\r\n 'index' => 'brand_status',\r\n\t\t\t'options' => array(\r\n\t\t\t\t1 => 'Enabled',\r\n\t\t\t\t2 => 'Disabled',\r\n\t\t\t),\r\n ));*/\r\n\r\n /* $fieldset->addField('category', 'multiselect',\r\n array(\r\n 'label' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'class' => 'required-entry',\r\n 'required' => true,\r\n 'values' => $this->getOptionArray(),\r\n 'name' => 'category',\r\n\r\n ));*/\r\n $this->addColumn('category', array(\r\n 'header' => Mage::helper('dynamic_brand')->__('Category'),\r\n 'width' => '180px',\r\n 'index' => 'category',\r\n \"renderer\" =>\"Dynamic_Brand_Block_Adminhtml_Renderer_Category\",\r\n\r\n ));\r\n\t\t$this->addColumn('action',\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'header' => Mage::helper('dynamic_brand')->__('Action'),\r\n\t\t\t\t\t'width' => '80',\r\n\t\t\t\t\t'type' => 'action',\r\n\t\t\t\t\t'getter' => 'getId',\r\n\t\t\t\t\t'actions' => array(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t'caption' => Mage::helper('dynamic_brand')->__('Edit'),\r\n\t\t\t\t\t\t\t'url' => array('base' => '*/*/edit'),\r\n\t\t\t\t\t\t\t'field' => 'id'\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t),\r\n\t\t\t\t\t'filter' => false,\r\n\t\t\t\t\t'sortable' => false,\r\n\t\t\t\t\t'index' => 'stores',\r\n\t\t\t\t\t'is_system' => true,\r\n\t\t));\r\n\t\t$this->addExportType('*/*/exportCsv', Mage::helper('dynamic_brand')->__('CSV'));\r\n\t\t$this->addExportType('*/*/exportXml', Mage::helper('dynamic_brand')->__('XML'));\r\n\t\t\r\n return parent::_prepareColumns();\r\n }", "function get_all_vendors($limit, $category) {\n\n /* we gonna change dis to\n [\"id\"]=>\n [\"name\"]=>\n [\"a_vendor_id\"]=>\n [\"vendor_name\"]=>\n [\"url_link\"]=>\n [\"url_image\"]=>\n [\"description\"]=>\n [\"created\"]=>\n [\"modified\"]=>\n [\"user_id\"]=>\n [\"category\"]=>\n [\"votes_up\"]=>\n [\"votes_down\"]=>\n [\"banned\"]=>\n [\"username\"]=>\n [\"allowed_id\"]=>\n [\"allowed_name\"]=>\n [\"allowed_url\"]=>\n [\"allowed_image_url\"]=>\n [\"allowed_tagline\"]=>\n [\"allowed_user_id\"]=>\n [\"allowed_created\"]=>\n [\"allowed_modified\"]=>\n\n*/\n $query = $this->db->query(\"SELECT vendors.*, users.username, allowed_vendors.*,categories.*\n FROM `vendors`\n JOIN `users` ON users.id = vendors.user_id\n JOIN `allowed_vendors` ON allowed_vendors.allowed_id = vendors.a_vendor_id\n JOIN `categories` ON categories.categories_category_id = vendors.vendors_category_id\n WHERE `vendors_category_id` = $category\n ORDER BY votes_up DESC\n LIMIT $limit, 8;\");\n\n //$query = $this->db->query(\"SELECT vendors.*, users.username FROM `vendors` JOIN `users` ON users.id = vendors.user_id WHERE `category` = $category ORDER BY votes_up DESC LIMIT $limit, 8;\");\n\n return $query->result();\n }", "public function loadAllManufacturers(){\r\n\t\t$html = '<table id=\"manufacturers_table\" class=\"table table-striped\">';\r\n\t\t$html.= '<thead>\r\n\t\t\t<tr>\r\n\t\t\t\t<th>Sr No</th>\r\n\t\t\t\t<th>Manufacturer Name</th>\r\n\t\t\t\t<th>Added on</th>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tbody>';\r\n\t\t\r\n\t\t$data = $this->getAllManufacturers();\r\n\t\t\r\n\t\t$i=1;\r\n\t\tif(count($data) != 0)\r\n\t\t{\r\n\t\t\tforeach($data as $ind => $rows)\r\n\t\t\t{\r\n\t\t\t\t$html.='<tr><td>'.$i.'</td><td>'.$rows['manufacturer_name'].'</td><td>'.$rows['added_datetime'].'</td></tr>';\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\t$html.='<tr><td>No Results Found</td><td></td><td></td></tr>';\r\n\t\t\r\n\t\t$html.='</tbody>';\r\n\t\t$html.='</table>';\r\n\t\t\r\n\t\techo $html;\r\n\t}", "public function handleVendor(){ \n $login = $this->hlp->logn();\n $vStr = \"vendorfee\";\n $vFee = intval($this->configuration->valueGetter($vStr));\n \n if (!$this->listings->isVendor($login)) {\n if ($this->wallet->getBalance($login) >= $vFee){ \n $this->wallet->moveAndStore($vStr, $login, \"profit\", $vFee);\n $this->listings->becomeVendor($login);\n $this->flashMessage(\"Váš účet má nyní vendor status\");\n $this->redirect(\"Listings:in\");\n } else {\n $this->flashMessage(\"You don't have sufficient funds!\");\n $this->redirect(\"Listings:in\");\n } \n } else {\n $this->redirect(\"Listings:in\");\n }\n }", "function display_used_vouchers() {\n\n\t\tglobal $current_user, $woo_vou_vendor_role;\n\n\t\t$prefix = WOO_VOU_META_PREFIX;\n\n\t\t$args = $data = array();\n\n\t\t// Taking parameter\n\t\t$orderby \t= isset( $_GET['orderby'] )\t? urldecode( $_GET['orderby'] )\t\t: 'ID';\n\t\t$order\t\t= isset( $_GET['order'] )\t? $_GET['order'] \t: 'DESC';\n\t\t$search \t= isset( $_GET['s'] ) \t\t? sanitize_text_field( trim($_GET['s']) )\t: null;\n\n\t\t$args = array(\n\t\t\t\t\t\t'posts_per_page'\t=> $this->per_page,\n\t\t\t\t\t\t'page'\t\t\t\t=> isset( $_GET['paged'] ) ? $_GET['paged'] : null,\n\t\t\t\t\t\t'orderby'\t\t\t=> $orderby,\n\t\t\t\t\t\t'order'\t\t\t\t=> $order,\n\t\t\t\t\t\t'offset' \t\t\t=> ( $this->get_pagenum() - 1 ) * $this->per_page,\n\t\t\t\t\t\t'woo_vou_list'\t\t=> true\n\t\t\t\t\t);\n\n\t\t$search_meta = \tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' \t\t=> $prefix . 'used_codes',\n\t\t\t\t\t\t\t\t'value' \t=> '',\n\t\t\t\t\t\t\t\t'compare' \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//Get user role\n\t\t$user_roles\t= isset( $current_user->roles ) ? $current_user->roles : array();\n\t\t$user_role\t= array_shift( $user_roles );\n\n\t\t//voucher admin roles\n\t\t$admin_roles\t= woo_vou_assigned_admin_roles();\n\n\t\tif( !in_array( $user_role, $admin_roles ) ) {// voucher admin can redeem all codes\n\t\t\t$args['author'] = $current_user->ID;\n\t\t}\n\n\t\tif( isset( $_GET['woo_vou_post_id'] ) && !empty( $_GET['woo_vou_post_id'] ) ) {\n\t\t\t$args['post_parent'] = $_GET['woo_vou_post_id'];\n\t\t}\n\t\t\n\t\tif( isset( $_GET['woo_vou_user_id'] ) && !empty( $_GET['woo_vou_user_id'] ) ) {\n\t\t\t\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'redeem_by',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['woo_vou_user_id'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> '=',\n\t\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}\n\t\t\n\t\tif( isset( $_GET['woo_vou_start_date'] ) && !empty( $_GET['woo_vou_start_date'] ) ) {\n\t\t\t\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'used_code_date',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> date( \"Y-m-d H:i:s\", strtotime( $_GET['woo_vou_start_date'] ) ),\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> '>=',\n\t\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}\n\t\t\n\t\tif( isset( $_GET['woo_vou_end_date'] ) && !empty( $_GET['woo_vou_end_date'] ) ) {\n\t\t\t\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'used_code_date',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> date( \"Y-m-d H:i:s\", strtotime( $_GET['woo_vou_end_date'] ) ),\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> '<=',\n\t\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}\n\n\t\tif( !empty( $search ) ) {\n\n\t\t\t$search_meta =\tarray(\n\t\t\t\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\t\t\t\t($search_meta),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'relation'\t=> 'OR',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'used_codes',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'first_name',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'last_name',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'order_id',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'key'\t\t=> $prefix.'order_date',\n\t\t\t\t\t\t\t\t\t\t\t'value'\t\t=> $_GET['s'],\n\t\t\t\t\t\t\t\t\t\t\t'compare'\t=> 'LIKE',\n\t\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}\n\t\t\n\t\t$args['meta_query']\t= $search_meta;\n\n\t\t//get used voucher codes data from database\n\t\t$woo_data \t= $this->model->woo_vou_get_voucher_details( $args );\n\t\t$data\t\t= isset( $woo_data['data'] ) ? $woo_data['data'] : '';\n\n\t\tif( !empty( $data ) ) {\n\n\t\t\tforeach ( $data as $key => $value ) {\n\n\t\t\t\t$user_id \t = get_post_meta( $value['ID'], $prefix.'redeem_by', true );\n\t\t\t\t$user_detail = get_userdata( $user_id );\n\t\t\t\t$user_profile = add_query_arg( array('user_id' => $user_id), admin_url('user-edit.php') );\n\t\t\t\t$display_name = isset( $user_detail->display_name ) ? $user_detail->display_name : '';\n\n\t\t\t\tif( !empty( $display_name ) ) {\n\t\t\t\t\t$display_name = '<a href=\"'.$user_profile.'\">'.$display_name.'</a>';\n\t\t\t\t} else {\n\t\t\t\t\t$display_name = __( 'N/A', 'woovoucher' );\n\t\t\t\t}\n\n\t\t\t\t$data[$key]['ID'] \t\t\t= $value['ID'];\n\t\t\t\t$data[$key]['post_parent'] \t= $value['post_parent'];\n\t\t\t\t$data[$key]['code'] \t\t= get_post_meta( $value['ID'], $prefix.'used_codes', true );\n\t\t\t\t$data[$key]['redeem_by'] \t= $display_name;\n\t\t\t\t$data[$key]['first_name'] \t= get_post_meta( $value['ID'], $prefix.'first_name', true );\n\t\t\t\t$data[$key]['last_name'] \t= get_post_meta( $value['ID'], $prefix.'last_name', true );\n\t\t\t\t$data[$key]['order_id'] \t= get_post_meta( $value['ID'], $prefix.'order_id', true );\n\t\t\t\t$data[$key]['order_date'] \t= get_post_meta( $value['ID'], $prefix.'order_date', true );\n\t\t\t\t$data[$key]['product_title']= get_the_title( $value['post_parent'] );\n\n\t\t\t\t$order_id = $data[$key]['order_id'];\n\n\t\t\t\t$data[$key]['buyers_info'] = $this->model->woo_vou_get_buyer_information( $order_id );\n\t\t\t}\n\t\t}\n\n\t\t$result_arr['data']\t\t= !empty($data) ? $data : array();\n\t\t$result_arr['total'] \t= isset( $woo_data['total'] ) ? $woo_data['total'] \t: 0; // Total no of data\n\n\t\treturn $result_arr;\n\t}", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM item_vendor_x';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "function AddVendor($arryDetails) { \r\n extract($arryDetails);\r\n$UserName = trim($FirstName.' '.$LastName);\r\n\t\r\n$sql = \"insert into p_supplier (SuppCode, SuppType, FirstName, LastName, UserName, Email, Mobile, Landline,CompanyName, country_id, state_id,city_id,ZipCode,Currency,UpdatedDate,OtherState,OtherCity) values('\".addslashes($SuppCode).\"', '\".addslashes($SuppType).\"', '\".addslashes($FirstName).\"', '\".addslashes($LastName).\"', '\".addslashes($UserName).\"', '\".addslashes($Email).\"', '\".addslashes($Mobile).\"','\".addslashes($Landline).\"', '\".addslashes($CompanyName).\"','\".addslashes($country_id).\"','\".addslashes($main_state_id).\"','\".addslashes($main_city_id).\"','\".mysql_real_escape_string($ZipCode).\"','\".addslashes($Currency).\"', '\".$Config['TodayDate'].\"','\".addslashes($State).\"', '\".addslashes($City).\"' )\";\r\n\r\n\r\n $this->query($sql, 0);\r\n $lastInsertId = $this->lastInsertId();\r\n if(empty($SuppCode)){\r\n\r\n\t\t\t\t$SuppCode = 'VEN000'.$lastInsertId;\r\n\t\t\t\t$strSQL = \"update p_supplier set SuppCode='\".$SuppCode.\"' where SuppID='\".$lastInsertId.\"'\"; \r\n\t\t\t\t$this->query($strSQL, 0);\r\n\t\t\t}\r\n\r\n return $lastInsertId;\r\n }", "function displayTable($conn)\n {\n echo \"<table border=\\\"4\\\">\";\n echo \"<tr>\";\n echo \"<th>Name</th>\";\n echo \"<th>Vendor</th>\";\n echo \"<th>Manufacturer</th>\";\n echo \"<th>Rating From Amazon System</th>\";\n echo \"<th>Quantity From Amazon Supply</th>\";\n echo \"<th>Rating From NewEgg System</th>\";\n echo \"<th>Quantity From NewEgg Supply</th>\";\n echo \"</tr>\";\n \n $result = $conn->query(\"SELECT * FROM AMAZON ORDER BY name, vendor\");\n if (!$result) die (\"Database access failed: \" . $conn->error);\n while($row = $result->fetch_assoc())\n { // displays Amazon Products\n echo \"<tr>\";\n echo \"<td>\".$row[name].\"</td>\";\n echo \"<td>\".$row[vendor].\"</td>\";\n echo \"<td>\".$row[manufacturer].\"</td>\";\n echo \"<td>\".$row[rating].\"</td>\";\n echo \"<td>\".$row[quantity].\"</td>\";\n echo \"<td></td>\";\n echo \"<td></td>\";\n echo \"</tr>\";\n }\n \n $result = $conn->query(\"SELECT * FROM NEWEGG ORDER BY name, vendor\");\n if (!$result) die (\"Database access failed: \" . $conn->error);\n while($row = $result->fetch_assoc())\n { // displays NewEgg Products\n echo \"<tr>\";\n echo \"<td>\".$row[name].\"</td>\";\n echo \"<td>\".$row[vendor].\"</td>\";\n echo \"<td>\".$row[manufacturer].\"</td>\";\n echo \"<td></td>\";\n echo \"<td></td>\";\n echo \"<td>\".$row[rating].\"</td>\";\n echo \"<td>\".$row[quantity].\"</td>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "public function change()\n {\n $table = $this->table('providers');\n $table->addColumn('name', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->addColumn('cnpj', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->addColumn('site', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ]);\n $table->addColumn('telephone', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ]);\n $table->addColumn('address_zipcode', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->addColumn('address_street', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->addColumn('address_number', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->addColumn('address_complement', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => true,\n ]);\n $table->addColumn('address_neighborhood', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->addColumn('address_city', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->addColumn('address_uf', 'string', [\n 'default' => null,\n 'limit' => 255,\n 'null' => false,\n ]);\n $table->create();\n }", "private function setupBusRegTable()\n {\n if ($this->licenceType === RefData::LICENCE_CATEGORY_GOODS_VEHICLE) {\n $this->counts['busRegistrations'] = 0;\n return;\n }\n $this->index(\n OpenBusReg::class,\n new GenericList([\n 'id' => 'licence',\n ], 'licId'),\n 'busRegistrations',\n 'licence-surrender-busreg',\n $this->tableViewTemplate\n );\n }", "public function vendor()\n {\n return $this->belongsTo('App\\Entities\\Vendor', 'vendor_id');\n }", "public function datatable_insurance_setup()\n\t{\n\t\t/* Array of database columns which should be read and sent back to DataTables. Use a space where\n\t\t * you want to insert a non-database field (for example a counter or static image)\n\t\t */\n\t\t$aColumns = array( '','mfi_account_insurance.account_insurance_no', 'mfi_cif.nama', 'mfi_product_insurance.product_name','mfi_account_insurance.status_rekening');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"WHERE (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch']).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\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$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_insurance_setup($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_insurance_setup($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_insurance_setup(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\n\t\t\t$row[] = '<input type=\"checkbox\" value=\"'.$aRow['account_insurance_id'].'\" id=\"checkbox\" class=\"checkboxes\" >';\n\t\t\t$row[] = $aRow['account_insurance_no'];\n\t\t\t$row[] = $aRow['nama'];\n\t\t\t$row[] = $aRow['product_name'];\n\t\t\t$row[] = $aRow['status_rekening'];\n\t\t\t\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "function install_main_table() {\n global $wpdb;\n\n $charset_collate = '';\n if ( ! empty($wpdb->charset) )\n $charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n if ( ! empty($wpdb->collate) )\n $charset_collate .= \" COLLATE $wpdb->collate\";\t\n $table_name = $wpdb->prefix . \"store_locator\";\n $sql = \"CREATE TABLE $table_name (\n sl_id mediumint(8) unsigned NOT NULL auto_increment,\n sl_store varchar(255) NULL,\n sl_address varchar(255) NULL,\n sl_address2 varchar(255) NULL,\n sl_city varchar(255) NULL,\n sl_state varchar(255) NULL,\n sl_zip varchar(255) NULL,\n sl_country varchar(255) NULL,\n sl_latitude varchar(255) NULL,\n sl_longitude varchar(255) NULL,\n sl_tags mediumtext NULL,\n sl_description text NULL,\n sl_email varchar(255) NULL,\n sl_url varchar(255) NULL,\n sl_hours varchar(255) NULL,\n sl_phone varchar(255) NULL,\n sl_fax varchar(255) NULL,\n sl_image varchar(255) NULL,\n sl_private varchar(1) NULL,\n sl_neat_title varchar(255) NULL,\n sl_linked_postid int NULL,\n sl_pages_url varchar(255) NULL,\n sl_pages_on varchar(1) NULL,\n sl_option_value longtext NULL,\n sl_lastupdated timestamp NOT NULL default current_timestamp,\t\t\t\n PRIMARY KEY (sl_id),\n KEY (sl_store(255)),\n KEY (sl_longitude(255)),\n KEY (sl_latitude(255))\n ) \n $charset_collate\n \";\n\n // If we updated an existing DB, do some mods to the data\n //\n if ($this->dbupdater($sql,$table_name) === 'updated') {\n // We are upgrading from something less than 2.0\n //\n if (floatval($this->db_version_on_start) < 2.0) {\n dbDelta(\"UPDATE $table_name SET sl_lastupdated=current_timestamp \" . \n \"WHERE sl_lastupdated < '2011-06-01'\"\n );\n } \n if (floatval($this->db_version_on_start) < 2.2) {\n dbDelta(\"ALTER $table_name MODIFY sl_description text \");\n }\n } \n\n //set up google maps v3\n $old_option = get_option('sl_map_type');\n $new_option = 'roadmap';\n switch ($old_option) {\n case 'G_NORMAL_MAP':\n $new_option = 'roadmap';\n break;\n case 'G_SATELLITE_MAP':\n $new_option = 'satellite';\n break;\n case 'G_HYBRID_MAP':\n $new_option = 'hybrid';\n break;\n case 'G_PHYSICAL_MAP':\n $new_option = 'terrain';\n break;\n default:\n $new_option = 'roadmap';\n break;\n }\n update_option('sl_map_type', $new_option);\n }" ]
[ "0.652645", "0.62908626", "0.5979304", "0.59584194", "0.57366353", "0.5657745", "0.55477744", "0.55459416", "0.5539948", "0.5536103", "0.54925424", "0.5484223", "0.5474092", "0.5439966", "0.543706", "0.5421754", "0.54095984", "0.540617", "0.5401537", "0.53790504", "0.5307969", "0.5304366", "0.52871346", "0.52717006", "0.5261405", "0.5233741", "0.5216127", "0.51840717", "0.5123606", "0.50735104", "0.5068137", "0.505608", "0.505608", "0.5052099", "0.5038839", "0.49989048", "0.49980468", "0.4994623", "0.49821305", "0.4972605", "0.49614733", "0.49585438", "0.49507168", "0.49261382", "0.49210528", "0.49209544", "0.4906257", "0.48976874", "0.48818117", "0.4852431", "0.48510325", "0.48442826", "0.4833025", "0.48320034", "0.483192", "0.48300552", "0.4809541", "0.48066306", "0.48037434", "0.47933772", "0.4791562", "0.478863", "0.47835085", "0.47808295", "0.4759158", "0.47574225", "0.475283", "0.4747905", "0.47368553", "0.4735206", "0.4723444", "0.47232783", "0.47103444", "0.47026107", "0.4700035", "0.46932277", "0.4688707", "0.4688108", "0.46831298", "0.46734363", "0.46541506", "0.46538454", "0.46319684", "0.46218276", "0.46191207", "0.46170363", "0.46161142", "0.46115172", "0.46088946", "0.46082026", "0.46079704", "0.46032324", "0.4582453", "0.45791003", "0.4572874", "0.45546347", "0.45511588", "0.45506427", "0.45494267", "0.4532376" ]
0.7402192
0
/LIST RATES TO TABLE
function list_rates($propertyCode) { $this->public_db->select('*'); $this->public_db->from('standardrates'); $this->public_db->where("propertyCode = $propertyCode"); $this->public_db->order_by('standardRateId','asc'); $query = $this->public_db->get(); if ($query->num_rows() > 0) { $output = ' <table width="100%" border="1"> <tr><th>Rate Id</th><th>Property</th><th>From</th><th>To</th><th>1 night</th><th>2 nights</th><th>3 nights</th><th>4 nights</th><th>5 nights</th><th>6 nights</th><th>1 week</th><th>Xtra night</th></tr>'; foreach ($query->result() as $item) { $output .= '<tr><td>' . $item->standardRateId . '</td><td>' . $item->propertyCode . '</td><td>' . $item->fromDate . '</td><td>' . $item->toDate . '</td><td>' . $item->rateOne . '</td><td>' . $item->rateTwo . '</td><td>' . $item->rateThree . '</td><td>' . $item->rateFour . '</td><td>' . $item->rateFive . '</td><td>' . $item->rateSix . '</td><td>' . $item->rateSeven . '</td>' . '<td>' . $item->xtraDay . '</td></tr>'; } $output .='</table>'; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCleanableTableList() {}", "public function getAllSuppliersToDataTables();", "function getListOfRecords(){\n // the orders will be display and the receipts from there \n \n $element = new Order();\n \n $receipts_filter_orders = cisess(\"receipts_filter_orders\");\n \n if ($receipts_filter_orders===FALSE){\n $receipts_filter_orders = \"Abierta\"; // default to abiertas\n }\n \n if (!empty($receipts_filter_orders))\n {\n $element->where(\"status\",$receipts_filter_orders);\n }\n \n \n $element->order_by(\"id\",\"desc\");\n \n $all = $element->get()->all;\n //echo $element->check_last_query();\n ///die();\n $table = $this->entable($all);\n \n return $table;\n \n \n }", "function populate_table()\n\t{\n\t\t$this->table = array();\n\n\t\t$prev_row = array();\n\t\tfor ($i = -1; $i < $this->data_new_len; $i++)\n\t\t{\n\t\t\t$prev_row[$i] = 0;\n\t\t}\n\n\t\tfor ($i = 0; $i < $this->data_old_len; $i++)\n\t\t{\n\t\t\t$this_row = array('-1' => 0);\n\t\t\t$data_old_value = $this->data_old[$i];\n\n\t\t\tfor ($j = 0; $j < $this->data_new_len; $j++)\n\t\t\t{\n\t\t\t\tif ($data_old_value == $this->data_new[$j])\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $prev_row[$j - 1] + 1;\n\t\t\t\t}\n\t\t\t\telse if ($this_row[$j - 1] > $prev_row[$j])\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $this_row[$j - 1];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $prev_row[$j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->table[$i - 1] = $this->compress_row($prev_row);\n\t\t\t$prev_row = $this_row;\n\t\t}\n\t\tunset($prev_row);\n\t\t$this->table[$this->data_old_len - 1] = $this->compress_row($this_row);\n\t}", "public function ListCrossListed(){\n\t\treturn array(\"results\" => $this->Read('[CROSSLISTINGS TABLE]'));\n\t}", "public function listAll(){\r\n\t\t$all = $this->select('SELECT id, '.$this->display.' FROM '.$this->table.' ORDER BY 2 ASC');\r\n\t\t$data = array();\r\n\t\tforeach ($all as $key => $value) {\r\n\t\t\t$data[$value[$this->primary]] = $value[$this->display];\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "private function table_data(){\n $data = array();\n\n global $wpdb;\n\n $data = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}lic_activations ORDER BY ID ASC\", ARRAY_A);\n \n return $data;\n }", "public function refreshListTable()\n {\n $this->listWidget->prepareVars();\n\n $data = [\n 'componentOptions' => $this->options,\n 'listWidget' => $this->listWidget\n ];\n\n $assets = $this->listWidget->getAssetPaths();\n\n $this->listWidget->alias = $this->alias;\n\n $this->defaultSuffix = 'pc-table';\n\n return [ 'X_OCTOBER_ASSETS' => $assets, '#'.$this->getDivId() => $this->makePartial('list_table', $data)];\n }", "public function listtabelSDMAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('SDM');\n }", "public function listTable()\n {\n // Searching the data\n $places = Place::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'places' => $places,\n ];\n\n //dd($data);\n\n return $data;\n }", "public static function list() {\n self::init();\n $columns = self::getListTableColumns();\n $columns = array_map(function($object) {\n return $object['label'];\n }, $columns);\n $columns = array_values($columns);\n\n $columnsSql = implode(', ', self::$listTableColumnsKeys);\n $data = self::$wpdb->get_results(\n self::$wpdb->prepare(\n \"SELECT {$columnsSql}\n FROM \" . self::$table . \"\n ORDER BY id ASC\"\n )\n );\n return $data;\n }", "public function tableList()\n {\n $list = (self::MODEL)::orderBy('clientes.created_at', 'DESC');\n $list = $this->handleRequest($list);\n\n return $this->listResponse(ClientTransformer::tableList($list));\n }", "public function toTable(){\r\n\t\t$datas = array();\r\n\t\tforeach ($this as $key => $value) {\r\n\t\t\tif(!in_array($key, $this->arraysis)){\r\n\t\t\t\t$datas[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $datas;\r\n\t}", "function subscriber_list_view ($table) {\n $s = render_button('Add Subscriber', 'email_list.php?action=add') . '<br><br>';\n $s .= '<table>';\n $s .= '<tr><th>Name</th><th>Email</th></tr>';\n foreach($table as $row) {\n $row = array(\"$row[0]. $row[1]\", $row[2]);\n $s .= '<tr><td>' . implode('</td><td>', $row) . '</td></tr>';\n }\n $s .= '</table>';\n \n return $s;\n }", "public function listtabelAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('%');\n }", "public function listTable()\n {\n // Searching the data\n $vehicles = Vehicle::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'vehicles' => $vehicles,\n ];\n\n //dd($data);\n\n return $data;\n }", "function makelist($res)\t{\r\n\t\t$items=\"\";\r\n\t\t$counter = $this->internal['res_count'];\r\n\t\twhile($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\r\n\t\t\t$items .= $this->makeListItem($counter);\r\n\t\t\t$counter--;\r\n\t\t}\r\n\r\n\t\t$subpartArray = array();\r\n\t\t$subpartArray[\"###LIST_TABLE_ROW###\"] = $items;\r\n\t\t$out = $this->cObj->substituteMarkerArrayCached($this->templates[\"list_table\"], array(), $subpartArray, array());\r\n\t\treturn $out;\r\n\t}", "function listTables();", "public function custList($table){\n\t\t\t\n\t\t\t$this->db->query($table);\n\t\t\t$row=$this->db->resultset();\n\t\t\t\n\t\t\treturn $row;\n\t\t\t\n\t\t}", "public function dataTable();", "public function table_get_all($table);", "public function getCpnyToTable() {\n return $this->db->selectObjList('SELECT company_id, longname, shortname, status, date_create FROM company ORDER BY company_id DESC;', $array = array(), \"Company\");\n }", "public function ddrowList(){\n\n\t\tdd($this->rowlist);\n\n\t}", "function create_sorted_table($liste, $order){\n $key_list = array_keys($liste);\n $first_key = $key_list[0][0];\n if ($order == 0) {\n // Sortiere aufsteigend\n if (is_numeric($first_key)) {\n natsort($key_list);\n }\n else {\n sort($key_list);\n }\n } else {\n // Sortiere absteigend\n if (is_numeric($first_key)) {\n natsort($key_list);\n $key_list = array_reverse($key_list);\n }\n else {\n rsort($key_list);\n }\n }\n \n $binary = 1;\n $table = [];\n\n // Erstelle Tabelleninhalte\n foreach ($key_list as $key) {\n foreach ($liste[$key] as $values) {\n if ($binary == 1) {\n $binary = 0;\n }\n else {\n $binary = 1;\n }\n $fach = $values[0];\n $frage = $values[1];\n $punkte = $values[2];\n $pfad = $values[3];\n $datei = $values[4];\n\n $new_row = create_row($binary, $fach, $frage, $punkte, $pfad, $datei);\n $table[] .= $new_row;\n }\n }\n\n return $table;\n }", "public function getTableOfContents();", "function DatesSchedulesTables($edit)\n {\n $tables=array();\n foreach ($this->ScheduleDates() as $date)\n {\n array_push($tables,$this->DateSchedulesTable($edit,$date));\n }\n\n return $tables;\n }", "public function refreshTable();", "function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}", "public function tableList()\n {\n $list = (self::MODEL)::with(['cliente', 'endereco'])\n ->join('clientes', 'clientes.id', '=', 'pedidos.cliente_id')\n ->leftJoin('pedido_notas', 'pedido_notas.pedido_id', '=', 'pedidos.id')\n ->orderBy('pedidos.created_at', 'DESC');\n\n $list = $this->handleRequest($list);\n\n return $this->listResponse(OrderTransformer::tableList($list));\n }", "function detail_list_output(String $table): Array {\n\n // Query result of the detail table\n $result = $this->toggle_detail_list_query($table);\n \n // Selected column of the detail table\n $keys = $this->toggle_detail_list_select_columns($table);\n \n // Check if the detail table has also other detail tables. \n // It makes its track number a link in the view if true\n $has_details = $this->CI->grants->check_if_table_has_detail_table($table);\n \n // It check if the detail table is approveable so as to show the approval links in the status action\n $is_approveable_item = $this->CI->grants->approveable_item($table);\n \n // Check if the add button is allowed to be shown\n $show_add_button = $this->CI->grants->show_add_button($table);\n \n // Checks if the detail table has a detail table to it\n $has_details_listing = $this->CI->grants->check_if_table_has_detail_listing($table);\n \n $converted_result = [];\n\n foreach($result as $row){\n $converted_result[] = $this->currency_conversion($row,$table);\n }\n\n return array(\n 'keys'=> $keys,\n 'table_body'=>$converted_result,\n 'table_name'=> $table,\n 'has_details_table' => $has_details,\n 'has_details_listing' => $has_details_listing,\n 'is_approveable_item' => $is_approveable_item,\n 'show_add_button'=>$show_add_button\n );\n }", "public function listtabelCSAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('CURRENT SYSTEM');\n }", "public function listtabelTAPAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('TATA PERSURATAN');\n }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "abstract protected function _listTables();", "function airtable_list_records($view, $filterByFormula, $fields){\n\t$endpoint = $data['endpoint'];\n\t$params = [\n\t \"filterByFormula\" => $filterByFormula,\n\t \"fields\" => $fields,\n\t \"sort\" => [['field' => 'name', 'direction' => \"asc\"]],\n\t \"maxRecords\" => 200,\n\t \"pageSize\" => 100,\n\t \"view\" => $view\n\t];\n\t\n\t$call = artaible_call_api($params, $endpoint);\n\treturn $call;\n}", "function trip_list_tbl() {\n\n global $wpdb;\n\n\n\n $table_name = $wpdb->prefix.'tb_trips_tbl';\n\n\n\n $charset_collate = $wpdb->get_charset_collate();\n\n\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name (\n\n id int(11) NOT NULL AUTO_INCREMENT,\n\n crm_id text DEFAULT NULL,\n\n \n\n Trip_Name text DEFAULT NULL,\n\n Trip_Location text DEFAULT NULL,\n\n Trip_Detail_Url text DEFAULT NULL,\n\n Trip_Image_Url text DEFAULT NULL,\n\n Trip_Description text DEFAULT NULL,\n\n\n\n Trip_Start_Date date DEFAULT NULL,\n\n Trip_End_Date date DEFAULT NULL,\n\n Total_Number_of_Seat text DEFAULT NULL,\n\n Trip_Total_Price text DEFAULT NULL,\n\n Trip_Single_Room_Price text DEFAULT NULL,\n\n Trip_Single_Room_Total_Price text DEFAULT NULL,\n\n Tier_2_Date text DEFAULT NULL,\n\n Tier_2_Increase_Amount text DEFAULT NULL,\n\n Tier_3_Date text DEFAULT NULL,\n\n Tier_3_Increase_Amount text DEFAULT NULL,\n\n Trip_Deposit_Amount text DEFAULT NULL,\n\n Payment_Due_Date date DEFAULT NULL,\n\n Seat_Booked text DEFAULT NULL,\n\n Trip_Included text DEFAULT NULL,\n Show_Trip_Included text DEFAULT NULL,\n\n Trip_Promo_Code text DEFAULT NULL,\n\n\n\n Trip_2_Start_Date date DEFAULT NULL,\n\n Trip_2_End_Date date DEFAULT NULL,\n\n Trip_2_Total_Number_of_Seat text DEFAULT NULL,\n\n Trip_2_Total_Price text DEFAULT NULL,\n\n Trip_2_Single_Room_Price text DEFAULT NULL,\n\n Trip_2_Single_Room_Total_Price text DEFAULT NULL,\n\n Trip_2_Tier_2_Date text DEFAULT NULL,\n\n Trip_2_Tier_2_Increase_Amount text DEFAULT NULL,\n\n Trip_2_Tier_3_Date text DEFAULT NULL,\n\n Trip_2_Tier_3_Increase_Amount text DEFAULT NULL,\n\n Trip_2_Deposit_Amount text DEFAULT NULL,\n\n Trip_2_Payment_Due_Date date DEFAULT NULL,\n\n Trip_2_Seat_Booked text DEFAULT NULL,\n\n Trip_2_Included text DEFAULT NULL,\n\n\n\n zoho_data mediumtext DEFAULT NULL,\n\n created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\n updated_at timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n\n PRIMARY KEY (id)\n\n ) $charset_collate;\";\n\n\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n dbDelta( $sql );\n\n\n\n }", "function get_supplier_manage_table($suppliers,$controller)\n{\n\t$CI =& get_instance();\n\t$table='<table class=\"tablesorter\" id=\"sortable_table\">';\n\n\t$headers = array('<input type=\"checkbox\" id=\"select_all\" />',\n\t$CI->lang->line('suppliers_company_name'),\n\t$CI->lang->line('common_last_name'),\n\t$CI->lang->line('common_first_name'),\n\t$CI->lang->line('common_email'),\n\t$CI->lang->line('common_phone_number'),\n\t'&nbsp');\n\n\t$table.='<thead><tr>';\n\tforeach($headers as $header)\n\t{\n\t\t$table.=\"<th>$header</th>\";\n\t}\n\t$table.='</tr></thead><tbody>';\n\t$table.=get_supplier_manage_table_data_rows($suppliers,$controller);\n\t$table.='</tbody></table>';\n\treturn $table;\n}", "public function get_invoice_list()\n {\n return $this->db->select('sr_no, invoice_no, round_off_total, invoice_date, bakery_name,bakery_address, bakery_area, bakery_city')->order_by('sr_no','desc')\n ->from('insider_bill')->join('customers', 'customers.id = insider_bill.customer_id')->get();\n }", "function get_supplier_manage_table($suppliers,$controller)\n{\n\t$CI =& get_instance();\n\t$table='<table class=\"tablesorter\" id=\"sortable_table\">';\n\t\n\t$headers = array('<input type=\"checkbox\" id=\"select_all\" />',\n\t$CI->lang->line('suppliers_company_name'),\n\t$CI->lang->line('common_last_name'),\n\t$CI->lang->line('common_first_name'),\n\t$CI->lang->line('common_phone_number'),\n\t$CI->lang->line('common_commision_value'),\n\t$CI->lang->line('common_commision_type'),\n\t'&nbsp');\n\t\n\t$table.='<thead><tr>';\n\tforeach($headers as $header)\n\t{\n\t\t$table.=\"<th>$header</th>\";\n\t}\n\t$table.='</tr></thead><tbody>';\n\t$table.=get_supplier_manage_table_data_rows($suppliers,$controller);\n\t$table.='</tbody></table>';\n\treturn $table;\n}", "function resultsToTable($results) {\n\t$html = \"<table border='1' cellspacing='0' cellpadding='2'>\\n\";\n\t$html .= \"<tr>\\n<th>ID</th>\\n<th>Name</th>\\n<th>Address</th>\\n<th></th>\\n\";\n\t$html .= \"<th>Region</th>\\n<th>State</th>\\n<th>Status</th>\\n\";\n\t$html .= \"<th>Deactivation Date</th>\\n<th>PWS Type</th>\\n</tr>\";\n\tforeach($results as $object) {\n\t\t$html .= \"\\n<tr>\\n<td>{$object->PWSID}</td>\\n<td>{$object->PWS_NAME}</td>\\n\";\n\t\t$html .= \"<td>{$object->ADDRESS_LINE1}</td>\\n<td>{$object->ADDRESS_LINE2}</td>\\n\";\n\t\t$html .= \"<td>{$object->EPA_REGION}</td>\\n\";\n\t\t$html .= \"<td>{$object->STATE_CODE}</th>\\n<td>{$object->SUBMISSION_STATUS_CODE}</td>\\n\";\n\t\t$html .= \"<td>{$object->PWS_DEACTIVATION_DATE}</td>\\n<td>{$object->PWS_TYPE_CODE}</td>\\n\";\n\t\t$html .= \"</tr>\\n\";\n\t}\n\treturn $html . \"</table>\\n\";\n}", "public function listtabelPrncAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('PERENCANAAN');\n }", "protected function _as_docs_from_list($rows){\n $out = array();\n foreach($rows as $curr){\n $out[] = $this->_as_doc(array(\"_id\" => $curr['id'], '_rev' => $curr['value']['rev']))->fetch();\n }\n return $out;\n \n }", "private function _getColorTable() {}", "public function getDataList()\n {\n //get all Tranfer Recipient\n\n $thePaystack = new Paystack();\n $theTransferRecipient = $thePaystack->listTransferRecipient(null, null);\n\n return Datatables::of($theTransferRecipient['data'])\n ->addColumn('action', function ($transferRecipient) {\n return '<button type=\"button\" class=\"btn btn-success btn-sm transfer_btn\"> <i class=\"fa fa-pencil\"></i>Transfer</button>'. ' <button type=\"button\" class=\"btn btn-info btn-sm\" onclick=\"alert('. $transferRecipient['id'] .');\"> <i class=\"fa fa-binoculars\"></i>Edit</button>';\n })\n ->make(true);\n }", "function AggregateListRow() {\n\t}", "function toTable($data)\n{\n//print_r($data);\n\t$keys = $data[0];\n\t$keys = array_flip($keys);\n\t$result = \"<table>\\n\\t<tr>\";\n\tforeach($keys as $key)\n\t{\n\t\t$result .= '<th>' . $key . '</th>';\n\t}\n\t$result .= \"</tr>\\n\";\n\t$counter = 0;\n\tforeach($data as $item)\n\t{\n\t\t$counter++;\n\t\tif ($counter % 2 == 1)\n\t\t{\n\t\t\t$result .= \"\\t<tr>\";\n\t\t} else\n\t\t{\n\t\t\t$result .= \"\\t<tr class=\\\"odd\\\">\";\n\t\t}\n\t\tforeach($item as $value)\n\t\t{\n\t\t\t$result .= '<td>' . $value . '</td>';\n\t\t}\n\t\t$result .= \"</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\treturn $result;\n}", "function viewTable($parks)\n{\n return formatTable($parks);\n}", "protected function configureTableSelection()\n {\n return [ 'Table1', 'Table2', '...' ];\n }", "public function toList();", "public function listing() {\n return array(\n '#header' => array($this->t('Title'), $this->t('Description'), $this->t('Operations')),\n '#type' => 'table',\n ) + $this->listingLevel($this->paymentStatusManager->hierarchy(), 0);\n }", "protected function make_table_list($items_table=null, $items_list=null, $template_table=null, $template_list=null) {\n\t $toprint = null;\n\t\t$mytemplate_table = $this->select_template($template_table);\n\t\t$mytemplate_list = $this->select_template($template_list);\n\t\t$mytemplate_tablelist = $this->select_template('fpkatalog-grid-list');\n\t\t$tokens = array();\n\t\t\n if ($mytemplate_tablelist) { \n\t\t\n\t\t\t$table_token[] = (!empty($items_table)) ? implode('',$items_table) : null; \n\t\t\t//echo $table_token[0];\n\t\t\t$tokens[] = $this->combine_tokens($mytemplate_table, $table_token);\n\n\t\t\t$list_token[] = (!empty($items_list)) ? implode('',$items_list) : null; \n\t\t\t//echo $list_token[0];\n\t\t\t$tokens[] = $this->combine_tokens($mytemplate_list, $list_token);\n //print_r($tokens);\n\t\t\t$toprint = $this->combine_tokens($mytemplate_tablelist, $tokens);\n\t\t\t//echo $toprint;\n\t\t\tunset ($tokens);\n\t\t\tunset ($table_token);\n\t\t\tunset ($list_token);\n\t\t}\t\n return ($toprint); \t\t\n }", "public function lists();", "function refreshTable(){\n\t\t$this->table = array();\n\n\t\t//set the column headers\n\t\t$this->table[0] = $this->getColumnHeaders();\n\n\t\t//add a row for each user\n\t\tforeach ($this->users as $name => $schedule) {\n\t\t\t$row = array();\n\n\t\t\t//if this user is being edited\n\t\t\tif($this->currentEdit == $name) $row = $this->userEditRow($name, $schedule, $this->table[0]);\n\t\t\telse $row = $this->userDisplayRow($name, $schedule, $this->table[0]);\n\t\t\t\n\t\t\tarray_push($this->table, $row);\n\t\t}\n\n\t\tarray_push($this->table, $this->genSubmitRow());\n\n\t\tarray_push($this->table, $this->genTotalRow());\n\n\t\t$this->logMsg(SUCCESS, 'internal table constructed');\n\t}", "function table_list()\n{\n\t//TODO - a similar function is in db_verify.php. Should probably all be moved to mysql_class.php.\n\n\t$exclude = array();\n\t$exclude[] = \"core\";\n\t$exclude[] = \"rbinary\";\n\t$exclude[] = \"parser\";\n\t$exclude[] = \"tmp\";\n\t$exclude[] = \"online\";\n\t$exclude[] = \"upload\";\n\t$exclude[] = \"user_extended_country\";\n\t$exclude[] = \"plugin\";\n\n\t$coreTables = e107::getDb()->db_TableList('nolan');\n\n\t$tables = array_diff($coreTables,$exclude);\n\n\tforeach($tables as $e107tab)\n\t{\n\t\t$count = e107::getDb()->gen(\"SELECT * FROM #\".$e107tab);\n\n\t\tif($count)\n\t\t{\n\t\t\t$tabs[$e107tab] = $count;\n\t\t}\n\t}\n\n\treturn $tabs;\n}", "public function dataRevisionsTable();", "function student_list() {\n $query = db_select('student', 'st');\n $query\n ->fields('st', array('st_id', 'st_fnm', 'st_lnm', 'st_email'))\n ->range(0, 50)\n ->orderby('st.st_id');\n $results = $query\n ->execute();\n $header = array(t('ID'),\n t('First Name'),\n t('Last Name'),\n t('E-mail'),\n t('Delete'),\n t('Edit'),\n );\n $rows = array(); /*values pulling database*/\n foreach ($results as $result) {\n $rows[] = array(\n check_plain($result->st_id),\n check_plain($result->st_fnm),\n check_plain($result->st_lnm),\n check_plain($result->st_email),\n l(t('Delete'), 'formlist/' . $result->st_id . '/delete'),\n l(t('Edit'), 'formlist/' . $result->st_id . '/edit'),\n );\n }\n return theme('table', array('header' => $header, 'rows' => $rows));\n}", "public function table()\n {\n $data = $this->data()['prescriptions']->map(function($prescription){\n\n if($prescription['stopped'] == 'stopped')\n {\n $button = \"<button class='btn btn-xs btn-warning' id='stop-'\".$prescription['id'].\" \n value='\".json_encode($prescription).\"' >\".\n \"<i class='fa fa-info-circle'></i> Stopped\n </button>\";\n }\n else\n {\n $button = \"<button class='btn btn-xs btn-danger stop-drug' id='stop-'\".$prescription['id'].\" \n value='\".json_encode($prescription).\"' >\".\n \"<i class='fa fa-ban'></i> Stop\n </button>\";\n }\n \n return [\n $prescription['drug'],\n $prescription['dose'],\n $prescription['prescribed'],\n $prescription['dispensed'],\n $prescription['stopped'],\n $prescription['remaining'],\n $prescription['administered'],\n $prescription['created_at'],\n $button\n ];\n\n })->toArray();\n\n return compact('data');\n }", "public function getScoreRecordListList(){\n return $this->_get(2);\n }", "function printRecords ($show_edits = 1) {\n print \"<table border='1' width='90%'>\";\n foreach ($this->ids as $i) {\n print \"<tr><td>\";\n $this->link[$i]->printHTML($show_edits);\n print \"</td>\";\n print \"<td><p><a href='delete.php?id=$i'>Delete</a></p>\";\n print \"<p><a href='modify.php?id=$i'>Modify</a></p></td></tr>\";\n }\n print \"</table>\";\n }", "private function _constructRoutesTable()\n\t{\n\t\t//construct manually\n\t\t$this->__routings_table = connectManager::exportRouting();\t\t\t\n\t\t\n\t\treturn true;\t\t\n\t}", "public function listForTable (){\r\n //generamo la query final que precisamos\r\n $queryResult= \"SELECT id,dni,nombre,apellido,mail FROM usuario.usuario ORDER BY id;\";\r\n\r\n //Ejecutamos la query\r\n $this->stmt=pg_query($this->link,$queryResult) or die(\"Error en la consulta,function listForTable :\".preg_last_error());\r\n\r\n return $this->stmt;\r\n }", "public function viewHistory() {\n $historyRows = $this->db->query(\"SELECT * FROM history\");\n if (!$historyRows) die(\"Fatal Error.\");\n\n // Looping through all rows in the histoy table.\n $history = [];\n foreach($historyRows as $historyRow) {\n $regNr = htmlspecialchars($historyRow[\"regNr\"]);\n $ssNr = htmlspecialchars($historyRow[\"ssNr\"]);\n $checkOut = htmlspecialchars($historyRow[\"checkOutTime\"]);\n $checkIn = htmlspecialchars($historyRow[\"checkInTime\"]);\n $days = htmlspecialchars($historyRow[\"days\"]);\n $cost = htmlspecialchars($historyRow[\"cost\"]);\n\n // Setting 0 as default value on days and cost if car not checked in yet.\n if (!$checkIn) {\n $checkIn = \"Checked Out\";\n $days = 0;\n $cost = 0;\n }\n \n $histor = [\"regNr\" => $regNr,\n \"ssNr\" => $ssNr, \n \"checkOut\" => $checkOut,\n \"checkIn\" => $checkIn, \n \"days\" => $days,\n \"cost\" => $cost,\n \"days\" => $days];\n \n $history[] = $histor;\n }\n return $history;\n }", "function get_degrees_manage_table($degrees, $controller) {\n $CI = &get_instance();\n $controller_name = strtolower(get_class($CI));\n\n $table = '<table class=\"tablesorter table table-bordered table-hover\" id=\"sortable_table\">';\n $headers = array(\n '<input type=\"checkbox\" id=\"select_all\" />',\n lang('degree_no'),\n lang('degree_code'),\n lang('degree_name'),\n lang('degree_name_kh'),\n lang('degree_duration'),\n lang('common_action')\n );\n \n $table.='<thead><tr>';\n $count = 0;\n foreach ($headers as $header) {\n $count++;\n\n if ($count == 1) {\n $table.=\"<th class='leftmost'>$header</th>\";\n } elseif ($count == count($headers)) {\n $table.=\"<th class='rightmost'>$header</th>\";\n } else {\n $table.=\"<th>$header</th>\";\n }\n }\n \n $table.='</tr></thead><tbody>';\n $table.=get_degrees_manage_table_data_rows($degrees, $controller);\n $table.='</tbody></table>';\n return $table;\n}", "public function laratablesRowData()\n\t\t{\n\t\t\t// Storage::download('coapath/' . $this->coa_name);\n\t\t//\tdd(Storage::disk('s3'));\n\t\t\treturn ['coa_path' =>'https://s3-us-west-1.amazonaws.com/'.$this->coa_name];\n/*\n\t\treturn [\n\t\t\t\t'coa_path' => Storage::disk('s3')\n\t\t\t];*/\n\t\t}", "public static function listTable() {\n self::init();\n $columns = self::getListTableColumns();\n $columnsData = array();\n\n foreach($columns as $key => $value)\n $columnsData[$key] = $value['label'];\n\n new AdminListTable(\n self::$table,\n array(\n 'singular' => 'Log',\n 'plural' => 'Logs',\n ),\n array(\n 'columns' => $columnsData,\n 'orderby' => 'date_time',\n 'order' => 'desc',\n 'search' => array(\n 'date_time',\n ),\n 'sortable' => array(\n 'date_time' => 'date_time',\n ),\n 'per_page' => 40,\n )\n );\n }", "public static function pxp_client_transactions_list()\n\t{\n\t\tglobal $My_WP_List_Table;\n\t\t\n\t\t$transactions = self::get_transactions();\n\t\t\n\t\t// Set the transactions to the table list.\n\t\t$My_WP_List_Table->set_item_list( $transactions );\n\t\t\n\t\t// Fetch, prepare, sort, and filter our data.\n\t\t$My_WP_List_Table->prepare_items();\n?>\n\t\t<div>\n\t\t\t<h2>Transaction History</h2>\n\t\t<div>\n\t\t<div>\n\t\t\t<h4>\n\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent finibus orci non turpis suscipit ornare.\n\t\t\t</h4>\n\t\t</div>\n\n<?php \n\t\t$My_WP_List_Table->display();\t\n\t}", "protected function setupListOperation()\n {\n $this->crud->removeAllButtons();\n $this->crud->disableResponsiveTable();\n CRUD::column('name');\n CRUD::column('cron_expression');\n CRUD::column('grace_time_in_minutes');\n CRUD::column('last_failed_at');\n CRUD::column('last_finished_at');\n// CRUD::column('last_pinged_at');\n CRUD::column('last_skipped_at');\n CRUD::column('last_started_at');\n// CRUD::column('ping_url');\n// CRUD::column('registered_on_oh_dear_at');\n CRUD::column('timezone');\n CRUD::column('type');\n CRUD::column('updated_at');\n\n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']);\n */\n }", "protected function RenderTable()\n {\n if ($this->m_QueryONRender)\n if (!$this->_run_search($resultRecords, $this->m_ClearSearchRule))\n return $this->ProcessDataObjError($ok);\n\n $records = array();\n $records[] = $this->m_RecordRow->RenderColumn();\n $counter = 0;\n while (true) {\n if ($this->m_Range != null && $this->m_Range > 0 && $counter > $this->m_Range)\n break;\n if ($this->CanShowData())\n $arr = $resultRecords[$counter];\n if (!$arr)\n break;\n $this->m_RecordRow->SetRecordArr($arr);\n $tblRow = $this->m_RecordRow->Render();\n $records[] = $tblRow;\n $counter++;\n }\n return $records;\n }", "public function generateList() {}", "public function generateList() {}", "public function generateList() {}", "public function getTableNames();", "function table()\n {\n return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,\n 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL);\n }", "function render_subscriber_table($table) {\n $s = '<table>';\n $s .= '<tr><th>Id</th><th>Name</th><th>Email</th></tr>';\n foreach($table as $row) {\n $id = \"$row[id]\";\n $name = \"<b>$row[name]</b>\";\n $email = \"$row[email]\";\n $s .= \"<tr><td>$id</td><td>$name</td><td>$email</td></tr>\";\n }\n $s .= '</table>';\n return $s;\n }", "public function ListTable()\n {\n echo $this->ListTableText();\n }", "function bookingstatus_listdata( $tbl_bookingstatus ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_bookingstatus\");\n\t\treturn $sql;\n}", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "private function get_export_list_table() {\n\t\treturn wc_customer_order_csv_export()->load_class( '/includes/admin/class-wc-customer-order-csv-export-list-table.php', 'WC_Customer_Order_CSV_Export_List_Table' );\n\t}", "function rec_empresa_list(){\n\t\t}", "public function getListRecords()\n {\n $result = array();\n $records = $this->records;\n if (count($records)) {\n $columns = $this->columns;\n $customColumns = $this->customColumns;\n $formatterColumns = $this->formatterColumns;\n foreach ($records as $index => $record) {\n $row = array();\n foreach ($columns as $column) {\n if (isset($customColumns[$column])) {\n $params = $customColumns[$column];\n ob_start();\n call_user_func($params['callback'], $record, $this);\n $output = ob_get_contents();\n ob_end_clean();\n $row[$column] = $output;\n } else {\n if (isset($formatterColumns[$column])) {\n $params = $formatterColumns[$column];\n ob_start();\n call_user_func($params['callback'], $record);\n $output = ob_get_contents();\n ob_end_clean();\n $row[$column] = $output;\n } else {\n // Is alias column\n if (array_key_exists($column, $this->aliases)) {\n $columnName = $column;\n } else {\n list($tableName, $columnName) = explode(\".\", $column);\n }\n $columnIdentifier = isset($columnName) ? $columnName : $column;\n $row[$column] = $record[$columnIdentifier];\n }\n }\n }\n $result[$index] = $row;\n }\n }\n return $result;\n }", "public function listAction()\n\t{\n\t\t# 1. SETUP HEADER STUFF\n\t\t$dirs = Zend_Registry::get('dirs');\n\t\t// Attach spreadsheet for table\n\t\t$this->view->headLink()\n\t\t\t->prependStylesheet(\"{$dirs->styles}/sortable_tables.css\", \"screen, projection\");\n\t\t// Attach scripts for dynamic sorting of table\n\t\t$this->view->headScript()\n\t\t\t->prependFile(\"{$dirs->scripts}/sortable_tables.js\")\n\t\t\t->prependFile(\"{$dirs->scripts}/MochiKit/MochiKit.js\");\n\t\t\n\t\t# 2. GET ROWS\n\t\t// Get select field\n\t\t$db = Zend_Registry::get('db');\n\t\t$select = $db->select()\n\t\t\t->from(array('s' => \"studies\"),\n\t\t\t\tarray('id', 'date_of_entry', 'study', 'to_use', 'lower_age', 'upper_age', 'odd_even', 'gcal_calendar_id'))\n\t\t\t->joinLeft(array('r' => \"researchers\"),\n\t\t\t\t\"s.researcher_id = r.id\", array(\"researcher\"))\n\t\t\t->joinLeft(array('l' => \"labs\"),\n\t\t\t\t\"r.lab_id = l.id\", array(\"lab\"));\n\t\t// Check if want to display archived\n\t\t$viewArchive = $this->_getParam(\"view_archive\");\n\t\tswitch ($viewArchive) {\n\t\t\t// View only archived (to_use = 0)\n\t\t\tcase 1:\n\t\t\t\t$select->where(\"s.to_use = ?\", 0);\n\t\t\t\t$this->view->viewArchived = TRUE;\n\t\t\t\tbreak;\n\t\t\t// View only active (to_use = 1)\n\t\t\tcase 2:\n\t\t\t\t$select->where(\"s.to_use = ?\", 1);\n\t\t\t\t$this->view->viewActive = TRUE;\n\t\t\t\tbreak;\n\t\t\t// View all\n\t\t\tdefault:\n\t\t\t\t$this->view->viewAll = TRUE;\n\t\t\t\tbreak;\n\t\t}\n\t\t// Fetch and Save rows\n\t\t$rows = $db->fetchAll($select);\n\t\t$this->view->results = $rows;\n\t\t\n\t\t# 3. ID PADDING FOR SORTING\n\t\t// Get the id of the last row (assuming that they are in order of id)\n\t\t$tmpRows = $rows;\n\t\t$lastRow = array_pop($tmpRows);\n\t\t$lastId = $lastRow[\"id\"];\n\t\t// Get the length of id + padding length to have proper sorting\n\t\t$this->view->idPad = strlen($lastId);\n\t}", "function books_list()\n\t{\n global $wpdb;\n\n \t$this->check_dir();\n \t$this->check_db();\n\n $list = '';\n $list .= \"<table class=\\\"form-table\\\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>ID</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Preview</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Creation Date</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Operation</h3></th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody> \";\n\n\t $sql = \"select `id`, `name`, `date` from `\".$this->table_name.\"` order by `id`\";\n\t $piecemakers = $wpdb->get_results($sql, ARRAY_A);\n\n\t if(count($piecemakers) == \"0\") \n\t\t\t$list\t.= \"<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\"\n\t\t\t\t\t.\"<td colspan=\\\"5\\\" style=\\\"text-align: center;\\\"><strong>There are currently no Piecemakers defined</strong></td></tr>\";\n\n else foreach($piecemakers as $piecemaker) {\n\t\t\t\t$creationDate = date(\"d/m/Y\", $piecemaker['date']);\n\t\t\t\t$piecemakerXml = $this->get_xml($piecemaker['id']);\n\t\t\t\t$piecemakerTable = $this->xml_to_table($piecemaker['id']);\n\n\t\t\t\t$list\t.=\"<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\"\n\t\t\t\t\t\t.\"<td width=\\\"10%\\\" style=\\\"text-align: center;\\\"><strong>\".$piecemaker['id'].\"</strong></td>\" \n\t\t\t\t\t\t.\"<td width=\\\"20%\\\" style=\\\"text-align: center;\\\">\".$this->printImg($piecemakerTable['allPages']['src'][0]).\"</td>\"\n\t\t\t\t\t\t.\"<td width=\\\"15%\\\" style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\".$creationDate.\"\n\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t <td width=\\\"35%\\\" style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\t <form name=\\\"operations\\\" id=\\\"operations\\\" method=\\\"post\\\" action=\\\"\\\">\n\t\t\t\t\t\t\t\t\t <input name=\\\"id\\\" value=\\\"\".$piecemaker['id'].\"\\\" type=\\\"hidden\\\"/>\";\n\n\t\t\t\tif($piecemakerXml)\n\t\t\t\t\t$list \t.= \"<input class=\\\"add_page\\\" name=\\\"do\\\" value=\\\"Add Slide\\\" type=\\\"submit\\\" title=\\\"Add Slide\\\"/>\"\n\t\t\t\t\t\t.\"<input class=\\\"piecemaker_properties\\\" name=\\\"do\\\" value=\\\"Book Properties\\\" type=\\\"submit\\\" title=\\\"Piecemaker Properties\\\"/>\"\n\t\t\t\t\t\t.\"<input class=\\\"view_pages\\\" name=\\\"do\\\" value=\\\"View pages\\\" type=\\\"submit\\\" title=\\\"View Pages\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"add_transition\\\" name=\\\"do\\\" value=\\\"Add Transition\\\" type=\\\"submit\\\" title=\\\"Add Transition\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"view_transitions\\\" name=\\\"do\\\" value=\\\"View Transitions\\\" type=\\\"submit\\\" title=\\\"View Transitions\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"delete\\\" name=\\\"do\\\" value=\\\"Delete Book\\\" type=\\\"submit\\\" onClick=\\\"return confirm('Delete this book?')\\\"/ title=\\\"Delete\\\">\"\n\t\t\t\t\t\t.\"</form> </td> </tr>\";\n\n\t\t\t}\n $list .= \"</tbody></table>\";\n echo $list;\n\t}", "public function delegateListTableNames();", "public function all()\n {\n $records = R::findAll( $this->table_name(), \" order by id \");\n\n $object = array_map( function($each_record) {\n return $this->map_reford_to_object( $each_record );\n },\n $records\n );\n\n return array_values( $object );\n }", "function newskomentar_listdata($tbl_newskomentar){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar\");\n\t\treturn $sql;\n}", "public function get_main_table()\n {\n $list = $this->M_mst_location->get_datatables();\n // echo \"<pre>\"; print_r($list); die;\n $data = array();\n $no = $_POST['start'];\n foreach ($list as $field) {\n $no++;\n\n $row = array();\n $row[] = $field->province;\n $row[] = $field->city;\n $row[] = $field->distrinct;\n $row[] = $field->subdistrict;\n $row[] = $field->postalcode;\n\n\n $data[] = $row;\n }\n\n $output = array(\n \"draw\" => $_POST['draw'],\n \"recordsTotal\" => $this->M_mst_location->count_all(),\n \"recordsFiltered\" => $this->M_mst_location->count_filtered(),\n \"data\" => $data\n );\n //output dalam format JSON\n echo json_encode($output);\n }", "public function recharge_list(){\n $recharge_log_where['user_id'] = ['eq',$this->user_id];\n $p = I('p/d',1);\n $page_last = 7;\n $count = M('recharge')->where($recharge_log_where)->count();\n $withdrawals_log = M('recharge')->where($recharge_log_where)\n ->order('order_id desc')\n ->page(\"{$p},{$page_last}\")\n ->select();\n $Page = new Page($count,$page_last);\n $Page->rollPage = 2;\n $page = $Page->show(); \n $this->assign('lists',$withdrawals_log);\n $this->assign('page', $page);\n \treturn $this->fetch();\n }", "protected function _readTable() {}", "protected function _readTable() {}", "public function auto_build_list_tbody($data){\r\n\t\t$list_tbody = \"<tbody>\";\r\n\t\t$i = 1;\r\n\t\tforeach ($data as $row) {\r\n\t\t\t$list_tbody .= '<tr>' .\r\n\t\t\t\t\"<td>\" . $i++ . \"</td>\";\r\n\t\t\tforeach ($this->model->table_fields as $list_field) {\r\n\t\t\t\tif ($list_field->get_visible_grid()) {\r\n\t\t\t\t\t//if($list_field->get_type()==Column::$COLUMN_TYPE_SELECT)\r\n\t\t\t\t\tif ($list_field->get_foreing_key()) {\r\n\t\t\t\t\t\t$select_data = $list_field->get_fk_entity()->get_select_data($row[$list_field->get_name()]);\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . $select_data[0]['name'] . \"</td>\";\r\n\t\t\t\t\t} else if ($list_field->get_type() == Column::$COLUMN_TYPE_PASS) {\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . (str_repeat('*', strlen($row[$list_field->get_name()]))) . \"</td>\";\r\n\t\t\t\t\t} else if (Column::$COLUMN_TYPE_ICONPICKER) {\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . $row[$list_field->get_name()] .\r\n\t\t\t\t\t\t\t\" <i class='\" . $row[$list_field->get_name()] . \"'></i></td>\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . $row[$list_field->get_name()] . \"</td>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$list_tbody .= \"<td class='text-center'>\" . ($this->model->crud_config['can_update'] ?\r\n\t\t\t\t\t\tComponent::edit_button($this->model->table_name, $row[$this->model->id_field]) : '') . \r\n\t\t\t\t\t($this->model->crud_config['can_delete'] ?\r\n\t\t\t\t\t\tComponent::delete_button($this->model->table_name, $row[$this->model->id_field]) : '') .\r\n\t\t\t\t\"</td>\" .\r\n\t\t\t\t\"</tr>\";\r\n\r\n\t\t}\r\n\t\treturn $list_tbody . \"</tbody>\";\r\n\t}", "function Certificates_Table($friend,$event,$certs,$datas=array())\n {\n if (empty($datas)) { $datas=$this->Certificates_Table_Datas(); }\n \n $n=1;\n \n $table=array();\n foreach ($certs as $cert)\n {\n if (!$this->Certificate_Verify($cert) ) { continue; }\n \n array_push\n (\n $table,\n $this->Certificate_Row($n++,$friend,$event,$cert,$datas)\n );\n }\n\n if (!empty($table))\n {\n array_unshift\n (\n $table,\n $this->H(3,$this->GetRealNameKey($event,\"Name\"))\n );\n array_push\n (\n $table,\n $this->Certificates_Table_SumRow($friend,$event,$certs)\n );\n }\n\n return $table;\n }", "public function remapListedDBRecords() {}", "public function getListOfTables() {}", "public static function getList()\n {\n return \\yii\\helpers\\ArrayHelper::map(self::find()->all(), 'id', 'id_santri');\n }", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}", "function AggregateListRowValues() {\n\t}" ]
[ "0.569231", "0.5620626", "0.54793113", "0.547211", "0.5438485", "0.5428176", "0.5397956", "0.5393835", "0.5369618", "0.5352866", "0.527787", "0.527031", "0.52674496", "0.5245191", "0.5193814", "0.51866084", "0.5182434", "0.5154388", "0.5151184", "0.5149681", "0.51431143", "0.5137937", "0.5114078", "0.50968176", "0.50920945", "0.5069878", "0.50654453", "0.50591063", "0.5056558", "0.5051946", "0.5051101", "0.5038507", "0.5033769", "0.5033769", "0.5033769", "0.5007571", "0.500102", "0.5000268", "0.4996373", "0.49954376", "0.49889785", "0.49787197", "0.49703157", "0.49687597", "0.4951095", "0.49452147", "0.49351612", "0.49349353", "0.49274382", "0.4919242", "0.49152952", "0.48891053", "0.48882732", "0.48762453", "0.4873993", "0.48692372", "0.48671845", "0.48669535", "0.4863165", "0.48557255", "0.4850841", "0.4841605", "0.4839282", "0.48380455", "0.48359907", "0.48355398", "0.48328552", "0.48309752", "0.48189017", "0.48077995", "0.48026326", "0.4802473", "0.4802473", "0.48010927", "0.48003134", "0.47987014", "0.47976753", "0.47962868", "0.47909242", "0.47885734", "0.4780019", "0.4779452", "0.47745213", "0.47742367", "0.4773783", "0.47718796", "0.47701988", "0.47610798", "0.4758489", "0.47523156", "0.47513258", "0.47493085", "0.47491467", "0.47490796", "0.4743775", "0.47401246", "0.4737489", "0.4737489", "0.4737489", "0.4737489" ]
0.47500545
91
/UPDATE A SINGLE RATE
function update_single_rate($rateId,$inputData) { $this->public_db->where('standardRateId', $rateId); $this->public_db->update('standardrates', $inputData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }", "public function updateRecord($code, $ratio, $rate, $reverserate) {\n\t\t$this->_db->q(\"\n\t\tUPDATE `currency` \n\t\tSET `ratio` = \" . $ratio . \", `rate` = \" . $rate . \", `reverserate` = \" . $reverserate . \"\n\t\tWHERE `code` = '\" . $code . \"'\n\t\tLIMIT 1\");\n\t}", "public function updateRating(){\r\n\t\t$mysqli = \\Database::Instance()->get();\r\n\r\n\t\t$rating = $this->rating;\r\n\r\n\t\t$stmt = $mysqli->prepare(\"SELECT SUM(`stars`)/COUNT(`stars`) AS `rating` FROM `ratings` WHERE `hotspot` = ?\");\r\n\t\t$stmt->bind_param(\"i\",$this->id);\r\n\t\tif($stmt->execute()){\r\n\t\t\t$result = $stmt->get_result();\r\n\r\n\t\t\tif($result->num_rows){\r\n\t\t\t\t$row = $result->fetch_assoc();\r\n\r\n\t\t\t\t$rating = (double)$row[\"rating\"];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$stmt->close();\r\n\r\n\t\t$stmt = $mysqli->prepare(\"UPDATE `hotspots` SET `rating` = ? WHERE `id` = ?\");\r\n\t\t$stmt->bind_param(\"di\",$rating,$this->id);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->close();\r\n\r\n\t\t$this->rating = $rating;\r\n\t\t$this->saveToCache();\r\n\t}", "public function updated(VoteRate $voteRate)\n {\n //\n }", "private function _update_currency_conversion_rate(){\n\t\t\t$query = \"SELECT `serial_num`, `\".$this->table_fields['currency_iso_code'].\"` as 'currency_iso_code' FROM `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` where `record_status`='1' AND `modification_date` < \".(date(\"U\") - (3600*24));\n\t\t\t$query_settings = array(\n\t\t\t\t'database' => $this->class_settings['database_name'] ,\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'SELECT',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n \n //get exchange rate\n $all_country_list = execute_sql_query($query_settings);\n\t\t\t$return = array();\n \n\t\t\tif( is_array( $all_country_list ) && ! empty( $all_country_list ) ){\n\t\t\t\t$query_settings['query_type'] = 'UPDATE';\n \n $first = true;\n foreach( $all_country_list as $val ){\n\t\t\t\t\tif( $val['currency_iso_code'] ){\n $json = file_get_contents('http://rate-exchange.appspot.com/currency?from=USD&to='.strtoupper($val['currency_iso_code']) );\n if($json)$cur = json_decode($json, true);\n if( isset( $cur['rate'] ) && $cur['rate'] ){\n $return[] = $cur;\n \n $query_settings['query'] = \"UPDATE `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` SET `\".$this->table_fields['conversion_rate'].\"`= '\".$cur['rate'].\"' WHERE `serial_num`='\".$val['serial_num'].\"' \";\n \n execute_sql_query($query_settings);\n \n if( $first ){\n $query_settings['tables'] = array();\n $query_settings['set_memcache'] = 0;\n $first = false;\n }\n }\n }\n\t\t\t\t}\n \n $this->class_settings[ 'do_not_check_cache' ] = 1;\n $this->_get_country_list();\n }\n \n return $return;\n }", "public function setRate($rate) {\n $this->rate = $rate;\n }", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function update()\n {\n if ($this->payableRate->fill(Input::all())->validate()) {\n if ($this->payableRate->updateWithInput()) {\n return Redirect::route('accounting.payrates')->with('success', 'Payable Rate Updated');\n }\n }\n Session::flash('danger', 'There was a problem updating the payable rate.');\n return Redirect::back()->withInput()->withErrors($this->payableRate->errors);\n }", "public function api_update_price(){\n $watchlists = $this->wr->all();\n foreach($watchlists as $watchlist)\n {\n $current_price = $this->get_quotes($watchlist->id);\n\n $this->wr->update([\n 'current_price' => $current_price,\n ],$watchlist->id);\n }\n }", "public function updateTaskHourlyRate($task_id, $task_hourly_rate) {\n\t\t$conn=parent::connect();\n\t\t$sql = \"UPDATE \" . TBL_TASK . \" SET\n\t\t\t\ttask_hourly_rate = :task_hourly_rate\n\t\t\t\tWHERE task_id = :task_id\";\n\t\t\ttry {\n\t\t\t\t$st = $conn->prepare($sql);\n\t\t\t\t$st->bindValue(\":task_hourly_rate\", $task_hourly_rate, PDO::PARAM_INT);\n\t\t\t\t$st->bindValue(\":task_id\", $task_id, PDO::PARAM_INT);\n\t\t\t\t$st->execute();\t\n\t\t\t\tparent::disconnect($conn);\n\t\t\t} catch (PDOException $e) {\n\t\t\t\tparent::disconnect($conn);\n\t\t\t\tdie(\"Query failed on update of task: \" . $e->getMessage() . \" sql is \" . $sql);\n\t\t\t}\n\t}", "public function update(UpdateRateRequest $request, Rate $rate)\n {\n\n RateService::updateRateWithParameters($request->all(), $rate);\n\n return response()->json('Rate was successefully updated', Response::HTTP_OK);\n }", "public function update(Request $request, $id)\n {\n //\n $airline = AirlineRate::findOrFail($id);\n $airline->update([\n \n 'rate' => $request['rate'],\n 'date' => $request['date'],\n 'day' => $request['day'],\n 'user_id' => Auth::user()->id\n \n ]);\n }", "function editAlterRate($design_no, $suit_rate,$dupatta_rate, $ghagra_rate, $blause_rate, $total_rate)\n\t\n\t{\n\t\t/*$stock_id\t\t\t =\tmysql_real_escape_string(trim($stock_id));*/\n\t\t$design_no\t \t\t=\ttrim($design_no);\n\t\t$suit_rate\t\t\t \t\t= mysql_real_escape_string(trim($suit_rate));\n\t\t$dupatta_rate\t\t\t =\tmysql_real_escape_string(trim($dupatta_rate));\n\t\t$ghagra_rate\t\t =\tmysql_real_escape_string(trim($ghagra_rate));\n\t\t$blause_rate\t\t =\tmysql_real_escape_string(trim($blause_rate));\n\t\t$total_rate\t\t\t =\tmysql_real_escape_string(trim($total_rate));\n\t\t\n\t\t//update stock description\n\t\t$edit = \"UPDATE alter_rate\n\t\t\t\tSET\n\t\t\t\tdesign_no\t\t \t= '$design_no',\n\t\t\t\tsuit_rate\t\t\t= '$suit_rate',\n\t\t\t\tdupatta_rate\t\t= '$dupatta_rate',\n\t\t\t\tghagra_rate \t\t= '$ghagra_rate',\n\t\t\t\tblause_rate \t\t= '$blause_rate',\n\t\t\t\ttotal_rate\t\t = '$total_rate',\n\t\t\t\tmodified_on\t\t\t= now()\n\t\t\t\tWHERE\n\t\t\t\trate_id \t\t\t= '$rate_id'\n\t\t\t\t\";\n\t\t$query = mysql_query($edit);\n\t\t//echo $edit.mysql_error();exit;\n\t\t\n\t}", "public function rate()\n {\n\n }", "public function unRate()\n {\n\n }", "function UpdateExchangeRatesDB() {\n $time_now = TIMESTAMP_NOW;\n $rates = GetExchangeRateAPI();\n\n foreach ($rates[\"rates\"] as $currency => $rate) {\n // If exists, update rates of each currency\n // Otherwise, add new entry and set base\n if (CheckIfCurrencyExists($currency)) {\n $query = \"UPDATE conversion_rates SET rate='$rate', updated_at='$time_now' WHERE currency='$currency';\";\n } else {\n $query = \"INSERT INTO conversion_rates (currency, rate, created_at, updated_at) VALUES ('$currency', '$rate', '$time_now', '$time_now')\";\n }\n $GLOBALS['conn']->query($query);\n\n // Set base currency flag\n $base_rate = $rates['base'];\n $query = \"UPDATE conversion_rates SET is_base=true WHERE currency='$base_rate'\";\n $GLOBALS['conn']->query($query);\n }\n }", "function ciniki_sapos_simpleshiprateUpdate(&$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 'rate_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Shipping Rate'),\n 'country'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Country'),\n 'province'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Province'),\n 'city'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'City'),\n 'minimum_amount'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Invoice Total'),\n 'rate'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Shipping Rate'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n if( isset($args['minimum_amount']) ) {\n $args['minimum_amount'] = preg_replace('/[^0-9\\.]/', '', $args['minimum_amount']);\n }\n if( isset($args['rate']) ) {\n $args['rate'] = preg_replace('/[^0-9\\.]/', '', $args['rate']);\n }\n\n //\n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'checkAccess');\n $rc = ciniki_sapos_checkAccess($ciniki, $args['tnid'], 'ciniki.sapos.simpleshiprateUpdate');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Start transaction\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', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.sapos');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the Shipping Rate in the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.sapos.simpleshiprate', $args['rate_id'], $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.sapos');\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', 'sapos');\n\n //\n // Update the web index if enabled\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'hookExec');\n ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.sapos.simpleshiprate', 'object_id'=>$args['rate_id']));\n\n return array('stat'=>'ok');\n}", "public function update(RateValidationRequest $request, Rate $rate)\n {\n $rate->update([\n 'name' => request('name'),\n 'icon' => request('icon'),\n ]);\n\n return redirect('rates/radiology')\n ->with('notification', [\n 'title' => 'Updated!',\n 'message' =>'Radiology Service Rate successfully updated!',\n 'class' => 'success'\n ]);\n }", "public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }", "public function postUpdate(Request $request){\n \tTax::where('id','>',0)->where('company_id',Auth::user()->company_id)->update(['status' => 2]);\n \t// insert new tax row with status 1 to show that this is the current tax rate.\n //Validate the request\n $this->validate($request, [\n 'rate' => 'required|min:1',\n 'company_id'=>'required'\n ]); \n\n // adjust rate\n $tax_rate = ($request->rate > 1) ? ($request->rate / 100) : $request->rate;\n\n $tax = new Tax();\n $tax->company_id = Auth::user()->company_id;\n $tax->rate = $tax_rate;\n $tax->status = 1;\n if($tax->save()){\n\t\t\tFlash::success('Successfully updated sales tax!');\n\t\t\treturn Redirect::route('taxes_index');\n } \t\n }", "public function updatesitterrateAction() {\n\n $job_id = $_POST['job_id'];\n $rate = $_POST['rate'];\n $this->jobs->update_sitter_rate($job_id, $rate);\n $data = array();\n $data['status'] = \"success\";\n $data['message'] = \"Sitter Rate has been updated successfully\";\n echo json_encode($data);\n die;\n }", "public function updateRate($Data)\n {\n $rate = CoursesRate::find($Data['id']);\n $rate->rate = $Data['rate'];\n $rate->rate_comment = $Data['rate_comment'];\n if($rate->save()){\n return true;\n }else{\n return false;\n }\n }", "public function updateclientrateAction() {\n\n $job_id = $_POST['job_id'];\n $rate = $_POST['rate'];\n $this->jobs->update_client_rate($job_id, $rate);\n $data = array();\n $data['status'] = \"success\";\n $data['message'] = \"Client Rate has been updated successfully\";\n echo json_encode($data);\n die;\n }", "public function updated(Credit $credit)\n {\n\n }", "public function updateHireRate(Request $request){\n // sanitize input (function in Controller parent)\n $this->formatInput($request);\n\n // validation of user input in the form\n $this->validateVehicle($request);\n\n // if VALIDATION went ok proceed to below\n // fetch correct Vehicle\n $vehi = Vehicle::find($request->specific_vehicle_id);\n\n // only hire price and updated_at are updated\n $vehi->fldHirePriceCurrent = $request->fldHirePriceCurrent;\n\n $vehi->save();\n\n return redirect('vehicles');\n }", "public function update(Request $request, $id)\n {\n /*$this->validate($request,[\n 'PlateNumber' => 'required|string|max:50',\n 'EngineNumber' => 'required|string|max:50',\n 'SerialNumber' => 'required|string|max:50',\n 'AssetNumber' => 'required|string|max:50',\n 'Type' => 'required|string|max:20',\n 'DriverName' => 'required|string|max:50',\n 'OperatorName' => 'required|string|max:50',\n 'GSCUnit' => 'required|string|max:1',\n ]);*/\n\n date_default_timezone_set('Asia/Manila');\n $driver= VehicleRate::findOrFail($id);\n //$driver->update($request->all());\n $driver->update([\n 'MVID_Link' => $request['MVID_Link'],\n 'PlateNumber' => $request['PlateNumber'],\n 'EffectiveDate' => strtoupper($request['EffectiveDate']),\n 'PerHourRate' => $request['PerHourRate']\n \n /*\n 'PerTransactionRate' => number_format($request['PerTransactionRate'],2,\".\",\",\"),\n 'DailyRate' => number_format($request['DailyRate'],2,\".\",\",\")\n 'EffectiveDate' => strtoupper($request['EffectiveDate']),\n 'PerHourRate' => number_format($request['PerHourRate'],2,\".\",\",\"),\n 'PerAreaRate' => number_format($request['PerAreaRate'],2,\".\",\",\"),\n 'FixedMonthlyRate' => number_format($request['FixedMonthlyRate'],2,\".\",\",\"),\n 'PerBagRate' => number_format($request['PerBagRate'],2,\".\",\",\"),\n 'PerDestinationRate' => number_format($request['PerDestinationRate'],2,\".\",\",\"),\n 'Status' => strtoupper($request['Status'])*/\n ]);\n }", "public function testUpdatePayrun()\n {\n }", "public function changeRateStatus($rateID, $status){\n \t$set = array(\n \t\t'active' => $status\n \t);\n \t$where = array(\n \t\t'id' => $rateID\n \t);\n \t$result = $this->update($set, $where);\n\n \treturn $result;\n }", "Function UpdateRates()\n{\n\t$query = \"SELECT *,NOW()-(last_update) as dif from HB_lastupdate\";\n \t$res = mysql_query($query);\n\t\n\tif(!$res)\n\t{\n\t\treturn;\n\t}\n\t$ar = mysql_fetch_array($res);\n\t$mydif = (int)($ar[dif]/60) - 1440;\n\tprint \"+++++++++++++++++++++\";$mydif;\n\tif($mydif>0)\n\t{\n\t $fp = fopen(\"http://www.bankofcanada.ca/fmd/exchange.htm\",\"r\");\n\t $x=0;$g=0;\n\t while(!feof($fp))\n\t {\n\t $buf = fgets($fp, 4096);\n\t if(eregi(\"U.S. Dollar\",$buf)) $x=4;\n\t if(eregi(\"</PRE>\",$buf)) $x=0;\n\t if($x==4)\n\t {\n if(!eregi(\"US/CA\",$buf))\n {\n \t$ime = explode(\"/\",$buf);\n\t\tprint_r($ime);\n\t\tprint \"<BR>\";\n \t$s = explode(\" \",$ime[1]);\n \t$r = array_reverse ($s);\n\n \tif(eregi(\"Euro de\",$buf))\n \t{\n \t $ime[0]=\"European Monetary Union EURO\";\n \t $s = explode(\" \",$buf);\n \t $r = array_reverse ($s);\n \t}\n\n \tif($ime[0]<>\"\" and $r[0]<>\"\")\n \t{\n \t $g++;\n \t if(eregi(\"U.S. Dollar\",$buf)) {$koef = (float)$r[0];}\n \t $k = ((float)$r[0]/(float)$koef);\n \t $usd = 1/$k;\n \t $res = mysql_query(\"SELECT * FROM HB_rates WHERE sifra=\\\"$ime[0]\\\"\");\n \t $num = mysql_num_rows($res);\n \t if($num > 0)\n\t\t {\n \tmysql_query(\"UPDATE HB_rates SET rate='$usd' WHERE sifra=\\\"$ime[0]\\\"\");\n\t\t }\n\t\t else\n\t\t {\n \t//mysql_query(\"INSERT INTO HB_rates VAUES( \t\t\t\t\t\t NULL,\t\t\t\t\t\t '$usd', sifra=\\\"$ime[0]\\\"\");\n\t\t }\n \t}\n if(eregi(\"Venezuelan Bolivar\",$buf)) $x=0;\n }\n\t }\n\t }\n\t fclose($fp);\n\t mysql_query(\"UPDATE HB_lastupdate SET last_update=NOW();\");\n\t}\n}", "public static function updateItemOptionRate($data)\n {\n $optionID = $data['id'];\n $rate = $data['rate'];\n $empID = base64_decode(Session::get('Emp_Id'));\n\n $query = DB::connection('dbChecklist')->select('EXEC [sp_ItemOptionRate_Update] ?, ?, ?', [$optionID, $rate, $empID]);\n return $query;\n }", "public function updateRates()\n {\n $client = new \\GuzzleHttp\\Client();\n\n foreach ($this->currencyRepository->all() as $currency) {\n if ($currency->code == config('app.currency')) {\n continue;\n }\n\n $result = $client->request('GET', $this->apiEndPoint . '?access_key='. $this->apiKey . '&base=' . config('app.currency') . '&symbols=' . $currency->code);\n\n $result = json_decode($result->getBody()->getContents(), true);\n\n if (\n isset($result['success'])\n && ! $result['success']\n ) {\n throw new \\Exception($result['error']['info'] ?? $result['error']['type'], 1);\n }\n\n if ($exchangeRate = $currency->exchange_rate) {\n $this->exchangeRateRepository->update([\n 'rate' => $result['rates'][$currency->code],\n ], $exchangeRate->id);\n } else {\n $this->exchangeRateRepository->create([\n 'rate' => $result['rates'][$currency->code],\n 'target_currency' => $currency->id,\n ]);\n }\n }\n }", "public function updateSeconds(Request $request){\n if(Auth::guard('api')->user()){\n $data=Credit::find($request->id);\n $data->credit=$data->credit+($request->country_cost/60);\n $data->balance=$data->balance-($request->country_cost/60);\n $data->update();\n if(isset($request->history_id)){\n $history=CallHistory::find($request->history_id);\n $history->call_ended_at=time();\n $history->update();}\n return response('updated');\n }else{\n return response('unauthorized');\n }\n }", "public function update($id, UpdaterateRequest $request)\n {\n $rate = $this->rateRepository->find($id);\n\n if (empty($rate)) {\n Flash::error('Rate not found');\n\n return redirect(route('rates.index'));\n }\n\n $rate = $this->rateRepository->update($request->all(), $id);\n\n Flash::success('Rate updated successfully.');\n\n return redirect(route('rates.index'));\n }", "public function update(Request $request, Salonrate $salonrate)\n {\n $this->validateRate();\n $rate_data = request()->all();\n $salonrate->update($rate_data);\n\n return redirect(route('admin.salonrates.index'))->withSuccess('Успешно обновлено');;\n }", "public function ratechange($feedid, $time_now, $value)\n {\n \n // Get the feed\n $feedname = \"feed_\" . trim($feedid) . \"\";\n\n // Get the current input id\n $result = $this->mysqli->query(\"Select * from input where processList like '%:$feedid%';\");\n $rowfound = $result->fetch_array();\n if ($rowfound)\n {\n $inputid = trim($rowfound['id']);\n $processlist = $rowfound['processList'];\n // Now get the feed for the log to feed command for the input\n $logfeed = preg_match('/1:(\\d+)/', $processlist, $matches);\n $logfeedid = trim($matches[1]);\n // Now need to get the last but one value in the main log to feed table\n $oldfeedname = \"feed_\" . trim($logfeedid) . \"\";\n $lastentry = $this->mysqli->query(\"Select * from $oldfeedname order by time desc LIMIT 2;\");\n if ($lastentry) {\n $lastentryrow = $lastentry->fetch_array();\n // Calling again so can get the 2nd row\n $lastentryrow = $lastentry->fetch_array();\n $prevValue = trim($lastentryrow['data']);\n $ratechange = $value - $prevValue;\n // now put this rate change into the correct feed table\n $this->feed->insert_data($feedid, $time_now, $time_now, $ratechange);\n }\n }\n \n\n }", "private function rateIt()\n {\n try\n {\n $request = $_POST;\n\n $types = array('videos','video','v','photos','photo','p','collections','collection','cl','users','user','u');\n\n //check if type sent\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check valid type\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type\");\n\n //check id \n if( !isset($request['id']) || $request['id']==\"\" )\n throw_error_msg(\"id not provided\"); \n\n //check valid id \n if( !is_numeric($request['id']) )\n throw_error_msg(\"invalid id\"); \n\n //check rating \n if( !isset($request['rating']) || $request['rating']==\"\" )\n throw_error_msg(\"rating not provided\"); \n\n //check valid rating \n if( !is_numeric($request['rating']) )\n throw_error_msg(\"invalid rating\");\n\n $type = mysql_clean($request['type']);\n $id = mysql_clean($request['id']);\n $rating = mysql_clean($request['rating']);\n \n switch($type)\n {\n case \"videos\":\n case \"video\":\n case \"v\":\n {\n global $cbvid;\n $rating = $rating*2;\n $result = $cbvid->rate_video($id,$rating);\n }\n break;\n\n case \"photos\":\n case \"photo\":\n case \"p\":\n {\n global $cbphoto;\n $rating = $rating*2;\n $result = $cbphoto->rate_photo($id,$rating);\n }\n break;\n\n case \"collections\":\n case \"collection\":\n case \"cl\":\n {\n global $cbcollection;\n $rating = $rating*2;\n $result = $cbcollection->rate_collection($id,$rating);\n }\n break;\n\n case \"users\":\n case \"user\":\n case \"u\":\n {\n global $userquery;\n $rating = $rating*2;\n $result = $userquery->rate_user($id,$rating);\n }\n break;\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $result);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "public function update() {\n $this->connection->update(\n \"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), array(\"idchangemoney\" => $this->observer->idchangemoney), $this->user->iduser\n );\n }", "public function rateAction()\n {\n $html = '';\n $paymentMethod = $this->getRequest()->getParam('paymentMethod');\n $calcValue = $this->getRequest()->getParam('calcValue');\n $ratePayShopId = $this->getRequest()->getParam('ratePayshopId');\n $amount = $this->getRequest()->getParam('amount');\n $ratePayCurrency = $this->getRequest()->getParam('ratePayCurrency');\n $isAdmin = $this->getRequest()->getParam('isAdmin');\n $quoteId = $this->getRequest()->getParam('quoteId');\n $this->loadLayout();\n\n try {\n if (preg_match('/^[0-9]+(\\.[0-9][0-9][0-9])?(,[0-9]{1,2})?$/', $calcValue)) {\n $calcValue = str_replace(\".\", \"\", $calcValue);\n $calcValue = str_replace(\",\", \".\", $calcValue);\n $calcValue = floor($calcValue * 100); //MAGE-363: Use cent instead of floating currency\n\n $client = Mage::getSingleton('payone_core/mapper_apiRequest_payment_genericpayment');\n $ratePayConfigModel = Mage::getSingleton('payone_core/payment_method_ratepay');\n $getConfig = $this->getConfig($ratePayConfigModel, $isAdmin, $quoteId);\n $result = $client->ratePayCalculationRequest($amount, $ratePayShopId, $ratePayCurrency, $calcValue, null, $getConfig, 'calculation-by-rate');\n\n if ($result instanceof Payone_Api_Response_Genericpayment_Ok) {\n $responseData = $result->getPayData()->toAssocArray();\n $initialRateChoice = $this->getRequest()->getParam('calcValue');\n $message = $this->__('lang_calculation_rate_ok');\n\n // if the calculated installment value is different from the choice, we notify the user\n if ($initialRateChoice != $responseData['rate']) {\n // if value is lower than choice AND number of months is at maximum (36)\n // then the choice was too low\n // otherwise, it just got adapted to the closest available installment value\n if (\n $initialRateChoice < $responseData['rate']\n && $responseData['number-of-rates'] == 36\n ) {\n $message = $this->__('lang_calculation_rate_too_low');\n } else {\n $message = $this->__('lang_calculation_rate_not_available');\n }\n }\n $responseData['calculation-result-message'] = $message;\n\n /** @var Payone_Core_Block_Checkout_RatePayInstallmentplan $reviewBlock */\n $reviewBlock = $this->getLayout()->getBlock('payone_ratepay.checkout.installmentplan');\n $reviewBlock->setData($responseData);\n $reviewBlock->setIsAdmin($isAdmin);\n $html = $reviewBlock->toHtml();\n\n //if admin order, some fields are added to store,\n //otherwise, data are stores into session\n if (!$isAdmin) {\n //set payone Session Data\n $this->setSessionData($responseData, $paymentMethod);\n }\n } else {\n $this->unsetSessionData($paymentMethod);\n if($result instanceof Payone_Api_Response_Error) {\n $html = \"<div class='ratepay-result rateError'>\" . $this->__($result->getCustomermessage()) . \"</div>\";\n }\n }\n } else {\n $this->unsetSessionData($paymentMethod);\n $html = \"<div class='ratepay-result rateError'>\" . $this->__('lang_error') . \":<br/>\" . $this->__('lang_wrong_value') . \"</div>\";\n }\n } catch (Exception $e) {\n $this->unsetSessionData($paymentMethod);\n Mage::getSingleton('checkout/session')->addError(\n $this->__('Unable to initialize Rate Pay Installement.')\n );\n Mage::logException($e);\n }\n \n $this->getResponse()\n ->clearHeaders()\n ->setHeader('Content-Type', 'text/html', true)\n ->setBody($html);\n return;\n }", "public function rate($offerId, $rate) {\n if(Offer::where('id', $offerId)->update([\n 'voters' => \\DB::raw( 'voters + 1' ),\n 'vote_sum' => \\DB::raw( 'vote_sum + '.$rate )\n ])) {\n return '1';\n } else {\n return '0';\n }\n }", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "public function setRate($var)\n {\n GPBUtil::checkString($var, True);\n $this->rate = $var;\n\n return $this;\n }", "public function testUpdateSuperfund()\n {\n }", "function UpdateOT($RateCode) {\r\n $conn = conn();\r\n $sql = \"UPDATE `paymentrates` SET `RateCode`='$this->RateCode',`RateAmount`='$this->RateAmount',\r\n `DateModified`=NOW(),`ModifiedBy`='$this->ModifiedBy' WHERE `RateCode`='$RateCode'\";\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 }", "public function update();", "public function update();", "public function update();", "public function update();", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function setRate(?float $rate): self\n {\n $this->initialized['rate'] = true;\n $this->rate = $rate;\n\n return $this;\n }", "function updateCurrency($currency) {\n $el = $this->findElByCode($currency[\"code\"]);\n $el->rate = $currency[\"rate\"];\n $el->timestamp = $currency[\"timestamp\"];\n $this->writeCurrenciesToFile();\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function update(Request $request, ss $ss)\n {\n App\\ss::where('active',1)\n ->where('prijs','500')\n ->update('rented');\n }", "public function get_rates(){\n\n \n $endpoint = 'live';\n $access_key = '6b976c41ce198b8b5d28f7890bd447f9';\n // Initialize CURL:\n $ch = curl_init('http://apilayer.net/api/'.$endpoint.'?access_key='.$access_key.'');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Store the data:\n $json = curl_exec($ch);\n curl_close($ch);\n\n // Decode JSON response:\n $exchangeRates = json_decode($json, true);\n \n #calculate the inverse rates \n\n #calculate ZAR -> USD Rate \n $zar_usd = 1 / $exchangeRates['quotes']['USDZAR'];\n # ZAR -> GBP\n $gbp_usd = (1 / $exchangeRates['quotes']['USDGBP']);\n $zar_gdp = $zar_usd / $gbp_usd;\n #ZAR->EUR\n $eur_usd = (1 / $exchangeRates['quotes']['USDEUR']);\n $zar_eur = $zar_usd / $eur_usd;\n #ZAR->KES\n $kes_usd = (1 / $exchangeRates['quotes']['USDKES']);\n $zar_kes = $zar_usd / $kes_usd;\n\n \n $updated_rates = array(\n array(\n 'er_id' => 1 , // ZAR -> GBP\n 'er_rate' => $zar_gdp \n ),\n array(\n 'er_id' => 2 , // ZAR -> EUR\n 'er_rate' => $zar_eur\n ),\n array(\n 'er_id' => 3 , // ZAR -> EUR\n 'er_rate' => $zar_kes\n ),\n array(\n 'er_id' => 4 , // ZAR -> EUR\n 'er_rate' => $zar_usd\n )\n );\n \n #batch update db\n $this->ExchangeRate->update_rates($updated_rates);\n\n echo \"Your exchange rates have been successfully updated\";\n\n // else do some exception handling here\n }", "public function setRate($rate)\n {\n $this->Rate = $rate;\n return $this;\n }", "public function raiseRating($ID) {\n\t\t\t$stmt = $this->DB->prepare ( \"UPDATE quotations SET rating=rating+1 WHERE id= :ID\" );\n\t\t\t$stmt->bindParam ( 'ID', $ID );\n\t\t\t$stmt->execute ();\n\t\t}", "public function update()\r\n {\r\n \r\n }", "public function update(Request $request, $id)\n {\n // return response()->json([ 'data' => $request->all(), 'status' => 'success']); \n\n // return response()->json([ 'data' => $request->all(), 'status' => 'success']); \n\n $default_currency = Currency::default();\n $exchange_rate_id = $default_currency->id;\n $selected_currency = Currency::findOrFail($request->current_currency_id);\n $exchange_rate = CurrencyExchangeRate::currentRate($selected_currency->id);\n $calculation = ($selected_currency->calculation == 'multiplication') ? 'divide' : 'multiplication';\n $rate = 1;\n \n // Start transaction!\n DB::beginTransaction();\n\n try {\n // ...\n $quotation = Quotation::findOrFail($id);\n $quotation->customer_id = $request->customer_id;\n $quotation->validity_date = $request->validity;\n $quotation->payment_term_id = $request->payment_term_id;\n $quotation->delivery_method_id = $request->delivery_method_id; \n $quotation->amount = $request->amount;\n $quotation->tax = $request->pay_tax;\n $quotation->discount = $request->discount;\n $quotation->discount_amount = $request->discount_amount;\n $quotation->grand_total = $request->grand_total;\n $quotation->rate = $rate;\n $quotation->currency_id = $default_currency->id;\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $rate = $exchange_rate->rate;\n $quotation->amount = $this->exchangeRate($calculation, $request->amount, $rate);\n $quotation->tax = $this->exchangeRate($calculation, $request->pay_tax, $rate);\n $quotation->discount_amount = $this->exchangeRate($calculation, $request->discount_amount, $rate);\n $quotation->grand_total = $this->exchangeRate($calculation, $request->grand_total, $rate);\n $quotation->rate = $rate;\n $quotation->is_default_currency = 0;\n $quotation->currency_id = $selected_currency->id;\n }\n\n $quotation->save();\n\n // ...\n // create quotation details reference to quotation id above\n QuotationDetail::where('quotation_id', $quotation->id)->delete();\n foreach ($request->product_id_array as $key => $value) {\n $detail = new QuotationDetail();\n $detail->quotation_id = $quotation->id;\n $detail->product_id = $request->product_id_array[$key];\n $detail->product_name = $request->product_name_array[$key];\n $detail->notes = $request->description_array[$key];\n $detail->variant_ids = $request->variant_ids[$key];\n $detail->qty = $request->qty_array[$key];\n $detail->unit_price = $request->price_array[$key];\n $detail->tax = $request->tax_array[$key];\n $detail->pay_tax = $request->pay_tax_array[$key];\n $detail->discount = $request->discount_array[$key];\n $detail->discount_amount = $request->discount_amount_array[$key];\n $detail->subtotal = $request->subtotal_array[$key];\n // ...\n // exchange money to default currency if the selected currency is not default currency\n if($default_currency->id != $selected_currency->id) { \n $detail->pay_tax = $this->exchangeRate($calculation, $request->pay_tax_array[$key], $rate);\n $detail->discount_amount = $this->exchangeRate($calculation, $request->discount_amount_array[$key], $rate);\n $detail->unit_price = $this->exchangeRate($calculation, $request->price_array[$key], $rate);\n $detail->subtotal = $this->exchangeRate($calculation, $request->subtotal_array[$key], $rate);\n } \n\n $detail->save();\n }\n\n } catch(\\Exception $e)\n {\n DB::rollback();\n throw $e;\n }\n\n DB::commit(); \n return response()->json([ 'quotation' => $quotation, 'status' => 'success']); \n }", "public function RateReview($bRateUp = true)\n {\n if (false == $this->ReviewRatedByActiveUser()) {\n $sRateString = 'helpful_count';\n //helpful_count\n //not_helpful_count\n if (false == $bRateUp) {\n $sRateString = 'not_helpful_count';\n }\n $query = 'UPDATE `'.MySqlLegacySupport::getInstance()->real_escape_string($this->table).\"`\n SET `{$sRateString}` = `{$sRateString}`+1\n WHERE `id` = '\".MySqlLegacySupport::getInstance()->real_escape_string($this->id).\"'\n LIMIT 1\n \";\n MySqlLegacySupport::getInstance()->query($query);\n // get value from disc\n $query = \"SELECT `{$sRateString}` FROM `\".MySqlLegacySupport::getInstance()->real_escape_string($this->table).\"` WHERE `id` = '\".MySqlLegacySupport::getInstance()->real_escape_string($this->id).\"'\";\n if ($aTmp = MySqlLegacySupport::getInstance()->fetch_assoc(MySqlLegacySupport::getInstance()->query($query))) {\n $this->sqlData[$sRateString] = $aTmp[$sRateString];\n if ($bRateUp) {\n $this->fieldHelpfulCount = $this->sqlData[$sRateString];\n } else {\n $this->fieldNotHelpfulCount = $this->sqlData[$sRateString];\n }\n }\n if (!array_key_exists('TPkgShopArticleReviewShopArticleReviewRated', $_SESSION)) {\n $_SESSION['TPkgShopArticleReviewShopArticleReviewRated'] = array();\n }\n $_SESSION['TPkgShopArticleReviewShopArticleReviewRated'][(string) $this->id] = time();\n }\n }", "protected function update() {}", "public function setRate($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->rate !== $v) {\n $this->rate = $v;\n $this->modifiedColumns[KluBillTableMap::COL_RATE] = true;\n }\n\n return $this;\n }", "public function update() {\r\n\r\n\t}", "public function updated(Currency $currency)\n {\n //\n }", "public function getRate() {\n return $this->rate;\n }", "public function getRefreshRate() { return 0; }", "public function updateBankerCredit()\n {\n $user = User::whereHas(\"roles\", function($q){$q->where(\"name\", \"Banker\");})->first();\n\n $total = Credit::where('credit_type', 0)->sum('value');\n $user->free_credits = $total;\n $total = Credit::where('credit_type', 1)->sum('value');\n $user->paid_credits = $total;\n $user->save();\n }", "public function updaterating($picture)\n {\n $pictureModel = new PictureModel();\n $rating=($pictureModel->rating($picture));\n\n $query = \"UPDATE $this->tableName SET rating=? WHERE id=?\";\n $statement = ConnectionHandler::getConnection()->prepare($query);\n $statement->bind_param('ii', $rating, $picture);\n $statement->execute();\n }", "public function update()\r\n {\r\n //\r\n }", "public function setBaseToGlobalRate($rate);", "function update_quality_rating(){\r\n\t\t\t\r\n\t\t\t// DETERMINE RATING BASED ON VOTES\r\n\t\t\t$query_result = sql_query('SELECT SUM(value) AS rating FROM qa_votes WHERE item_type=\"question\" AND item_id=\"'.$this->info['id'].'\"');\r\n\t\t\t$quality_rating = mysql_result($query_result,0,'rating');\r\n\r\n\t\t\tif(is_null($quality_rating)||$quality_rating=='') $quality_rating = 0;\r\n\r\n\t\t\t$query_result = sql_query('SELECT SUM(quality_rating) AS rating FROM qa_answers WHERE question_id=\"'.$this->info['id'].'\" AND is_active=1');\r\n\t\t\t$quality_rating_answers = mysql_result($query_result,0,'rating');\r\n\t\t\tif(is_null($quality_rating_answers)||$quality_rating_answers=='') $quality_rating_answers = 0;\r\n\t\t\t\r\n\t\t\tsql_query('UPDATE qa_questions SET quality_rating=\"'.$quality_rating.'\", quality_rating_overall = \"' . ($quality_rating_answers + $quality_rating) . '\" WHERE id=\"'.$this->info['id'].'\"');\r\n\t\t\t\r\n\t\t}", "public function rate($id){\n\t\t// else\n\n\t\tif($this->alreadyRate($id)){\n\t\t\treturn redirect('books/'.$id);\n\t\t}\n\n\t\t$userID = Auth::id();\n\n\t\t$user = User::findOrfail($userID);\n\n\t\t$input = Request::all();\n\t\t$book = Book::findOrFail($id);\n\n\t\t// check user level if level == 0 -> basic user\n\t\t// if level == 1 -> critic user\n\t\t// level 2 -> admin\n\n\t\t// assume it pass data user vote\n\n\t\tif(!$user -> isCritic()) {\n\t\t\t$book->userRating += $input['rating'];\n\t\t\t$book->userRatingCount += 1;\n\t\t\t$book->save();\n\t\t}\n\t\telse{\n\t\t\t$book->criticRating += $input['rating'];\n\t\t\t$book->criticRatingCount += 1;\n\t\t\t$book->save();\n\t\t}\n\n\t\t$rating = new Rating();\n\t\t$rating -> book_id = $book->getKey();\n\t\t$rating -> user_id = $userID;\n\t\t$rating -> save();\n\n\t\treturn redirect($this->getURI().'/'.$id);\n\n\t}", "public function update() {\r\n }", "public function setHourlyRateAttribute($input)\n {\n $this->attributes['hourly_rate'] = $input ? $input : null;\n }", "function wcumcs_cron_currency_exchange_rate_update(){\r\n\t\r\n\tglobal $woocommerce_ultimate_multi_currency_suite;\r\n\t$action_data = array();\r\n\t$action_data['name'] = 'update_exchange_rates';\r\n\t$action_data['currency_data'] = array();\t\r\n\t\r\n\t$available_currencies_json = get_option('wcumcs_available_currencies');\r\n\t$available_currencies = json_decode($available_currencies_json, true);\r\n\t$requested_currencies_data = array();\r\n\t\r\n\tforeach ($available_currencies as $code => $currency_data){\r\n\t\t$requested_currencies_data[$code] = array();\r\n\t\t$exchange_api = get_option('wcumcs_exchange_api_' . $code);\r\n\t\t$requested_currencies_data[$code]['api'] = $exchange_api;\r\n\t}\r\n\t\r\n\t$action_data['currency_data'] = $requested_currencies_data;\r\n\t\r\n\t$woocommerce_ultimate_multi_currency_suite->callbacks->execute_action($action_data, true); // execute rates update\r\n\t\r\n\treturn true;\r\n\t\r\n}", "public function update()\n {\n }", "function update_price($symbol = null) {\n\n $whereCondition = \"WHERE user_id = \".$this->user->user_id.\" AND symbol = '\".$symbol.\"';\";\n DB::instance(DB_NAME)->update(\"transactions\", $_POST, $whereCondition);\n\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'code' => 'required',\n 'name' => 'required',\n ]);\n\n\t\tif (isset($request['disable'])) $request['disable']=1; else $request['disable']=0;\n Rates::find($id)->update($request->all());\n\n // get all the nerds\n $rates = Rates::all();\n return redirect()->route('admin.rates.index')\n \t\t\t\t ->with('success','Location update successfully');\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "function editRating($param, $sqlConnection)\r\n{\r\n\t$uid = intval($param['userID']);\r\n\t$aid = intval($param['albumID']);\r\n\t$rating = floatval($param['rating']);\r\n\t$sqlSuccess = get_sql_results($result, $sqlConnection,\r\n\t\t\t\"UPDATE Rates SET rating=$rating \".\r\n\t\t\t\"WHERE userID=$uid AND \".\r\n\t\t\t\"albumID=$aid\");\r\n\treturn $sqlSuccess;\r\n}", "private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }", "abstract public function update();", "abstract public function update();", "function update() {\n\t\t$sql = \"UPDATE cost_detail \n\t\t\t\tSET\tcd_start_time=?, cd_end_time=?, cd_hour=?, cd_minute=?, cd_cost=?, cd_update=?, cd_user_update=? \n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\t\n\t\t$this->ffm->query($sql, array($this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update, $this->cd_fr_id, $this->cd_seq));\t\n\t}", "public function actionRate()\n\t{\n\t\t$note_id = $_POST['note_id'];\n\t\t$student_id = $_POST['student_id'];\n\t\t$rating = $_POST['rating'];\n\n\t\t$model = $this->loadModel($note_id);\n\t\t$model->rate($student_id, $rating);\n\n\t\t$totalRating = $model->getTotalRating();\n\t\t$ratersCount = $model->getRatersCount();\n\n\t\tif ( ! $totalRating)\n\t\t\techo 'N/A';\n\t\telse\n\t\t\techo '' . ((double)$totalRating / $ratersCount) . ' (dari ' . $ratersCount . ' pengguna)';\n\t}" ]
[ "0.7071247", "0.6644952", "0.66391456", "0.65970474", "0.65498686", "0.65411186", "0.6461672", "0.6461672", "0.6409952", "0.63773", "0.6348325", "0.6304736", "0.63017356", "0.62423545", "0.6236449", "0.61680573", "0.61432046", "0.61148095", "0.6090473", "0.6088791", "0.6076673", "0.6072813", "0.60645264", "0.60428953", "0.60288215", "0.5967144", "0.5960281", "0.59300333", "0.592665", "0.5925913", "0.59170824", "0.59062034", "0.5898189", "0.588426", "0.58763146", "0.58697844", "0.586227", "0.58557105", "0.5849095", "0.58424914", "0.58346826", "0.5833273", "0.5822123", "0.58111", "0.5803147", "0.5803147", "0.5803147", "0.5803147", "0.58021593", "0.58021593", "0.5797815", "0.57854044", "0.57595104", "0.57595104", "0.57595104", "0.57595104", "0.57595104", "0.5756731", "0.5754627", "0.57401174", "0.573682", "0.5735032", "0.572624", "0.5720608", "0.5715052", "0.57108307", "0.5692733", "0.5690156", "0.5687974", "0.56776655", "0.56752306", "0.56745183", "0.56711406", "0.56709534", "0.5669696", "0.5668061", "0.5651163", "0.56463456", "0.5641377", "0.5636762", "0.5634111", "0.56256354", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56247723", "0.56213975", "0.56193584", "0.56184435", "0.56184435", "0.56174064", "0.56158686" ]
0.7281589
0
/ DELETE SINGLE RATE
function delete_single_rate($rateId) { $this->public_db->where('standardRateId', $rateId); $this->public_db->delete('standardrates'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_service_method_unit_rate($method_unit_rate_id){\r\t\t\t$query=\"delete from `\".$this->table_name_smur.\"` where `id`=$method_unit_rate_id\";\r\t\t\tmysqli_query($this->conn,$query);\r\t\t}", "public function delete_addons_rate($addon_rate_id){\r\t\t\t$query=\"delete from `\".$this->table_name_sar.\"` where `id`=$addon_rate_id\";\r\t\t\tmysqli_query($this->conn,$query);\r\t\t}", "function delAlterRate($arid)\n\t{\n\t\t\n\t\t//delete from product\n\t\t$delete1 = \"DELETE FROM alter_rate WHERE arate_id='$arid'\";\n\t\t\n\t\t//execute quary\n\t\t$query1\t= mysql_query($delete1);\n\t\t\n\t}", "public function clear_rate($id) {\n if ($id > 0) {\n $data = Input::all();//echo \"<pre>\";print_r($data);exit();\n $CompanyID = User::get_companyID();\n $username = User::get_user_full_name();\n $EffectiveDate = $EndDate = $Rate = $RateN = $Interval1 = $IntervalN = $ConnectionFee = 'NULL';\n try {\n DB::beginTransaction();\n $p_criteria = 0;\n $action = 2; //delete action\n $criteria = json_decode($data['criteria'], true);\n\n $criteria['Code'] = !empty($criteria['Code']) && $criteria['Code'] != '' ? \"'\" . $criteria['Code'] . \"'\" : 'NULL';\n $criteria['Description'] = !empty($criteria['Description']) && $criteria['Description'] != '' ? \"'\" . $criteria['Description'] . \"'\" : 'NULL';\n $criteria['Country'] = !empty($criteria['Country']) && $criteria['Country'] != '' && $criteria['Country'] != 'All' ? \"'\" . $criteria['Country'] . \"'\" : 'NULL';\n $criteria['Effective'] = !empty($criteria['Effective']) && $criteria['Effective'] != '' ? \"'\" . $criteria['Effective'] . \"'\" : 'NULL';\n $criteria['TrunkID'] = !empty($criteria['Trunk']) && $criteria['Trunk'] != '' ? \"'\" . $criteria['Trunk'] . \"'\" : 'NULL';\n $criteria['TimezonesID'] = !empty($criteria['Timezones']) && $criteria['Timezones'] != '' ? \"'\" . $criteria['Timezones'] . \"'\" : 'NULL';\n\n if(empty($criteria['TimezonesID']) || $criteria['TimezonesID'] == 'NULL') {\n $criteria['TimezonesID'] = $data['TimezonesID'];\n }\n\n if(empty($criteria['TrunkID']) || $criteria['TrunkID'] == 'NULL') {\n $criteria['TrunkID'] = $data['TrunkID'];\n }\n\n $AccountID = $id;\n $VendorRateID = $data['VendorRateID'];\n\n if (empty($data['VendorRateID']) && !empty($data['criteria'])) {\n $p_criteria = 1;\n }\n\n $query = \"call prc_VendorRateUpdateDelete (\" . $CompanyID . \",\" . $AccountID . \",'\" . $VendorRateID . \"',\" . $EffectiveDate . \",\" . $EndDate . \",\" . $Rate . \",\" . $RateN . \",\" . $Interval1 . \",\" . $IntervalN . \",\" . $ConnectionFee . \",\" . $criteria['Country'] . \",\" . $criteria['Code'] . \",\" . $criteria['Description'] . \",\" . $criteria['Effective'] . \",\" . $criteria['TrunkID'] . \",\" . $criteria['TimezonesID'] . \",'\" . $username . \"',\".$p_criteria.\",\".$action.\")\";\n Log::info($query);\n $results = DB::statement($query);\n\n if ($results) {\n DB::commit();\n return Response::json(array(\"status\" => \"success\", \"message\" => \"Rates Successfully Deleted\"));\n } else {\n return Response::json(array(\"status\" => \"failed\", \"message\" => \"Problem Deleting Vendor Rates.\"));\n }\n } catch (Exception $ex) {\n DB::rollback();\n return Response::json(array(\"status\" => \"failed\", \"message\" => $ex->getMessage()));\n }\n\n }\n }", "public static function delete()\n {\n if ( empty($_REQUEST['mgb_rating_id']) ) return;\n $id = (int) $_REQUEST['mgb_rating_id'];\n\n Database::query(\n \"DELETE FROM ?\n WHERE id=${id}\"\n );\n }", "public function unRate()\n {\n\n }", "function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_AlternativeCurrency WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n\r\n \r\n }", "public function deleteDiscount();", "public function destroy(Rate $rates)\n {\n //\n }", "public function deleted(Credit $credit)\n {\n\n }", "public function deleted(VoteRate $voteRate)\n {\n $rate = VoteRate::where(['kode_tukang'=>$voteRate->kode_tukang,'value'=>$voteRate->value])->get();\n if (empty($result)) {\n $recounting = 0;\n }else{\n $recounting = count($rate);\n }\n Rate::where(['kode_tukang'=>$voteRate->kode_tukang,'value_rate'=>$voteRate->value])->update(['count_rate'=>$recounting]);\n\n //for cunting score of rate\n $cal = Rate::where(['kode_tukang'=>$voteRate->kode_tukang])->get();\n $total_data = 0;\n $freq = 0;\n foreach ($cal as $arate){\n $total_data = $total_data + ($arate->value_rate * $arate->count_rate);\n $freq = $freq + $arate->count_rate;\n }\n $score = $freq == 0 ? 0 : ($total_data/$freq);\n\n Tukang::whereId($voteRate->kode_tukang)->update([\"rate\"=>$score]);\n }", "public function maybe_delete_rate() {\n\t\t\tif ( ! wct_is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! wct_user_can( 'edit_talks' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( empty( $_GET['remove_vote'] ) || empty( $_GET['post'] ) || empty( $_GET['action'] ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$talk_id = absint( $_GET['post'] );\n\t\t\t$user_id = absint( $_GET['remove_vote'] );\n\n\t\t\t// nonce check\n\t\t\tcheck_admin_referer( 'talk_remove_vote_' . $user_id );\n\n\t\t\tif( false !== wct_delete_rate( $talk_id, $user_id ) ) {\n\t\t\t\t$message = 11;\n\t\t\t} else {\n\t\t\t\t$message = 12;\n\t\t\t}\n\n\t\t\t// Utimate and not necessary check...\n\t\t\tif ( ! empty( $_GET['remove_vote'] ) ) {\n\t\t\t\t$redirect = add_query_arg( 'message', $message, get_edit_post_link( $talk_id, 'url' ) );\n\t\t\t\twp_safe_redirect( $redirect );\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function destroy(Salonrate $salonrate)\n {\n //\n }", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "public function destroy(Rate $rate)\n {\n $rate->delete();\n\n return response()->json('This rate was succesefully deleted', Response::HTTP_OK);\n }", "public function delete_vendorrates($id){\n $data = Input::all();\n $username = User::get_user_full_name();\n $rules = array('Trunkid' => 'required');\n $validator = Validator::make($data, $rules);\n if ($validator->fails()) {\n return json_validator_response($validator);\n }\n if(isset($data['action']) && $data['action']=='check_count'){\n return VendorRate::where([\"AccountID\" =>$id ,'TrunkID'=>$data['Trunkid']])->count();\n }\n\n $CompanyID = User::get_companyID();\n $results = DB::statement(\"call prc_VendorBulkRateDelete ('\".$CompanyID.\"','\".$id.\"','\".$data['Trunkid'].\"',NULL,NULL,NULL,NULL,NULL,'\".$username.\"',2)\");\n if ($results) {\n return Response::json(array(\"status\" => \"success\", \"message\" => \"Vendor Rates Successfully Deleted.\"));\n } else {\n return Response::json(array(\"status\" => \"failed\", \"message\" => \"Problem Deleting Vendor Rate.\"));\n }\n }", "final public function delete() {\n global $config; \n # Borrar el elemento de la base de datos\n $this->db->query(\"DELETE FROM guarderia_2 WHERE id_guarderia = $this->id\");\n # Redireccionar a la página principal del controlador\n $this->functions->redir($config['site']['url'] . 'sedes/&success=true');\n }", "function delete()\n {\n }", "public static function delete() {\n\n\n\t\t}", "public function DELETE() {\n #\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function destroy(AirlineRate $airlineRate)\n {\n //\n }", "public function delete()\n {\n echo '客户要求减少一个需求' . PHP_EOL;\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 delete() {\n\t$stmt = $this->_database->prepare('DELETE FROM planetterrains WHERE refid = ?');\n\t$stmt->bind_param('i', $this->refid);\n\t$stmt->execute();\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->delete();\n\t}\n }", "function _deleteRound()\r\n\t{\r\n\t\t$utr = new utRound();\r\n\t\t$roundId = kform::getInput(\"roundId\");\n\t\t$utr->delRound($roundId);\n\t\t$page = new utPage('none');\r\n\t\t$page->close();\r\n\t\texit;\n\t}", "function delete() ;", "function delete() ;", "public function delete(Request $request) \n {\n $credit = \\App\\Goldcredit::where('id', $request->id)->first();\n \n $images = $credit->credit_images;\n \n // Save images\n if (sizeof($images))\n {\n foreach ($images as $key => $image) \n {\n if (file_exists(public_path() . $image->image)) unlink(public_path() . $image->image);\n }\n }\n \\App\\credit_image::where('goldcredit_id', $request->id)->delete();\n \\App\\creditItem::where('goldcredit_id', $request->id)->delete(); \n $credit->delete(); \n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function destroy($id)\n {\n $rate=ShippingTableRates::find($id);\n if(!empty($rate)) {\n $rate->delete();\n return redirect('/admin/shipping-table-rates')->with('success', 'Rate Deleted Successfully');\n }\n return redirect('/admin/shipping-table-rates');\n }", "public function delete(){\n //Préparation de la requête\n $sql = \"DELETE FROM atelier WHERE idAtelier = ?\";\n $requete = $this->connectBdd->prepare($sql);\n\n //Execution de la requete\n $requete->execute([$this->getIdAtelier()]);\n\n //Fermeture de la requete\n $requete->closeCursor();// requête delete \n }", "function delete()\r\n {\r\n\r\n }", "public function delete($bid);", "public function deleteAction() {\n if ($_GET['id']) {\n $this->oLegalNotice->setId($_GET['id']);\n $sStatus = $this->oLegalNotice->select(array('is_use'))[0]['is_use']; \n\n $this->disableAll();\n\n $sStatus ? $this->oLegalNotice->setIsUse(0) : $this->oLegalNotice->setIsUse(1);\n $this->oLegalNotice->save();\n\n header('location: /back/legalnotices');\n return;\n }\n }", "public function DeleteSupplier($id){\n\n $delete=DB::table('suppliers')\n ->where('id',$id)\n ->first();\n $photo=$delete->photo;\n unlink($photo);\n $dltuser=DB::table('suppliers')\n ->where('id',$id)\n ->delete(); \n\n return Redirect()->route('all.supplier')->with('message','Deleted Successfully.');\n\n \n}", "public function destroy($id)\n {\n $driver = VehicleRate::findOrFail($id);\n $driver->delete();\n }", "public static function delete() {\r\n\t\t\r\n\t}", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function delete() {\r\n }", "public static function delete(){\r\n }", "public function delete()\r\n\t{\r\n\t}", "public function delete()\n {\n \n }", "public function delete()\n {\n \n }", "public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }", "public function delete () {\n\t\t$recToDelete = ORM::for_table(self::REPORT_TABLE)->find_one($this->id);\n\t\t$recToDelete->delete();\n\t}", "function delete() \n {\n \n }", "public function delete($id)\r\n {\r\n if (!Sentinel::hasAccess('withdrawals.delete')) {\r\n Flash::warning(\"Permission Denied\");\r\n return redirect('/');\r\n }\r\n\r\n $coin=\"\";\r\n if($withdrawal->trade_currency_id == 1)\r\n $coin ='ETH';\r\n else if($withdrawal->trade_currency_id == 2)\r\n $coin ='XRP';\r\n else if($withdrawal->trade_currency_id == 3)\r\n $coin ='AED';\r\n else if($withdrawal->trade_currency_id == 4)\r\n $coin ='BTC';\r\n else if($withdrawal->trade_currency_id == 5)\r\n $coin ='LTC';\r\n\r\n $walletaddress = WalletAddress::where('user_id',$withdrawal->user_id)->where('coin',$coin)->first();\r\n $walletaddress->balance = $walletaddress->balance + $withdrawal->amount;\r\n $walletaddress->save();\r\n\r\n\r\n\r\n\r\n Withdrawal::destroy($id);\r\n\r\n GeneralHelper::audit_trail(\"Deleted withdrawal with id:\" . $id);\r\n Flash::success(trans('general.successfully_deleted'));\r\n return redirect('withdrawal/data');\r\n\r\n }", "public function declineSingle(){\n\t\tif(isset($_SESSION['admin_email'])){\n\t\t$this->model(\"AdminApproveModel\");\n\t\tif(isset($_POST['admin_decline'])){\n\t\t\t$this->sanitizeString($_POST['admin_decline']);\n\t\t\t$id = $this->sanitizeString($_POST['id']);\n\t\t\tAdminApproveModel::where('id', $id)->delete();\n\t\t}\n\t}\n\n\t}", "function delete()\n {\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n //\n }", "public function deleteById($specialPriceId);", "public function delete(){\n }", "public function deleting()\n {\n # code...\n }", "public function deleteCard()\n {\n }", "public function delete()\n\t{\n\t}", "public function delete_method_unit($method_unit){\r\t\t\t$query=\"delete from `\".$this->table_name_smu.\"` where `id`=$method_unit\";\r\t\t\tmysqli_query($this->conn,$query);\r\t\t}", "function deleteItem(){\n\t\tif( $this->primary == '' || $this->currency_id == '') return false;\n\t\t\n\t\t$del = $this->_db->delete($this->table_pay_currency(), $this->keyUpdate());\n\t\t\n\t\tif($del) return true;\n\t\telse return false;\n\t}", "function delete() {\n\n }", "public function delete()\n {\n\n }", "protected function delete() {\n\t}", "public function deleteAllowance() {\n $id = Request::Segment(3);\n //$coa = Request::Segment(5);\n $checkStatus = $this->db2->select($this->db2->raw('select count(id) as count from hr_emp_allowance where fkAllowId=' . $id));\n if ($checkStatus[0]->count == 0) {\n //$delete = $this->db2->table('il_accounting_coa_level4')->where('id','=',$coa)->delete();\n $delete = $this->db2->table('hr_allowances')->where('id', '=', $id)->delete();\n if ($delete)\n return Redirect::to('config/allowance')->with(array('successalert' => 'Allowance Deleted Successfully'));\n else\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Server problem Try again'));\n } else {\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Allowance already assigned so it cannot be deleted'));\n }\n }", "function item_delete()\n {\n $key = $this->get('id');\n $this->supplies->delete($key);\n $this->response(array('ok'), 200);\n }", "public function destroy($id)\n {\n $rate = $this->rateRepository->find($id);\n\n if (empty($rate)) {\n Flash::error('Rate not found');\n\n return redirect(route('rates.index'));\n }\n\n $this->rateRepository->delete($id);\n\n Flash::success('Rate deleted successfully.');\n\n return redirect(route('rates.index'));\n }", "function delete()\n {\n $nim = $this->uri->segment(3);\n $this->siswa_model->delete($nim);\n redirect('siswa/page');\n }", "function delete() {\n }", "function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }", "public function deleted(Currency $currency)\n {\n //\n }", "public function delete() {\n\n }", "function line_allowance_charge_delete($args)\n {\n global $_lib;\n $query = \"delete from $this->line_allowance_charge_table where InvoiceLineAllowanceChargeID = \" . $args['InvoiceLineAllowanceChargeID'];\n return $_lib['db']->db_delete($query);\n }", "public function delete(){\r\n $rsid_array = $this -> uri -> segment_array();\r\n\r\n foreach ($rsid_array as $key => $value) {\r\n \r\n //If the key is greater than 2 i.e is one of the the ids\r\n if ($key > 2) {\r\n\r\n //Run delete\r\n $this -> db -> delete('refSubs', array('id' => $value));\r\n\r\n } \r\n }\r\n\r\n }" ]
[ "0.7165377", "0.6979208", "0.6703423", "0.6607189", "0.6549604", "0.65167797", "0.64643186", "0.64536846", "0.6198084", "0.6100794", "0.6061584", "0.60474366", "0.60307854", "0.6012346", "0.6007809", "0.60014874", "0.5958533", "0.59337026", "0.593333", "0.59227145", "0.59199876", "0.5919871", "0.5919871", "0.59197867", "0.5906772", "0.5902829", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.5895387", "0.58939135", "0.5874899", "0.5850032", "0.5850032", "0.58271015", "0.58258367", "0.58212066", "0.5818016", "0.58177185", "0.580865", "0.5799582", "0.57981366", "0.57952875", "0.5785842", "0.5783317", "0.57740784", "0.5771739", "0.57411677", "0.5740861", "0.5739804", "0.57368684", "0.5729834", "0.57110685", "0.56830704", "0.5682771", "0.5680762", "0.567425", "0.567425", "0.56604207", "0.56604207", "0.56604207", "0.56604207", "0.56604207", "0.56604207", "0.56604207", "0.56604207", "0.56604207", "0.56604207", "0.5655222", "0.5651006", "0.5640096", "0.56309915", "0.5630365", "0.5630077", "0.5627676", "0.5626414", "0.5618918", "0.56122243", "0.5610809", "0.5609602", "0.56093955", "0.56059414", "0.55985636", "0.5598474", "0.55976284", "0.5594952", "0.5592791", "0.5587184", "0.55836946" ]
0.7399539
0
A basic unit test example.
public function testaddMovie() { $mov_title="dhamal"; $mov_director="asbc"; $mov_cast="acn,qwe"; $mov_type="english"; $mov_realasedate="29 april 2019"; $mov_duration="120min"; $image="image"; $mov_url="gsdgsv"; $mov_description="cxdcsghcxdc"; $response=$this->call("POST","/addMovies/ $mov_title/$mov_director/$mov_cast/$mov_type/$mov_realasedate /$mov_duration/$image/$mov_url/$mov_description"); $this->assertEquals(404,$response->status()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testExample()\n {\n }", "public function testBasicExample()\n {\n $this->assertTrue(true);\n }", "public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function testBasicTest()\n {\n\n }", "public function testExample()\n {\n dump(\"testExample\");\n $this->assertTrue(true);\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n \n }", "function test_sample() {\n\t\t$this->assertTrue( true );\n\t}", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "public function testExample()\n {\n $this->assertTrue(true);\n }", "function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function test_example()\n {\n $this->assertTrue(true);\n }", "public function testExample(): void\n {\n $this->assertTrue(true);\n }", "public function testBasic()\n {\n $this->assertEquals(1, 1);\n }", "public function testExample()\n {\n // lets make it risky to destroy the green\n }", "public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }", "public function testBasicExample()\n\t{\n \t$response = $this->call('GET', '/');\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testGetPatrimonio()\n {\n }", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "public function testGetChamado()\n {\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('TROLOLOLO');\n }", "public function testSomething()\n {\n }", "public function testExample()\n {\n $response = $this->get('/api/test/');\n\n $response->assertStatus(200);\n }", "public function testBasicTest()\r\n {\r\n $this->assertTrue(true);\r\n }", "public function test() {\n\n\t}", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $this->assertTrue(true);\n }", "public function testGetExpedicao()\n {\n }", "public function testBasicTest()\n {\n dd('here');\n $this->assertTrue(true);\n }", "public function testBasicTest()\n {\n $response = $this->get('/dangthi');\n $response->assertStatus(200);\n }", "public function testBasicExample()\n\t{\n\t\t$response = $this->call('GET', '/');\n\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}", "public function testExample()\n {\n // $roomController = new RoomController();\n $request = $this->call('GET', '/room/123');\n $this->assertEquals(200, $request->status());\n }" ]
[ "0.8075383", "0.7855031", "0.78070784", "0.77604944", "0.7665733", "0.7645663", "0.7625706", "0.7590362", "0.75463027", "0.75261366", "0.7511399", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74239534", "0.74007994", "0.7393721", "0.7393721", "0.7393721", "0.7393721", "0.7326666", "0.7326294", "0.729584", "0.7276566", "0.72634286", "0.72496074", "0.72211987", "0.7215973", "0.71966547", "0.7182196", "0.7179482", "0.71634036", "0.71536636", "0.71441495", "0.71441495", "0.71441495", "0.71441495", "0.71441495", "0.71441495", "0.71441495", "0.71441495", "0.71441495", "0.7133791", "0.7128368", "0.71251714", "0.71154356", "0.71014965" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'sender' => [ 'bail', 'required', 'numeric', 'exists:payment_cards,card_number', // $this->container->make(LuhnRule::class), ], 'cvv' => [ 'bail', 'required', 'regex:/^[0-9]{3}$/m', $this->container->make(CardCvvRule::class), ], 'expiration' => [ 'bail', 'required', 'date_format:m/y', $this->container->make(CardDateRule::class), ], 'recipient' => [ 'bail', 'required', 'numeric', 'different:sender', 'exists:payment_cards,card_number', // $this->container->make(LuhnRule::class), ], 'transfer_amount' => [ 'bail', 'required', 'regex:/\d+([,.]\d{0,2})?/m', 'not_regex:/^[0]([,.][0]{2})?$/m', $this->container->make(BalanceRule::class), ], ]; }
{ "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() { $records = []; for ($i = 0; $i < 10; $i++) { $records[] = [ 'category_id' => rand(1, 10), 'title' => Str::random(10) . 'についての議題', 'handle_name_template' => Str::random(10) . '的名無しさん', 'created_at' => date('Y-m-d H:i:s') ]; } DB::table('thread')->insert($records); }
{ "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
This file is part of Moodle Moodle is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Moodle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Moodle. If not, see < Version details
function filter_coursecompletion_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) { global $CFG; \core\session\manager::write_close(); // Unlock session during file serving. $isicon = ($filearea === 'completeicon' || $filearea === 'incompleteicon' || $filearea === 'inprogressicon'); $isacticon = ($filearea === 'completeacticon' || $filearea === 'incompleteacticon' || $filearea === 'inprogressacticon' || $filearea === 'completefailacticon'); $isicon2 = ($filearea === 'completeicon2' || $filearea === 'incompleteicon2' || $filearea === 'inprogressicon2'); $isacticon2 = ($filearea === 'completeacticon2' || $filearea === 'incompleteacticon2' || $filearea === 'inprogressacticon2' || $filearea === 'completefailacticon2'); if ($context->contextlevel == CONTEXT_SYSTEM && ($isicon || $isacticon || $isicon2 || $isacticon2)) { require_once("$CFG->libdir/filelib.php"); $syscontext = context_system::instance(); $component = 'filter_coursecompletion'; $lifetime = 60 * 60 * 24 * 60; array_shift($args); $fs = get_file_storage(); $relativepath = implode('/', $args); $fullpath = "/{$syscontext->id}/{$component}/{$filearea}/0/{$relativepath}"; $fullpath = rtrim($fullpath, '/'); if ($file = $fs->get_file_by_hash(sha1($fullpath))) { header('Content-Disposition: inline; filename="'.$file->filename.'"'); header('Cache-Control: public, max-age='.$lifetime.', no-transform'); header('Expires: '. gmdate('D, d M Y H:i:s', time() + $lifetime) .' GMT'); header('Pragma: '); readfile_accel($file, $file->get_mimetype(), true); exit; } else { send_file_not_found(); } } else { send_file_not_found(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xmldb_cognitivefactory_upgrade($oldversion = 0) {\n/// older versions to match current functionality \n\n global $CFG;\n\n $result = true;\n\n // Moodle 2.0 line\n \n return true;\n}", "function xmldb_enrol_lmb_upgrade($oldversion=0) {\n\n global $CFG, $THEME, $DB;\n\n $dbman = $DB->get_manager();\n\n $result = true;\n\n if ($result && $oldversion < 2007072501) {\n $table = new xmldb_table('lmb_enrolments');\n if (!$dbman->field_exists($table, new xmldb_field('succeeded'))) {\n $field = new xmldb_field('succeeded');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'status');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n\n $table = new xmldb_table('lmb_crosslist');\n if (!$dbman->field_exists($table, new xmldb_field('timemodified'))) {\n $field = new xmldb_field('timemodified');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'crosslistsourcedid');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n if (!$dbman->field_exists($table, new xmldb_field('coursesourcedidsource'))) {\n $field = new xmldb_field('coursesourcedidsource');\n $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'id');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n if (!$dbman->field_exists($table, new xmldb_field('crosssourcedidsource'))) {\n $field = new xmldb_field('crosssourcedidsource');\n $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'coursesourcedid');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n if (!$dbman->field_exists($table, new xmldb_field('status'))) {\n $field = new xmldb_field('status');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '-1', 'crosslistsourcedid');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n }\n\n if ($result && $oldversion < 2007101701) {\n unset_config('enrol_lmb_bannercron');\n unset_config('enrol_lmb_bannercronhr');\n unset_config('enrol_lmb_bannercronmin');\n set_config('enrol_lmb_storexml', 'always');\n }\n\n if ($result && $oldversion < 2008050501) {\n $table = new xmldb_table('lmb_crosslist');\n if (!$dbman->field_exists($table, new xmldb_field('manual'))) {\n $field = new xmldb_field('manual');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'status');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n }\n\n if ($result && $oldversion < 2008073101) {\n $table = new xmldb_table('lmb_enrolments');\n if (!$dbman->field_exists($table, new xmldb_field('midtermgrademode'))) {\n $field = new xmldb_field('midtermgrademode');\n $field->set_attributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'succeeded');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n if (!$dbman->field_exists($table, new xmldb_field('midtermsubmitted'))) {\n $field = new xmldb_field('midtermsubmitted');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'midtermgrademode');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n if (!$dbman->field_exists($table, new xmldb_field('finalgrademode'))) {\n $field = new xmldb_field('finalgrademode');\n $field->set_attributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'midtermsubmitted');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n if (!$dbman->field_exists($table, new xmldb_field('finalsubmitted'))) {\n $field = new xmldb_field('finalsubmitted');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'finalgrademode');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n }\n\n if ($result && $oldversion < 2008073102) {\n $table = new xmldb_table('lmb_enrolments');\n\n if (!$dbman->field_exists($table, new xmldb_field('gradable'))) {\n $field = new xmldb_field('gradable');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'succeeded');\n\n // Launch add field gradable.\n $result = $result && $dbman->add_field($table, $field);\n }\n }\n\n if ($result && $oldversion < 2008073104) {\n $table = new xmldb_table('lmb_terms');\n $field = new xmldb_field('active');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '1', 'studentshowtime');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n\n if ($result && $oldversion < 2008081302) {\n $table = new xmldb_table('lmb_crosslist');\n $field = new xmldb_field('type');\n $field->set_attributes(XMLDB_TYPE_CHAR, '8', null, null, null, $CFG->enrol_lmb_xlstype, 'manual');\n\n $result = $result && $dbman->add_field($table, $field);\n\n $field->set_attributes(XMLDB_TYPE_CHAR, '8', null, null, null, null, 'manual');\n\n $result = $result && $dbman->change_field_default($table, $field);\n }\n\n if ($result && $oldversion < 2008082001) {\n set_config('silent', 1, 'enrol/lmb');\n }\n\n if ($result && $oldversion < 2008082201) {\n set_config('logtolocation', $CFG->enrol_lmb_logtolocation, 'enrol/lmb');\n unset_config('enrol_lmb_logtolocation');\n\n set_config('performlmbcheck', $CFG->enrol_lmb_performlmbcheck, 'enrol/lmb');\n unset_config('enrol_lmb_performlmbcheck');\n\n set_config('startbiztimehr', $CFG->enrol_lmb_startbiztimehr, 'enrol/lmb');\n unset_config('enrol_lmb_startbiztimehr');\n\n set_config('startbiztimemin', $CFG->enrol_lmb_startbiztimemin, 'enrol/lmb');\n unset_config('enrol_lmb_startbiztimemin');\n\n set_config('endbiztimehr', $CFG->enrol_lmb_endbiztimehr, 'enrol/lmb');\n unset_config('enrol_lmb_endbiztimehr');\n\n set_config('endbiztimemin', $CFG->enrol_lmb_endbiztimemin, 'enrol/lmb');\n unset_config('enrol_lmb_endbiztimemin');\n\n set_config('bizgrace', $CFG->enrol_lmb_bizgrace, 'enrol/lmb');\n unset_config('enrol_lmb_bizgrace');\n\n set_config('nonbizgrace', $CFG->enrol_lmb_nonbizgrace, 'enrol/lmb');\n unset_config('enrol_lmb_nonbizgrace');\n\n set_config('emails', $CFG->enrol_lmb_emails, 'enrol/lmb');\n unset_config('enrol_lmb_emails');\n\n set_config('bannerxmllocation', $CFG->enrol_lmb_bannerxmllocation, 'enrol/lmb');\n unset_config('enrol_lmb_bannerxmllocation');\n\n set_config('bannercron', $CFG->enrol_lmb_bannercron, 'enrol/lmb');\n unset_config('enrol_lmb_bannercron');\n\n set_config('bannercronhr', $CFG->enrol_lmb_bannercronhr, 'enrol/lmb');\n unset_config('enrol_lmb_bannercronhr');\n\n set_config('bannercronmin', $CFG->enrol_lmb_bannercronmin, 'enrol/lmb');\n unset_config('enrol_lmb_bannercronmin');\n\n set_config('coursetitle', $CFG->enrol_lmb_coursetitle, 'enrol/lmb');\n unset_config('enrol_lmb_coursetitle');\n\n set_config('courseshorttitle', $CFG->enrol_lmb_courseshorttitle, 'enrol/lmb');\n unset_config('enrol_lmb_courseshorttitle');\n\n set_config('cattype', $CFG->enrol_lmb_cattype, 'enrol/lmb');\n unset_config('enrol_lmb_cattype');\n\n set_config('catselect', $CFG->enrol_lmb_catselect, 'enrol/lmb');\n unset_config('enrol_lmb_catselect');\n\n set_config('xlstitle', $CFG->enrol_lmb_xlstitle, 'enrol/lmb');\n unset_config('enrol_lmb_xlstitle');\n\n set_config('xlsshorttitle', $CFG->enrol_lmb_xlsshorttitle, 'enrol/lmb');\n unset_config('enrol_lmb_xlsshorttitle');\n\n set_config('xlstype', $CFG->enrol_lmb_xlstype, 'enrol/lmb');\n unset_config('enrol_lmb_xlstype');\n\n set_config('createnewusers', $CFG->enrol_lmb_createnewusers, 'enrol/lmb');\n unset_config('enrol_lmb_createnewusers');\n\n set_config('createusersemaildomain', $CFG->enrol_lmb_createusersemaildomain, 'enrol/lmb');\n unset_config('enrol_lmb_createusersemaildomain');\n\n set_config('imsdeleteusers', $CFG->enrol_lmb_imsdeleteusers, 'enrol/lmb');\n unset_config('enrol_lmb_imsdeleteusers');\n\n set_config('usernamesource', $CFG->enrol_lmb_usernamesource, 'enrol/lmb');\n unset_config('enrol_lmb_usernamesource');\n\n set_config('useridtypeother', $CFG->enrol_lmb_useridtypeother, 'enrol/lmb');\n unset_config('enrol_lmb_useridtypeother');\n\n set_config('auth', $CFG->enrol_lmb_auth, 'enrol/lmb');\n unset_config('enrol_lmb_auth');\n\n set_config('passwordnamesource', $CFG->enrol_lmb_passwordnamesource, 'enrol/lmb');\n unset_config('enrol_lmb_passwordnamesource');\n\n set_config('passworduseridtypeother', $CFG->enrol_lmb_passworduseridtypeother, 'enrol/lmb');\n unset_config('enrol_lmb_passworduseridtypeother');\n\n set_config('defaultcity', $CFG->enrol_lmb_defaultcity, 'enrol/lmb');\n unset_config('enrol_lmb_defaultcity');\n\n set_config('standardcity', $CFG->enrol_lmb_standardcity, 'enrol/lmb');\n unset_config('enrol_lmb_standardcity');\n\n set_config('imsrolemap01', $CFG->enrol_lmb_imsrolemap01, 'enrol/lmb');\n unset_config('enrol_lmb_imsrolemap01');\n set_config('imsrolemap02', $CFG->enrol_lmb_imsrolemap02, 'enrol/lmb');\n unset_config('enrol_lmb_imsrolemap02');\n\n set_config('unenrolmember', $CFG->enrol_lmb_unenrolmember, 'enrol/lmb');\n unset_config('enrol_lmb_unenrolmember');\n }\n\n if ($result && $oldversion < 2008082301) {\n set_config('xlstitlerepeat', $CFG->enrol_lmb_xlstitlerepeat, 'enrol/lmb');\n unset_config('enrol_lmb_xlstitlerepeat');\n\n set_config('xlstitledivider', $CFG->enrol_lmb_xlstitledivider, 'enrol/lmb');\n unset_config('enrol_lmb_xlstitledivider');\n\n set_config('xlsshorttitlerepeat', $CFG->enrol_lmb_xlsshorttitlerepeat, 'enrol/lmb');\n unset_config('enrol_lmb_xlsshorttitlerepeat');\n\n set_config('xlsshorttitledivider', $CFG->enrol_lmb_xlsshorttitledivider, 'enrol/lmb');\n unset_config('enrol_lmb_xlsshorttitledivider');\n\n set_config('storexml', $CFG->enrol_lmb_storexml, 'enrol/lmb');\n unset_config('enrol_lmb_storexml');\n\n set_config('sourcedidfallback', $CFG->enrol_lmb_sourcedidfallback, 'enrol/lmb');\n unset_config('enrol_lmb_sourcedidfallback');\n\n unset_config('enrol_lmb_movinglogs');\n\n set_config('logerrors', $CFG->enrol_lmb_logerrors, 'enrol/lmb');\n unset_config('enrol_lmb_logerrors');\n\n set_config('includetelephone', $CFG->enrol_lmb_includetelephone, 'enrol/lmb');\n unset_config('enrol_lmb_includetelephone');\n\n set_config('includeaddress', $CFG->enrol_lmb_includeaddress, 'enrol/lmb');\n unset_config('enrol_lmb_includeaddress');\n\n set_config('forcetitle', $CFG->enrol_lmb_forcetitle, 'enrol/lmb');\n unset_config('enrol_lmb_forcetitle');\n\n set_config('forcetelephone', $CFG->enrol_lmb_forcetelephone, 'enrol/lmb');\n unset_config('enrol_lmb_forcetelephone');\n\n set_config('forceshorttitle', $CFG->enrol_lmb_forceshorttitle, 'enrol/lmb');\n unset_config('enrol_lmb_forceshorttitle');\n\n set_config('forcename', $CFG->enrol_lmb_forcename, 'enrol/lmb');\n unset_config('enrol_lmb_forcename');\n\n set_config('forceemail', $CFG->enrol_lmb_forceemail, 'enrol/lmb');\n unset_config('enrol_lmb_forceemail');\n\n set_config('forcecat', $CFG->enrol_lmb_forcecat, 'enrol/lmb');\n unset_config('enrol_lmb_forcecat');\n\n set_config('forceaddress', $CFG->enrol_lmb_forceaddress, 'enrol/lmb');\n unset_config('enrol_lmb_forceaddress');\n\n set_config('coursehidden', $CFG->enrol_lmb_coursehidden, 'enrol/lmb');\n unset_config('enrol_lmb_coursehidden');\n\n set_config('consolidateusernames', $CFG->enrol_lmb_consolidateusernames, 'enrol/lmb');\n unset_config('enrol_lmb_consolidateusernames');\n }\n\n if ($result && $oldversion < 2008082402) {\n $sql = 'SELECT MAX(timereceived) FROM '.$CFG->prefix.'lmb_raw_xml';\n\n if ($lasttime = get_field_sql($sql)) {\n set_config('lastlmbmessagetime', $lasttime, 'enrol/lmb');\n }\n\n }\n\n if ($result && $oldversion < 2008082402) {\n set_config('ignoreusernamecase', 0, 'enrol/lmb');\n }\n\n if ($result && $oldversion < 2008082601) {\n $table = new xmldb_table('lmb_enrolments');\n $field = new xmldb_field('extractstatus');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'status');\n\n $result = $result && $dbman->add_field($table, $field);\n }\n\n if ($result && $oldversion < 2009081302) {\n set_config('lastunhidetime', time(), 'enrol/lmb');\n set_config('cronunhidecourses', 0, 'enrol/lmb');\n\n if (isset($config->coursehidden) && ($config->coursehidden == 1)) {\n set_config('coursehidden', 'always', 'enrol/lmb');\n } else {\n set_config('coursehidden', 'never', 'enrol/lmb');\n }\n }\n\n if ($result && $oldversion < 2009082001) {\n $table = new xmldb_table('lmb_enrolments');\n $field = new xmldb_field('extractstatus');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'status');\n\n // Launch change of precision for field extractstatus.\n $result = $result && $dbman->change_field_precision($table, $field);\n }\n\n if ($result && $oldversion < 2009082201) {\n\n // Define field crosslistgroupid to be added to lmb_crosslist.\n $table = new xmldb_table('lmb_crosslist');\n $field = new xmldb_field('crosslistgroupid');\n $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, 'crosslistsourcedid');\n\n // Launch add field crosslistgroupid.\n $result = $result && $dbman->add_field($table, $field);\n }\n\n if ($result && $oldversion < 2010012001) {\n\n // Define table lmb_categories to be created.\n $table = new xmldb_table('lmb_categories');\n\n // Adding fields to table lmb_categories.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('termsourcedid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null);\n $table->add_field('sourcedidsource', XMLDB_TYPE_TEXT, 'medium', null, null, null, null);\n $table->add_field('dept', XMLDB_TYPE_TEXT, 'medium', null, null, null, null);\n $table->add_field('categoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null);\n $table->add_field('cattype', XMLDB_TYPE_TEXT, 'medium', null, null, null, null);\n\n // Adding keys to table lmb_categories.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Launch create table for lmb_categories.\n $result = $result && $dbman->create_table($table);\n\n $depts = get_records_sql('SELECT MIN(id), depttitle FROM '.$CFG->prefix.'lmb_courses GROUP BY depttitle');\n $xl = new stdClass();\n $xl->depttitle = 'Crosslisted';\n $depts[] = $xl;\n if ($terms = get_records('lmb_terms')) {\n foreach ($terms as $term) {\n if ($term->categoryid) {\n $cat = new stdClass();\n $cat->categoryid = $term->categoryid;\n $cat->termsourcedid = $term->sourcedid;\n $cat->sourcedidsource = $term->sourcedidsource;\n $cat->cattype = 'term';\n\n insert_record('lmb_categories', addslashes_object($cat));\n unset($cat);\n\n if ($depts) {\n foreach ($depts as $dept) {\n if ($catid = get_field('course_categories', 'id', 'name',\n addslashes($dept->depttitle), 'parent', $term->categoryid)) {\n $cat = new stdClass();\n $cat->categoryid = $catid;\n $cat->termsourcedid = $term->sourcedid;\n $cat->sourcedidsource = $term->sourcedidsource;\n $cat->dept = $dept->depttitle;\n $cat->cattype = 'termdept';\n\n insert_record('lmb_categories', addslashes_object($cat));\n unset($cat);\n }\n }\n }\n }\n }\n }\n\n if ($depts) {\n foreach ($depts as $dept) {\n if ($catid = get_field('course_categories', 'id', 'name', addslashes($dept->depttitle), 'parent', 0)) {\n $cat = new stdClass();\n $cat->categoryid = $catid;\n $cat->dept = $dept->depttitle;\n $cat->cattype = 'dept';\n\n insert_record('lmb_categories', addslashes_object($cat));\n unset($cat);\n }\n }\n }\n\n // Define field categoryid to be dropped from lmb_terms.\n $table = new xmldb_table('lmb_terms');\n $field = new xmldb_field('categoryid');\n\n // Launch drop field categoryid.\n $result = $result && $dbman->drop_field($table, $field);\n\n }\n\n if ($result && $oldversion < 2010082701) {\n $config = get_config('enrol/lmb');\n\n $curtime = time();\n $endtoday = mktime(23, 59, 59, date('n', $curtime), date('j', $curtime), date('Y', $curtime));\n\n set_config('nextunhiderun', $endtoday, 'enrol/lmb');\n\n if (isset($config->lastunhidetime) && ($lasttime = $config->lastunhidetime)) {\n $lastdaytime = mktime(23, 59, 59, date('n', $lasttime), date('j', $lasttime), date('Y', $lasttime));\n $lastendtime = $lastdaytime + ($config->cronunhidedays * 86400);\n\n set_config('prevunhideendtime', $lastendtime, 'enrol/lmb');\n }\n\n unset_config('lastunhidetime', 'enrol/lmb');\n }\n\n if ($oldversion < 2011012501) {\n $config_bad = get_config('enrol/lmb');\n\n $objarray = get_object_vars($config_bad);\n\n foreach ($objarray as $key => $val) {\n if (get_config('enrol_lmb', $key) === false) {\n set_config($key, $val, 'enrol_lmb');\n }\n unset_config($key, 'enrol/lmb');\n }\n\n // Changing type of field sourcedidsource on table lmb_terms to char.\n $table = new xmldb_table('lmb_terms');\n $field = new xmldb_field('sourcedidsource', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'sourcedid');\n\n // Launch change of type for field sourcedidsource.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field sourcedid on table lmb_courses to char.\n $table = new xmldb_table('lmb_courses');\n $field = new xmldb_field('sourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'id');\n\n // Launch change of type for field sourcedid.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field sourcedidsource on table lmb_courses to char.\n $table = new xmldb_table('lmb_courses');\n $field = new xmldb_field('sourcedidsource', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'sourcedid');\n\n // Launch change of type for field sourcedidsource.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field cattype on table lmb_categories to char.\n $table = new xmldb_table('lmb_categories');\n $field = new xmldb_field('cattype', XMLDB_TYPE_CHAR, '32', null, null, null, null, 'categoryid');\n\n // Launch change of type for field cattype.\n $dbman->change_field_type($table, $field);\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2011012501, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2011012502) {\n // Changing type of field coursesourcedid on table lmb_enrolments to char.\n $table = new xmldb_table('lmb_enrolments');\n $field = new xmldb_field('coursesourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'id');\n\n // Launch change of type for field coursesourcedid.\n $dbman->change_field_type($table, $field);\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2011012502, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2011012503) {\n // Changing type of field coursesourcedidsource on table lmb_crosslist to char.\n $table = new xmldb_table('lmb_crosslist');\n $field = new xmldb_field('coursesourcedidsource', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'id');\n\n // Launch change of type for field coursesourcedidsource.\n $dbman->change_field_type($table, $field);\n\n $field = new xmldb_field('coursesourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'coursesourcedidsource');\n\n // Launch change of type for field coursesourcedid.\n $dbman->change_field_type($table, $field);\n\n $field = new xmldb_field('crosssourcedidsource', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'coursesourcedid');\n\n // Launch change of type for field crosssourcedidsource.\n $dbman->change_field_type($table, $field);\n\n $field = new xmldb_field('crosslistsourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'crosssourcedidsource');\n\n // Launch change of type for field crosslistsourcedid.\n $dbman->change_field_type($table, $field);\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2011012503, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2011020301) {\n $table = new xmldb_table('lmb_enrolments');\n $field = new xmldb_field('personsourcedid', XMLDB_TYPE_CHAR, '128', null, XMLDB_NOTNULL, null, '0', 'coursesourcedid');\n\n // Launch change of type for field personsourcedid.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field sourcedid on table lmb_people to char.\n $table = new xmldb_table('lmb_people');\n $field = new xmldb_field('sourcedid', XMLDB_TYPE_CHAR, '128', null, XMLDB_NOTNULL, null, '0', 'id');\n\n // Launch change of type for field sourcedid.\n $dbman->change_field_type($table, $field);\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2011020301, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2011030801) {\n // Changing type of field sourcedid on table lmb_terms to char.\n $table = new xmldb_table('lmb_terms');\n $field = new xmldb_field('sourcedid', XMLDB_TYPE_CHAR, '128', null, XMLDB_NOTNULL, null, '0', 'id');\n\n // Launch change of type for field sourcedid.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field term on table lmb_courses to char.\n $table = new xmldb_table('lmb_courses');\n $field = new xmldb_field('term', XMLDB_TYPE_CHAR, '128', null, XMLDB_NOTNULL, null, '0', 'coursenumber');\n\n // Launch change of type for field term.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field term on table lmb_enrolments to char.\n $table = new xmldb_table('lmb_enrolments');\n $field = new xmldb_field('term', XMLDB_TYPE_CHAR, '128', null, XMLDB_NOTNULL, null, '0', 'personsourcedid');\n\n // Launch change of type for field term.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field termsourcedid on table lmb_categories to char.\n $table = new xmldb_table('lmb_categories');\n $field = new xmldb_field('termsourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'id');\n\n // Launch change of type for field termsourcedid.\n $dbman->change_field_type($table, $field);\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2011030801, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2011122501) {\n\n // Changing type of field sourcedidsource on table lmb_categories to char.\n $table = new xmldb_table('lmb_categories');\n $field = new xmldb_field('sourcedidsource', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'termsourcedid');\n\n // Launch change of type for field sourcedidsource.\n $dbman->change_field_type($table, $field);\n\n // Changing type of field dept on table lmb_categories to char.\n $field = new xmldb_field('dept', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'sourcedidsource');\n\n // Launch change of type for field dept.\n $dbman->change_field_type($table, $field);\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2011122501, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2012032701) {\n\n // Define field nickname to be added to lmb_people.\n $table = new xmldb_table('lmb_people');\n $field = new xmldb_field('nickname', XMLDB_TYPE_TEXT, 'small', null, null, null, null, 'givenname');\n\n // Conditionally launch add field nickname.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2012032701, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2012032901) {\n\n // Define table lmb_courses to be renamed to enrol_lmb_courses.\n $table = new xmldb_table('lmb_courses');\n\n // Launch rename table for lmb_courses.\n $dbman->rename_table($table, 'enrol_lmb_courses');\n\n // Define table lmb_people to be renamed to enrol_lmb_people.\n $table = new xmldb_table('lmb_people');\n\n // Launch rename table for lmb_people.\n $dbman->rename_table($table, 'enrol_lmb_people');\n\n // Define table lmb_enrolments to be renamed to enrol_lmb_enrolments.\n $table = new xmldb_table('lmb_enrolments');\n\n // Launch rename table for lmb_enrolments.\n $dbman->rename_table($table, 'enrol_lmb_enrolments');\n\n // Define table lmb_raw_xml to be renamed to enrol_lmb_raw_xml.\n $table = new xmldb_table('lmb_raw_xml');\n\n // Launch rename table for lmb_courses.\n $dbman->rename_table($table, 'enrol_lmb_raw_xml');\n\n // Define table lmb_crosslist to be renamed to enrol_lmb_crosslists.\n $table = new xmldb_table('lmb_crosslist');\n\n // Launch rename table for lmb_crosslist.\n $dbman->rename_table($table, 'enrol_lmb_crosslists');\n\n // Define table lmb_courses to be renamed to enrol_lmb_terms.\n $table = new xmldb_table('lmb_terms');\n\n // Launch rename table for lmb_terms.\n $dbman->rename_table($table, 'enrol_lmb_terms');\n\n // Define table lmb_categories to be renamed to enrol_lmb_categories.\n $table = new xmldb_table('lmb_categories');\n\n // Launch rename table for lmb_categories.\n $dbman->rename_table($table, 'enrol_lmb_categories');\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2012032901, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2012033004) {\n $config_bad = get_config('enrol/lmb');\n\n $objarray = get_object_vars($config_bad);\n\n foreach ($objarray as $key => $val) {\n if (get_config('enrol_lmb', $key) === false) {\n set_config($key, $val, 'enrol_lmb');\n }\n unset_config($key, 'enrol/lmb');\n }\n\n upgrade_plugin_savepoint(true, 2012033004, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2012033005) {\n if (($config = get_config('enrol_lmb', 'enrol_lmb/endbiztimemin')) !== false) {\n set_config('endbiztimemin', $config, 'enrol_lmb');\n unset_config('enrol_lmb/endbiztimemin', 'enrol_lmb');\n }\n\n if (($config = get_config('enrol_lmb', 'enrol_lmb/startbiztimemin')) !== false) {\n set_config('startbiztimemin', $config, 'enrol_lmb');\n unset_config('enrol_lmb/startbiztimemin', 'enrol_lmb');\n }\n\n upgrade_plugin_savepoint(true, 2012033005, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2012040101) {\n $config = get_config('enrol_lmb');\n\n if (!isset($config->parsecoursexml)) {\n set_config('parsecoursexml', 1, 'enrol_lmb');\n }\n\n if (!isset($config->parsexlsxml)) {\n set_config('parsexlsxml', 1, 'enrol_lmb');\n }\n\n if (!isset($config->parsepersonxml)) {\n set_config('parsepersonxml', 1, 'enrol_lmb');\n }\n\n if (!isset($config->parseenrolxml)) {\n set_config('parseenrolxml', 1, 'enrol_lmb');\n }\n\n upgrade_plugin_savepoint(true, 2012040101, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2012060702) {\n // Define index enrolmbcour_sou_ix (not unique) to be added to enrol_lmb_courses.\n $table = new xmldb_table('enrol_lmb_courses');\n $index = new xmldb_index('enrolmbcour_sou_ix', XMLDB_INDEX_NOTUNIQUE, array('sourcedid'));\n\n // Conditionally launch add index enrolmbcour_sou_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbpeop_sou_ix (not unique) to be added to enrol_lmb_people.\n $table = new xmldb_table('enrol_lmb_people');\n $index = new xmldb_index('enrolmbpeop_sou_ix', XMLDB_INDEX_NOTUNIQUE, array('sourcedid'));\n\n // Conditionally launch add index enrolmbpeop_sou_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbcour_per_ix (not unique) to be added to enrol_lmb_enrolments.\n $table = new xmldb_table('enrol_lmb_enrolments');\n $index = new xmldb_index('enrolmbenro_per_ix', XMLDB_INDEX_NOTUNIQUE, array('personsourcedid'));\n\n // Conditionally launch add index enrolmbcour_per_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbcour_cou_ix (not unique) to be added to enrol_lmb_enrolments.\n $table = new xmldb_table('enrol_lmb_enrolments');\n $index = new xmldb_index('enrolmbenro_cou_ix', XMLDB_INDEX_NOTUNIQUE, array('coursesourcedid'));\n\n // Conditionally launch add index enrolmbcour_cou_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbcros_cou_ix (not unique) to be added to enrol_lmb_crosslists.\n $table = new xmldb_table('enrol_lmb_crosslists');\n $index = new xmldb_index('enrolmbcros_cou_ix', XMLDB_INDEX_NOTUNIQUE, array('coursesourcedid'));\n\n // Conditionally launch add index enrolmbcros_cou_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbcros_cro_ix (not unique) to be added to enrol_lmb_crosslists.\n $table = new xmldb_table('enrol_lmb_crosslists');\n $index = new xmldb_index('enrolmbcros_cro_ix', XMLDB_INDEX_NOTUNIQUE, array('crosslistsourcedid'));\n\n // Conditionally launch add index enrolmbcros_cro_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbterm_sou_ix (not unique) to be added to enrol_lmb_terms.\n $table = new xmldb_table('enrol_lmb_terms');\n $index = new xmldb_index('enrolmbterm_sou_ix', XMLDB_INDEX_NOTUNIQUE, array('sourcedid'));\n\n // Conditionally launch add index enrolmbterm_sou_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbcate_ter_ix (not unique) to be added to enrol_lmb_categories.\n $table = new xmldb_table('enrol_lmb_categories');\n $index = new xmldb_index('enrolmbcate_ter_ix', XMLDB_INDEX_NOTUNIQUE, array('termsourcedid'));\n\n // Conditionally launch add index enrolmbcate_ter_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // Define index enrolmbcate_dep_ix (not unique) to be added to enrol_lmb_categories.\n $table = new xmldb_table('enrol_lmb_categories');\n $index = new xmldb_index('enrolmbcate_dep_ix', XMLDB_INDEX_NOTUNIQUE, array('dept'));\n\n // Conditionally launch add index enrolmbcate_dep_ix.\n if (!$dbman->index_exists($table, $index)) {\n $dbman->add_index($table, $index);\n }\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2012060702, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2012091201) {\n // Define field customfield1 to be added to enrol_lmb_people.\n $table = new xmldb_table('enrol_lmb_people');\n $field = new xmldb_field('customfield1', XMLDB_TYPE_TEXT, null, null, null, null, null, 'academicmajor');\n\n // Conditionally launch add field customfield1.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // LMB savepoint reached.\n upgrade_plugin_savepoint(true, 2012091201, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2013071601) {\n // Define field beginrestrict to be added to enrol_lmb_enrolments.\n $table = new xmldb_table('enrol_lmb_enrolments');\n $field = new xmldb_field('beginrestrict', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'status');\n\n // Conditionally launch add field beginrestrict.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $field = new xmldb_field('beginrestricttime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'beginrestrict');\n\n // Conditionally launch add field beginrestricttime.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $field = new xmldb_field('endrestrict', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'beginrestricttime');\n\n // Conditionally launch add field endrestrict.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $field = new xmldb_field('endrestricttime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'endrestrict');\n\n // Conditionally launch add field endrestricttime.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Lmb savepoint reached.\n upgrade_plugin_savepoint(true, 2013071601, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2013080202) {\n if (enrol_is_enabled('lmb')) {\n $config = get_config('enrol_lmb');\n if (((!isset($config->lmbusername)) || empty($config->lmbusername)) && ((!isset($config->lmbpasswd)) || empty($config->lmbpasswd))) {\n set_config('disablesecurity', 1, 'enrol_lmb');\n }\n }\n\n // Lmb savepoint reached.\n upgrade_plugin_savepoint(true, 2013080202, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2014121402) {\n $config = get_config('enrol_lmb');\n if (isset($config->includeaddress)) {\n set_config('includecity', $config->includeaddress, 'enrol_lmb');\n unset_config('includeaddress', 'enrol_lmb');\n }\n if (isset($config->forceaddress)) {\n set_config('forcecity', $config->forceaddress, 'enrol_lmb');\n unset_config('forceaddress', 'enrol_lmb');\n }\n\n // Lmb savepoint reached.\n upgrade_plugin_savepoint(true, 2014121402, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2016020901) {\n\n // Define field sctid to be added to enrol_lmb_people.\n $table = new xmldb_table('enrol_lmb_people');\n $field = new xmldb_field('sctid', XMLDB_TYPE_CHAR, '127', null, null, null, null, 'sourcedidsource');\n\n // Conditionally launch add field sctid.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Lmb savepoint reached.\n upgrade_plugin_savepoint(true, 2016020901, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2019060501) {\n\n // Define table enrol_lmb_colleges to be created.\n $table = new xmldb_table('enrol_lmb_colleges');\n\n // Adding fields to table enrol_lmb_colleges.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('sourcedid', XMLDB_TYPE_CHAR, '128', null, XMLDB_NOTNULL, null, null);\n $table->add_field('sourcedidsource', XMLDB_TYPE_CHAR, '128', null, null, null, null);\n $table->add_field('shortdescription', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null);\n $table->add_field('longdescription', XMLDB_TYPE_TEXT, null, null, null, null, null);\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n\n // Adding keys to table enrol_lmb_colleges.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);\n\n // Conditionally launch create table for enrol_lmb_colleges.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n // Define field collegesourcedid to be added to enrol_lmb_categories.\n $table = new xmldb_table('enrol_lmb_categories');\n $field = new xmldb_field('collegesourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'cattype');\n\n // Conditionally launch add field collegesourcedid.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define field collegesourcedid to be added to enrol_lmb_courses.\n $table = new xmldb_table('enrol_lmb_courses');\n $field = new xmldb_field('collegesourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'term');\n\n // Conditionally launch add field collegesourcedid.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n \n // Lmb savepoint reached.\n upgrade_plugin_savepoint(true, 2019060501, 'enrol', 'lmb');\n }\n\n if ($oldversion < 2019060601) {\n\n // Rename field collegesourcedid on table enrol_lmb_courses to coursesourceid.\n $table = new xmldb_table('enrol_lmb_courses');\n $field = new xmldb_field('collegesourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null, 'term');\n\n // Launch rename field coursesourcedid.\n $dbman->rename_field($table, $field, 'coursesourceid');\n\n // Define table enrol_lmb_colleges to be created.\n $table = new xmldb_table('enrol_lmb_coursebase');\n\n // Adding fields to table enrol_lmb_colleges.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('sourcedid', XMLDB_TYPE_CHAR, '128', null, XMLDB_NOTNULL, null, null);\n $table->add_field('sourcedidsource', XMLDB_TYPE_CHAR, '128', null, null, null, null);\n $table->add_field('shortdescription', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null);\n $table->add_field('longdescription', XMLDB_TYPE_TEXT, null, null, null, null, null);\n $table->add_field('collegesourcedid', XMLDB_TYPE_CHAR, '128', null, null, null, null);\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n\n // Adding keys to table enrol_lmb_colleges.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);\n\n // Conditionally launch create table for enrol_lmb_colleges.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n // Lmb savepoint reached.\n upgrade_plugin_savepoint(true, 2019060601, 'enrol', 'lmb');\n }\n\n return $result;\n}", "public function getName()\n {\n return 'moodle';\n }", "function tincanlaunch_get_moodle_language() {\n $lang = current_language();\n $langarr = explode('_', $lang);\n if (count($langarr) == 2) {\n return $langarr[0] . '-' . strtoupper($langarr[1]);\n } else {\n return $lang;\n }\n}", "function get_legacy_roles() {\n return array(\n 'admin' => 'moodle/legacy:admin',\n 'coursecreator' => 'moodle/legacy:coursecreator',\n 'editingteacher' => 'moodle/legacy:editingteacher',\n 'teacher' => 'moodle/legacy:teacher',\n 'student' => 'moodle/legacy:student',\n 'guest' => 'moodle/legacy:guest',\n 'user' => 'moodle/legacy:user'\n );\n}", "function upgrade_activity_modules($return) {\n\n global $CFG, $db;\n\n if (!$mods = get_list_of_plugins('mod') ) {\n error('No modules installed!');\n }\n\n $updated_modules = false;\n $strmodulesetup = get_string('modulesetup');\n\n foreach ($mods as $mod) {\n\n if ($mod == 'NEWMODULE') { // Someone has unzipped the template, ignore it\n continue;\n }\n\n $fullmod = $CFG->dirroot .'/mod/'. $mod;\n\n unset($module);\n\n if ( is_readable($fullmod .'/version.php')) {\n include_once($fullmod .'/version.php'); // defines $module with version etc\n } else {\n notify('Module '. $mod .': '. $fullmod .'/version.php was not readable');\n continue;\n }\n\n $oldupgrade = false;\n $newupgrade = false;\n if ( is_readable($fullmod .'/db/' . $CFG->dbtype . '.php')) {\n include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function\n $oldupgrade = true;\n }\n if ( is_readable($fullmod . '/db/upgrade.php')) {\n include_once($fullmod . '/db/upgrade.php'); // defines new upgrading function\n $newupgrade = true;\n }\n\n if (!isset($module)) {\n continue;\n }\n\n if (!empty($module->requires)) {\n if ($module->requires > $CFG->version) {\n $info = new object();\n $info->modulename = $mod;\n $info->moduleversion = $module->version;\n $info->currentmoodle = $CFG->version;\n $info->requiremoodle = $module->requires;\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n notify(get_string('modulerequirementsnotmet', 'error', $info));\n $updated_modules = true;\n continue;\n }\n }\n\n $module->name = $mod; // The name MUST match the directory\n\n include_once($fullmod.'/lib.php'); // defines upgrading and/or installing functions\n\n if ($currmodule = get_record('modules', 'name', $module->name)) {\n if ($currmodule->version == $module->version) {\n // do nothing\n } else if ($currmodule->version < $module->version) {\n /// If versions say that we need to upgrade but no upgrade files are available, notify and continue\n if (!$oldupgrade && !$newupgrade) {\n notify('Upgrade files ' . $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php or ' .\n $fullmod . '/db/upgrade.php were not readable');\n continue;\n }\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name .' module needs upgrading');\n\n /// Run de old and new upgrade functions for the module\n $oldupgrade_function = $module->name . '_upgrade';\n $newupgrade_function = 'xmldb_' . $module->name . '_upgrade';\n\n /// First, the old function if exists\n $oldupgrade_status = true;\n if ($oldupgrade && function_exists($oldupgrade_function)) {\n $db->debug = true;\n $oldupgrade_status = $oldupgrade_function($currmodule->version, $module);\n if (!$oldupgrade_status) {\n notify ('Upgrade function ' . $oldupgrade_function .\n ' did not complete successfully.');\n }\n } else if ($oldupgrade) {\n notify ('Upgrade function ' . $oldupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php');\n }\n\n /// Then, the new function if exists and the old one was ok\n $newupgrade_status = true;\n if ($newupgrade && function_exists($newupgrade_function) && $oldupgrade_status) {\n $db->debug = true;\n $newupgrade_status = $newupgrade_function($currmodule->version, $module);\n } else if ($newupgrade && $oldupgrade_status) {\n notify ('Upgrade function ' . $newupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/upgrade.php');\n }\n\n $db->debug=false;\n /// Now analyze upgrade results\n if ($oldupgrade_status && $newupgrade_status) { // No upgrading failed\n // OK so far, now update the modules record\n $module->id = $currmodule->id;\n if (! update_record('modules', $module)) {\n error('Could not update '. $module->name .' record in modules table!');\n }\n remove_dir($CFG->dataroot . '/cache', true); // flush cache\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n notify('Upgrading '. $module->name .' from '. $currmodule->version .' to '. $module->version .' FAILED!');\n }\n\n /// Update the capabilities table?\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not update '.$module->name.' capabilities!');\n }\n events_update_definition('mod/'.$module->name);\n\n $updated_modules = true;\n\n } else {\n upgrade_log_start();\n error('Version mismatch: '. $module->name .' can\\'t downgrade '. $currmodule->version .' -> '. $module->version .' !');\n }\n\n } else { // module not installed yet, so install it\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name);\n $updated_modules = true;\n $db->debug = true;\n @set_time_limit(0); // To allow slow databases to complete the long SQL\n\n /// Both old .sql files and new install.xml are supported\n /// but we priorize install.xml (XMLDB) if present\n if (file_exists($fullmod . '/db/install.xml')) {\n $status = install_from_xmldb_file($fullmod . '/db/install.xml'); //New method\n } else {\n $status = modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql'); //Old method\n }\n\n $db->debug = false;\n\n /// Continue with the installation, roles and other stuff\n if ($status) {\n if ($module->id = insert_record('modules', $module)) {\n\n /// Capabilities\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not set up the capabilities for '.$module->name.'!');\n }\n\n /// Events\n events_update_definition('mod/'.$module->name);\n\n /// Run local install function if there is one\n $installfunction = $module->name.'_install';\n if (function_exists($installfunction)) {\n if (! $installfunction() ) {\n notify('Encountered a problem running install function for '.$module->name.'!');\n }\n }\n\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n error($module->name .' module could not be added to the module list!');\n }\n } else {\n error($module->name .' tables could NOT be set up successfully!');\n }\n }\n\n /// Check submodules of this module if necessary\n\n $submoduleupgrade = $module->name.'_upgrade_submodules';\n if (function_exists($submoduleupgrade)) {\n $submoduleupgrade();\n }\n\n\n /// Run any defaults or final code that is necessary for this module\n\n if ( is_readable($fullmod .'/defaults.php')) {\n // Insert default values for any important configuration variables\n unset($defaults);\n include($fullmod .'/defaults.php'); // include here means execute, not library include\n if (!empty($defaults)) {\n foreach ($defaults as $name => $value) {\n if (!isset($CFG->$name)) {\n set_config($name, $value);\n }\n }\n }\n }\n }\n\n upgrade_log_finish(); // finish logging if started\n\n if ($updated_modules) {\n print_continue($return);\n print_footer('none');\n die;\n }\n}", "function resource_upgrade($oldversion) {\n// This function does anything necessary to upgrade\n// older versions to match current functionality\n \n global $CFG ;\n\n if ($oldversion < 2004013101) {\n modify_database(\"\", \"INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name');\");\n modify_database(\"\", \"INSERT INTO prefix_log_display VALUES ('resource', 'add', 'resource', 'name');\");\n }\n\n if ($oldversion < 2004071000) {\n table_column(\"resource\", \"\", \"popup\", \"text\", \"\", \"\", \"\", \"\", \"alltext\");\n if ($resources = get_records_select(\"resource\", \"type='3' OR type='5'\", \"\", \"id, alltext\")) {\n foreach ($resources as $resource) {\n $resource->popup = addslashes($resource->alltext);\n $resource->alltext = \"\";\n if (!update_record(\"resource\", $resource)) {\n notify(\"Error updating popup field for resource id = $resource->id\");\n } \n }\n }\n require_once(\"$CFG->dirroot/course/lib.php\");\n rebuild_course_cache();\n }\n \n if ($oldversion < 2004071300) {\n table_column(\"resource\", \"\", \"options\", \"varchar\", \"255\", \"\", \"\", \"\", \"popup\");\n }\n\n if ($oldversion < 2004071303) {\n table_column(\"resource\", \"type\", \"type\", \"varchar\", \"30\", \"\", \"\", \"\", \"\");\n\n modify_database(\"\", \"UPDATE prefix_resource SET type='reference' WHERE type='1';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file', options='frame' WHERE type='2';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file' WHERE type='3';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='text', options='0' WHERE type='4';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file' WHERE type='5';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='html' WHERE type='6';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='file' WHERE type='7';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='text', options='3' WHERE type='8';\");\n modify_database(\"\", \"UPDATE prefix_resource SET type='directory' WHERE type='9';\");\n }\n\n if ($oldversion < 2004080801) {\n modify_database(\"\", \"UPDATE prefix_resource SET alltext=reference,type='html' WHERE type='reference';\");\n rebuild_course_cache();\n }\n\n if ($oldversion < 2004111200) {//drop first to avoid conflicts when upgrading\n execute_sql(\"DROP INDEX {$CFG->prefix}resource_course_idx;\",false);\n\n modify_database('','CREATE INDEX prefix_resource_course_idx ON prefix_resource (course);');\n }\n \n if ($oldversion < 2005041100) { // replace wiki-like with markdown\n include_once( \"$CFG->dirroot/lib/wiki_to_markdown.php\" );\n $wtm = new WikiToMarkdown();\n $wtm->update( 'resource','alltext','options' );\n }\n\n return true;\n}", "function xmldb_qtype_multianswerbu_upgrade($oldversion) {\n global $CFG, $DB;\n\n $dbman = $DB->get_manager();\n\n if ($oldversion < 2008050800) {\n //hey - no functions here in this file !!!!!!!\n\n $rs = $DB->get_recordset_sql(\"SELECT q.id, q.category, qma.sequence\n FROM {question} q\n JOIN {question_multianswerbu} qma ON q.id = qma.question\");\n foreach ($rs as $q) {\n if (!empty($q->sequence)) {\n $DB->execute(\"UPDATE {question}\n SET parent = ?, category = ?\n WHERE id IN ($q->sequence) AND parent <> 0\",\n array($q->id, $q->category));\n }\n }\n $rs->close();\n\n /// multianswerbu savepoint reached\n upgrade_plugin_savepoint(true, 2008050800, 'qtype', 'multianswerbu');\n }\n\n // Moodle v2.1.0 release upgrade line\n // Put any upgrade step following this\n\n // Moodle v2.2.0 release upgrade line\n // Put any upgrade step following this\n\n return true;\n}", "function local_ltiprovider_duplicate_module( $cmid, $courseid, $newidnumber, $lticontext ) {\n global $CFG, $DB, $USER;\n\n require_once( $CFG->dirroot . '/backup/util/includes/backup_includes.php' );\n require_once( $CFG->dirroot . '/backup/util/includes/restore_includes.php' );\n require_once( $CFG->libdir . '/filelib.php' );\n\n if ( empty( $USER ) ) {\n // Emulate session.\n cron_setup_user();\n }\n\n $course = $DB->get_record( 'course', array( 'id' => $courseid ), '*', MUST_EXIST );\n $cm = get_coursemodule_from_id( '', $cmid, 0, true, MUST_EXIST );\n $cmcontext = context_module::instance( $cm->id );\n $context = context_course::instance( $course->id );\n\n\n if ( ! plugin_supports( 'mod', $cm->modname, FEATURE_BACKUP_MOODLE2 ) ) {\n $url = course_get_url( $course, $cm->sectionnum );\n print_error( 'duplicatenosupport', 'error', $url );\n }\n\n // backup the activity\n $admin = get_admin();\n\n $bc = new backup_controller( backup::TYPE_1ACTIVITY, $cm->id, backup::FORMAT_MOODLE,\n backup::INTERACTIVE_NO, backup::MODE_IMPORT, $admin->id );\n\n $backupid = $bc->get_backupid();\n $backupbasepath = $bc->get_plan()->get_basepath();\n\n $bc->execute_plan();\n\n $bc->destroy();\n\n // restore the backup immediately\n\n $rc = new restore_controller( $backupid, $courseid,\n backup::INTERACTIVE_NO, backup::MODE_IMPORT, $admin->id, backup::TARGET_CURRENT_ADDING );\n\n if ( ! $rc->execute_precheck() ) {\n $precheckresults = $rc->get_precheck_results();\n if ( is_array( $precheckresults ) && ! empty( $precheckresults['errors'] ) ) {\n if ( empty( $CFG->keeptempdirectoriesonbackup ) ) {\n fulldelete( $backupbasepath );\n }\n print_r( $precheckresults );\n die();\n }\n }\n\n $rc->execute_plan();\n\n $newcmid = null;\n $tasks = $rc->get_plan()->get_tasks();\n foreach ( $tasks as $task ) {\n if ( is_subclass_of( $task, 'restore_activity_task' ) ) {\n if ( $task->get_old_contextid() == $cmcontext->id ) {\n $newcmid = $task->get_moduleid();\n break;\n }\n }\n }\n\n $rc->destroy();\n\n\n if ( ! $DB->get_record( 'course_modules', array( 'idnumber' => $newidnumber ) ) ) {\n if ( $module = $DB->get_record( 'course_modules', array( 'id' => $newcmid ) ) ) {\n $module->idnumber = $newidnumber;\n $DB->update_record( 'course_modules', $module );\n }\n } else {\n if ( empty( $CFG->keeptempdirectoriesonbackup ) ) {\n fulldelete( $backupbasepath );\n }\n\n return $newcmid;\n }\n\n\n $newtoolid = 0;\n $newcmcontext = context_module::instance( $newcmid );\n if ( $tools = $DB->get_records( 'local_ltiprovider', array( 'contextid' => $cmcontext->id ) ) ) {\n foreach ( $tools as $tool ) {\n $tool->courseid = $course->id;\n $tool->contextid = $newcmcontext->id;\n $newtoolid = $DB->insert_record( 'local_ltiprovider', $tool );\n }\n }\n\n if ( ! $newtoolid ) {\n $tool = local_ltiprovider_create_tool( $course->id, $newcmcontext->id, $lticontext );\n }\n\n if ( empty( $CFG->keeptempdirectoriesonbackup ) ) {\n fulldelete( $backupbasepath );\n }\n\n return $newcmid;\n\n}", "function xmldb_promising_upgrade($oldversion=0) {\n\n global $CFG, $THEME, $DB;\n\t\n\t$dbman = $DB->get_manager();\n if ($oldversion < 2013100900) {\n\n // Define field projectconfidential to be added to promising.\n $table = new xmldb_table('promising');\n\t\t//ajout dans table promising => des projets\n\t\t\n\t\t//champ projectconfidential\n $field = new xmldb_field('projectconfidential', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, '0', 'typeprojet');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n\t\t//champ introimg\n $field = new xmldb_field('introimg', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'projectconfidential');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n\t\t//champ commanditaire\n $field = new xmldb_field('commanditaire', XMLDB_TYPE_CHAR, '64', null, XMLDB_NOTNULL, null, null, 'introimg');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n\t\t//champ projectgrpid\n $field = new xmldb_field('projectgrpid', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'commanditaire');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n\t\t//champ etat\n $field = new xmldb_field('etat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'projectgrpid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n // Define field statut to be added to promising_milestone.\n $table = new xmldb_table('promising_milestone');\n\t\t//ajout dans table étapes\n\t\t\n\t\t//champ statut\n $field = new xmldb_field('statut', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL, null, '0', 'deadlineenable');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n\t\t//champ numversion\n $field = new xmldb_field('numversion', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, '0', 'statut');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n\t\t // Define field typeelm to be added to promising_deliverable.\n $table = new xmldb_table('promising_deliverable');\n\t\t//ajout dans table deliverable\n\t\t\n\t\t//champ type d'element (ressource ou livrable)\n $field = new xmldb_field('typeelm', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL, null, '0', 'url');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n\t\t//champ commentaire\n $field = new xmldb_field('commentaire', XMLDB_TYPE_TEXT, null, null, null, null, null, 'descriptionformat');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t//champ commentaireformat\n $field = new xmldb_field('commentaireformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, null, 'commentaire');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n // Define table promising_messages to be created.\n $table = new xmldb_table('promising_messages');\n // Adding fields to table promising_messages.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('parent', XMLDB_TYPE_INTEGER, '10', null, null, null, null);\n $table->add_field('ordering', XMLDB_TYPE_INTEGER, '5', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('groupid', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');\n $table->add_field('projectid', XMLDB_TYPE_INTEGER, '6', null, null, null, '0');\n $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('created', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('modified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('lastuserid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n $table->add_field('abstract', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null);\n $table->add_field('message', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null);\n // Adding keys to table promising_messages.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n // Conditionally launch create table for promising_messages.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\t\t\n\t\t//champ messageformat\n $field = new xmldb_field('messageformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, null, 'message');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\t\t\n // Promising savepoint reached.\n upgrade_mod_savepoint(true, 2013100900, 'promising');\n }\n\n $result = true;\n\n\t/// Moodle 1.9 break\n\n return $result;\n}", "function moodle_install_roles() {\n\n global $CFG, $db;\n\n/// Create a system wide context for assignemnt.\n $systemcontext = $context = get_context_instance(CONTEXT_SYSTEM);\n\n\n/// Create default/legacy roles and capabilities.\n/// (1 legacy capability per legacy role at system level).\n\n $adminrole = create_role(addslashes(get_string('administrator')), 'admin',\n addslashes(get_string('administratordescription')), 'moodle/legacy:admin');\n $coursecreatorrole = create_role(addslashes(get_string('coursecreators')), 'coursecreator',\n addslashes(get_string('coursecreatorsdescription')), 'moodle/legacy:coursecreator');\n $editteacherrole = create_role(addslashes(get_string('defaultcourseteacher')), 'editingteacher',\n addslashes(get_string('defaultcourseteacherdescription')), 'moodle/legacy:editingteacher');\n $noneditteacherrole = create_role(addslashes(get_string('noneditingteacher')), 'teacher',\n addslashes(get_string('noneditingteacherdescription')), 'moodle/legacy:teacher');\n $studentrole = create_role(addslashes(get_string('defaultcoursestudent')), 'student',\n addslashes(get_string('defaultcoursestudentdescription')), 'moodle/legacy:student');\n $guestrole = create_role(addslashes(get_string('guest')), 'guest',\n addslashes(get_string('guestdescription')), 'moodle/legacy:guest');\n $userrole = create_role(addslashes(get_string('authenticateduser')), 'user',\n addslashes(get_string('authenticateduserdescription')), 'moodle/legacy:user');\n \n/// Now is the correct moment to install capabilities - after creation of legacy roles, but before assigning of roles\n\n if (!assign_capability('moodle/site:doanything', CAP_ALLOW, $adminrole, $systemcontext->id)) {\n error('Could not assign moodle/site:doanything to the admin role');\n }\n if (!update_capabilities()) {\n error('Had trouble upgrading the core capabilities for the Roles System');\n }\n\n/// Look inside user_admin, user_creator, user_teachers, user_students and\n/// assign above new roles. If a user has both teacher and student role,\n/// only teacher role is assigned. The assignment should be system level.\n\n $dbtables = $db->MetaTables('TABLES');\n\n/// Set up the progress bar\n\n $usertables = array('user_admins', 'user_coursecreators', 'user_teachers', 'user_students');\n\n $totalcount = $progresscount = 0;\n foreach ($usertables as $usertable) {\n if (in_array($CFG->prefix.$usertable, $dbtables)) {\n $totalcount += count_records($usertable);\n }\n }\n\n print_progress(0, $totalcount, 5, 1, 'Processing role assignments');\n\n/// Upgrade the admins.\n/// Sort using id ASC, first one is primary admin.\n\n if (in_array($CFG->prefix.'user_admins', $dbtables)) {\n if ($rs = get_recordset_sql('SELECT * from '.$CFG->prefix.'user_admins ORDER BY ID ASC')) {\n while ($admin = rs_fetch_next_record($rs)) {\n role_assign($adminrole, $admin->userid, 0, $systemcontext->id);\n $progresscount++;\n print_progress($progresscount, $totalcount, 5, 1, 'Processing role assignments');\n }\n rs_close($rs);\n }\n } else {\n // This is a fresh install.\n }\n\n\n/// Upgrade course creators.\n if (in_array($CFG->prefix.'user_coursecreators', $dbtables)) {\n if ($rs = get_recordset('user_coursecreators')) {\n while ($coursecreator = rs_fetch_next_record($rs)) {\n role_assign($coursecreatorrole, $coursecreator->userid, 0, $systemcontext->id);\n $progresscount++;\n print_progress($progresscount, $totalcount, 5, 1, 'Processing role assignments');\n }\n rs_close($rs);\n }\n }\n\n\n/// Upgrade editting teachers and non-editting teachers.\n if (in_array($CFG->prefix.'user_teachers', $dbtables)) {\n if ($rs = get_recordset('user_teachers')) {\n while ($teacher = rs_fetch_next_record($rs)) {\n \n // removed code here to ignore site level assignments\n // since the contexts are separated now\n \n // populate the user_lastaccess table\n $access = new object();\n $access->timeaccess = $teacher->timeaccess;\n $access->userid = $teacher->userid;\n $access->courseid = $teacher->course;\n insert_record('user_lastaccess', $access);\n\n // assign the default student role\n $coursecontext = get_context_instance(CONTEXT_COURSE, $teacher->course); // needs cache\n // hidden teacher\n if ($teacher->authority == 0) {\n $hiddenteacher = 1; \n } else {\n $hiddenteacher = 0; \n } \n \n if ($teacher->editall) { // editting teacher\n role_assign($editteacherrole, $teacher->userid, 0, $coursecontext->id, $teacher->timestart, $teacher->timeend, $hiddenteacher, $teacher->enrol, $teacher->timemodified);\n } else {\n role_assign($noneditteacherrole, $teacher->userid, 0, $coursecontext->id, $teacher->timestart, $teacher->timeend, $hiddenteacher, $teacher->enrol, $teacher->timemodified);\n }\n $progresscount++;\n print_progress($progresscount, $totalcount, 5, 1, 'Processing role assignments');\n }\n rs_close($rs);\n }\n }\n\n\n/// Upgrade students.\n if (in_array($CFG->prefix.'user_students', $dbtables)) {\n if ($rs = get_recordset('user_students')) {\n while ($student = rs_fetch_next_record($rs)) {\n\n // populate the user_lastaccess table\n $access = new object;\n $access->timeaccess = $student->timeaccess;\n $access->userid = $student->userid;\n $access->courseid = $student->course;\n insert_record('user_lastaccess', $access);\n\n // assign the default student role\n $coursecontext = get_context_instance(CONTEXT_COURSE, $student->course);\n role_assign($studentrole, $student->userid, 0, $coursecontext->id, $student->timestart, $student->timeend, 0, $student->enrol, $student->time);\n $progresscount++;\n print_progress($progresscount, $totalcount, 5, 1, 'Processing role assignments');\n }\n rs_close($rs);\n }\n }\n\n\n/// Upgrade guest (only 1 entry).\n if ($guestuser = get_record('user', 'username', 'guest')) {\n role_assign($guestrole, $guestuser->id, 0, $systemcontext->id);\n }\n print_progress($totalcount, $totalcount, 5, 1, 'Processing role assignments');\n\n\n/// Insert the correct records for legacy roles\n allow_assign($adminrole, $adminrole);\n allow_assign($adminrole, $coursecreatorrole);\n allow_assign($adminrole, $noneditteacherrole);\n allow_assign($adminrole, $editteacherrole);\n allow_assign($adminrole, $studentrole);\n allow_assign($adminrole, $guestrole);\n\n allow_assign($coursecreatorrole, $noneditteacherrole);\n allow_assign($coursecreatorrole, $editteacherrole);\n allow_assign($coursecreatorrole, $studentrole);\n allow_assign($coursecreatorrole, $guestrole);\n\n allow_assign($editteacherrole, $noneditteacherrole);\n allow_assign($editteacherrole, $studentrole);\n allow_assign($editteacherrole, $guestrole);\n\n/// Set up default permissions for overrides\n allow_override($adminrole, $adminrole);\n allow_override($adminrole, $coursecreatorrole);\n allow_override($adminrole, $noneditteacherrole);\n allow_override($adminrole, $editteacherrole);\n allow_override($adminrole, $studentrole);\n allow_override($adminrole, $guestrole);\n allow_override($adminrole, $userrole);\n\n\n/// Delete the old user tables when we are done\n\n drop_table(new XMLDBTable('user_students'));\n drop_table(new XMLDBTable('user_teachers'));\n drop_table(new XMLDBTable('user_coursecreators'));\n drop_table(new XMLDBTable('user_admins'));\n\n}", "function dllc_add_instance(stdClass $dllc, mod_dllc_mod_form $mform = null) {\n global $DB,$COURSE;\n $courseid = $COURSE->id;\n\n $data = new stdClass();\n $data->courseid = $courseid;\n $data->name = 'Participants '.$mform->get_data()->dateheuredebut;\n $data->description = 'Groupe pour les etudiants inscirts à l\\'atelier ';\n $data->descriptionformat = FORMAT_HTML;\n try {\n $newgroupid = groups_create_group($data);\n } catch (moodle_exception $e) {\n echo $e;\n }\n $dllc->timecreated = time();\n $dllc->salle = $mform->get_data()->salle;\n $dllc->grade = '';\n $dllc->c_atelier = $mform->get_data()->c_atelier;\n $dllc->niveau = $mform->get_data()->niveau;\n $dllc->ateliers = $mform->get_data()->ateliers;\n $dllc->dateheuredebut = $mform->get_data()->dateheuredebut;\n $dllc->dateheurefin = $mform->get_data()->dateheurefin;\n $dllc->nbplacedispo = $mform->get_data()->nbplacedispo;\n $dllc->idgroup = $newgroupid ;\n\n try {\n $dllc->id = $DB->insert_record('dllc', $dllc);\n } catch (dml_exception $e) {\n echo $e;\n }\n dllc_grade_item_update($dllc);\n\n return $dllc->id;\n\n\n\n}", "function local_ltiprovider_create_tool( $courseid, $contextid, $lticontext ) {\n global $CFG, $DB;\n\n $tool = new stdClass();\n $tool->courseid = $courseid;\n $tool->contextid = $contextid;\n $tool->disabled = 0;\n $tool->forcenavigation = 0;\n $tool->croleinst = 3;\n $tool->crolelearn = 5;\n $tool->aroleinst = 3;\n $tool->arolelearn = 5;\n $tool->secret = get_config( 'local_ltiprovider', 'globalsharedsecret' );\n $tool->encoding = 'UTF-8';\n $tool->institution = \"\";\n $tool->lang = $CFG->lang;\n $tool->timezone = 99;\n $tool->maildisplay = 2;\n $tool->city = \"mycity\";\n $tool->country = \"ES\";\n $tool->hidepageheader = 0;\n $tool->hidepagefooter = 0;\n $tool->hideleftblocks = 0;\n $tool->hiderightblocks = 0;\n $tool->customcss = '';\n $tool->enrolstartdate = 0;\n $tool->enrolperiod = 0;\n $tool->enrolenddate = 0;\n $tool->maxenrolled = 0;\n $tool->userprofileupdate = 1;\n $tool->timemodified = time();\n $tool->timecreated = time();\n $tool->lastsync = 0;\n $tool->enrolinst = 1;\n $tool->enrollearn = 1;\n $tool->sendgrades = ( ! empty( $lticontext->info['lis_outcome_service_url'] ) ) ? 1 : 0;\n $tool->syncmembers = ( ! empty( $lticontext->info['ext_ims_lis_memberships_url'] ) ) ? 1 : 0;\n $tool->syncmode = ( ! empty( $lticontext->info['ext_ims_lis_memberships_url'] ) ) ? 1 : 0;\n $tool->syncperiod = ( ! empty( $lticontext->info['ext_ims_lis_memberships_url'] ) ) ? 86400 : 0;\n\n $tool->id = $DB->insert_record( 'local_ltiprovider', $tool );\n\n return $tool;\n}", "function moodle_require_minimum_php_version() {\n // PLEASE NOTE THIS FUNCTION MUST BE COMPATIBLE WITH OLD UNSUPPORTED VERSIONS OF PHP!\n moodle_minimum_php_version_is_met(true);\n}", "function upgrade_blocks_plugins($continueto) {\n\n global $CFG;\n\n $blocktitles = array();\n $invalidblocks = array();\n $validblocks = array();\n $notices = array();\n\n //Count the number of blocks in db\n $blockcount = count_records('block');\n //If there isn't records. This is the first install, so I remember it\n if ($blockcount == 0) {\n $first_install = true;\n } else {\n $first_install = false;\n }\n\n $site = get_site();\n\n if (!$blocks = get_list_of_plugins('blocks', 'db') ) {\n error('No blocks installed!');\n }\n\n include_once($CFG->dirroot .'/blocks/moodleblock.class.php');\n if(!class_exists('moodleblock')) {\n error('Class MoodleBlock is not defined or file not found for /blocks/moodleblock.class.php');\n }\n\n foreach ($blocks as $blockname) {\n\n if ($blockname == 'NEWBLOCK') { // Someone has unzipped the template, ignore it\n continue;\n }\n\n $fullblock = $CFG->dirroot .'/blocks/'. $blockname;\n\n if ( is_readable($fullblock.'/block_'.$blockname.'.php')) {\n include_once($fullblock.'/block_'.$blockname.'.php');\n } else {\n $notices[] = 'Block '. $blockname .': '. $fullblock .'/block_'. $blockname .'.php was not readable';\n continue;\n }\n\n if ( @is_dir($fullblock .'/db/')) {\n if ( @is_readable($fullblock .'/db/'. $CFG->dbtype .'.php')) {\n include_once($fullblock .'/db/'. $CFG->dbtype .'.php'); // defines upgrading function\n } else {\n $notices[] ='Block '. $blockname .': '. $fullblock .'/db/'. $CFG->dbtype .'.php was not readable';\n continue;\n }\n }\n\n $classname = 'CourseBlock_'.$blockname;\n if(!class_exists($classname)) {\n $notices[] = 'Block '. $blockname .': '. $classname .' not implemented';\n continue;\n }\n\n // Here is the place to see if the block implements a constructor (old style),\n // an init() function (new style) or nothing at all (error time).\n\n $constructor = get_class_constructor($classname);\n if(empty($constructor)) {\n // No constructor\n $notices[] = 'Block '. $blockname .': class does not have a constructor';\n $invalidblocks[] = $blockname;\n continue;\n }\n $methods = get_class_methods($classname);\n if(!in_array('init', $methods)) {\n // This is an old-style block\n $notices[] = 'Block '. $blockname .' is an old style block and needs to be updated by a programmer.';\n $invalidblocks[] = $blockname;\n continue;\n }\n\n $block = new stdClass; // This may be used to update the db below\n $blockobj = new $classname; // This is what we 'll be testing\n\n // Inherits from MoodleBlock?\n if(!is_subclass_of($blockobj, 'moodleblock')) {\n $notices[] = 'Block '. $blockname .': class does not inherit from MoodleBlock';\n continue;\n }\n\n // OK, it's as we all hoped. For further tests, the object will do them itself.\n if(!$blockobj->_self_test()) {\n $notices[] = 'Block '. $blockname .': self test failed';\n continue;\n }\n $block->version = $blockobj->get_version();\n\n if (!isset($block->version)) {\n $notices[] = 'Block '. $blockname .': has no version support. It must be updated by a programmer.';\n continue;\n }\n\n $block->name = $blockname; // The name MUST match the directory\n $blocktitle = $blockobj->get_title();\n\n if ($currblock = get_record('block', 'name', $block->name)) {\n if ($currblock->version == $block->version) {\n // do nothing\n } else if ($currblock->version < $block->version) {\n if (empty($updated_blocks)) {\n $strblocksetup = get_string('blocksetup');\n print_header($strblocksetup, $strblocksetup, $strblocksetup, '', '', false, '&nbsp;', '&nbsp;');\n }\n print_heading('New version of '.$blocktitle.' ('.$block->name.') exists');\n $upgrade_function = $block->name.'_upgrade';\n if (function_exists($upgrade_function)) {\n $db->debug=true;\n if ($upgrade_function($currblock->version, $block)) {\n\n $upgradesuccess = true;\n } else {\n $upgradesuccess = false;\n }\n $db->debug=false;\n }\n else {\n $upgradesuccess = true;\n }\n if(!$upgradesuccess) {\n notify('Upgrading block '. $block->name .' from '. $currblock->version .' to '. $block->version .' FAILED!');\n }\n else {\n // OK so far, now update the block record\n $block->id = $currblock->id;\n if (! update_record('block', $block)) {\n error('Could not update block '. $block->name .' record in block table!');\n }\n notify(get_string('blocksuccess', '', $blocktitle), 'green');\n echo '<hr />';\n }\n $updated_blocks = true;\n } else {\n error('Version mismatch: block '. $block->name .' can\\'t downgrade '. $currblock->version .' -> '. $block->version .'!');\n }\n\n } else { // block not installed yet, so install it\n\n // If it allows multiples, start with it enabled\n $block->multiple = $blockobj->instance_allow_multiple();\n\n // [pj] Normally this would be inline in the if, but we need to\n // check for NULL (necessary for 4.0.5 <= PHP < 4.2.0)\n $conflictblock = array_search($blocktitle, $blocktitles);\n if($conflictblock !== false && $conflictblock !== NULL) {\n // Duplicate block titles are not allowed, they confuse people\n // AND PHP's associative arrays ;)\n error('<strong>Naming conflict</strong>: block <strong>'.$block->name.'</strong> has the same title with an existing block, <strong>'.$conflictblock.'</strong>!');\n }\n if (empty($updated_blocks)) {\n $strblocksetup = get_string('blocksetup');\n print_header($strblocksetup, $strblocksetup, $strblocksetup, '', '', false, '&nbsp;', '&nbsp;');\n }\n print_heading($block->name);\n $updated_blocks = true;\n $db->debug = true;\n @set_time_limit(0); // To allow slow databases to complete the long SQL\n if (!is_dir($fullblock .'/db/') || modify_database($fullblock .'/db/'. $CFG->dbtype .'.sql')) {\n $db->debug = false;\n if ($block->id = insert_record('block', $block)) {\n notify(get_string('blocksuccess', '', $blocktitle), 'green');\n echo '<hr />';\n } else {\n error($block->name .' block could not be added to the block list!');\n }\n } else {\n error('Block '. $block->name .' tables could NOT be set up successfully!');\n }\n }\n\n $blocktitles[$block->name] = $blocktitle;\n }\n\n if(!empty($notices)) {\n foreach($notices as $notice) {\n notify($notice);\n }\n }\n\n // Finally, if we are in the first_install of BLOCKS (this means that we are\n // upgrading from Moodle < 1.3), put blocks in all existing courses.\n if ($first_install) {\n //Iterate over each course\n if ($courses = get_records('course')) {\n foreach ($courses as $course) {\n $page = new stdClass;\n $page->type = MOODLE_PAGE_COURSE;\n $page->id = $course->id;\n blocks_repopulate_page($page);\n }\n }\n }\n\n if (!empty($CFG->siteblocksadded)) { /// This is a once-off hack to make a proper upgrade\n $page = new stdClass;\n $page->type = MOODLE_PAGE_COURSE;\n $page->id = SITEID;\n blocks_repopulate_page($page);\n delete_records('config', 'name', 'siteblocksadded');\n }\n\n if (!empty($updated_blocks)) {\n print_continue($continueto);\n die;\n }\n}", "function rss_client_upgrade($oldversion) {\n/// This function does anything necessary to upgrade \n/// older versions to match current functionality \n\n global $CFG;\n\n if ($oldversion < 2003111500) {\n # Do something ...\n }\n\n if ($oldversion < 2004112001) {\n // title and description should be TEXT as we don't have control over their length.\n table_column('block_rss_client','title','title','text',10,'unsigned','');\n table_column('block_rss_client','description','description','text',10,'unsigned','');\n }\n\n return true;\n}", "function xmldb_accredible_upgrade($oldversion=0) {\n\n global $CFG, $THEME, $DB;\n $dbman = $DB->get_manager();\n\n $result = true;\n\n if ($oldversion < 2014111800) {\n\n // Changing type of field description on table accredible to text.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('description', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null, 'achievementid');\n\n // Launch change of type for field description.\n $dbman->change_field_type($table, $field);\n\n // Accredible savepoint reached.\n upgrade_mod_savepoint(true, 2014111800, 'accredible');\n }\n\n if ($oldversion < 2014112600) {\n\n // Define field completionactivities to be added to accredible.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('completionactivities', XMLDB_TYPE_TEXT, null, null, null, null, null, 'passinggrade');\n\n // Conditionally launch add field completionactivities.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Accredible savepoint reached.\n upgrade_mod_savepoint(true, 2014112600, 'accredible');\n }\n\n if ($oldversion < 2014121800) {\n\n // Define field certificatename to be added to accredible.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('certificatename', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'timecreated');\n\n // Conditionally launch add field certificatename.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Set the certificate names to equal the Activity name.\n if ($accredibleactivities = $DB->get_records('accredible')) {\n foreach ($accredibleactivities as $activity) {\n $activity->certificatename = $activity->name;\n $DB->update_record('accredible', $activity);\n }\n }\n\n // Accredible savepoint reached.\n upgrade_mod_savepoint(true, 2014121800, 'accredible');\n }\n\n if ($oldversion < 2016111000) {\n\n // Define field groupid to be added to accredible.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('groupid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'certificatename');\n\n // Conditionally launch add field groupid.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Changing nullability of field name on table accredible to null.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'id');\n\n // Launch change of nullability for field name.\n $dbman->change_field_notnull($table, $field);\n\n // Changing nullability of field course on table accredible to null.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('course', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'name');\n\n // Launch change of nullability for field course.\n $dbman->change_field_notnull($table, $field);\n\n // Changing nullability of field achievementid on table accredible to null.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('achievementid', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'course');\n\n // Launch change of nullability for field achievementid.\n $dbman->change_field_notnull($table, $field);\n\n // Changing nullability of field description on table accredible to null.\n $table = new xmldb_table('accredible');\n $field = new xmldb_field('description', XMLDB_TYPE_TEXT, null, null, null, null, null, 'achievementid');\n\n // Launch change of nullability for field description.\n $dbman->change_field_notnull($table, $field);\n\n // Accredible savepoint reached.\n upgrade_mod_savepoint(true, 2016111000, 'accredible');\n\n }\n\n if ($oldversion < 2022060900) {\n $table = new xmldb_table('accredible');\n\n // Define field includegradeattribute to be added to accredible.\n $field = new xmldb_field('includegradeattribute', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0',\n 'completionactivities');\n\n // Conditionally launch add field groupid.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define field gradeattributegradeitemid to be added to accredible.\n $field = new xmldb_field('gradeattributegradeitemid', XMLDB_TYPE_INTEGER, '10', null, null, null,\n null, 'includegradeattribute');\n\n // Conditionally launch add field groupid.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Define field gradeattributekeyname to be added to accredible.\n $field = new xmldb_field('gradeattributekeyname', XMLDB_TYPE_CHAR, '255', null, null, null,\n null, 'gradeattributegradeitemid');\n\n // Conditionally launch add field groupid.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Accredible savepoint reached.\n upgrade_mod_savepoint(true, 2022060900, 'accredible');\n }\n\n return true;\n}", "function get_course_infos($courseid, $DB){\n\n\n $final_course_infos=new stdClass();\n\n $course_allowedfields='id,category,fullname,shortname,summary,format,lang,timecreated,timemodified,courseurl';\n $course_allowedfieldsarray=explode(',',$course_allowedfields);\n $category_allowedfields='id,name,description,parent,coursecount,depth,path';\n $category_allowedfieldsarray=explode(',',$category_allowedfields);\n $module_allowedfields='id,course,module,instance,section,added,score,modname,moduleurl';\n $module_allowedfieldsarray=explode(',',$module_allowedfields);\n $moduleinstance_allowedfields='id,course,name,intro,introformat';\n $moduleinstance_allowedfieldsarray=explode(',',$moduleinstance_allowedfields);\n $context_allowedfields='id,contextlevel,instanceid,path,depth';\n $context_allowedfieldsarray=explode(',',$context_allowedfields);\n $file_allowedfields='id,contextid,component,filearea,filepath,filename,filesize,mimetype,source,author,license,timecreated,timemodified,sortorder,referencefileid,fileurl';\n $file_allowedfieldsarray=explode(',',$file_allowedfields);\n $licence_allowedfields='id,shortname,fullname,source,enabled,version';\n $licence_allowedfieldsarray=explode(',',$licence_allowedfields);\n\n $course_mods = get_course_mods($courseid);\n $final_course_infos->course_gen_infos= $DB->get_record('course', array('id' =>$courseid));\n //Addition of 'CourseURl' as attribute\n $final_course_infos->course_gen_infos->courseurl= $GLOBALS['GLBMDL_CFG']->wwwroot.\"/course/view.php?id=\".$final_course_infos->course_gen_infos->id;\n $final_course_infos->course_cat_infos= $DB->get_record('course_categories', array('id' =>$final_course_infos->course_gen_infos->category ));\n\n\n $result = array();\n if($course_mods) {\n foreach($course_mods as $course_mod) {\n\n //Addition of 'ModuleURl' as attribute\n $course_mod->moduleurl= $GLOBALS['GLBMDL_CFG']->wwwroot.\"/mod/\".$course_mod->modname.\"/view.php?id=\".$course_mod->id;\n $course_mod->course_module_instance = $DB->get_record($course_mod->modname, array('id' =>$course_mod->instance ));\n $course_mod->course_module_context = $DB->get_record('context', array('instanceid' =>$course_mod->id, 'contextlevel' => 70 ));\n\n\n $course_mod->course_module_file = $DB->get_record('files', array('contextid' =>$course_mod->course_module_context->id, 'sortorder' => 1));\n $course_mod->course_module_file_licence= null;\n if($course_mod->course_module_file){\n\n $course_mod->course_module_file_licence = $DB->get_record('license', array('shortname' =>$course_mod->course_module_file->license));\n //Addition of 'FileURl' as attribute\n $course_mod->course_module_file->fileurl= $GLOBALS['GLBMDL_CFG']->wwwroot.\"/pluginfile.php/\".$course_mod->course_module_context->id.\"/\".$course_mod->course_module_file->component.\"/\".$course_mod->course_module_file->filearea.\"/\".$course_mod->course_module_file->itemid.$course_mod->course_module_file->filepath.$course_mod->course_module_file->filename;\n\n }\n //$course_mod=module_filesandrelatedlicences($DB, $course_mod, array('content'));\n $result[$course_mod->id] = $course_mod;\n\n }\n }\n $final_course_infos->course_modules=$result;\n $final_course_infos->response_notice=\"Response success\";\n\n //Return only the needed infos: allowed infos to the frontEnd side.\n $finalfinal_course_infos=new stdClass();\n $finalfinal_course_infos->course_gen_infos=json_encode( clean_object($final_course_infos->course_gen_infos, $course_allowedfieldsarray));\n $finalfinal_course_infos->course_cat_infos=json_encode( clean_object($final_course_infos->course_cat_infos, $category_allowedfieldsarray));\n $finalfinal_course_infos->course_modules=null;\n foreach ($final_course_infos->course_modules as $key => $value) {\n\n $finalcoursemodule =new stdClass();\n $finalcoursemodule->course_module_geninfos=clean_object($value, $module_allowedfieldsarray);\n $finalcoursemodule->course_module_instance=clean_object($value->course_module_instance, $moduleinstance_allowedfieldsarray);\n $finalcoursemodule->course_module_context=clean_object($value->course_module_context, $context_allowedfieldsarray);\n $finalcoursemodule->course_module_file=clean_object($value->course_module_file, $file_allowedfieldsarray);\n $finalcoursemodule->course_module_file_licence=clean_object($value->course_module_file_licence, $licence_allowedfieldsarray);\n\n $finalfinal_course_infos->course_modules[\"$key\"]=$finalcoursemodule;\n $finalcoursemodule=null;\n }\n\n\n $finalfinal_course_infos->course_modules= json_encode( $finalfinal_course_infos->course_modules);\n\n return $final_course_infos;\n }", "function tquiz_pluginfile($course, $cm, $context, $filearea, array $args, $forcedownload, array $options=array()) {\n global $DB, $CFG;\n\n if ($context->contextlevel != CONTEXT_MODULE) {\n send_file_not_found();\n }\n\n require_login($course, true, $cm);\n\t\n\t$itemid = (int)array_shift($args);\n\n require_course_login($course, true, $cm);\n\n if (!has_capability('mod/tquiz:view', $context)) {\n return false;\n }\n\n // $arg could be revision number or index.html\n // $arg = array_shift($args);\n //$itemid = (int)array_shift($args);\n\n $fs = get_file_storage();\n $relativepath = implode('/', $args);\n $fullpath = \"/$context->id/mod_tquiz/$filearea/$itemid/$relativepath\";\n\t\t//error_log($fullpath);\n if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {\n\t\t/*\n $page = $DB->get_record('webquest', array('id'=>$cm->instance), 'id, legacyfiles', MUST_EXIST);\n if ($page->legacyfiles != RESOURCELIB_LEGACYFILES_ACTIVE) {\n return false;\n }\n if (!$file = resourcelib_try_file_migration('/'.$relativepath, $cm->id, $cm->course, 'mod_webquest', $filearea, $itemid)) {\n return false;\n }\n\t\t\t*/\n return false;\n }\n\n // finally send the file\n send_stored_file($file, null, 0, $forcedownload, $options);\n}", "function print_context_name($context) {\n\n $name = '';\n switch ($context->contextlevel) {\n\n case CONTEXT_SYSTEM: // by now it's a definite an inherit\n $name = get_string('coresystem');\n break;\n\n case CONTEXT_PERSONAL:\n $name = get_string('personal');\n break;\n\n case CONTEXT_USER:\n if ($user = get_record('user', 'id', $context->instanceid)) {\n $name = get_string('user').': '.fullname($user);\n }\n break;\n\n case CONTEXT_COURSECAT: // Coursecat -> coursecat or site\n if ($category = get_record('course_categories', 'id', $context->instanceid)) {\n $name = get_string('category').': '. format_string($category->name);\n }\n break;\n\n case CONTEXT_COURSE: // 1 to 1 to course cat\n if ($course = get_record('course', 'id', $context->instanceid)) {\n \n if ($context->instanceid == SITEID) {\n $name = get_string('site').': '. format_string($course->fullname);\n } else {\n $name = get_string('course').': '. format_string($course->fullname);\n }\n }\n break;\n\n case CONTEXT_GROUP: // 1 to 1 to course\n if ($name = groups_get_group_name($context->instanceid)) {\n $name = get_string('group').': '. $name;\n }\n break;\n\n case CONTEXT_MODULE: // 1 to 1 to course\n if ($cm = get_record('course_modules','id',$context->instanceid)) {\n if ($module = get_record('modules','id',$cm->module)) {\n if ($mod = get_record($module->name, 'id', $cm->instance)) {\n $name = get_string('activitymodule').': '.$mod->name;\n }\n }\n }\n break;\n\n case CONTEXT_BLOCK: // 1 to 1 to course\n if ($blockinstance = get_record('block_instance','id',$context->instanceid)) {\n if ($block = get_record('block','id',$blockinstance->blockid)) {\n global $CFG;\n require_once(\"$CFG->dirroot/blocks/moodleblock.class.php\");\n require_once(\"$CFG->dirroot/blocks/$block->name/block_$block->name.php\");\n $blockname = \"block_$block->name\";\n if ($blockobject = new $blockname()) {\n $name = $blockobject->title.' ('.get_string('block').')';\n }\n }\n }\n break;\n\n default:\n error ('This is an unknown context (' . $context->contextlevel . ') in print_context_name!');\n return false;\n\n }\n return $name;\n}", "function wooflash_get_coursemodule_info($cm) {\n global $CFG;\n\n $info = new cached_cm_info();\n\n $fullurl = \"$CFG->wwwroot/mod/wooflash/view.php?id=$cm->id&amp;redirect=1\";\n $info->onclick = \"window.open('$fullurl'); return false;\";\n\n return $info;\n}", "function xmldb_format_institutes_ceu_upgrade($oldversion) {\n global $CFG, $DB;\n\n $dbman = $DB->get_manager();\n\n\t// Define table course_format_sections to be created.\n\t$table = new xmldb_table('course_format_sections');\n\n\t// Adding fields to table course_format_sections.\n\t$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n\t$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('format', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('sectionid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('section', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('parent', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('level', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('parentssequence', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('imageid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n\t$table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n\t$table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n\t\n\t// Adding keys to table course_format_sections.\n\t$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n\t// Conditionally launch create table for course_format_sections.\n\tif (!$dbman->table_exists($table)) {\n\t\t$dbman->create_table($table);\n\t}\n \n \n // Define table course_format_settings to be created.\n\t$table = new xmldb_table('course_format_settings');\n\n\t// Adding fields to table course_format_settings.\n\t$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n\t$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('type', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('value', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n \n\t// Adding keys to table course_format_settings.\n\t$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n\t// Conditionally launch create table for course_format_settings.\n\tif (!$dbman->table_exists($table)) {\n\t\t$dbman->create_table($table);\n\t}\n \n \n // Define table course_format_resource to be created.\n\t$table = new xmldb_table('course_format_resource');\n\n\t// Adding fields to table course_format_resource.\n\t$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n\t$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n\t$table->add_field('title', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n\t$table->add_field('resourcetext', XMLDB_TYPE_TEXT, null, null, null, null, null);\n\t$table->add_field('filename', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('popuptext', XMLDB_TYPE_TEXT, null, null, null, null, null);\n $table->add_field('states', XMLDB_TYPE_TEXT, null, null, null, null, null);\n\t$table->add_field('resourcefile', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n\t$table->add_field('status', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1');\n\t$table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n \n\t// Adding keys to table course_format_resource.\n\t$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n\t// Conditionally launch create table for course_format_resource.\n\tif (!$dbman->table_exists($table)) {\n\t\t$dbman->create_table($table);\n\t}\n \n \n if ($oldversion < 20170131000) {\n\n // Add \"sectiontype\" column to submissions table to mark the sectiontype.\n $table = new xmldb_table('course_format_sections');\n $field = new xmldb_field('sectiontype', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'timemodified');\n\n // Conditionally launch add field sectiontype.\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // Assign savepoint reached.\n upgrade_mod_savepoint(true, 20170131000, 'assign');\n }\n \n if ($oldversion < 20170131002) {\n // Define table course_format_instructions to be created.\n $table = new xmldb_table('course_format_instructions');\n\n // Adding fields to table course_format_instructions.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('title', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('message', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('attention', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('state', XMLDB_TYPE_CHAR, '20', null, null, null, null);\n $table->add_field('instructionfile', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('status', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1');\n $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n \n // Adding keys to table course_format_instructions.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Conditionally launch create table for course_format_instructions.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n }\n \n if ($oldversion < 20170131003) {\n // Define table course_format_notes to be created.\n $table = new xmldb_table('course_format_notes');\n\n // Adding fields to table course_format_notes.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('text', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('color', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('timestart', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('timeend', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('status', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1');\n $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n \n // Adding keys to table course_format_notes.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Conditionally launch create table for course_format_notes.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n }\n \n if ($oldversion < 20170131005) {\n \n // course_format_resource\n $table = new xmldb_table('course_format_resource');\n if ($dbman->table_exists($table)) {\n $dbman->drop_table($table, true, true);\n }\n \n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('title', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('resourcetext', XMLDB_TYPE_TEXT, '255', null, null, null, null);\n $table->add_field('filename', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('popuptext', XMLDB_TYPE_TEXT, '255', null, null, null, null);\n $table->add_field('states', XMLDB_TYPE_TEXT, '255', null, null, null, null);\n $table->add_field('resourcefile', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('status', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1');\n $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n\n // Adding keys to table course_format_resource.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n $dbman->create_table($table);\n \n \n \n // Course notes //\n // Define table course_format_notes to be created.\n $table = new xmldb_table('course_format_notes');\n if ($dbman->table_exists($table)) {\n $dbman->drop_table($table, true, true);\n }\n\n // Adding fields to table course_format_notes.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('notetext', XMLDB_TYPE_TEXT, null, null, null, null, null);\n $table->add_field('color', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n $table->add_field('timestart', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('timeend', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('status', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '1');\n $table->add_field('sortorder', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n \n // Adding keys to table course_format_notes.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Conditionally launch create table for course_format_notes.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n \n // Course format ussates //\n // Define table course_format_usstates to be created.\n $table = new xmldb_table('course_format_usstates');\n if ($dbman->table_exists($table)) {\n $dbman->drop_table($table, true, true);\n }\n\n // Adding fields to table course_format_usstates.\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('abbr', XMLDB_TYPE_CHAR, '5', null, null, null, null);\n $table->add_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null);\n\n // Adding keys to table course_format_usstates.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Conditionally launch create table for course_format_usstates.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n $usstates = array(\n array('id' => '2', 'abbr' => 'AL', 'name' => 'Alabama'),\n array('id' => '3', 'abbr' => 'AK', 'name' => 'Alaska'),\n array('id' => '4', 'abbr' => 'AZ', 'name' => 'Arizona'),\n array('id' => '5', 'abbr' => 'AR', 'name' => 'Arkansas'),\n array('id' => '6', 'abbr' => 'CA', 'name' => 'California'),\n array('id' => '7', 'abbr' => 'CO', 'name' => 'Colorado'),\n array('id' => '8', 'abbr' => 'CT', 'name' => 'Connecticut'),\n array('id' => '9', 'abbr' => 'DE', 'name' => 'Delaware'),\n array('id' => '10', 'abbr' => 'DC', 'name' => 'District of Columbia'),\n array('id' => '11', 'abbr' => 'FL', 'name' => 'Florida'),\n array('id' => '12', 'abbr' => 'GA', 'name' => 'Georgia'),\n array('id' => '13', 'abbr' => 'HI', 'name' => 'Hawaii'),\n array('id' => '14', 'abbr' => 'ID', 'name' => 'Idaho'),\n array('id' => '15', 'abbr' => 'IL', 'name' => 'Illinois'),\n array('id' => '16', 'abbr' => 'IN', 'name' => 'Indiana'),\n array('id' => '17', 'abbr' => 'IA', 'name' => 'Iowa'),\n array('id' => '18', 'abbr' => 'KS', 'name' => 'Kansas'),\n array('id' => '19', 'abbr' => 'KY', 'name' => 'Kentucky'),\n array('id' => '20', 'abbr' => 'LA', 'name' => 'Louisiana'),\n array('id' => '21', 'abbr' => 'ME', 'name' => 'Maine'),\n array('id' => '22', 'abbr' => 'MD', 'name' => 'Maryland'),\n array('id' => '23', 'abbr' => 'MA', 'name' => 'Massachusetts'),\n array('id' => '24', 'abbr' => 'MI', 'name' => 'Michigan'),\n array('id' => '25', 'abbr' => 'MN', 'name' => 'Minnesota'),\n array('id' => '26', 'abbr' => 'MS', 'name' => 'Mississippi'),\n array('id' => '27', 'abbr' => 'MO', 'name' => 'Missouri'),\n array('id' => '28', 'abbr' => 'MT', 'name' => 'Montana'),\n array('id' => '29', 'abbr' => 'NE', 'name' => 'Nebraska'),\n array('id' => '30', 'abbr' => 'NV', 'name' => 'Nevada'),\n array('id' => '31', 'abbr' => 'NH', 'name' => 'New Hampshire'),\n array('id' => '32', 'abbr' => 'NJ', 'name' => 'New Jersey'),\n array('id' => '33', 'abbr' => 'NM', 'name' => 'New Mexico'),\n array('id' => '34', 'abbr' => 'NY', 'name' => 'New York'),\n array('id' => '35', 'abbr' => 'NC', 'name' => 'North Carolina'),\n array('id' => '36', 'abbr' => 'ND', 'name' => 'North Dakota'),\n array('id' => '37', 'abbr' => 'OH', 'name' => 'Ohio'),\n array('id' => '38', 'abbr' => 'OK', 'name' => 'Oklahoma'),\n array('id' => '39', 'abbr' => 'OR', 'name' => 'Oregon'),\n array('id' => '40', 'abbr' => 'PA', 'name' => 'Pennsylvania'),\n array('id' => '41', 'abbr' => 'RI', 'name' => 'Rhode Island'),\n array('id' => '42', 'abbr' => 'SC', 'name' => 'South Carolina'),\n array('id' => '43', 'abbr' => 'SD', 'name' => 'South Dakota'),\n array('id' => '44', 'abbr' => 'TN', 'name' => 'Tennessee'),\n array('id' => '45', 'abbr' => 'TX', 'name' => 'Texas'),\n array('id' => '46', 'abbr' => 'UT', 'name' => 'Utah'),\n array('id' => '47', 'abbr' => 'VT', 'name' => 'Vermont'),\n array('id' => '48', 'abbr' => 'VA', 'name' => 'Virginia'),\n array('id' => '49', 'abbr' => 'WA', 'name' => 'Washington'),\n array('id' => '50', 'abbr' => 'WV', 'name' => 'West Virginia'),\n array('id' => '51', 'abbr' => 'WI', 'name' => 'Wisconsin'),\n array('id' => '52', 'abbr' => 'WY', 'name' => 'Wyoming')\n );\n\n foreach ($usstates as $state){\n $ins_state = (object)$state;\n if (!$DB->get_record('course_format_usstates', array('name'=>$ins_state->abbr))){\n $DB->insert_record('course_format_usstates', $ins_state, false);\n }\n }\n }\n \n\n return true;\n}", "function frmget_context() {\n\tglobal $CFG, $DB;\n //include this file for content /libdir/filelib.php\n return $systemcontext = context_system::instance();\t\n}", "function mnetadmin_rpc_restore_course($user, $shortname, $fullname, $idnumber, $catidnumber, $location, $jsonrequired = true) {\n global $CFG, $USER, $DB;\n\n debug_trace(\"VMOODLE : Starting Restore course\");\n debug_trace('RPC '.json_encode($user));\n\n if ($auth_response = invoke_local_user((array)$user)) {\n if ($jsonrequired) {\n return $auth_response;\n } else {\n return json_decode($auth_response);\n }\n }\n\n // Creating response.\n $response = new stdClass;\n $response->status = RPC_SUCCESS;\n\n // TODO :\n\n if (!file_exists($location)) {\n $response->status = RPC_FAILURE_DATA;\n $response->error = get_string('errornolocation', 'vmoodleadminset_courses');\n $response->errors[] = get_string('errornolocation', 'vmoodleadminset_courses');\n }\n\n if (!preg_match('/\\.mbz/', $location)) {\n $response->status = RPC_FAILURE_DATA;\n $response->error = get_string('errornotamoodlearchive', 'vmoodleadminset_courses');\n $response->errors[] = get_string('errornotamoodlearchive', 'vmoodleadminset_courses');\n }\n\n if (!$coursecat = $DB->get_record('course_categories', array('idnumber' => $catidnumber))) {\n $response->status = RPC_FAILURE_DATA;\n $response->error = get_string('errornocategory', 'vmoodleadminset_courses');\n $response->errors[] = get_string('errornocategory', 'vmoodleadminset_courses');\n }\n\n if ($DB->get_record('course', array('shortname' => $shortname))) {\n $response->status = RPC_FAILURE_DATA;\n $response->error = get_string('errorcoursealreadyexists', 'vmoodleadminset_courses');\n $response->errors[] = get_string('errorcoursealreadyexists', 'vmoodleadminset_courses');\n }\n\n if (!empty($idnumber) && $DB->get_record('course', array('idnumber' => $shortname))) {\n $response->status = RPC_FAILURE_DATA;\n $response->error = get_string('errorcourseidnumberexists', 'vmoodleadminset_courses');\n $response->errors[] = get_string('errorcourseidnumberexists', 'vmoodleadminset_courses');\n }\n\n $coursecatcontext = context_coursecat::instance($coursecat->id);\n if (!has_capability('moodle/course:create', $coursecatcontext)) {\n $response->status = RPC_FAILURE_CAPABILITY;\n $response->error = get_string('errornopermission', 'vmoodleadminset_courses');\n $response->errors[] = get_string('errornopermission', 'vmoodleadminset_courses');\n }\n\n if ($response->status != RPC_SUCCESS) {\n // Trap any previously detected errors.\n if ($jsonrequired) {\n return json_encode($response);\n } else {\n return $response;\n }\n }\n\n debug_trace('RPC Bind : Executing restore');\n try {\n $newcourseid = restore_automation::run_automated_restore(null, $location, $coursecat->id);\n\n if (!$newcourseid) {\n $response->status = RPC_FAILURE_RUN;\n $response->error = get_string('errorafterrestore', 'vmoodleadminset_courses');\n $response->errors[] = get_string('errorafterrestore', 'vmoodleadminset_courses');\n }\n } catch (Exception $e) {\n $response->status = RPC_FAILURE_RUN;\n $response->error = get_string('errorduringrestore', 'vmoodleadminset_courses', $e->getMessage());\n $response->errors[] = get_string('errorduringrestore', 'vmoodleadminset_courses', $e->getMessage());\n }\n\n debug_trace('RPC Bind : Sending response');\n\n // Returns response (success or failure).\n if ($jsonrequired) {\n return json_encode($response);\n } else {\n return $response;\n }\n}", "function xmldb_block_online_users_map_upgrade($oldversion) {\n\n global $CFG, $DB, $OUTPUT;\n\n\t$dbman = $DB->get_manager();\n\t\n if ($oldversion < 2007110101) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_centre_lat\";\n $setting->value = 17.383;\n $DB->insert_record(\"config\",$setting);\n \n $setting = new object();\n $setting->name = \"block_online_users_map_centre_lng\";\n $setting->value = 11.183;\n $DB->insert_record(\"config\",$setting);\n \n $setting = new object();\n $setting->name = \"block_online_users_map_init_zoom\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2008011400) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_debug\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n \n }\n \n if ($oldversion < 2008030600) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_show_offline\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n \n $setting = new object();\n $setting->name = \"block_online_users_map_show_offline_role\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2008052700) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_centre_user\";\n $setting->value = 0;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2008080700) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_update_limit\";\n $setting->value = 100;\n $DB->insert_record(\"config\",$setting);\n }\n \n\tif ($oldversion < 2010051900) { \n // add new config entries\n $setting = new object();\n $setting->name = \"block_online_users_map_has_names\";\n $setting->value = 1;\n $DB->insert_record(\"config\",$setting);\n }\n \n if ($oldversion < 2010122700) {\n $setting = new object();\n $setting->name = \"block_online_users_map_type\";\n $setting->value = 'osm';\n $DB->insert_record(\"config\",$setting);\n \n // block savepoint reached\n upgrade_block_savepoint(true, 2010122700, 'online_users_map');\n }\n \n return true;\n}", "function upgrade_blocks_db($continueto) {\n/// It's called from admin/index.php\n\n global $CFG, $db;\n\n require_once ($CFG->dirroot .'/blocks/version.php'); // Get code versions\n\n if (empty($CFG->blocks_version)) { // Blocks have never been installed.\n $strdatabaseupgrades = get_string('databaseupgrades');\n print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades,\n '', '', false, '&nbsp;', '&nbsp;');\n\n $db->debug=true;\n if (modify_database($CFG->dirroot .'/blocks/db/'. $CFG->dbtype .'.sql')) {\n $db->debug = false;\n if (set_config('blocks_version', $blocks_version)) {\n notify(get_string('databasesuccess'), 'green');\n notify(get_string('databaseupgradeblocks', '', $blocks_version));\n print_continue($continueto);\n exit;\n } else {\n error('Upgrade of blocks system failed! (Could not update version in config table)');\n }\n } else {\n error('Blocks tables could NOT be set up successfully!');\n }\n }\n\n\n if ($blocks_version > $CFG->blocks_version) { // Upgrade tables\n $strdatabaseupgrades = get_string('databaseupgrades');\n print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades);\n\n require_once ($CFG->dirroot .'/blocks/db/'. $CFG->dbtype .'.php');\n\n $db->debug=true;\n if (blocks_upgrade($CFG->blocks_version)) {\n $db->debug=false;\n if (set_config('blocks_version', $blocks_version)) {\n notify(get_string('databasesuccess'), 'green');\n notify(get_string('databaseupgradeblocks', '', $blocks_version));\n print_continue($continueto);\n exit;\n } else {\n error('Upgrade of blocks system failed! (Could not update version in config table)');\n }\n } else {\n $db->debug=false;\n error('Upgrade failed! See blocks/version.php');\n }\n\n } else if ($blocks_version < $CFG->blocks_version) {\n notify('WARNING!!! The code you are using is OLDER than the version that made these databases!');\n }\n}", "function xmldb_game_upgrade($oldversion) {\n\n global $CFG, $DB;\n\n $dbman = $DB->get_manager();\n\n if ($oldversion < 2007082802) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('questioncategoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0', 'glossarycategoryid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('quizid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'questionid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082802, 'game'); }\n\n if ($oldversion < 2007082803) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('glossaryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'quizid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('glossarycategoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'glossaryid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('questioncategoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'glossarycategoryid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082803, 'game');\n }\n\n if ($oldversion < 2007082804) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('questioncategoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'quizid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082804, 'game');\n }\n\n if ($oldversion < 2007082805) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('try', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'answer');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('maxtries', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'try');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082805, 'game');\n\t}\n\n if ($oldversion < 2007082807) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('finishedword', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'maxtries');\n\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('corrects', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'finishedword');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082807, 'game');\n\t}\n\n if ($oldversion < 2007082808) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('param7', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'param6');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082808, 'game');\n\t}\n\n\n if ($oldversion < 2007082809) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('letters', XMLDB_TYPE_CHAR, '30');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082809, 'game');\n }\n\n if ($oldversion < 2007082901) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('glossaryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'quizid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082901, 'game');\n }\n\n if ($oldversion < 2007083002) {\n $table = new xmldb_table('game_instances');\n $field = new xmldb_field('lastip', XMLDB_TYPE_CHAR, '30', null, null, '', 'grade');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007082901, 'game');\n }\n\t\n if ($oldversion < 2007091001) {\n $table = new xmldb_table('game_bookquiz_questions');\n $field = new xmldb_field('questioncategoryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007091001, 'game');\n\t}\n\t\n if ($oldversion < 2007091701) {\n $table = new xmldb_table( 'game_bookquiz_chapters');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('gameinstanceid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('chapterid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n \n $table->add_key('PRIMARY', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('gameinstanceidchapterid', XMLDB_KEY_NOTUNIQUE, array('gameinstanceid', 'chapterid'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2007091701, 'game');\n\t}\n\n if ($oldversion < 2007092207) {\n $table = new xmldb_table( 'game_snakes_database');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('name', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, '');\n $table->add_field('cols', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('rows', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('data', XMLDB_TYPE_TEXT, '0', null, XMLDB_NOTNULL, null, '');\n $table->add_field('file', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, '');\n $table->add_field('direction', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('headerx', XMLDB_TYPE_INTEGER, '5', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('headery', XMLDB_TYPE_INTEGER, '5', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('footerx', XMLDB_TYPE_INTEGER, '5', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('footery', XMLDB_TYPE_INTEGER, '5', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n $table->add_key('PRIMARY', XMLDB_KEY_PRIMARY, array('id'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2007092207, 'game');\n\t}\n\t\n if ($oldversion < 2007092208) {\n $table = new xmldb_table( 'game_snakes');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('snakesdatabaseid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('position', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n $table->add_key('PRIMARY', XMLDB_KEY_PRIMARY, array('id'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2007092208, 'game');\n\t}\n\t\n if ($oldversion < 2007092301) {\n $table = new xmldb_table('game_snakes_database');\n $field = new xmldb_field('width', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007092301, 'game');\n }\n\n if ($oldversion < 2007092302) {\n $table = new xmldb_table('game_snakes_database');\n $field = new xmldb_field('height', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007092302, 'game');\n }\n\n if ($oldversion < 2007092306) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('sourcemodule', XMLDB_TYPE_CHAR, '20', null, null, null, '');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007092306, 'game');\n }\n\t\n if ($oldversion < 2007092307) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('questionid', XMLDB_TYPE_INTEGER, '10');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007092307, 'game');\n }\n\n if ($oldversion < 2007092308) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('glossaryentryid', XMLDB_TYPE_INTEGER, '10');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007092308, 'game');\n }\n\n if ($oldversion < 2007092309) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('dice', XMLDB_TYPE_INTEGER, '1');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007092309, 'game');\n }\n\n if ($oldversion < 2007100601) {\n $table = new xmldb_table('game_instances');\n $field = new xmldb_field('lastremotehost', XMLDB_TYPE_CHAR, '50', null, null, null, '');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007100601, 'game');\n }\n\n if ($oldversion < 2007100605) {\n $table = new xmldb_table('game_questions');\n $field = new xmldb_field('timelastattempt', XMLDB_TYPE_INTEGER, '10');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007100605, 'game');\n }\n\t\n if ($oldversion < 2007101301) {\n $table = new xmldb_table('game_instances');\n $field = new xmldb_field('tries', XMLDB_TYPE_INTEGER, '10');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007101301, 'game');\n }\n\t\n if ($oldversion < 2007110801) {\n $table = new xmldb_table('game_bookquiz_questions');\n $field = new xmldb_field('bookid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110801, 'game');\n }\n\t\n\n if ($oldversion < 2007110802) {\n $table = new xmldb_table( 'game_grades');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('gameid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('score', XMLDB_TYPE_FLOAT, null, null, XMLDB_NOTNULL, null, '0');\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('userid', XMLDB_KEY_NOTUNIQUE, array('userid'));\n $table->add_key('gameid', XMLDB_KEY_NOTUNIQUE, array('gameid'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n } \n upgrade_mod_savepoint(true, 2007110802, 'game');\n\t}\n\t\n if ($oldversion < 2007110811) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('sourcemodule');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110811, 'game');\n }\t\n\t\n if ($oldversion < 2007110812) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('questionsid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110812, 'game');\n }\t\n\t\n if ($oldversion < 2007110813) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('quizid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110813, 'game');\n }\t\n\t\n if ($oldversion < 2007110814) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('glossaryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110814, 'game');\n }\t\n\t\n if ($oldversion < 2007110815) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('glossarycategoryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110815, 'game');\n }\t\n\t\n if ($oldversion < 2007110816) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('glossaryentryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110816, 'game');\n }\t\n\n if ($oldversion < 2007110818) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('question');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110818, 'game');\n }\t\n\t\n if ($oldversion < 2007110819) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('answer');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110819, 'game');\n }\t\n\t\n if ($oldversion < 2007110820) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('sourcemodule');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110820, 'game');\n }\t\n\t\n if ($oldversion < 2007110821) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('quizid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110821, 'game');\n }\t\n\t\n if ($oldversion < 2007110822) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('questionid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110822, 'game');\n }\t\n\t\n if ($oldversion < 2007110823) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('queryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'id');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110823, 'game');\n }\t\n\t\n if ($oldversion < 2007110824) {\n $table = new xmldb_table('game_bookquiz');\n $field = new xmldb_field('bookid');\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110824, 'game');\n }\n\n if ($oldversion < 2007110825) {\n $table = new xmldb_table('game_sudoku');\n $field = new xmldb_field('sourcemodule');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110825, 'game');\n }\n\n if ($oldversion < 2007110826) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('queryid', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0', 'id');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110826, 'game');\n }\t\n\n if ($oldversion < 2007110827) {\n $table = new xmldb_table('game_sudoku');\n $field = new xmldb_field('quizid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110825, 'game');\n }\n\n if ($oldversion < 2007110828) {\n $table = new xmldb_table('game_sudoku');\n $field = new xmldb_field('glossaryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110828, 'game');\n }\n\n if ($oldversion < 2007110829) {\n $table = new xmldb_table('game_sudoku');\n $field = new xmldb_field('glossarycategoryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110829, 'game');\n }\n\n if ($oldversion < 2007110830) {\n $table = new xmldb_table('game_sudoku_questions');\n\n if ($dbman->table_exists($table)) {\n $dbman->drop_table($table);\n }\n upgrade_mod_savepoint(true, 2007110830, 'game');\n }\n\t\n if ($oldversion < 2007110832) {\n $table = new xmldb_table('game_cross');\n $field = new xmldb_field('sourcemodule');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110832, 'game');\n }\n\t\n if ($oldversion < 2007110833) {\n $table = new xmldb_table('game_cross');\n $field = new xmldb_field('createscore', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'wordsall');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110826, 'game');\n }\t\n\n if ($oldversion < 2007110834) {\n $table = new xmldb_table( 'game_bookquiz');\n\t\t$field = new xmldb_field( 'attemptid', XMLDB_TYPE_FLOAT, null, null, null, null, '0');\n\n $dbman->rename_field($table, $field, 'score');\n\n upgrade_mod_savepoint(true, 2009042200, 'game');\n }\n\n if ($oldversion < 2007110835) {\n $table = new xmldb_table('game_cross');\n $field = new xmldb_field('tries');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110835, 'game');\n }\n\n if ($oldversion < 2007110836) {\n $table = new xmldb_table( 'game_cross');\n\t\t$field = new xmldb_field( 'timelimit', XMLDB_TYPE_FLOAT, null, null, null, null, '0');\n\n $dbman->rename_field($table, $field, 'createtimelimit');\n upgrade_mod_savepoint(true, 2007110836, 'game');\n }\n\t\n if ($oldversion < 2007110837) {\n $table = new xmldb_table('game_cross');\n $field = new xmldb_field('createconnectors', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110837, 'game');\n }\t\t\n\t\n if ($oldversion < 2007110838) {\n $table = new xmldb_table('game_cross');\n $field = new xmldb_field('createfilleds', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110838, 'game');\n }\t\t\n\n if ($oldversion < 2007110839) {\n $table = new xmldb_table('game_cross');\n $field = new xmldb_field('createspaces', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110839, 'game');\n }\t\t\n\t\n if ($oldversion < 2007110840) {\n $table = new xmldb_table('game_cross_questions');\n\n if ($dbman->table_exists($table)) {\n $dbman->drop_table($table);\n }\n upgrade_mod_savepoint(true, 2007110840, 'game');\n\n }\t\n\n if ($oldversion < 2007110841) {\n $table = new xmldb_table( 'game_questions');\n $dbman->rename_table( $table, 'game_queries');\n\n upgrade_mod_savepoint(true, 2007110841, 'game');\n }\n\n if ($oldversion < 2007110853) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('sourcemodule');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110853, 'game');\n }\t\n\t\n if ($oldversion < 2007110854) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('questionid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110854, 'game');\n }\t\n\t\n if ($oldversion < 2007110855) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('glossaryentryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110855, 'game');\n }\n\n if ($oldversion < 2007110856) {\n $table = new xmldb_table( 'game_instances');\n $dbman->rename_table( $table, 'game_attempts');\n\n upgrade_mod_savepoint(true, 2007110856, 'game');\n }\n\n if ($oldversion < 2007110857) {\n $table = new xmldb_table('game_attempts');\n $field = new xmldb_field('gamekind');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110857, 'game');\n }\t\n\n if ($oldversion < 2007110858) {\n $table = new xmldb_table('game_attempts');\n $field = new xmldb_field( 'finished');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110858, 'game');\n }\t\n\t\n if ($oldversion < 2007110859) {\n $table = new xmldb_table( 'game_attempts');\n\t\t$field = new xmldb_field( 'timestarted', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n\n $dbman->rename_field($table, $field, 'timestart');\n upgrade_mod_savepoint(true, 2007110859, 'game');\n }\n\n if ($oldversion < 2007110860) {\n $table = new xmldb_table( 'game_attempts');\n\t\t$field = new xmldb_field( 'timefinished', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n\t\t\n $dbman->rename_field( $table, $field, 'timefinish');\n upgrade_mod_savepoint(true, 2007110860, 'game');\n }\t\t\n\t\n if ($oldversion < 2007110861) {\n $table = new xmldb_table('game_attempts');\n $field = new xmldb_field('grade');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007110861, 'game');\n }\t\t\n\t\n if ($oldversion < 2007110862) {\n $table = new xmldb_table( 'game_attempts');\n\t\t$field = new xmldb_field( 'tries', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n\t\t\n $dbman->rename_field( $table, $field, 'attempts');\n upgrade_mod_savepoint(true, 2007110862, 'game');\n }\t\t\n\t\n if ($oldversion < 2007110863) {\n $table = new xmldb_table( 'game_attempts');\n\t\t$field = new xmldb_field( 'preview', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '0', 'lastremotehost');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110863, 'game');\n }\t\t\n\t\n if ($oldversion < 2007110864) {\n $table = new xmldb_table( 'game_attempts');\n\t\t$field = new xmldb_field( 'attempt', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'preview');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110864, 'game');\n }\t\t\n\t\n if ($oldversion < 2007110865) {\n $table = new xmldb_table( 'game_attempts');\n\t\t$field = new xmldb_field( 'score', XMLDB_TYPE_FLOAT, null, XMLDB_UNSIGNED, null, null, '0', 'attempt');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110865, 'game');\n }\t\t\n\n\n if ($oldversion < 2007110866) {\n $table = new xmldb_table( 'game_course_input');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('name', XMLDB_TYPE_CHAR, '100', null, XMLDB_NOTNULL, null, '');\n $table->add_field('course', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('sourcemodule', XMLDB_TYPE_CHAR, '20', null, XMLDB_NOTNULL, null, '');\n $table->add_field('ids', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, '');\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n } \n upgrade_mod_savepoint(true, 2007110866, 'game');\n\t}\n\n if ($oldversion < 2007111302) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('gameinputid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'bookid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007110865, 'game');\n }\n\n if ($oldversion < 2007111303) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('bottomtext', XMLDB_TYPE_TEXT);\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111303, 'game');\n }\n\n if ($oldversion < 2007111304) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('grademethod', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111304, 'game');\n }\n\n if ($oldversion < 2007111305) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('grade', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'bottomtext');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111305, 'game');\n }\n\n if ($oldversion < 2007111306) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('decimalpoints', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111306, 'game');\n }\n\n if ($oldversion < 2007111307) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('popup', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111307, 'game');\n }\n\n if ($oldversion < 2007111308) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('review', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111307, 'game');\n }\n\t\n if ($oldversion < 2007111309) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('attempts', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111309, 'game');\n }\n\t\n if ($oldversion < 2007111310) {\n\t\t$DB->execute('UPDATE {game} SET grade=0 WHERE grade IS NULL', true);\n\n upgrade_mod_savepoint(true, 2007111310, 'game');\n\t}\n\t\n if ($oldversion < 2007111842) {\n $table = new xmldb_table( 'game_queries');\n\t\t$field = new xmldb_field( 'gameinstanceid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n\t\t\n $dbman->rename_field( $table, $field, 'attemptid');\n\n upgrade_mod_savepoint(true, 2007111842, 'game');\n }\t\t\n\n if ($oldversion < 2007111843) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('grade');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2007111843, 'game');\n }\n\n if ($oldversion < 2007111303) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('bottomtext', XMLDB_TYPE_TEXT);\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111303, 'game');\n }\n\n if ($oldversion < 2007111844) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('questiontext', XMLDB_TYPE_TEXT, null, null, null, null, '','glossaryentryid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111844, 'game');\n }\n\n if ($oldversion < 2007111845) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('score', XMLDB_TYPE_FLOAT, null, null, null, null, '0','questiontext');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111845, 'game');\n }\n\t\n if ($oldversion < 2007111846) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('studentanswer', XMLDB_TYPE_TEXT, null, null, null, null, '','glossaryentryid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111846, 'game');\n }\t\n\n if ($oldversion < 2007111847) {\n $table = new xmldb_table( 'game_queries');\n\t\t$field = new xmldb_field( 'col', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111847, 'game');\n }\t\t\n\n if ($oldversion < 2007111848) {\n $table = new xmldb_table( 'game_queries');\n\t\t$field = new xmldb_field( 'row', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111848, 'game');\n }\t\t\n\t\n if ($oldversion < 2007111849) {\n $table = new xmldb_table( 'game_queries');\n\t\t$field = new xmldb_field( 'horizontal', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111849, 'game');\n }\t\t\n\n if ($oldversion < 2007111850) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('answertext', XMLDB_TYPE_TEXT);\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111850, 'game');\n }\t\n\n if ($oldversion < 2007111851) {\n $table = new xmldb_table( 'game_queries');\n\t\t$field = new xmldb_field( 'correct', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111851, 'game');\n }\t\t\n\t\n if ($oldversion < 2007111853) {\n\t\texecute_sql('UPDATE {game} SET grademethod=1 WHERE grademethod=0 OR grademethod IS NULL', true);\n\n upgrade_mod_savepoint(true, 2007111853, 'game');\n\t}\n\n if ($oldversion < 2007111854) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('queryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'id');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111854, 'game');\n }\t\n\n if ($oldversion < 2007111855) {\n $table = new xmldb_table('game_snakes');\n $field = new xmldb_field('queryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'snakesdatabaseid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111855, 'game');\n }\t\n\n if ($oldversion < 2007111856) {\n $table = new xmldb_table( 'game_bookquiz_chapters');\n\t\t$field = new xmldb_field( 'attemptid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0', 'id');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007111856, 'game');\n }\n\n if ($oldversion < 2007120103) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('letters', XMLDB_TYPE_CHAR, '100');\n\n $dbman->change_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2007120103, 'game');\n }\n\n if ($oldversion < 2007120104) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('allletters', XMLDB_TYPE_CHAR, '100');\n\n $dbman->change_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2007120104, 'game');\n }\n\n if ($oldversion < 2007120106) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('attachment', XMLDB_TYPE_CHAR, '100');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2007120106, 'game');\n }\n \n //2008\n \n if ($oldversion < 2008011301) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('glossaryid2', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008011301, 'game');\n }\n \n if ($oldversion < 2008011302) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('glossarycategoryid2', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008011302, 'game');\n } \n \n if ($oldversion < 2008011308) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('attachment', XMLDB_TYPE_CHAR, '200', null, null, null, '');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008011308, 'game');\n } \n \n if ($oldversion < 2008011504) {\n $table = new xmldb_table( 'game_hiddenpicture');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('correct', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('wrong', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('found', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2008011504, 'game');\n\t}\n\t\n if ($oldversion < 2008012701) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('param8', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, '0', 'param7');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008012701, 'game');\n\t}\n\t\n if ($oldversion < 2008071101) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('language', XMLDB_TYPE_CHAR, '10', null, null, null, '');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008071101, 'game');\n }\n\n if ($oldversion < 2008072204) {\n $table = new xmldb_table( 'game_export_javame');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('gameid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('filename', XMLDB_TYPE_CHAR, '20');\n $table->add_field('icon', XMLDB_TYPE_CHAR, '100');\n $table->add_field('createdby', XMLDB_TYPE_CHAR, '50');\n $table->add_field('vendor', XMLDB_TYPE_CHAR, '50');\n $table->add_field('name', XMLDB_TYPE_CHAR, '20');\n $table->add_field('description', XMLDB_TYPE_CHAR, '100');\n $table->add_field('version', XMLDB_TYPE_CHAR, '10');\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('gameid', XMLDB_KEY_UNIQUE, array('gameid')); \n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2008072204, 'game');\n\t} \n\t\n if ($oldversion < 2008072501) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('quizid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2008072501, 'game');\n }\n\n if ($oldversion < 2008072502) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('glossaryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2008072502, 'game');\n }\n \n if ($oldversion < 2008072503) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('questioncategoryid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2008072503, 'game');\n }\n\n if ($oldversion < 2008072504) {\n $table = new xmldb_table('game_hangman');\n $field = new xmldb_field('gameinputid');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2008072504, 'game');\n }\n \n if ($oldversion < 2008090101) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('subcategories', XMLDB_TYPE_INTEGER, '1');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008090101, 'game');\n\t}\n \n if ($oldversion < 2008101103) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('state', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '0');\n\n $dbman->change_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2008101103, 'game');\n\t}\n\t\n if ($oldversion < 2008101104) {\n $table = new xmldb_table('game_millionaire');\n $field = new xmldb_field('level', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '0');\n\n $dbman->change_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2008101104, 'game');\n\t}\n\n if ($oldversion < 2008101106) {\n $table = new xmldb_table('game_sudoku');\n $field = new xmldb_field('level', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0');\n\n $dbman->cchange_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2008101106, 'game');\n\t}\n\t\n if ($oldversion < 2008101107) {\n $table = new xmldb_table('game_hiddenpicture');\n $field = new xmldb_field('correct', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0');\n\n $dbman->change_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2008101107, 'game');\n\t}\t\t\n\t\n if ($oldversion < 2008101108) {\n $table = new xmldb_table('game_hiddenpicture');\n $field = new xmldb_field('wrong', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0');\n\n $dbman->change_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2008101108, 'game');\n\t}\t\n\t\n if ($oldversion < 2008101109) {\n $table = new xmldb_table('game_hiddenpicture');\n $field = new xmldb_field('found', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, null, null, '0');\n\n $dbman->change_field_precision($table, $field);\n upgrade_mod_savepoint(true, 2008101109, 'game');\n\t}\t\n\t\n if ($oldversion < 2008102701) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('answerid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008102701, 'game');\n\t}\n\t\n if ($oldversion < 2008110701) {\n $table = new xmldb_table( 'game_export_html');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('gameid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('filename', XMLDB_TYPE_CHAR, '30');\n $table->add_field('title', XMLDB_TYPE_CHAR, '200');\n $table->add_field('checkbutton', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL);\n $table->add_field('printbutton', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL);\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); \n $table->add_key('gameid', XMLDB_INDEX_UNIQUE, array('gameid')); \n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2008110701, 'game');\n\t} \n\n if ($oldversion < 2008111701) {\n $table = new xmldb_table( 'game_snakes_database');\n\t\t$field = new xmldb_field( 'file', XMLDB_TYPE_CHAR, 100, null, null, null, '');\n\t\t\n $dbman->rename_field( $table, $field, 'fileboard');\n upgrade_mod_savepoint(true, 2008111701, 'game');\n }\n\n if ($oldversion < 2008111801) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('bottomtext', XMLDB_TYPE_TEXT);\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2008111801, 'game');\n }\n\n //2009\n\n if ($oldversion < 2009010502) {\n $table = new xmldb_table('game_export_javame');\n $field = new xmldb_field('maxpicturewidth', XMLDB_TYPE_INTEGER, '7');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2009010502, 'game');\n\t}\n\t\n if ($oldversion < 2009031801) {\n $table = new xmldb_table('game_repetitions');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE);\n $table->add_field('gameid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('questionid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('glossaryentryid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n $table->add_field('repetitions', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('main', XMLDB_KEY_UNIQUE, array('gameid,userid,questionid,glossaryentryid')); \n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2009031801, 'game');\n\t}\n\n if ($oldversion < 2009071403) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('shuffle', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '1', 'param8');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2009010502, 'game');\n\t}\n\n if ($oldversion < 2009072801) {\n $table = new xmldb_table('game_export_html');\n $field = new xmldb_field('inputsize', XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED);\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2009072801, 'game');\n\t}\n \n if ($oldversion < 2009072901) {\n $table = new xmldb_table('game_export_html');\n $field = new xmldb_field('maxpicturewidth', XMLDB_TYPE_INTEGER, '7');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2009072901, 'game');\n\t}\n\n if ($oldversion < 2009073101) {\n $table = new xmldb_table('game_export_html');\n $field = new xmldb_field('maxpictureheight', XMLDB_TYPE_INTEGER, '7');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2009072901, 'game');\n\t}\n\n if ($oldversion < 2009073102) {\n $table = new xmldb_table('game_export_javame');\n $field = new xmldb_field('maxpictureheight', XMLDB_TYPE_INTEGER, '7');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2009073102, 'game');\n\t}\n\n if ($oldversion < 2009083102) {\n $table = new xmldb_table('game');\n $field = new xmldb_field('toptext', XMLDB_TYPE_TEXT, null, null, null, null, null, 'gameinputid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2009073102, 'game');\n }\n\t\n if ($oldversion < 2010031101) {\n $table = new xmldb_table('game_queries');\n $field = new xmldb_field('tries', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, null, null, '0', 'answerid');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2010031101, 'game');\n }\n\n if ($oldversion < 2010071606) {\n $table = new xmldb_table('game_export_html');\n $field = new xmldb_field('id');\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n upgrade_mod_savepoint(true, 2010071606, 'game');\n }\n\t\n if ($oldversion < 2010071607) {\n $table = new xmldb_table( 'game_export_html');\n\t\t$field = new xmldb_field( 'gameid', XMLDB_TYPE_INTEGER, 10, null, null, null, null, null, '0');\n\t\t\n $dbman->rename_field($table, $field, 'id');\n\n upgrade_mod_savepoint(true, 2010071607, 'game');\n }\n\n if ($oldversion < 2010071608) {\n $table = new xmldb_table('game_export_html');\n $field = new xmldb_field('type', XMLDB_TYPE_CHAR, '10');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2010071608, 'game');\n\t}\n\n if ($oldversion < 2010071609) {\n $table = new xmldb_table('game_export_javame');\n $field = new xmldb_field('id');\n\n if ($dbman->field_exists($table, $field)) {\n $dbman->drop_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2010071609, 'game');\n }\n\t\n if ($oldversion < 2010071610) {\n $table = new xmldb_table( 'game_export_javame');\n\t\t$field = new xmldb_field( 'gameid', XMLDB_TYPE_INTEGER, 10, null, null, null, null, null, '0');\n\n $dbman->rename_field($table, $field, 'id');\n\n upgrade_mod_savepoint(true, 2010071610, 'game');\n }\n\n if ($oldversion < 2010071611) {\n $table = new xmldb_table('game_export_javame');\n $field = new xmldb_field('type', XMLDB_TYPE_CHAR, '10');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2010071611, 'game');\n\t}\n\n if ($oldversion < 2010072605) {\n\n // Define field language to be added to game_attempts\n $table = new xmldb_table('game_attempts');\n $field = new xmldb_field('language', XMLDB_TYPE_CHAR, '10', null, null, null, null, 'attempts');\n\n // Conditionally launch add field language\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // game savepoint reached\n upgrade_mod_savepoint(true, 2010072605, 'game');\n }\n\n if ($oldversion < 2010090301) {\n\n // Define field param9 to be added to game\n $table = new xmldb_table('game');\n $field = new xmldb_field('param9', XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'param8');\n\n // Conditionally launch add field param9\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // game savepoint reached\n upgrade_mod_savepoint(true, 2010090301, 'game');\n }\n\n\n \n return true;\n}", "public function get_settings(MoodleQuickForm $mform) {\r\n global $DB, $COURSE, $CFG;\r\n //ref the checkpoint form\r\n //require_once('checkpoint_form.php');\r\n\r\n $firstset = true;\r\n\r\n //$assignmentid = $this->assignment->get_instance()->id;\r\n //echo var_dump();\r\n $defaultproglang = get_config('assignsubmission_codehandin', 'defaultproglang');\r\n $mustattemptcompile = get_config('assignsubmission_codehandin', 'mustattemptcompile');\r\n\r\n // get default\r\n// set the programming language\r\n $languages = $DB->get_records_select_menu('codehandin_proglang', null, null, 'id', 'id, name');\r\n $mform->addElement('select', 'assignsubmission_codehandin_proglang', get_string('proglang', 'assignsubmission_codehandin'), $languages);\r\n $mform->addHelpButton('assignsubmission_codehandin_proglang', 'assignsubmission_codehandin_proglang', 'assignsubmission_codehandin');\r\n $mform->setDefault('assignsubmission_codehandin_proglang', $defaultproglang);\r\n $mform->disabledIf('assignsubmission_codehandin_proglang', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n// select if submissions must have been attemptedly compiled\r\n $mform->addElement('checkbox', 'assignsubmission_codehandin_mustattemptcompile', get_string('mustattemptcompile', 'assignsubmission_codehandin'));\r\n $mform->addHelpButton('assignsubmission_codehandin_mustattemptcompile', 'assignsubmission_codehandin_mustattemptcompile', 'assignsubmission_codehandin');\r\n $mform->setDefault('assignsubmission_codehandin_mustattemptcompile', $mustattemptcompile);\r\n $mform->disabledIf('assignsubmission_codehandin_mustattemptcompile', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n\r\n// // add checkpoint ... not enabled yet \r\n// $edittemplateurl = new moodle_url('/mod/assign/submission/codehandin_submission/addcp.php', array('courseid' => $COURSE->id));\r\n// $edittemplatelink = html_writer::link($edittemplateurl, get_string('addcp', 'assignsubmission_codehandin'),\r\n// array('target' => '_blank'));\r\n// $mform->addElement('static', 'assignsubmission_codehandin_addcp', '', $edittemplatelink);\r\n// // show individual descriptions ... not enabled at the mo\r\n// $mform->addElement('checkbox', 'showcpdescription', get_string('showcpdescription'));\r\n// $mform->addHelpButton('showcpdescription', 'showcpdescription');\r\n\r\n\r\n $mform->addElement('text', 'assignsubmission_codehandin_cpname', get_string('cpname', 'assignsubmission_codehandin'), array('size' => '64'));\r\n//$mform->addHelpButton('cpname', 'cpname', 'assignsubmission_codehandin');\r\n if (!empty($CFG->formatstringstriptags)) {\r\n $mform->setType('assignsubmission_codehandin_cpname', PARAM_TEXT);\r\n } else {\r\n $mform->setType('assignsubmission_codehandin_cpname', PARAM_CLEANHTML);\r\n }\r\n $mform->addRule('assignsubmission_codehandin_cpname', null, 'required', null, 'client');\r\n $mform->addRule('assignsubmission_codehandin_cpname', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');\r\n $mform->disabledIf('assignsubmission_codehandin_cpname', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n//checkpoint ordering value or quasi checkpoint id ... may change to hidden later and handle by dynamic order\r\n $mform->addElement('text', 'assignsubmission_codehandin_cpordering', get_string('cpordering', 'assignsubmission_codehandin'));\r\n $mform->addHelpButton('assignsubmission_codehandin_cpordering', 'cpordering', 'assignsubmission_codehandin');\r\n $mform->setType('assignsubmission_codehandin_cpordering', PARAM_INT);\r\n $mform->setDefault('assignsubmission_codehandin_cpordering', 1);\r\n $mform->addRule('assignsubmission_codehandin_cpordering', null, 'required', null, 'client');\r\n $mform->disabledIf('assignsubmission_codehandin_cpordering', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n //checkpoint description\r\n $label = get_string('cpdescription', 'assignsubmission_codehandin');\r\n $mform->addElement('textarea', 'assignsubmission_codehandin_cpdescription', get_string('cpdecription', 'assignsubmission_codehandin'));\r\n ;\r\n //$mform->addHelpButton('cpdescription', 'cpdescription', 'assignsubmission_codehandin');\r\n $mform->setType('assignsubmission_codehandin_cpdescription', PARAM_RAW); // no XSS prevention here, users must be trusted\r\n $mform->addRule('assignsubmission_codehandin_cpdescription', get_string('required'), 'required', null, 'client');\r\n $mform->disabledIf('assignsubmission_codehandin_cpdescription', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n //checkpoint run time args\r\n $mform->addElement('text', 'assignsubmission_codehandin_cpruntimeargs', get_string('cpruntimeargs', 'assignsubmission_codehandin'), array('size' => '64'));\r\n $mform->addHelpButton('assignsubmission_codehandin_cpruntimeargs', 'assignsubmission_codehandin_cpruntimeargs', 'assignsubmission_codehandin');\r\n $mform->setType('assignsubmission_codehandin_cpruntimeargs', PARAM_TEXT); // text only do not want to display anything\r\n $mform->disabledIf('assignsubmission_codehandin_cpruntimeargs', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n // add a task\r\n\r\n $mform->addElement('selectyesno', 'assignsubmission_codehandin_testassessment', get_string('testassessment', 'assignsubmission_codehandin'));\r\n $mform->addHelpButton('assignsubmission_codehandin_testassessment', 'assignsubmission_codehandin_testassessment', 'assignsubmission_codehandin');\r\n $mform->setDefault('assignsubmission_codehandin_testassessment', 1);\r\n $mform->disabledIf('assignsubmission_codehandin_testassessment', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n $mform->addElement('textarea', 'assignsubmission_codehandin_testdescription', get_string('taskdecription', 'assignsubmission_codehandin'));\r\n //$mform->addHelpButton('taskdescription', 'taskdescription', 'assignsubmission_codehandin'); \r\n $mform->setType('assignsubmission_codehandin_testdescription', PARAM_TEXT);\r\n $mform->disabledIf('assignsubmission_codehandin_testdescription', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n// $mform->addElement('text', 'taskruntimeargs', get_string('taskruntimeargs', 'assignsubmission_codehandin'), array('size' => '64'));\r\n// $mform->addHelpButton('taskruntimeargs', 'taskruntimeargs', 'assignsubmission_codehandin');\r\n// $mform->setType('taskruntimeargs', PARAM_TEXT);\r\n// $mform->disabledIf('taskruntimeargs', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n $mform->addElement('text', 'assignsubmission_codehandin_testretval', get_string('testretval', 'assignsubmission_codehandin'));\r\n $mform->addHelpButton('assignsubmission_codehandin_testretval', 'testretval', 'assignsubmission_codehandin');\r\n $mform->setType('assignsubmission_codehandin_testretval', PARAM_INT);\r\n $mform->disabledIf('assignsubmission_codehandin_testretval', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n //prepre some file managers ... piggy back on the mform rather than data\r\n //$fileoptions = $this->get_file_options();\r\n //echo var_dump();\r\n //echo \"bbbbbbbsfsds \".$assignmentid = $this->assignment->get_instance()->id; \r\n //echo \"bdbff \".var_dump($this);\r\n // returns mform + an extra field\r\n //$mydata = new stdClass();\r\n\r\n $maxbytes = $COURSE->maxbytes;\r\n $mform->addElement('filemanager', 'assignsubmission_codehandin_testinput', get_string('testinput', 'assignsubmission_codehandin'), null, array('subdirs' => 0, 'maxbytes' => $maxbytes,\r\n 'maxfiles' => 1, 'accepted_types' => '*'));\r\n //$mform->addElement('filepicker', 'taskinput_filemanager', get_string('taskinput', 'assignsubmission_codehandin'), null, array('subdirs' => 0, 'maxbytes' => $maxbytes, 'maxfiles' => 1, 'accepted_types' => '*'));\r\n $mform->addHelpButton('assignsubmission_codehandin_testinput', 'assignsubmission_codehandin_testinput', 'assignsubmission_codehandin');\r\n $mform->addRule('assignsubmission_codehandin_testinput', get_string('required'), 'required', null, 'client');\r\n $mform->disabledIf('assignsubmission_codehandin_testinput', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n $mform->addElement('filemanager', 'assignsubmission_codehandin_testoutput', get_string('testoutput', 'assignsubmission_codehandin'), null, array('subdirs' => 0, 'maxbytes' => $maxbytes, 'maxfiles' => 1, 'accepted_types' => '*'));\r\n //$mform->addElement('filepicker', 'taskoutput_filemanager', get_string('taskoutput', 'assignsubmission_codehandin'), null, array('subdirs' => 0, 'maxbytes' => $maxbytes, 'maxfiles' => 1, 'accepted_types' => '*'));\r\n $mform->addHelpButton('assignsubmission_codehandin_testoutput', 'assignsubmission_codehandin_testoutput', 'assignsubmission_codehandin');\r\n $mform->addRule('assignsubmission_codehandin_testoutput', get_string('required'), 'required', null, 'client');\r\n $mform->disabledIf('assignsubmission_codehandin_testoutput', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n\r\n $mform->addElement('filemanager', 'assignsubmission_codehandin_teststderr', get_string('teststderr', 'assignsubmission_codehandin'), null, array('subdirs' => 0, 'maxbytes' => $maxbytes, 'maxfiles' => 1, 'accepted_types' => '*'));\r\n //$mform->addElement('filepicker', 'taskstderr_filemanager', get_string('taskstderr', 'assignsubmission_codehandin'), null, array('subdirs' => 0, 'maxbytes' => $maxbytes, 'maxfiles' => 1, 'accepted_types' => '*'));\r\n $mform->addHelpButton('assignsubmission_codehandin_teststderr', 'assignsubmission_codehandin_teststderr', 'assignsubmission_codehandin');\r\n $mform->disabledIf('assignsubmission_codehandin_teststderr', 'assignsubmission_codehandin_enabled', 'notchecked');\r\n }", "public function longHelp()\n {\n return <<<LONGHELP\n\n __ __ _____ _\n | \\/ | __ _ __ _ ___| ___| | _____ __\n | |\\/| |/ _` |/ _` |/ _ \\ |_ | |/ _ \\ \\ /\\ / /\n | | | | (_| | (_| | __/ _| | | (_) \\ V V /\n |_| |_|\\__,_|\\__, |\\___|_| |_|\\___/ \\_/\\_/\n __ __ |___/_\n | \\/ | ___ __| (_) __ _\n | |\\/| |/ _ \\/ _` | |/ _` |\n | | | | __/ (_| | | (_| |\n |_|_ |_|\\___|\\__,_|_|\\__,_|\n |_ _|_ __ __| | _____ _____ _ __\n | || '_ \\ / _` |/ _ \\ \\/ / _ \\ '__|\n | || | | | (_| | __/> < __/ |\n |___|_| |_|\\__,_|\\___/_/\\_\\___|_|\n\n\n LICENSE AND COPYRIGHT NOTICE\n\n PLEASE READ THIS SOFTWARE LICENSE AGREEMENT (\"LICENSE\") CAREFULLY\n BEFORE USING THE SOFTWARE. BY USING THE SOFTWARE, YOU ARE AGREEING\n TO BE BOUND BY THE TERMS OF THIS LICENSE.\n IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, DO NOT USE THE SOFTWARE.\n\n Full text of this license is available @license\n\n @license http://mageflow.com/license/connector/eula.txt MageFlow EULA\n @author MageFlow\n @copyright 2014 MageFlow http://mageflow.com/\n\n GENERAL INFO\n\n This script will create or update Media Index. Media Index is an up-to-date list of\n all media files under WYSIWYG folder in Magento media folder.\n\n\nLONGHELP;\n\n }", "function moodle_minimum_php_version_is_met($haltexecution = false) {\n // PLEASE NOTE THIS FUNCTION MUST BE COMPATIBLE WITH OLD UNSUPPORTED VERSIONS OF PHP.\n // Do not use modern php features or Moodle convenience functions (e.g. localised strings).\n\n $minimumversion = '7.1.0';\n $moodlerequirementchanged = '3.7';\n\n if (version_compare(PHP_VERSION, $minimumversion) < 0) {\n if ($haltexecution) {\n $error = \"Moodle ${moodlerequirementchanged} or later requires at least PHP ${minimumversion} \"\n . \"(currently using version \" . PHP_VERSION .\").\\n\"\n . \"Some servers may have multiple PHP versions installed, are you using the correct executable?\\n\";\n\n // Our CLI scripts define CLI_SCRIPT before running this test, so make use of\n // to send error on STDERR.\n if (defined('CLI_SCRIPT') && defined('STDERR')) {\n fwrite(STDERR, $error);\n } else {\n echo $error;\n }\n exit(1);\n } else {\n return false;\n }\n }\n return true;\n}", "public function about_moodle($message) {\r\n $result['Version'] = moodle_major_version();\r\n $result['Message'] = $message;\r\n return $result;\r\n }", "function adminbartweak_version() {return \"1.0.0\";}", "function XXLINK_edit($action, $lid = '')\n{\n global $_CONF, $_GROUPS, $_TABLES, $_USER, $_LI_CONF,\n $LANG_LINKS_ADMIN, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE;\n\n USES_lib_admin();\n\n $retval = '';\n $editFlag = false;\n\n switch ($action) {\n case 'edit':\n $blocktitle = $LANG_LINKS_ADMIN[1]; // Link Editor\n $saveoption = $LANG_ADMIN['save']; // Save\n break;\n case 'moderate':\n $blocktitle = $LANG_LINKS_ADMIN[65]; // Moderate Link\n $saveoption = $LANG_ADMIN['moderate']; // Save & Approve\n break;\n }\n\n $link_templates = new Template($_CONF['path'] . 'plugins/links/templates/admin/');\n $link_templates->set_file('editor','linkeditor.thtml');\n\n $link_templates->set_var('lang_pagetitle', $LANG_LINKS_ADMIN[28]);\n $link_templates->set_var('lang_link_list', $LANG_LINKS_ADMIN[53]);\n $link_templates->set_var('lang_new_link', $LANG_LINKS_ADMIN[51]);\n $link_templates->set_var('lang_validate_links', $LANG_LINKS_ADMIN[26]);\n $link_templates->set_var('lang_list_categories', $LANG_LINKS_ADMIN[50]);\n $link_templates->set_var('lang_new_category', $LANG_LINKS_ADMIN[52]);\n $link_templates->set_var('lang_admin_home', $LANG_ADMIN['admin_home']);\n $link_templates->set_var('instructions', $LANG_LINKS_ADMIN[29]);\n\n if ($action <> 'moderate' AND !empty($lid)) {\n $result = DB_query(\"SELECT * FROM {$_TABLES['links']} WHERE lid ='$lid'\");\n if (DB_numRows($result) !== 1) {\n $msg = COM_startBlock ($LANG_LINKS_ADMIN[24], '',\n COM_getBlockTemplate ('_msg_block', 'header'));\n $msg .= $LANG_LINKS_ADMIN[25];\n $msg .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));\n return $msg;\n }\n $A = DB_fetchArray($result);\n $access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);\n if ($access == 0 OR $access == 2) {\n $retval .= COM_startBlock($LANG_LINKS_ADMIN[16], '',\n COM_getBlockTemplate ('_msg_block', 'header'));\n $retval .= $LANG_LINKS_ADMIN[17];\n $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));\n COM_accessLog(\"User {$_USER['username']} tried to illegally submit or edit link $lid.\");\n return $retval;\n }\n $editFlag = true;\n } else {\n if ($action == 'moderate') {\n $result = DB_query (\"SELECT * FROM {$_TABLES['linksubmission']} WHERE lid = '$lid'\");\n $A = DB_fetchArray($result);\n } else {\n $A['lid'] = COM_makesid();\n $A['cid'] = '';\n $A['url'] = '';\n $A['description'] = '';\n $A['title']= '';\n $A['owner_id'] = $_USER['uid'];\n }\n $A['hits'] = 0;\n if (isset ($_GROUPS['Links Admin'])) {\n $A['group_id'] = $_GROUPS['Links Admin'];\n } else {\n $A['group_id'] = SEC_getFeatureGroup ('links.edit');\n }\n SEC_setDefaultPermissions ($A, $_LI_CONF['default_permissions']);\n $access = 3;\n }\n $retval .= COM_startBlock ($blocktitle, '',\n COM_getBlockTemplate ('_admin_block', 'header'));\n\n if ( $editFlag ) {\n $lang_create_or_edit = $LANG_ADMIN['edit'];\n } else {\n $lang_create_or_edit = $LANG_LINKS_ADMIN[51];\n }\n $menu_arr = array(\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/index.php',\n 'text' => $LANG_LINKS_ADMIN[53]),\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/index.php?edit=x',\n 'text' => $lang_create_or_edit,'active'=>true),\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/category.php',\n 'text' => $LANG_LINKS_ADMIN[50]),\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/index.php?validate=enabled',\n 'text' => $LANG_LINKS_ADMIN[26]),\n array('url' => $_CONF['site_admin_url'],\n 'text' => $LANG_ADMIN['admin_home'])\n );\n\n\n\n $retval .= ADMIN_createMenu($menu_arr, $LANG_LINKS_ADMIN[66], plugin_geticon_links());\n\n $link_templates->set_var('link_id', $A['lid']);\n if (!empty($lid) && SEC_hasRights('links.edit')) {\n $delbutton = '<input type=\"submit\" value=\"' . $LANG_ADMIN['delete']\n . '\" name=\"delete\"%s>';\n $jsconfirm = ' onclick=\"return confirm(\\'' . $MESSAGE[76] . '\\');\"';\n $link_templates->set_var ('delete_option',\n sprintf ($delbutton, $jsconfirm));\n $link_templates->set_var ('delete_option_no_confirmation',\n sprintf ($delbutton, ''));\n $link_templates->set_var ('delete_confirm_msg',$MESSAGE[76]);\n if ($action == 'moderate') {\n $link_templates->set_var('submission_option',\n '<input type=\"hidden\" name=\"type\" value=\"submission\">');\n }\n }\n $link_templates->set_var('lang_linktitle', $LANG_LINKS_ADMIN[3]);\n $link_templates->set_var('link_title',\n htmlspecialchars ($A['title']));\n $link_templates->set_var('lang_linkid', $LANG_LINKS_ADMIN[2]);\n $link_templates->set_var('lang_linkurl', $LANG_LINKS_ADMIN[4]);\n $link_templates->set_var('max_url_length', 255);\n $link_templates->set_var('link_url', $A['url']);\n $link_templates->set_var('lang_includehttp', $LANG_LINKS_ADMIN[6]);\n $link_templates->set_var('lang_category', $LANG_LINKS_ADMIN[5]);\n $othercategory = links_select_box (3,$A['cid']);\n $link_templates->set_var('category_options', $othercategory);\n $link_templates->set_var('lang_ifotherspecify', $LANG_LINKS_ADMIN[20]);\n $link_templates->set_var('category', $othercategory);\n $link_templates->set_var('lang_linkhits', $LANG_LINKS_ADMIN[8]);\n $link_templates->set_var('link_hits', $A['hits']);\n $link_templates->set_var('lang_linkdescription', $LANG_LINKS_ADMIN[9]);\n $link_templates->set_var('link_description', $A['description']);\n $link_templates->set_var('lang_save', $saveoption);\n $link_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);\n\n // user access info\n $link_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);\n $link_templates->set_var('lang_owner', $LANG_ACCESS['owner']);\n $ownername = COM_getDisplayName ($A['owner_id']);\n $link_templates->set_var('owner_username', DB_getItem($_TABLES['users'],\n 'username', \"uid = {$A['owner_id']}\"));\n $link_templates->set_var('owner_name', $ownername);\n $link_templates->set_var('owner', $ownername);\n $link_templates->set_var('link_ownerid', $A['owner_id']);\n $link_templates->set_var('lang_group', $LANG_ACCESS['group']);\n $link_templates->set_var('group_dropdown',\n SEC_getGroupDropdown ($A['group_id'], $access));\n $link_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);\n $link_templates->set_var('lang_permissionskey', $LANG_ACCESS['permissionskey']);\n $link_templates->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']));\n $link_templates->set_var('lang_lockmsg', $LANG_ACCESS['permmsg']);\n $link_templates->set_var('gltoken_name', CSRF_TOKEN);\n $link_templates->set_var('gltoken', SEC_createToken());\n $link_templates->parse('output', 'editor');\n $retval .= $link_templates->finish($link_templates->get_var('output'));\n\n $retval .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer'));\n\n return $retval;\n}", "function islegacy($capabilityname) {\n if (strpos($capabilityname, 'moodle/legacy') === 0) {\n return true;\n } else {\n return false;\n }\n}", "function enrol_user_pditt($type='teacher',$userid,$courseid,$timestart=0,$timeend=0,$status=null,$DEBUG=false) {\n global $DB;\n\n\n //$DEBUG=true;\n if ($DEBUG==true){\n print_r(array($type,$userid,$courseid));\n } \n\n \n $hasil=array();\n\n if (!$plugin=enrol_get_plugin('manual')) {\n $hasil['result']=0;\n\n return $hasil;\n }\n\n\n\n\n $instances = enrol_get_instances($courseid, true);\n foreach ($instances as $instance) {\n if ($instance->enrol === 'manual') {\n break;\n }\n }\n if ($instance->enrol !== 'manual') {\n $hasil['result']=0;\n return $hasil;\n }\n\n $role = $DB->get_record('role', array('shortname' => $type), '*', MUST_EXIST);\n\n $cc = $DB->get_record('course',array('id'=>$courseid),'*');\n $cc->visible=1;\n $cc->visibleold=1;\n $DB->update_record_raw('course', $cc);\n $plugin->enrol_user($instance, $userid, $role->id, $timestart, $timeend, $status);\n $hasil['result']=31;\n return $hasil;\n}", "function check_module_visibilityANDavailability_standalone($moduleid){\n\n $DB=$GLOBALS['GLBMDL_DB'];\n\n //Controlled in Moodle Gui: under 'availability (under \"Common module settings\")'\n $module_infos=new stdClass();\n $module_restrictions= new stdClass();\n try {\n\n $module_infos= $DB->get_record('course_modules', array('id' =>$moduleid));\n $resource_course_infos=new stdClass();\n $resource_course_infos=get_course_infos($module_infos->course, $DB);\n\n $module_infos=$resource_course_infos->course_modules[$moduleid];\n\n $module_section_infos= $DB->get_record('course_sections', array('id' =>$module_infos->section));\n $module_section_availability = $module_section_infos->availability;\n\n //Get all module/section availability restrictions in array format: including those on complexe set of restrictions.\n $module_section_access_restrictions= get_availability_restelements_fromavfield( $module_section_availability);\n $module_access_restrictions= get_availability_restelements_fromavfield( $module_infos->availability );\n\n //Module visisbility: \"module visibility\" AND \"section visibility\"\n $module_restrictions->mod_visibility = $module_infos->visible;\n $module_restrictions->mod_accrestrictions = $module_access_restrictions;\n $module_restrictions->mod_section_accrestrictions = $module_section_access_restrictions;\n\n\n } catch (\\Exception $e) {\n //$module_infos->course_gen_infos = 'Resource not existant. Verify your request or contact Univ-Nantes Admin.';\n return $e;\n echo \"Exception occurred\";\n }\n\n return array($module_restrictions,decide_about_modVisibilityANDAvailability( $module_restrictions, 0, 0 ));\n\n }", "function get_default_course_role($course) {\n global $CFG;\n\n/// First let's take the default role the course may have\n if (!empty($course->defaultrole)) {\n if ($role = get_record('role', 'id', $course->defaultrole)) {\n return $role;\n }\n }\n\n/// Otherwise the site setting should tell us\n if ($CFG->defaultcourseroleid) {\n if ($role = get_record('role', 'id', $CFG->defaultcourseroleid)) {\n return $role;\n }\n }\n\n/// It's unlikely we'll get here, but just in case, try and find a student role\n if ($studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {\n return array_shift($studentroles); /// Take the first one\n }\n\n return NULL;\n}", "function extendedforum_upgrade($oldversion) {\n// This function does anything necessary to upgrade\n// older versions to match current functionality\n\n global $CFG;\n\n if ($oldversion < 2003042402) {\n execute_sql(\"INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('extendedforum', 'move discussion', 'extendedforum_discussions', 'name')\");\n }\n\n if ($oldversion < 2003082500) {\n table_column(\"extendedforum\", \"\", \"assesstimestart\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"assessed\");\n table_column(\"extendedforum\", \"\", \"assesstimefinish\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"assesstimestart\");\n }\n\n if ($oldversion < 2003082502) {\n execute_sql(\"UPDATE {$CFG->prefix}extendedforum SET scale = (- scale)\");\n }\n\n if ($oldversion < 2003100600) {\n table_column(\"extendedforum\", \"\", \"maxbytes\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"scale\");\n }\n\n if ($oldversion < 2004010100) {\n table_column(\"extendedforum\", \"\", \"assesspublic\", \"integer\", \"4\", \"unsigned\", \"0\", \"\", \"assessed\");\n }\n\n if ($oldversion < 2004011404) {\n table_column(\"extendedforum_discussions\", \"\", \"userid\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"firstpost\");\n\n if ($discussions = get_records_sql(\"SELECT d.id, p.userid\n FROM {$CFG->prefix}extendedforum_discussions as d, \n {$CFG->prefix}extendedforum_posts as p\n WHERE d.firstpost = p.id\")) {\n foreach ($discussions as $discussion) {\n update_record(\"extendedforum_discussions\", $discussion);\n }\n }\n }\n if ($oldversion < 2004012200) {\n table_column(\"extendedforum_discussions\", \"\", \"groupid\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"userid\");\n }\n\n if ($oldversion < 2004020600) {\n table_column(\"extendedforum_discussions\", \"\", \"usermodified\", \"integer\", \"10\", \"unsigned\", \"0\", \"\", \"timemodified\");\n }\n\n if ($oldversion < 2004050300) {\n table_column(\"extendedforum\",\"\",\"rsstype\",\"integer\",\"2\", \"unsigned\", \"0\", \"\", \"forcesubscribe\");\n table_column(\"extendedforum\",\"\",\"rssarticles\",\"integer\",\"2\", \"unsigned\", \"0\", \"\", \"rsstype\");\n set_config(\"extendedforum_enablerssfeeds\",0);\n }\n\n if ($oldversion < 2004060100) {\n modify_database('', \"CREATE TABLE prefix_extendedforum_queue (\n id SERIAL PRIMARY KEY,\n userid integer default 0 NOT NULL,\n discussionid integer default 0 NOT NULL,\n postid integer default 0 NOT NULL\n );\");\n }\n\n if ($oldversion < 2004070700) { // This may be redoing it from STABLE but that's OK\n table_column(\"extendedforum_discussions\", \"groupid\", \"groupid\", \"integer\", \"10\", \"\", \"0\", \"\");\n }\n\n\n if ($oldversion < 2004111700) {\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_posts_parent_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_posts_discussion_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_posts_userid_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_discussions_extendedforum_idx;\",false);\n execute_sql(\" DROP INDEX {$CFG->prefix}extendedforum_discussions_userid_idx;\",false);\n\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_posts_parent_idx ON {$CFG->prefix}extendedforum_posts (parent) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_posts_discussion_idx ON {$CFG->prefix}extendedforum_posts (discussion) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_posts_userid_idx ON {$CFG->prefix}extendedforum_posts (userid) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_discussions_extendedforum_idx ON {$CFG->prefix}extendedforum_discussions (extendedforum) \");\n execute_sql(\" CREATE INDEX {$CFG->prefix}extendedforum_discussions_userid_idx ON {$CFG->prefix}extendedforum_discussions (userid) \");\n }\n\n if ($oldversion < 2004111200) {\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_course_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_queue_userid_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_queue_discussion_idx;\",false); \n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_queue_postid_idx;\",false); \n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_ratings_userid_idx;\",false); \n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_ratings_post_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_subscriptions_userid_idx;\",false);\n execute_sql(\"DROP INDEX {$CFG->prefix}extendedforum_subscriptions_extendedforum_idx;\",false);\n\n modify_database('','CREATE INDEX prefix_extendedforum_course_idx ON prefix_extendedforum (course);');\n modify_database('','CREATE INDEX prefix_extendedforum_queue_userid_idx ON prefix_extendedforum_queue (userid);');\n modify_database('','CREATE INDEX prefix_extendedforum_queue_discussion_idx ON prefix_extendedforum_queue (discussionid);');\n modify_database('','CREATE INDEX prefix_extendedforum_queue_postid_idx ON prefix_extendedforum_queue (postid);');\n modify_database('','CREATE INDEX prefix_extendedforum_ratings_userid_idx ON prefix_extendedforum_ratings (userid);');\n modify_database('','CREATE INDEX prefix_extendedforum_ratings_post_idx ON prefix_extendedforum_ratings (post);');\n modify_database('','CREATE INDEX prefix_extendedforum_subscriptions_userid_idx ON prefix_extendedforum_subscriptions (userid);');\n modify_database('','CREATE INDEX prefix_extendedforum_subscriptions_extendedforum_idx ON prefix_extendedforum_subscriptions (extendedforum);');\n }\n\n if ($oldversion < 2005011500) {\n modify_database('','CREATE TABLE prefix_extendedforum_read (\n id SERIAL PRIMARY KEY,\n userid integer default 0 NOT NULL,\n extendedforumid integer default 0 NOT NULL,\n discussionid integer default 0 NOT NULL,\n postid integer default 0 NOT NULL,\n firstread integer default 0 NOT NULL,\n lastread integer default 0 NOT NULL\n );');\n\n modify_database('','CREATE INDEX prefix_extendedforum_user_extendedforum_idx ON prefix_extendedforum_read (userid, extendedforumid);');\n modify_database('','CREATE INDEX prefix_extendedforum_user_discussion_idx ON prefix_extendedforum_read (userid, discussionid);');\n modify_database('','CREATE INDEX prefix_extendedforum_user_post_idx ON prefix_extendedforum_read (userid, postid);');\n\n set_config('upgrade', 'extendedforumread'); // The upgrade of this table will be done later by admin/upgradeextendedforumread.php\n }\n\n if ($oldversion < 2005032900) {\n modify_database('','CREATE INDEX prefix_extendedforum_posts_created_idx ON prefix_extendedforum_posts (created);');\n modify_database('','CREATE INDEX prefix_extendedforum_posts_mailed_idx ON prefix_extendedforum_posts (mailed);');\n }\n\n if ($oldversion < 2005041100) { // replace wiki-like with markdown\n include_once( \"$CFG->dirroot/lib/wiki_to_markdown.php\" );\n $wtm = new WikiToMarkdown();\n $sql = \"select course from {$CFG->prefix}extendedforum_discussions, {$CFG->prefix}extendedforum_posts \";\n $sql .= \"where {$CFG->prefix}extendedforum_posts.discussion = {$CFG->prefix}extendedforum_discussions.id \";\n $sql .= \"and {$CFG->prefix}extendedforum_posts.id = \";\n $wtm->update( 'extendedforum_posts','message','format',$sql );\n }\n\n if ($oldversion < 2005042300) { // Add tracking prefs table\n modify_database('','CREATE TABLE prefix_extendedforum_track_prefs (\n id SERIAL PRIMARY KEY, \n userid integer default 0 NOT NULL,\n extendedforumid integer default 0 NOT NULL\n );');\n }\n\n if ($oldversion < 2005042600) {\n table_column('extendedforum','','trackingtype','integer','2', 'unsigned', '1', '', 'forcesubscribe');\n modify_database('','CREATE INDEX prefix_extendedforum_track_user_extendedforum_idx ON prefix_extendedforum_track_prefs (userid, extendedforumid);');\n }\n\n if ($oldversion < 2005042601) { // Mass cleanup of bad postgres upgrade scripts\n modify_database('','ALTER TABLE prefix_extendedforum ALTER trackingtype SET NOT NULL');\n }\n\n if ($oldversion < 2005111100) {\n table_column('extendedforum_discussions','','timestart','integer');\n table_column('extendedforum_discussions','','timeend','integer');\n }\n\n if ($oldversion < 2006011600) {\n notify('extendedforum_type does not exists, you can ignore and this will properly removed');\n execute_sql(\"ALTER TABLE {$CFG->prefix}extendedforum DROP CONSTRAINT {$CFG->prefix}extendedforum_type\");\n execute_sql(\"ALTER TABLE {$CFG->prefix}extendedforum ADD CONSTRAINT {$CFG->prefix}extendedforum_type CHECK (type IN ('single','news','general','social','eachuser','teacher','qanda')) \");\n }\n\n if ($oldversion < 2006011601) {\n table_column('extendedforum','','warnafter');\n table_column('extendedforum','','blockafter');\n table_column('extendedforum','','blockperiod');\n }\n\n if ($oldversion < 2006011700) {\n table_column('extendedforum_posts','','mailnow','integer');\n }\n\n if ($oldversion < 2006011701) {\n execute_sql(\"ALTER TABLE {$CFG->prefix}extendedforum DROP CONSTRAINT {$CFG->prefix}extendedforum_type_check\");\n }\n\n if ($oldversion < 2006011702) {\n execute_sql(\"INSERT INTO {$CFG->prefix}log_display (module, action, mtable, field) VALUES ('extendedforum', 'user report', 'user', 'firstname||\\' \\'||lastname')\");\n }\n\n if ($oldversion < 2006081800) {\n // Upgrades for new roles and capabilities support.\n require_once($CFG->dirroot.'/mod/extendedforum/lib.php');\n\n $extendedforummod = get_record('modules', 'name', 'extendedforum');\n\n if ($extendedforums = get_records('extendedforum')) {\n\n if (!$teacherroles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW)) {\n notify('Default teacher role was not found. Roles and permissions '.\n 'for all your extendedforums will have to be manually set after '.\n 'this upgrade.');\n }\n if (!$studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {\n notify('Default student role was not found. Roles and permissions '.\n 'for all your extendedforums will have to be manually set after '.\n 'this upgrade.');\n }\n if (!$guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) {\n notify('Default guest role was not found. Roles and permissions '.\n 'for teacher extendedforums will have to be manually set after '.\n 'this upgrade.');\n }\n foreach ($extendedforums as $extendedforum) {\n if (!extendedforum_convert_to_roles($extendedforum, $extendedforummod->id, $teacherroles,\n $studentroles, $guestroles)) {\n notify('Forum with id '.$extendedforum->id.' was not upgraded');\n }\n }\n // We need to rebuild all the course caches to refresh the state of\n // the extendedforum modules.\n rebuild_course_cache();\n \n } // End if.\n \n // Drop column extendedforum.open.\n modify_database('', 'ALTER TABLE prefix_extendedforum DROP COLUMN open;');\n\n // Drop column extendedforum.assesspublic.\n modify_database('', 'ALTER TABLE prefix_extendedforum DROP COLUMN assesspublic;');\n }\n \n if ($oldversion < 2006082700) {\n $sql = \"UPDATE {$CFG->prefix}extendedforum_posts SET message = REPLACE(message, '\".TRUSTTEXT.\"', '');\";\n $likecond = sql_ilike().\" '%\".TRUSTTEXT.\"%'\";\n while (true) {\n if (!count_records_select('extendedforum_posts', \"message $likecond\")) {\n break;\n }\n execute_sql($sql);\n }\n }\n\n ////// DO NOT ADD NEW THINGS HERE!! USE upgrade.php and the lib/ddllib.php functions.\n\n return true;\n\n}", "function sitemgr_upgrade1_2()\n{\n\t$GLOBALS['egw_setup']->db->update('egw_sitemgr_modules',array('module_name' => 'news_admin'),array('module_name' => 'news'),__LINE__,__FILE__);\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '1.3.001';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "function local_ltiprovider_get_new_course_info( $field, $context ) {\n global $DB;\n\n $info = '';\n\n $setting = get_config( 'local_ltiprovider', $field . \"format\" );\n\n switch ( $setting ) {\n case 0:\n $info = $context->info['context_id'];\n break;\n case '1':\n $info = $context->info['context_title'];\n break;\n case '2':\n $info = $context->info['context_label'];\n break;\n case '3':\n $info = $context->info['oauth_consumer_key'] . ':' . $context->info['context_id'];\n break;\n case '4':\n $info = $context->info['oauth_consumer_key'] . ':' . $context->info['context_title'];\n break;\n case '5':\n $info = $context->info['oauth_consumer_key'] . ':' . $context->info['context_label'];\n break;\n case '6':\n $info = local_ltiprovider_get_custom_new_course_info( $field, $context );\n break;\n }\n\n // Special case.\n if ( $field == 'shortname' ) {\n // Add or increase the number at the final of the shortname.\n if ( $course = $DB->get_record( 'course', array( 'shortname' => $info ) ) ) {\n if ( $samecourses = $DB->get_records( 'course', array( 'fullname' => $course->fullname ), 'id DESC',\n 'shortname', '0', '1' ) ) {\n $samecourse = array_shift( $samecourses );\n $parts = explode( ' ', $samecourse->shortname );\n $number = array_pop( $parts );\n if ( is_numeric( $number ) ) {\n $parts[] = $number + 1;\n } else {\n $parts[] = $number . ' 1';\n }\n $info = implode( ' ', $parts );\n }\n }\n }\n\n return $info;\n}", "function xmldb_local_joulegrader_upgrade($oldversion) {\n global $DB;\n\n $dbman = $DB->get_manager();\n\n if ($oldversion < 2012030700) {\n\n // Define table local_joulegrader_comments to be created\n $table = new xmldb_table('local_joulegrader_comments');\n\n // Adding fields to table local_joulegrader_comments\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('gareaid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);\n $table->add_field('guserid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);\n $table->add_field('content', XMLDB_TYPE_TEXT, 'medium', null, XMLDB_NOTNULL, null, null);\n $table->add_field('commenterid', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);\n $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null);\n $table->add_field('attachment', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null);\n $table->add_field('deleted', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null);\n\n // Adding keys to table local_joulegrader_comments\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('gareaid', XMLDB_KEY_FOREIGN, array('gareaid'), 'grading_areas', array('id'));\n $table->add_key('guserid', XMLDB_KEY_FOREIGN, array('guserid'), 'user', array('id'));\n\n // Adding indexes to table local_joulegrader_comments\n $table->add_index('gareaid-guserid', XMLDB_INDEX_NOTUNIQUE, array('gareaid', 'guserid'));\n\n // Conditionally launch create table for local_joulegrader_comments\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n // joulegrader savepoint reached\n upgrade_plugin_savepoint(true, 2012030700, 'local', 'joulegrader');\n }\n}", "function schedule_backup_course_execute($preferences,$starttime = 0) {\n\n global $CFG;\n\n $status = true;\n\n //Another Info to add\n $preferences->moodle_version = $CFG->version;\n $preferences->moodle_release = $CFG->release;\n $preferences->backup_version = $CFG->backup_version;\n $preferences->backup_release = $CFG->backup_release;\n\n //Some parts of the backup doesn't know about $preferences, so we\n //put a copy of it inside that CFG (always global) to be able to\n //use it. Then, when needed I search for preferences inside CFG\n //Used to avoid some problems in full_tag() when preferences isn't\n //set globally (i.e. in scheduled backups)\n $CFG->backup_preferences = $preferences;\n\n //Check for temp and backup and backup_unique_code directory\n //Create them as needed\n schedule_backup_log($starttime,$preferences->backup_course,\" checking temp structures\");\n $status = check_and_create_backup_dir($preferences->backup_unique_code);\n //Empty backup dir\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" cleaning current dir\");\n $status = clear_backup_dir($preferences->backup_unique_code);\n }\n\n //Create the moodle.xml file\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" creating backup file\");\n //Obtain the xml file (create and open) and print prolog information\n $backup_file = backup_open_xml($preferences->backup_unique_code);\n //Prints general info about backup to file\n if ($backup_file) {\n schedule_backup_log($starttime,$preferences->backup_course,\" general info\");\n $status = backup_general_info($backup_file,$preferences);\n } else {\n $status = false;\n }\n\n //Prints course start (tag and general info)\n if ($status) {\n $status = backup_course_start($backup_file,$preferences);\n }\n\n //Metacourse information\n if ($status && $preferences->backup_metacourse) {\n schedule_backup_log($starttime,$preferences->backup_course,\" metacourse info\");\n $status = backup_course_metacourse($backup_file,$preferences);\n }\n\n //Block info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" blocks info\");\n $status = backup_course_blocks($backup_file,$preferences);\n }\n\n //Section info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" sections info\");\n $status = backup_course_sections($backup_file,$preferences);\n }\n\n //User info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" user info\");\n $status = backup_user_info($backup_file,$preferences);\n }\n\n //If we have selected to backup messages and we are\n //doing a SITE backup, let's do it\n if ($status && $preferences->backup_messages && $preferences->backup_course == SITEID) {\n schedule_backup_log($starttime,$preferences->backup_course,\" messages\");\n if (!$status = backup_messages($backup_file,$preferences)) {\n notify(\"An error occurred while backing up messages\");\n }\n }\n\n //If we have selected to backup quizzes, backup categories and\n //questions structure (step 1). See notes on mod/quiz/backuplib.php\n if ($status and $preferences->mods['quiz']->backup) {\n schedule_backup_log($starttime,$preferences->backup_course,\" categories & questions\");\n $status = backup_question_categories($backup_file,$preferences);\n }\n\n //Print logs if selected\n if ($status) {\n if ($preferences->backup_logs) {\n schedule_backup_log($starttime,$preferences->backup_course,\" logs\");\n $status = backup_log_info($backup_file,$preferences);\n }\n }\n\n //Print scales info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" scales\");\n $status = backup_scales_info($backup_file,$preferences);\n }\n\n //Print groupings info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" groupings\");\n $status = backup_groupings_info($backup_file,$preferences);\n }\n\n //Print groups info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" groups\");\n $status = backup_groups_info($backup_file,$preferences);\n }\n\n //Print events info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" events\");\n $status = backup_events_info($backup_file,$preferences);\n }\n\n //Print gradebook info\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" gradebook\");\n $status = backup_gradebook_info($backup_file,$preferences);\n }\n\n //Module info, this unique function makes all the work!!\n //db export and module fileis copy\n if ($status) {\n $mods_to_backup = false;\n //Check if we have any mod to backup\n foreach ($preferences->mods as $module) {\n if ($module->backup) {\n $mods_to_backup = true;\n }\n }\n //If we have to backup some module\n if ($mods_to_backup) {\n schedule_backup_log($starttime,$preferences->backup_course,\" modules\");\n //Start modules tag\n $status = backup_modules_start ($backup_file,$preferences);\n //Iterate over modules and call backup\n foreach ($preferences->mods as $module) {\n if ($module->backup and $status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" $module->name\");\n $status = backup_module($backup_file,$preferences,$module->name);\n }\n }\n //Close modules tag\n $status = backup_modules_end ($backup_file,$preferences);\n }\n }\n\n //Backup course format data, if any.\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" course format data\");\n $status = backup_format_data($backup_file,$preferences);\n }\n\n //Prints course end\n if ($status) {\n $status = backup_course_end($backup_file,$preferences);\n }\n\n //Close the xml file and xml data\n if ($backup_file) {\n backup_close_xml($backup_file);\n }\n }\n\n //Now, if selected, copy user files\n if ($status) {\n if ($preferences->backup_user_files) {\n schedule_backup_log($starttime,$preferences->backup_course,\" copying user files\");\n $status = backup_copy_user_files ($preferences);\n }\n }\n\n //Now, if selected, copy course files\n if ($status) {\n if ($preferences->backup_course_files) {\n schedule_backup_log($starttime,$preferences->backup_course,\" copying course files\");\n $status = backup_copy_course_files ($preferences);\n }\n }\n\n //Now, zip all the backup directory contents\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" zipping files\");\n $status = backup_zip ($preferences);\n }\n\n //Now, copy the zip file to course directory\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" copying backup\");\n $status = copy_zip_to_course_dir ($preferences);\n }\n\n //Now, clean temporary data (db and filesystem)\n if ($status) {\n schedule_backup_log($starttime,$preferences->backup_course,\" cleaning temp data\");\n $status = clean_temp_data ($preferences);\n }\n\n //Unset CFG->backup_preferences only needed in scheduled backups\n unset ($CFG->backup_preferences);\n\n return $status;\n}", "function usp_ews_modules_in_use($courseid) {\n global $DB;\n\t\n $dbmanager = $DB->get_manager(); // used to check if tables exist\n $modules = usp_ews_get_active_monitorable_modules();\n $modulesinuse = array();\n\n foreach ($modules as $module => $details) {\n if (\n $dbmanager->table_exists($module) &&\n $DB->record_exists($module, array('course'=>$courseid))\n ) {\n $modulesinuse[$module] = $details;\n }\n }\n return $modulesinuse;\n}", "function xmldb_vcubeseminar_upgrade($oldversion) {\n global $CFG, $DB;\n $dbman = $DB->get_manager();\n\n if ($oldversion < 2015081003) {\n\n //add field 'seminar_type'\n $table = new xmldb_table('vcubeseminar');\n $field = new xmldb_field('seminar_type', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n //rename 'charmanurl' to 'chairmanurl'\n $table = new xmldb_table('vcubeseminar');\n $field = new xmldb_field('charmanurl', XMLDB_TYPE_CHAR, '1333', null, XMLDB_NOTNULL, null, null);\n if ($dbman->field_exists($table, $field)) {\n $dbman->rename_field($table,$field,'chairmanurl');\n }\n\n }\n\n\n if ($oldversion < 2015082500) {\n\n //create table 'vcubeseminar_ondemandlog'\n $table = new xmldb_table('vcubeseminar_ondemandlog');\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('instanceid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);\n $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);\n $table->add_field('starttime', XMLDB_TYPE_INTEGER, '10', null, null, null, null);\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n if(!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n }\n\n\n if ($oldversion < 2015090901) {\n \t// Define table vcubeseminar_files to be created.\n \t$table = new xmldb_table('vcubeseminar_files');\n\n \t// Adding fields to table vcubeseminar_files.\n \t$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n \t$table->add_field('instanceid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n \t$table->add_field('fileid', XMLDB_TYPE_INTEGER, '10', null, null, null, null);\n \t$table->add_field('documentid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);\n \t$table->add_field('type', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null);\n \t$table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, null, null, null);\n \t$table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, null, null, null);\n\n \t// Adding keys to table vcubeseminar_files.\n \t$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n \t// Adding indexes to table vcubeseminar_files.\n \t$table->add_index('fileid_id', XMLDB_INDEX_UNIQUE, array('fileid'));\n\n \t// Conditionally launch create table for vcubeseminar_files.\n \tif (!$dbman->table_exists($table)) {\n \t\t$dbman->create_table($table);\n \t}\n }\n\n if ($oldversion < 2015091600) {\n //add to 4 field to table 'vcubeseminar'\n \t$dbman = $DB->get_manager();\n \t$table = new xmldb_table('vcubeseminar');\n\n \t//add is_animation\n \t$field = new xmldb_field('is_animation', XMLDB_TYPE_INTEGER,'1',null,null,null,null);\n \tif (!$dbman->field_exists($table, $field)) $dbman->add_field($table, $field);\n\n \t//add download_whiteboard\n \t$field = new xmldb_field('download_whiteboard', XMLDB_TYPE_INTEGER,'1',null,null,null,null);\n \tif (!$dbman->field_exists($table, $field)) $dbman->add_field($table, $field);\n\n \t//add download_filecabinet\n \t$field = new xmldb_field('download_filecabinet', XMLDB_TYPE_INTEGER,'1',null,null,null,null);\n \tif (!$dbman->field_exists($table, $field)) $dbman->add_field($table, $field);\n\n \t//add link_url\n \t$field = new xmldb_field('link_url', XMLDB_TYPE_CHAR,'1333',null,null,null,null);\n \tif (!$dbman->field_exists($table, $field)) $dbman->add_field($table, $field);\n\n }\n\n return true;\n}", "function upgrade_300()\n {\n }", "function xmldb_assignsubmission_cle_install() {\r\n global $CFG;\r\n\r\n // do the install\r\n\r\n require_once($CFG->dirroot . '/mod/assign/adminlib.php');\r\n // set the correct initial order for the plugins\r\n $pluginmanager = new assign_plugin_manager('assignsubmission');\r\n\r\n \r\n \r\n // do the upgrades\r\n return true;\r\n\r\n}", "function role_assign($roleid, $userid, $groupid, $contextid, $timestart=0, $timeend=0, $hidden=0, $enrol='manual',$timemodified='') {\n global $USER, $CFG;\n\n debugging(\"Assign roleid $roleid userid $userid contextid $contextid\", DEBUG_DEVELOPER);\n\n/// Do some data validation\n\n if (empty($roleid)) {\n debugging('Role ID not provided');\n return false;\n }\n\n if (empty($userid) && empty($groupid)) {\n debugging('Either userid or groupid must be provided');\n return false;\n }\n\n if ($userid && !record_exists('user', 'id', $userid)) {\n debugging('User ID '.intval($userid).' does not exist!');\n return false;\n }\n\n if ($groupid && !groups_group_exists($groupid)) {\n debugging('Group ID '.intval($groupid).' does not exist!');\n return false;\n }\n\n if (!$context = get_context_instance_by_id($contextid)) {\n debugging('Context ID '.intval($contextid).' does not exist!');\n return false;\n }\n\n if (($timestart and $timeend) and ($timestart > $timeend)) {\n debugging('The end time can not be earlier than the start time');\n return false;\n }\n\n if (!$timemodified) {\n $timemodified = time(); \n }\n\n/// Check for existing entry\n if ($userid) {\n $ra = get_record('role_assignments', 'roleid', $roleid, 'contextid', $context->id, 'userid', $userid);\n } else {\n $ra = get_record('role_assignments', 'roleid', $roleid, 'contextid', $context->id, 'groupid', $groupid);\n }\n\n\n $newra = new object;\n\n if (empty($ra)) { // Create a new entry\n $newra->roleid = $roleid;\n $newra->contextid = $context->id;\n $newra->userid = $userid;\n $newra->hidden = $hidden;\n $newra->enrol = $enrol;\n /// Always round timestart downto 100 secs to help DBs to use their own caching algorithms \n /// by repeating queries with the same exact parameters in a 100 secs time window\n $newra->timestart = round($timestart, -2);\n $newra->timeend = $timeend;\n $newra->timemodified = $timemodified;\n $newra->modifierid = empty($USER->id) ? 0 : $USER->id;\n\n $success = insert_record('role_assignments', $newra);\n\n } else { // We already have one, just update it\n\n $newra->id = $ra->id;\n $newra->hidden = $hidden;\n $newra->enrol = $enrol;\n /// Always round timestart downto 100 secs to help DBs to use their own caching algorithms \n /// by repeating queries with the same exact parameters in a 100 secs time window\n $newra->timestart = round($timestart, -2);\n $newra->timeend = $timeend;\n $newra->timemodified = $timemodified;\n $newra->modifierid = empty($USER->id) ? 0 : $USER->id;\n\n $success = update_record('role_assignments', $newra);\n }\n\n if ($success) { /// Role was assigned, so do some other things\n\n /// If the user is the current user, then reload the capabilities too.\n if (!empty($USER->id) && $USER->id == $userid) {\n load_all_capabilities();\n }\n \n /// Ask all the modules if anything needs to be done for this user\n if ($mods = get_list_of_plugins('mod')) {\n foreach ($mods as $mod) {\n include_once($CFG->dirroot.'/mod/'.$mod.'/lib.php');\n $functionname = $mod.'_role_assign';\n if (function_exists($functionname)) {\n $functionname($userid, $context, $roleid);\n }\n }\n }\n\n /// Make sure they have an entry in user_lastaccess for courses they can access\n // role_add_lastaccess_entries($userid, $context);\n }\n\n /// now handle metacourse role assignments if in course context\n if ($success and $context->contextlevel == CONTEXT_COURSE) {\n if ($parents = get_records('course_meta', 'child_course', $context->instanceid)) {\n foreach ($parents as $parent) {\n sync_metacourse($parent->parent_course);\n }\n }\n }\n\n return $success;\n}", "function myblocks() {\n $this->name=\"myblocks\";\n $this->title=\"<#LANG_MODULE_MYBLOCKS#>\";\n $this->module_category=\"<#LANG_SECTION_SETTINGS#>\";\n $this->checkInstalled();\n}", "function programming_upgrade($oldversion) {\n/// This function does anything necessary to upgrade \n/// older versions to match current functionality \n\n global $CFG;\n\n if ($oldversion < 2005090101) {\n\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_tests` ADD `weight` TINYINT(3) NOT NULL DEFAULT '3'\");\n\n }\n\n if ($oldversion < 2005100103) {\n\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` ADD `keeplatestonly` TINYINT(3) NOT NULL DEFAULT 0 AFTER attempts\");\n\n }\n\n if ($oldversion < 2006030412) {\n\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` ADD `timediscount` INT(10) NOT NULL DEFAULT '130000000' AFTER `memlimit`\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` ADD `discount` FLOAT NOT NULL DEFAULT '8' AFTER `timediscount`\");\n\n }\n\n if ($oldversion < 2006040200) {\n\n // Add new columns to test results\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` ADD `status` INT(10) NOT NULL DEFAULT '0' AFTER `passed`\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` ADD `stderr` TEXT NULL AFTER `output`\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` CHANGE `output` `output` TEXT NULL\");\n\n // Change the type of column language of submits\n execute_sql(\"UPDATE `{$CFG->prefix}programming_submits` set language=1 where language='c89' or language='c99'\");\n execute_sql(\"UPDATE `{$CFG->prefix}programming_submits` set language=2 where language='c++98'\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_submits` CHANGE `language` `language` INT(10) NULL\");\n\n // Create a table for languages\n execute_sql(\"CREATE TABLE {$CFG->prefix}programming_languages ( id int(10) NOT NULL auto_increment, name varchar(20) NOT NULL, PRIMARY KEY (id)) COMMENT='programming language'\");\n execute_sql(\"INSERT INTO {$CFG->prefix}programming_languages VALUES (1, 'gcc-3.3')\");\n execute_sql(\"INSERT INTO {$CFG->prefix}programming_languages VALUES (2, 'g++-3.3')\");\n\n }\n\n if ($oldversion < 2006040312) {\n // Add new columns to test results\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` ADD exitcode TINYINT(3) NOT NULL DEFAULT '0' AFTER `status`\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` ADD signal TINYINT(3) NOT NULL DEFAULT '0' AFTER `exitcode`\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` DROP `status`\");\n }\n\n if ($oldversion < 2006040512) {\n execute_sql(\"\n CREATE TABLE {$CFG->prefix}programming_langlimit (\n id int(10) NOT NULL AUTO_INCREMENT,\n programmingid int(10) NOT NULL,\n languageid int(10) NOT NULL,\n PRIMARY KEY (id),\n UNIQUE KEY programminglanguage(programmingid, languageid),\n UNIQUE KEY languageprogramming(languageid, programmingid)\n ) COMMENT='programming language limit';\n \");\n }\n\n if ($oldversion < 2006040617) {\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_tests` CHANGE `input` `input` MEDIUMTEXT NOT NULL\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_tests` CHANGE `output` `output` MEDIUMTEXT NOT NULL\");\n }\n\n if ($oldversion < 2006062300) {\n execute_sql(\"\n CREATE TABLE `{$CFG->prefix}programming_resemble` (\n id int(10) NOT NULL auto_increment,\n programmingid int(10) NOT NULL default '0',\n matchedcount int(4) NOT NULL default '0',\n matchedlines text,\n submitid1 int(10) NOT NULL default '0',\n percent1 int(2) NOT NULL default '0',\n submitid2 int(10) NOT NULL default '0',\n percent2 int(2) NOT NULL default '0',\n flag tinyint(2) NOT NULL default '0',\n PRIMARY KEY (id),\n KEY proglines (programmingid, flag, matchedcount)\n ) COMMENT='resemble info returned by moss';\n \");\n }\n\n if ($oldversion < 2006070301) {\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` ADD `generatortype` tinyint(1) NOT NULL DEFAULT '0'\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` CHANGE `generator` `generator` TEXT\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` ADD `validatortype` tinyint(1) NOT NULL DEFAULT '0'\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` CHANGE `validator` `validator` TEXT\");\n }\n\n if ($oldversion < 2006112801) {\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_submits` ADD `codelines` int(10) NOT NULL default '0' AFTER `code`\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_submits` ADD `codesize` int(10) NOT NULL default '0' AFTER `codelines`\");\n execute_sql(\"UPDATE `{$CFG->prefix}programming_submits` SET codesize = CHAR_LENGTH(code)\");\n execute_sql(\"UPDATE `{$CFG->prefix}programming_submits` SET codelines = codesize - CHAR_LENGTH(REPLACE(code, '\\n', ''))\");\n }\n\n if ($oldversion < 2006112802) {\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming` ADD `showmode` TINYINT(1) NOT NULL DEFAULT '1'\");\n }\n\n if ($oldversion < 2006121001) {\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` CHANGE `output` `output` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL\");\n execute_sql(\"ALTER TABLE `{$CFG->prefix}programming_test_results` CHANGE `stderr` `stderr` TEXT CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL\");\n }\n\n return true;\n}", "function monitorable_modules() {\n global $DB;\n\n return array(\n 'assign' => array(\n 'defaultTime' => 'duedate',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {assign_submission}\n WHERE assignment = :eventid\n AND userid = :userid\n AND status = 'submitted'\",\n 'marked' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assign'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assign'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n ),\n 'defaultAction' => 'submitted'\n ),\n 'assignment' => array(\n 'defaultTime' => 'timedue',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {assignment_submissions}\n WHERE assignment = :eventid\n AND userid = :userid\n AND (\n numfiles >= 1\n OR {$DB->sql_compare_text('data2')} <> ''\n )\",\n 'marked' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assignment'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assignment'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n ),\n 'defaultAction' => 'submitted'\n ),\n 'bigbluebuttonbn' => array(\n 'defaultTime' => 'timedue',\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'bigbluebuttonbn'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_bigbluebuttonbn'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'recordingsbn' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'recordingsbn'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_recordingsbn'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'book' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'book'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_book'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'certificate' => array(\n 'actions' => array(\n 'awarded' => \"SELECT id\n FROM {certificate_issues}\n WHERE certificateid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'awarded'\n ),\n 'chat' => array(\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {chat_messages}\n WHERE chatid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'choice' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'answered' => \"SELECT id\n FROM {choice_answers}\n WHERE choiceid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'answered'\n ),\n 'data' => array(\n 'defaultTime' => 'timeviewto',\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'data'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_data'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'feedback' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'responded_to' => \"SELECT id\n FROM {feedback_completed}\n WHERE feedback = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'responded_to'\n ),\n 'resource' => array( // AKA file.\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'resource'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_resource'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'flashcardtrainer' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'flashcardtrainer'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_flashcardtrainer'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'folder' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'folder'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_folder'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'forum' => array(\n 'defaultTime' => 'assesstimefinish',\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {forum_posts}\n WHERE userid = :userid AND discussion IN (\n SELECT id\n FROM {forum_discussions}\n WHERE forum = :eventid\n )\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'glossary' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'glossary'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_glossary'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'hotpot' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {hotpot_attempts}\n WHERE hotpotid = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {hotpot_attempts}\n WHERE hotpotid = :eventid\n AND userid = :userid\n AND timefinish <> 0\",\n ),\n 'defaultAction' => 'finished'\n ),\n 'hsuforum' => array(\n 'defaultTime' => 'assesstimefinish',\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {hsuforum_posts}\n WHERE userid = :userid AND discussion IN (\n SELECT id\n FROM {hsuforum_discussions}\n WHERE forum = :eventid\n )\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'imscp' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'imscp'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_imscp'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'journal' => array(\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {journal_entries}\n WHERE journal = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'lesson' => array(\n 'defaultTime' => 'deadline',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {lesson_attempts}\n WHERE lessonid = :eventid\n AND userid = :userid\n UNION ALL\n SELECT id\n FROM {lesson_branch}\n WHERE lessonid = :eventid1\n AND userid = :userid1\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'lesson'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n ),\n 'defaultAction' => 'attempted'\n ),\n 'page' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'page'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_page'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'questionnaire' => array(\n 'defaultTime' => 'closedate',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {questionnaire_attempts}\n WHERE qid = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {questionnaire_response}\n WHERE complete = 'y'\n AND username = :userid\n AND survey_id = :eventid\",\n ),\n 'defaultAction' => 'finished'\n ),\n 'quiz' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {quiz_attempts}\n WHERE quiz = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {quiz_attempts}\n WHERE quiz = :eventid\n AND userid = :userid\n AND timefinish <> 0\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'quiz'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'quiz'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n ),\n 'defaultAction' => 'finished'\n ),\n 'scorm' => array(\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\",\n 'completed' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\n AND element = 'cmi.core.lesson_status'\n AND {$DB->sql_compare_text('value')} = 'completed'\",\n 'passedscorm' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\n AND element = 'cmi.core.lesson_status'\n AND {$DB->sql_compare_text('value')} = 'passed'\"\n ),\n 'defaultAction' => 'attempted'\n ),\n 'turnitintool' => array(\n 'defaultTime' => 'defaultdtdue',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {turnitintool_submissions}\n WHERE turnitintoolid = :eventid\n AND userid = :userid\n AND submission_score IS NOT NULL\"\n ),\n 'defaultAction' => 'submitted'\n ),\n 'url' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'url'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_url'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'wiki' => array(\n 'actions' => array(\n 'viewed' => array (\n 'logstore_legacy' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'wiki'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\",\n 'sql_internal_reader' => \"SELECT id\n FROM {log}\n WHERE courseid = :courseid\n AND component = 'mod_wiki'\n AND action = 'viewed'\n AND objectid = :eventid\n AND userid = :userid\",\n ),\n ),\n 'defaultAction' => 'viewed'\n ),\n 'workshop' => array(\n 'defaultTime' => 'assessmentend',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {workshop_submissions}\n WHERE workshopid = :eventid\n AND authorid = :userid\",\n 'assessed' => \"SELECT s.id\n FROM {workshop_assessments} a, {workshop_submissions} s\n WHERE s.workshopid = :eventid\n AND s.id = a.submissionid\n AND a.reviewerid = :userid\n AND a.grade IS NOT NULL\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'workshop'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND (g.finalgrade IS NOT NULL OR g.excluded <> 0)\",\n ),\n 'defaultAction' => 'submitted'\n ),\n );\n}", "function kilman_get_js_module() {\n return array(\n 'name' => 'mod_kilman',\n 'fullpath' => '/mod/kilman/module.js',\n 'requires' => array('base', 'dom', 'event-delegate', 'event-key',\n 'core_question_engine', 'moodle-core-formchangechecker'),\n 'strings' => array(\n array('cancel', 'moodle'),\n array('flagged', 'question'),\n array('functiondisabledbysecuremode', 'quiz'),\n array('startattempt', 'quiz'),\n array('timesup', 'quiz'),\n array('changesmadereallygoaway', 'moodle'),\n ),\n );\n}", "function plugin_version_estimation() {\n return [\n 'name' => 'Оценка качества работы с заявкой',\n 'version' => PLUGIN_ESTIMATION_VERSION,\n 'author' => 'Roman Gonyukov',\n 'license' => '',\n 'homepage' => '',\n 'requirements' => [\n 'glpi' => [\n 'min' => '9.2',\n ]\n ]\n ];\n}", "function get_oermdlmodule_infos( $moduleid ){\n\n $oer_category_id=$GLOBALS['glbstg_crs_category'];\n $DB=$GLOBALS['GLBMDL_DB'];\n $module_infos=new stdClass();\n try {\n\n $module_infos= $DB->get_record('course_modules', array('id' =>$moduleid));\n $resource_course_infos=new stdClass();\n $resource_course_infos=get_course_infos($module_infos->course, $DB);\n\n //X5GON 1st OER Criteria: Category + Course Visibility + Course Availability ===> X5GON Snippet integrated\n $nopermittedmodules=0;\n if( in_array($resource_course_infos->course_cat_infos->id, $oer_category_id) and validate_course_enrolment($resource_course_infos->course_gen_infos->id, $DB, $GLOBALS['glbstg_crs_allowed_enrolment_types'], $GLOBALS['glbstg_crs_allow_typeswith_pass']) and validate_course_visibility($resource_course_infos->course_gen_infos->id, $DB, $GLOBALS['glbstg_crs_allowhidden_courses']) ){\n\n $course_mod_restrictions=check_module_visibilityANDavailability($DB, $resource_course_infos->course_modules[$moduleid], $GLOBALS['glbstg_mod_visibility_allowhiddenmodules'], $GLOBALS['glbstg_mod_availability_ignoreavailabilityrestrictions']);\n if($course_mod_restrictions[1]==1){\n\n //X5GON 3rd OER Criteria: Final file license.\n if($resource_course_infos->course_modules[$moduleid]->course_module_file){\n //not empty file attribute infos\n if( preg_match(\"/\".$GLOBALS['glbstg_mod_fresallowedlicenses'].\"/\", $resource_course_infos->course_modules[$moduleid]->course_module_file->license) ){\n\n $module_infos=$resource_course_infos->course_modules[$moduleid];\n $module_infos->course_gen_infos = $resource_course_infos->course_gen_infos ;\n $module_infos->course_cat_infos = $resource_course_infos->course_cat_infos ;\n $nopermittedmodules=1;\n }\n\n }else{\n // Else: other type of moodle resources + category is \"OER category(Nantes case)\"\n $module_infos=$resource_course_infos->course_modules[$moduleid];\n $module_infos->course_gen_infos = $resource_course_infos->course_gen_infos ;\n $module_infos->course_cat_infos = $resource_course_infos->course_cat_infos ;\n $nopermittedmodules=1;\n\n }\n\n\n }\n\n //Y1: For FinalResources: We are interested for the moment about 'type=resource' of moodle modules.\n if ( $nopermittedmodules==1 ){\n if(is_concerned_resource( $module_infos, $GLOBALS['glbstg_mod_finalfilter_concernedmdlmodtypes'] ) == 0){\n\n $nopermittedmodules=0;\n }\n\n }\n }\n\n\n } catch (\\Exception $e) {\n //$module_infos->course_gen_infos = 'Resource not existant. Verify your request or contact Univ-Nantes Admin.';\n //return $e;\n $module_infos->response_notice=\"No permitted informations to be rendered. Check with admin.\";\n echo \"Exception occurred\";\n }\n if($nopermittedmodules==0){\n $module_infos->response_notice=\"No permitted informations to be rendered. Check with admin.\";\n }\n\n //Clean function to 'mustRenderedX5gonInfos' must be applied here.\n return cleanresponse_resource_infos($module_infos);\n\n\n }", "function require_capability($capability, $context=NULL, $userid=NULL, $doanything=true,\n $errormessage='nopermissions', $stringfile='') {\n\n global $USER, $CFG;\n\n/// If the current user is not logged in, then make sure they are (if needed)\n\n if (empty($userid) and empty($USER->capabilities)) {\n if ($context && ($context->contextlevel == CONTEXT_COURSE)) {\n require_login($context->instanceid);\n } else if ($context && ($context->contextlevel == CONTEXT_MODULE)) {\n if ($cm = get_record('course_modules','id',$context->instanceid)) {\n if (!$course = get_record('course', 'id', $cm->course)) {\n error('Incorrect course.');\n }\n require_course_login($course, true, $cm);\n\n } else {\n require_login();\n }\n } else if ($context && ($context->contextlevel == CONTEXT_SYSTEM)) {\n if (!empty($CFG->forcelogin)) {\n require_login();\n }\n\n } else {\n require_login();\n }\n }\n\n/// OK, if they still don't have the capability then print a nice error message\n\n if (!has_capability($capability, $context, $userid, $doanything)) {\n $capabilityname = get_capability_string($capability);\n print_error($errormessage, $stringfile, '', $capabilityname);\n }\n}", "function MaximumCMSVersion() {\n\t\treturn \"2.0.0\";\n\t}", "function bptmce_loader() {\n\trequire_once( dirname(__FILE__) . '/bp-tinymce.php' );\n}", "function usp_ews_get_monitorable_modules() {\n global $DB;\n\n return array(\n 'assign' => array(\n 'defaultTime' => 'duedate',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {assign_submission}\n WHERE assignment = :eventid\n AND userid = :userid\n AND status = 'submitted'\",\n 'marked' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assign'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assign'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\"\n ),\n 'defaultAction' => 'submitted'\n ),\n 'assignment' => array(\n 'defaultTime' => 'timedue',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {assignment_submissions}\n WHERE assignment = :eventid\n AND userid = :userid\n AND (\n numfiles >= 1\n OR {$DB->sql_compare_text('data2')} <> ''\n )\",\n 'marked' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assignment'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'assignment'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\"\n ),\n 'defaultAction' => 'submitted'\n ),\n 'bigbluebuttonbn' => array(\n 'defaultTime' => 'timedue',\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'bigbluebuttonbn'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'recordingsbn' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'recordingsbn'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'book' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'book'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'certificate' => array(\n 'actions' => array(\n 'awarded' => \"SELECT id\n FROM {certificate_issues}\n WHERE certificateid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'awarded'\n ),\n 'chat' => array(\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {chat_messages}\n WHERE chatid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'choice' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'answered' => \"SELECT id\n FROM {choice_answers}\n WHERE choiceid = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'answered'\n ),\n 'data' => array(\n 'defaultTime' => 'timeviewto',\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'data'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'feedback' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'responded_to' => \"SELECT id\n FROM {feedback_completed}\n WHERE feedback = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'responded_to'\n ),\n 'resource' => array( // AKA file.\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'resource'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'flashcardtrainer' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'flashcardtrainer'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'folder' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'folder'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'forum' => array(\n 'defaultTime' => 'assesstimefinish',\n 'actions' => array(\n\t\t\t\t'viewed' => \"SELECT id\n\t\t\t\t\t\t\t\t\t FROM {log}\n\t\t\t\t\t\t\t\t\tWHERE course = :courseid\n\t\t\t\t\t\t\t\t\t AND module = 'forum'\n\t\t\t\t\t\t\t\t\t AND action = 'view forum' \n\t\t\t\t\t\t\t\t\t AND cmid = :cmid\n\t\t\t\t\t\t\t\t\t AND userid = :userid\",\n 'posted_to' => \"SELECT id\n FROM {forum_posts}\n WHERE userid = :userid AND discussion IN (\n SELECT id\n FROM {forum_discussions}\n WHERE forum = :eventid\n )\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'glossary' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'glossary'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'hotpot' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {hotpot_attempts}\n WHERE hotpotid = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {hotpot_attempts}\n WHERE hotpotid = :eventid\n AND userid = :userid\n AND timefinish <> 0\",\n ),\n 'defaultAction' => 'finished'\n ),\n 'imscp' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'imscp'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'journal' => array(\n 'actions' => array(\n 'posted_to' => \"SELECT id\n FROM {journal_entries}\n WHERE journal = :eventid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'posted_to'\n ),\n 'lesson' => array(\n 'defaultTime' => 'deadline',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {lesson_attempts}\n WHERE lessonid = :eventid\n AND userid = :userid\n UNION ALL\n SELECT id\n FROM {lesson_branch}\n WHERE lessonid = :eventid1\n AND userid = :userid1\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'lesson'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\"\n ),\n 'defaultAction' => 'attempted'\n ),\n 'page' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'page'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'questionnaire' => array(\n 'defaultTime' => 'closedate',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {questionnaire_attempts}\n WHERE qid = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {questionnaire_response}\n WHERE complete = 'y'\n AND username = :userid\n AND survey_id = :eventid\",\n ),\n 'defaultAction' => 'finished'\n ),\n 'quiz' => array(\n 'defaultTime' => 'timeclose',\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {quiz_attempts}\n WHERE quiz = :eventid\n AND userid = :userid\",\n 'finished' => \"SELECT id\n FROM {quiz_attempts}\n WHERE quiz = :eventid\n AND userid = :userid\n AND timefinish <> 0\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'quiz'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\",\n 'passed' => \"SELECT g.finalgrade, i.gradepass\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'quiz'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\"\n ),\n 'defaultAction' => 'finished'\n ),\n 'scorm' => array(\n 'actions' => array(\n 'attempted' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\",\n 'completed' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\n AND element = 'cmi.core.lesson_status'\n AND {$DB->sql_compare_text('value')} = 'completed'\",\n 'passedscorm' => \"SELECT id\n FROM {scorm_scoes_track}\n WHERE scormid = :eventid\n AND userid = :userid\n AND element = 'cmi.core.lesson_status'\n AND {$DB->sql_compare_text('value')} = 'passed'\"\n ),\n 'defaultAction' => 'attempted'\n ),\n 'turnitintool' => array(\n 'defaultTime' => 'defaultdtdue',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {turnitintool_submissions}\n WHERE turnitintoolid = :eventid\n AND userid = :userid\n AND submission_score IS NOT NULL\"\n ),\n 'defaultAction' => 'submitted'\n ),\n 'url' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'url'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'wiki' => array(\n 'actions' => array(\n 'viewed' => \"SELECT id\n FROM {log}\n WHERE course = :courseid\n AND module = 'wiki'\n AND action = 'view'\n AND cmid = :cmid\n AND userid = :userid\"\n ),\n 'defaultAction' => 'viewed'\n ),\n 'workshop' => array(\n 'defaultTime' => 'assessmentend',\n 'actions' => array(\n 'submitted' => \"SELECT id\n FROM {workshop_submissions}\n WHERE workshopid = :eventid\n AND authorid = :userid\",\n 'assessed' => \"SELECT s.id\n FROM {workshop_assessments} a, {workshop_submissions} s\n WHERE s.workshopid = :eventid\n AND s.id = a.submissionid\n AND a.reviewerid = :userid\n AND a.grade IS NOT NULL\",\n 'graded' => \"SELECT g.rawgrade\n FROM {grade_grades} g, {grade_items} i\n WHERE i.itemmodule = 'workshop'\n AND i.iteminstance = :eventid\n AND i.id = g.itemid\n AND g.userid = :userid\n AND g.finalgrade IS NOT NULL\"\n ),\n 'defaultAction' => 'submitted'\n ),\n );\n}", "function mr_megaresult_admin_init() {\n include_once 'megaresult_admin.php';\n}", "function getJname() \r\n {\r\n return 'phpbb3';\r\n }", "function qa_register_core_modules()\n{\n\tqa_register_module('filter', 'plugins/qa-filter-basic.php', 'qa_filter_basic', '');\n\tqa_register_module('editor', 'plugins/qa-editor-basic.php', 'qa_editor_basic', '');\n\tqa_register_module('viewer', 'plugins/qa-viewer-basic.php', 'qa_viewer_basic', '');\n\tqa_register_module('event', 'plugins/qa-event-limits.php', 'qa_event_limits', 'Q2A Event Limits');\n\tqa_register_module('event', 'plugins/qa-event-notify.php', 'qa_event_notify', 'Q2A Event Notify');\n\tqa_register_module('event', 'plugins/qa-event-updates.php', 'qa_event_updates', 'Q2A Event Updates');\n\tqa_register_module('search', 'plugins/qa-search-basic.php', 'qa_search_basic', '');\n\tqa_register_module('widget', 'plugins/qa-widget-activity-count.php', 'qa_activity_count', 'Activity Count');\n\tqa_register_module('widget', 'plugins/qa-widget-ask-box.php', 'qa_ask_box', 'Ask Box');\n\tqa_register_module('widget', 'plugins/qa-widget-related-qs.php', 'qa_related_qs', 'Related Questions');\n\tqa_register_module('widget', 'plugins/qa-widget-category-list.php', 'qa_category_list', 'Categories');\n}", "function plugin_version_itilcategorygroups() {\n return array('name' => __('ItilCategory Groups', 'itilcategorygroups'),\n 'version' => '0.90+1.0.3',\n 'author' => \"<a href='http://www.teclib.com'>TECLIB'</a>\",\n 'homepage' => 'http://www.teclib.com');\n}", "function get_coursemodule($module, $recordid, $courseid) {\n global $CFG;\n\n if ($CFG->version >= 2012120300) {\n return get_fast_modinfo($courseid)->instances[$module][$recordid];\n }\n else {\n return get_coursemodule_from_instance($module, $recordid, $courseid);\n }\n}", "function WPLMS_plugin_init()\n{\n // Load translation support\n $domain = 'wp_lms'; // This is the translation locale.\n\n // Check the WordPress language directory for /wp-content/languages/wp_lms/wp_lms-en_US.mo first\n $locale = apply_filters('plugin_locale', get_locale(), $domain);\n load_textdomain($domain, WP_LANG_DIR . '/wp_lms/' . $domain . '-' . $locale . '.mo');\n\n // Then load the plugin version\n load_plugin_textdomain($domain, FALSE, dirname(plugin_basename(__FILE__)) . '/language/');\n\n // Run setup\n WPLMS_plugin_setup(false);\n\n // ### Admin\n if (is_admin()) {\n // Menus\n add_action('admin_menu', 'WPLMS_menu_MainMenu');\n add_action('admin_menu', 'WPLMS_excludeFromMenu');\n }else{\n\n }\n\n //Admin Scripts\n add_action('admin_enqueue_scripts', 'WPLMS_adminScripts');\n\n //AJAX calls\n add_action('wp_ajax_add_new_user_course', 'WPLMS_add_new_user_course');\n\n //ShortCodes\n add_shortcode('lms_course_info', 'WPLMS_courseInfo');\n add_shortcode('lms_choose_product', 'WPLMS_chooseProduct');\n add_shortcode('lms_shopping_cart', 'WPLMS_shoppingCart');\n add_shortcode('lms_checkout', 'WPLMS_checkout');\n add_shortcode('lms_lessons', 'WPLMS_lessons');\n add_shortcode('lms_mycourses', 'WPLMS_mycourses');\n\tadd_shortcode('lms_quiz', 'WPLMS_quiz');\n\n\n\t//add_shortcode('process_product_page', 'process_product_page_shortcode');\n}", "function xmldb_tictactoe_upgrade($oldversion) {\n global $DB;\n\n $dbman = $DB->get_manager(); // Loads ddl manager and xmldb classes.\n\n if ($oldversion < 2018030502) {\n\n $table = new xmldb_table('tictactoe');\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('course', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'id');\n $table->add_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'course');\n $table->add_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'name');\n $table->add_field('introformat', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'intro');\n $table->add_field('level', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'introformat');\n $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'level');\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'timecreated');\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_index('courseindex', XMLDB_INDEX_NOTUNIQUE, array('course'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n upgrade_mod_savepoint(true, 2018030502, 'tictactoe');\n }\n\n if ($oldversion < 2018031300) {\n\n $table = new xmldb_table('tictactoe_game');\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('tictactoeid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'id');\n $table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'tictactoeid');\n $table->add_field('state', XMLDB_TYPE_TEXT, null, null, null, null, null, 'userid');\n $table->add_field('level', XMLDB_TYPE_INTEGER, '4', null, XMLDB_NOTNULL, null, '0', 'introformat');\n $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'result');\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, 'timecreated');\n\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n $table->add_key('tictactoeid', XMLDB_KEY_FOREIGN, array('tictactoeid'), 'tictactoe', array('id'));\n $table->add_key('userid', XMLDB_KEY_FOREIGN, array('userid'), 'user', array('id'));\n\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n\n upgrade_mod_savepoint(true, 2018031300, 'tictactoe');\n }\n\n return true;\n}", "function __construct() \r\n{\r\n $this->name=\"scheduled_job\";\r\n $this->title=\"scheduled job module\";\r\n $this->module_category=\"<#LANG_SECTION_SYSTEM#>\";\r\n //$this->checkInstalled();\r\n}", "function xmldb_vocabulario_install() {\n //importar los datos.\n $dbhost = 'localhost';\n $dbuser = 'root'; //establecemos el nombre de usuario\n //$dbpass = 'Daf-Collage*'; //y la contraseña\n //Con la llamada a esta función, podemos conectarnos a nuestra base de datos.\n $conn = mysql_connect($dbhost, $dbuser/*, $dbpass*/);\n //Comprobamos si la conexión se ha realizado correctamente\n if(! $conn )\n {\n die('No se ha podido conectar con la base de datos: ' . mysql_error());\n }\n //A continuación, seleccionamos la base de datos donde queremos realizar la inserción\n //de datos\n mysql_select_db('moodle');\n //Creamos un array con el nombre de todas las tablas que deseamos importar.\n $filenames = array(\n 'camposlexicos_de', \n 'camposlexicos_en', \n 'camposlexicos_es', \n 'camposlexicos_fr',\n 'camposlexicos_pl',\n 'intenciones_de', \n 'intenciones_en', \n 'intenciones_es', \n 'intenciones_fr',\n 'intenciones_pl',\n 'tipologias_de', \n 'tipologias_en', \n 'tipologias_es', \n 'tipologias_fr',\n 'tipologias_pl',\n 'adjetivos',\n 'estrategias',\n 'otros',\n 'sustantivos',\n 'verbos',\n 'gramatica'\n );\n //En el fichero vocabulariobackupvacio.sql se encuentran las instrucciones necesarias\n //para crear las tablas oportunas en la base de datos moodle.\n $crear='/home/dafcollage/cuaderno_digital/vocabulario/db/dataxmls/vocabulariobackupvacio.sql';\n $sql = \"LOAD DATA INFILE '$crear' INTO DATABASE moodle\";\n //Recorremos todos los ficheros *.sql\n foreach ($filenames as $filename) {\n\n $table_name = \"mdl_vocabulario_\".$filename;\n //Para poder cargar cada fichero *.sql, debemos darle permisos a la ruta\n //que especifica abajo.\n $backup_file = '/var/lib/mysql/moodle28des/'.$filename.'.sql';\n //para cada tabla, insertamos sus datos correspondientes.\n $sql = \"LOAD DATA INFILE '$backup_file' INTO TABLE $table_name\";\n $retval = mysql_query( $sql, $conn );\n //Comprobamos si la inserción se ha realizado correctamente.\n if(! $retval )\n {\n die('Los datos no han podido ser cargados: ' .mysql_error());\n }\n }\n //Si todo ha salido bien, mostramos un mensaje diciendo que todo está OK y cerramos\n //la conexión con la base de datos.\n echo \"Los datos se han cargado correctamente. \\n\";\n mysql_close($conn);\n\n \n}", "public function test_not_class_not_time_not_group() {\n require_once('C:\\wamp\\www\\moodle\\blocks\\supervised\\logs\\logslib.php');\n global $DB;\n $this->resetAfterTest(true);\n // Add new student into user's table.\n $student = $this->construct_user('student', '[email protected]');\n // Add new teacher into user's table.\n $teacher = $this->construct_user('teacher', '[email protected]');\n // Add new course into course's table.\n $course = $this->construct_course(1418301283, 1418301683);\n // Add new group into group's table.\n $group = $this->construct_group($course->id, 1418301283, 1418301683);\n // Add student into group.\n $this->add_user_to_group($group->id, $student->id);\n // Add new classroom into classroom's table.\n $class = $this->construct_class(\"192.168.173.100\");\n // Add new lessontype into lessontype's table.\n $lesson = $this->construct_lesson($course->id);\n // Add new session into session's table.\n $session = $this->construct_session_for_group($course->id, $class->id, $group->id, $teacher->id, $lesson->id);\n $session->timestart = 1411044722;\n $session->duration = '2';\n $session->timeend = 1411044813;\n $session->state = '2';\n $session->iplist = \"192.168.173.100\";\n $session->id = $DB->insert_record('block_supervised_session', $session);\n // Add new user-session pair into supervised_user table.\n $studentsession = new stdClass();\n $studentsession->sessionid = $session->id;\n $studentsession->userid = $student->id + 1;\n $DB->insert_record('block_supervised_user', $studentsession);\n // Write record in logstore table about event.\n $log = $this->construct_log($student->id + 1, $course->id, '1411044900', \"192.168.173.248\");\n\n $logsfilteredexpected = array();\n $expectedresult['logs'] = array_slice($logsfilteredexpected, 0, 10);\n $expectedresult['totalcount'] = 0;\n\n $timefrom = 1411044722;\n $timeto = 1411044813;\n $result = supervisedblock_build_logs_array($session->id, $timefrom, $timeto, $student->id, 0, 10);\n $this->assertEquals($result, $expectedresult);\n }", "function upgrade_560()\n {\n }", "function xmldb_solo_upgrade($oldversion) {\n global $DB;\n\n $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes\n\n if ($oldversion < 2019092400){\n $table = new xmldb_table('solo_ai_result');\n\n $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n $table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('moduleid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('attemptid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('transcript', XMLDB_TYPE_TEXT, null, null, null, null);\n $table->add_field('passage', XMLDB_TYPE_TEXT, null, null, null, null);\n $table->add_field('jsontranscript', XMLDB_TYPE_TEXT, null, null, null, null);\n $table->add_field('wpm', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('accuracy', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('sessionscore', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('sessiontime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('sessionerrors', XMLDB_TYPE_TEXT, null, null, null, null);\n $table->add_field('sessionmatches', XMLDB_TYPE_TEXT, null, null, null, null);\n $table->add_field('sessionendword', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('errorcount', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n $table->add_field('timemodified', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');\n\n // Adding keys to table solo ai result.\n $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\n // Conditionally launch create table for solo ai resiult.\n if (!$dbman->table_exists($table)) {\n $dbman->create_table($table);\n }\n upgrade_mod_savepoint(true, 2019092400, 'solo');\n }\n\n\n if ($oldversion < 2019100500) {\n $table = new xmldb_table('solo_attemptstats');\n $field = new xmldb_field('aiaccuracy', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2019100500, 'solo');\n }\n\n if ($oldversion < 2019120900) {\n $table = new xmldb_table('solo');\n $field = new xmldb_field('postattemptedit', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2019120900, 'solo');\n }\n\n\n if ($oldversion < 2020061615) {\n // Define field feedback to be added to solo_attempts.\n $table = new xmldb_table('solo_attempts');\n $field = new xmldb_field('feedback', XMLDB_TYPE_TEXT, null, null, null, null, null, 'completedsteps');\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n // solo savepoint reached.\n upgrade_mod_savepoint(true, 2020061615, 'solo');\n }\n\n if ($oldversion < 2020071501) {\n $table = new xmldb_table('solo_attempts');\n $field = new xmldb_field('grade', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null);\n\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2020071501, 'solo');\n }\n\n if ($oldversion < 2020082500) {\n $table = new xmldb_table('solo');\n $field = new xmldb_field('completionallsteps', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, '0');\n\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2020082500, 'solo');\n }\n\n if ($oldversion < 2021011001) {\n $table = new xmldb_table('solo');\n $field = new xmldb_field('gradewordgoal', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, 200);\n\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n\n upgrade_mod_savepoint(true, 2021011001, 'solo');\n }\n\n // Add TTS topic to solo table\n if ($oldversion < 2021022200) {\n $table = new xmldb_table('solo');\n\n // Define fields itemtts and itemtts voice to be added to minilesson\n $fields=[];\n $fields[] = new xmldb_field('topicttsvoice', XMLDB_TYPE_CHAR, '255', XMLDB_UNSIGNED);\n $fields[] = new xmldb_field('topictts', XMLDB_TYPE_TEXT, null, null, null, null);\n\n // Add fields\n foreach ($fields as $field) {\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field);\n }\n }\n upgrade_mod_savepoint(true, 2021022200, 'solo');\n }\n\n // Final return of upgrade result (true, all went good) to Moodle.\n return true;\n}", "function upgrade_130()\n {\n }", "function Login_mod_new()\n {\n //parent||CI_Model();\n\t\tparent::Model();\n \t//$this->load->database();\n }", "function xmldb_local_dashboard_upgrade($oldversion) {\n\tglobal $DB;\n\t// Loads ddl manager and xmldb classes.\n\t$dbman = $DB->get_manager();\n\t\n\tif ($oldversion < 2017012303) {\n\t\n\t\t// Define table dashboard_turnitin to be created.\n\t\t$table = new xmldb_table('dashboard_turnitin');\n\t\n\t\t// Adding fields to table dashboard_turnitin.\n\t\t$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n\t\t$table->add_field('time', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('courseid', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('amountcreated', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('useramount', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\n\t\t// Adding keys to table dashboard_turnitin.\n\t\t$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\t\n\t\t// Conditionally launch create table for dashboard_turnitin.\n\t\tif (!$dbman->table_exists($table)) {\n\t\t\t$dbman->create_table($table);\n\t\t}\n\t\n\t\t// Dashboard savepoint reached.\n\t\tupgrade_plugin_savepoint(true, 2017012303, 'local', 'dashboard');\n\t}\n\t\n\tif ($oldversion < 2017012304) {\n\t\n\t\t// Define table dashboard_emarking to be created.\n\t\t$table = new xmldb_table('dashboard_emarking');\n\t\n\t\t// Adding fields to table dashboard_emarking.\n\t\t$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n\t\t$table->add_field('time', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('courseid', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('amountcreated', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('digitalized', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('corrections', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('publish', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\n\t\t// Adding keys to table dashboard_emarking.\n\t\t$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\t\n\t\t// Conditionally launch create table for dashboard_emarking.\n\t\tif (!$dbman->table_exists($table)) {\n\t\t\t$dbman->create_table($table);\n\t\t}\n\t\n\t\t// Dashboard savepoint reached.\n\t\tupgrade_plugin_savepoint(true, 2017012304, 'local', 'dashboard');\n\t}\n\t\n\tif ($oldversion < 2017012305) {\n\t\n\t\t// Define table dashboard_paperattendance to be created.\n\t\t$table = new xmldb_table('dashboard_paperattendance');\n\t\n\t\t// Adding fields to table dashboard_paperattendance.\n\t\t$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);\n\t\t$table->add_field('time', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('courseid', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('amountcreated', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('presence', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\t$table->add_field('discussion', XMLDB_TYPE_INTEGER, '20', null, null, null, null);\n\t\n\t\t// Adding keys to table dashboard_paperattendance.\n\t\t$table->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));\n\t\n\t\t// Conditionally launch create table for dashboard_paperattendance.\n\t\tif (!$dbman->table_exists($table)) {\n\t\t\t$dbman->create_table($table);\n\t\t}\n\t\n\t\t// Dashboard savepoint reached.\n\t\tupgrade_plugin_savepoint(true, 2017012305, 'local', 'dashboard');\n\t}\n\tif ($oldversion < 2017032801) {\n\t\n\t\t// Rename field courseid on table dashboard_paperattendance to categoryid.\n\t\t$table = new xmldb_table('dashboard_paperattendance');\n\t\t$field = new xmldb_field('courseid', XMLDB_TYPE_INTEGER, '20', null, null, null, null, 'time');\n\t\n\t\t// Launch rename field courseid.\n\t\t$dbman->rename_field($table, $field, 'categoryid');\n\t\n\t\t// Dashboard savepoint reached.\n\t\tupgrade_plugin_savepoint(true, 2017032801, 'local', 'dashboard');\n\t}\n\tif ($oldversion < 2017032802) {\n\t\n\t\t// Rename field amountcreated on table dashboard_paperattendance to sessionsnumber.\n\t\t$table = new xmldb_table('dashboard_paperattendance');\n\t\t$field = new xmldb_field('amountcreated', XMLDB_TYPE_INTEGER, '20', null, null, null, null, 'courseid');\n\t\n\t\t// Launch rename field amountcreated.\n\t\t$dbman->rename_field($table, $field, 'sessionsnumber');\n\t\n\t\t// Dashboard savepoint reached.\n\t\tupgrade_plugin_savepoint(true, 2017032802, 'local', 'dashboard');\n\t}\n\t\n\treturn true;\n\t}", "function customlabel_get_candidate_modules() {\n global $COURSE, $CFG;\n\n if (!empty($CFG->upgraderunning)) {\n return;\n }\n\n $modinfo = get_fast_modinfo($COURSE);\n $modules = array('0' => get_string('unassigned', 'customlabeltype_worktodo'));\n\n foreach ($modinfo->get_cms() as $cminfo) {\n if (!$cminfo->visible) {\n continue;\n }\n if (preg_match('/label$/', $cminfo->modname)) {\n continue;\n }\n include_once($CFG->dirroot.'/mod/'.$cminfo->modname.'/lib.php');\n $supportf = $cminfo->modname.'_supports';\n if (!$supportf(FEATURE_GRADE_HAS_GRADE) && !$supportf(FEATURE_GRADE_OUTCOMES)) {\n // Module seems it is not gradable so not a worktodo module.\n continue;\n }\n $modules[$cminfo->module] = $cminfo->name;\n }\n\n return $modules;\n}", "function upgrade_270()\n {\n }", "function subpage_get_coursemodule_info($cm) {\n global $DB, $CFG;\n $subpage = $DB->get_record('subpage', array('id' => $cm->instance), '*', MUST_EXIST);\n if ($subpage->enablesharing) {\n // Work out current value.\n require_once($CFG->dirroot . '/mod/sharedsubpage/locallib.php');\n $content = serialize(sharedsubpage_gather_data($subpage));\n $hash = sha1($subpage->name . \"\\n\" . $content);\n\n if ($hash != $subpage->sharedcontenthash) {\n // Update on all shared versions.\n $DB->execute(\"UPDATE {sharedsubpage} SET content=?, name=? WHERE subpageid=?\",\n array($content, sharedsubpage_get_name($subpage->name), $subpage->id));\n // Clear modinfo on all courses that include shared versions.\n $courses = $DB->get_fieldset_sql(\n \"SELECT DISTINCT course FROM {sharedsubpage} WHERE subpageid = ?\",\n array($subpage->id));\n foreach ($courses as $courseid) {\n rebuild_course_cache($courseid, true);\n }\n\n // Update OSEP theme shared subpages.\n if (class_exists('\\mod_oustudyplanshare\\backend')) {\n // Update on all shared versions.\n $DB->execute('UPDATE {oustudyplanshare} SET content = ?, name = ? ' .\n 'WHERE oustudyplansubpageid = ?', array($content,\n \\mod_oustudyplanshare\\backend::get_share_name($subpage->name),\n -$subpage->id));\n // Clear modinfo on all courses that include shared versions.\n $courses = $DB->get_fieldset_sql(\n \"SELECT DISTINCT course FROM {oustudyplanshare} WHERE oustudyplansubpageid = ?\",\n array(-$subpage->id));\n foreach ($courses as $courseid) {\n rebuild_course_cache($courseid, true);\n }\n }\n\n // Set hash so we don't do that again.\n $DB->set_field('subpage', 'sharedcontenthash', $hash, array('id' => $subpage->id));\n }\n }\n // Add the all the sectionids within this subpage to the customdata.\n $info = new cached_cm_info();\n $sectionids = array();\n $sectionstealth = array();\n $sections = $DB->get_records('subpage_sections',\n array('subpageid' => $subpage->id), 'pageorder');\n foreach ($sections as $section) {\n $sectionids[] = $section->sectionid;\n $sectionstealth[$section->sectionid] = $section->stealth;\n }\n $info->customdata = (object)array('sectionids' => $sectionids,\n 'sectionstealth' => $sectionstealth);\n return $info;\n}", "function WPLMS_dashboard(){\n require_once WPLMS_PLUGIN_PATH . \"/pages/admin/dashboard_page.php\";\n}", "function upgrade_101()\n {\n }", "function local_ltiprovider_enrol_user( $tool, $user, $isinstructor, $return = false ) {\n global $DB;\n\n if ( ( $isinstructor && ! $tool->enrolinst ) || ( ! $isinstructor && ! $tool->enrollearn ) ) {\n return $return;\n }\n\n $course = $DB->get_record( 'course', array( 'id' => $tool->courseid ), '*', MUST_EXIST );\n\n $manual = enrol_get_plugin( 'manual' );\n\n $today = time();\n $today = make_timestamp( date( 'Y', $today ), date( 'm', $today ), date( 'd', $today ), 0, 0, 0 );\n $timeend = 0;\n if ( $tool->enrolperiod ) {\n $timeend = $today + $tool->enrolperiod;\n }\n\n // Course role id for the Instructor or Learner\n // TODO Do something with lti system admin (urn:lti:sysrole:ims/lis/Administrator)\n $roleid = $isinstructor ? $tool->croleinst : $tool->crolelearn;\n\n if ( $instances = enrol_get_instances( $course->id, false ) ) {\n foreach ( $instances as $instance ) {\n if ( $instance->enrol === 'manual' ) {\n\n // Check if the user enrolment exists\n if ( ! $ue = $DB->get_record( 'user_enrolments',\n array( 'enrolid' => $instance->id, 'userid' => $user->id ) ) ) {\n // This means a new enrolment, so we have to check enroment starts and end limits and also max occupation\n\n // First we check if there is a max enrolled limit\n if ( $tool->maxenrolled ) {\n // TODO Improve this count because unenrolled users from Moodle admin panel are not sync with this table\n if ( $DB->count_records( 'local_ltiprovider_user',\n array( 'toolid' => $tool->id ) ) > $tool->maxenrolled ) {\n // We do not use print_error for the iframe issue allowframembedding\n if ( $return ) {\n return false;\n } else {\n echo get_string( 'maxenrolledreached', 'local_ltiprovider' );\n die;\n }\n }\n }\n\n $timenow = time();\n if ( $tool->enrolstartdate and $timenow < $tool->enrolstartdate ) {\n // We do not use print_error for the iframe issue allowframembedding\n if ( $return ) {\n return false;\n } else {\n echo get_string( 'enrolmentnotstarted', 'local_ltiprovider' );\n die;\n }\n }\n if ( $tool->enrolenddate and $timenow > $tool->enrolenddate ) {\n // We do not use print_error for the iframe issue allowframembedding\n if ( $return ) {\n return false;\n } else {\n echo get_string( 'enrolmentfinished', 'local_ltiprovider' );\n die;\n }\n }\n // TODO, delete created users not enrolled\n\n $manual->enrol_user( $instance, $user->id, $roleid, $today, $timeend );\n if ( $return ) {\n return true;\n }\n }\n break;\n }\n }\n }\n\n return false;\n}", "function ufclas_matlab_admin_notice_error(){\n\t?>\n <div class=\"notice notice-error\">\n <p><?php _e( 'There was an error importing. Please try again.', 'ufclas-matlab' ); ?></p>\n </div>\n <?php\n}", "function sitemgr_upgrade1_0_1_001()\n{\n\t$modules2nav_type = array('currentsection' => 1,'index' => 2,'index_block' => 3,'navigation' => 4,'sitetree' => 5,'toc' => 6,'toc_block' => 7);\n\n\t$db = clone($GLOBALS['egw_setup']->db);\n\t$db->set_app('sitemgr');\n\t$db2 = clone($db);\n\n\t// get the module_id of all navigation modules and remove the old modules\n\t$db->select('egw_sitemgr_modules','module_id,module_name',array('module_name' => array_keys($modules2nav_type)),__LINE__,__FILE__);\n\t$id2module = $old_modules = array();\n\twhile(($row = $db->row(true)))\n\t{\n\t\t$id2module[$row['module_id']] = $row['module_name'];\n\t\tif ($row['module_name'] != 'navigation')\n\t\t{\n\t\t\t$old_modules[] = $row['module_id'];\n\t\t}\n\t}\n\t$db->delete('egw_sitemgr_modules',array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t// check if navigation is already registered, if not register it\n\n\tif (!($navigation_id = array_search('navigation',$id2module)))\n\t{\n\t\tif (ereg('\\$this->description = lang\\(\\'([^'.\"\\n\".']*)\\'\\);',implode(\"\\n\",file(EGW_SERVER_ROOT.'/sitemgr/modules/class.module_navigation.inc.php')),$parts))\n\t\t{\n\t\t\t$description = str_replace(\"\\\\'\",\"'\",$parts[1]);\n\t\t}\n\t\t$db->insert('egw_sitemgr_modules',array(\n\t\t\t'module_name' => 'navigation',\n\t\t\t'module_description' => $description,\n\t\t),false,__LINE__,__FILE__);\n\t\t$navigation_id = $db->get_last_insert_id('egw_sitemgr_modules','module_id');\n\t}\n\t// add navigation to all contentareas, which allowed any for the old modules before and remove the old modules\n\t$db->select('egw_sitemgr_active_modules','DISTINCT cat_id,area',array('module_id' => $old_modules),__LINE__,__FILE__);\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$row['module_id'] = $navigation_id;\n\t\t$db2->insert('egw_sitemgr_active_modules',array(),$row,__LINE__,__FILE__);\n\t}\n\t$db->delete('egw_sitemgr_active_modules',array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t// replace old modules in the blocks with the navigation module\n\t$db->select('egw_sitemgr_blocks','block_id,module_id',array('module_id' => array_keys($id2module)),__LINE__,__FILE__);\n\t$block_id2module_id = array();\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$block_id2module_id[$row['block_id']] = $row['module_id'];\n\t}\n\t$db->select('egw_sitemgr_content','version_id,block_id,arguments',array('block_id' => array_keys($block_id2module_id)),__LINE__,__FILE__);\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$arguments = unserialize($row['arguments']);\n\t\tif (!isset($arguments['nav_type']))\n\t\t{\n\t\t\t$version_id = $row['version_id'];\n\t\t\tunset($row['version_id']);\n\t\t\t$arguments['nav_type'] = $modules2nav_type[$id2module[$block_id2module_id[$row['block_id']]]];\n\t\t\t$row['arguments'] = serialize($arguments);\n\t\t\t$db2->update('egw_sitemgr_content',$row,array('version_id' => $version_id),__LINE__,__FILE__);\n\t\t}\n\t}\n\t$db->update('egw_sitemgr_blocks',array('module_id' => $navigation_id),array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '1.2';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "function requireLogin() {\n global $CFG;\n if ( ! isset($_SESSION['user_id']) ) {\n $_SESSION['err'] = 'Login required';\n doRedirect($CFG->wwwroot.'/login.php') ;\n exit();\n }\n}", "function xmldb__auth_redmine_upgrade($oldversion) {\n global $CFG, $DB;\n\n // Automatically generated Moodle v3.2.0 release upgrade line.\n // Put any upgrade step following this.\n\n if ($oldversion < 2017032800) {\n // Convert info in config plugins from auth/redmine to auth_redmine\n upgrade_fix_config_auth_plugin_names('redmine');\n upgrade_fix_config_auth_plugin_defaults('redmine');\n upgrade_plugin_savepoint(true, 2017032800, 'auth', 'redmine');\n }\n\n // Automatically generated Moodle v3.3.0 release upgrade line.\n // Put any upgrade step following this.\n\n // Automatically generated Moodle v3.4.0 release upgrade line.\n // Put any upgrade step following this.\n\n // Automatically generated Moodle v3.5.0 release upgrade line.\n // Put any upgrade step following this.\n\n return true;\n}", "function dllc_pluginfile($course, $cm, $context, $filearea, array $args, $forcedownload, array $options=array()) {\n global $DB, $CFG;\n\n if ($context->contextlevel != CONTEXT_MODULE) {\n send_file_not_found();\n }\n\n require_login($course, true, $cm);\n\n send_file_not_found();\n}", "function lesson_restore_mods($mod,$restore) {\n\n global $CFG;\n\n $status = true;\n\n //Get record from backup_ids\n $data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id);\n\n if ($data) {\n //Now get completed xmlized object\n $info = $data->info;\n //if necessary, write to restorelog and adjust date/time fields\n if ($restore->course_startdateoffset) {\n restore_log_date_changes('Lesson', $restore, $info['MOD']['#'], array('AVAILABLE', 'DEADLINE'));\n }\n //traverse_xmlize($info); //Debug\n //print_object ($GLOBALS['traverse_array']); //Debug\n //$GLOBALS['traverse_array']=\"\"; //Debug\n\n //Now, build the lesson record structure\n $lesson->course = $restore->course_id;\n $lesson->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);\n $lesson->practice = backup_todb($info['MOD']['#']['PRACTICE']['0']['#']);\n $lesson->modattempts = backup_todb($info['MOD']['#']['MODATTEMPTS']['0']['#']);\n $lesson->usepassword = backup_todb($info['MOD']['#']['USEPASSWORD']['0']['#']);\n $lesson->password = backup_todb($info['MOD']['#']['PASSWORD']['0']['#']); \n $lesson->dependency = isset($info['MOD']['#']['DEPENDENCY']['0']['#'])?backup_todb($info['MOD']['#']['DEPENDENCY']['0']['#']):'';\n $lesson->conditions = isset($info['MOD']['#']['CONDITIONS']['0']['#'])?backup_todb($info['MOD']['#']['CONDITIONS']['0']['#']):'';\n $lesson->grade = backup_todb($info['MOD']['#']['GRADE']['0']['#']);\n $lesson->custom = backup_todb($info['MOD']['#']['CUSTOM']['0']['#']);\n $lesson->ongoing = backup_todb($info['MOD']['#']['ONGOING']['0']['#']);\n $lesson->usemaxgrade = backup_todb($info['MOD']['#']['USEMAXGRADE']['0']['#']);\n $lesson->maxanswers = backup_todb($info['MOD']['#']['MAXANSWERS']['0']['#']);\n $lesson->maxattempts = backup_todb($info['MOD']['#']['MAXATTEMPTS']['0']['#']);\n $lesson->review = backup_todb($info['MOD']['#']['REVIEW']['0']['#']);\n $lesson->nextpagedefault = backup_todb($info['MOD']['#']['NEXTPAGEDEFAULT']['0']['#']);\n $lesson->feedback = isset($info['MOD']['#']['FEEDBACK']['0']['#'])?backup_todb($info['MOD']['#']['FEEDBACK']['0']['#']):'';\n $lesson->minquestions = backup_todb($info['MOD']['#']['MINQUESTIONS']['0']['#']);\n $lesson->maxpages = backup_todb($info['MOD']['#']['MAXPAGES']['0']['#']);\n $lesson->timed = backup_todb($info['MOD']['#']['TIMED']['0']['#']);\n $lesson->maxtime = backup_todb($info['MOD']['#']['MAXTIME']['0']['#']);\n $lesson->retake = backup_todb($info['MOD']['#']['RETAKE']['0']['#']);\n $lesson->activitylink = isset($info['MOD']['#']['ACTIVITYLINK']['0']['#'])?backup_todb($info['MOD']['#']['ACTIVITYLINK']['0']['#']):'';\n $lesson->mediafile = isset($info['MOD']['#']['MEDIAFILE']['0']['#'])?backup_todb($info['MOD']['#']['MEDIAFILE']['0']['#']):'';\n $lesson->mediaheight = isset($info['MOD']['#']['MEDIAHEIGHT']['0']['#'])?backup_todb($info['MOD']['#']['MEDIAHEIGHT']['0']['#']):'';\n $lesson->mediawidth = isset($info['MOD']['#']['MEDIAWIDTH']['0']['#'])?backup_todb($info['MOD']['#']['MEDIAWIDTH']['0']['#']):'';\n $lesson->mediaclose = isset($info['MOD']['#']['MEDIACLOSE']['0']['#'])?backup_todb($info['MOD']['#']['MEDIACLOSE']['0']['#']):'';\n $lesson->slideshow = backup_todb($info['MOD']['#']['SLIDESHOW']['0']['#']);\n $lesson->width = backup_todb($info['MOD']['#']['WIDTH']['0']['#']);\n $lesson->height = backup_todb($info['MOD']['#']['HEIGHT']['0']['#']);\n $lesson->bgcolor = backup_todb($info['MOD']['#']['BGCOLOR']['0']['#']);\n $lesson->displayleft = isset($info['MOD']['#']['DISPLAYLEFT']['0']['#'])?backup_todb($info['MOD']['#']['DISPLAYLEFT']['0']['#']):'';\n $lesson->displayleftif = isset($info['MOD']['#']['DISPLAYLEFTIF']['0']['#'])?backup_todb($info['MOD']['#']['DISPLAYLEFTIF']['0']['#']):'';\n $lesson->progressbar = isset($info['MOD']['#']['PROGRESSBAR']['0']['#'])?backup_todb($info['MOD']['#']['PROGRESSBAR']['0']['#']):'';\n $lesson->highscores = backup_todb($info['MOD']['#']['SHOWHIGHSCORES']['0']['#']);\n $lesson->maxhighscores = backup_todb($info['MOD']['#']['MAXHIGHSCORES']['0']['#']);\n $lesson->available = backup_todb($info['MOD']['#']['AVAILABLE']['0']['#']);\n $lesson->deadline = backup_todb($info['MOD']['#']['DEADLINE']['0']['#']);\n $lesson->timemodified = backup_todb($info['MOD']['#']['TIMEMODIFIED']['0']['#']);\n\n //The structure is equal to the db, so insert the lesson\n $newid = insert_record(\"lesson\", $lesson);\n\n //Do some output\n if (!defined('RESTORE_SILENTLY')) {\n echo \"<li>\".get_string(\"modulename\",\"lesson\").\" \\\"\".format_string(stripslashes($lesson->name),true).\"\\\"</li>\";\n }\n backup_flush(300);\n\n if ($newid) {\n //We have the newid, update backup_ids\n backup_putid($restore->backup_unique_code,$mod->modtype,\n $mod->id, $newid);\n //We have to restore the lesson pages which are held in their logical order...\n $userdata = restore_userdata_selected($restore,\"lesson\",$mod->id);\n $status = lesson_pages_restore_mods($newid,$info,$restore,$userdata);\n //...and the user grades, high scores, and timer (if required)\n if ($status) {\n if ($userdata) {\n if(!lesson_grades_restore_mods($newid,$info,$restore)) {\n return false;\n }\n if (!lesson_high_scores_restore_mods($newid,$info,$restore)) {\n return false;\n }\n if (!lesson_timer_restore_mods($newid,$info,$restore)) {\n return false;\n }\n }\n // restore the default for the course. Only do this once by checking for an id for lesson_default\n $lessondefault = backup_getid($restore->backup_unique_code,'lesson_default',$restore->course_id);\n if (!$lessondefault) {\n $status = lesson_default_restore_mods($info,$restore);\n }\n \n }\n } else {\n $status = false;\n }\n } else {\n $status = false;\n }\n return $status;\n }", "function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0, $enrol=NULL) {\n\n global $USER, $CFG;\n\n $success = true;\n\n $args = array('roleid', 'userid', 'groupid', 'contextid');\n $select = array();\n foreach ($args as $arg) {\n if ($$arg) {\n $select[] = $arg.' = '.$$arg;\n }\n }\n if (!empty($enrol)) {\n $select[] = \"enrol='$enrol'\";\n }\n\n if ($select) {\n if ($ras = get_records_select('role_assignments', implode(' AND ', $select))) {\n $mods = get_list_of_plugins('mod');\n foreach($ras as $ra) {\n /// infinite loop protection when deleting recursively\n if (!$ra = get_record('role_assignments', 'id', $ra->id)) {\n continue;\n }\n $success = delete_records('role_assignments', 'id', $ra->id) and $success;\n\n /// If the user is the current user, then reload the capabilities too.\n if (!empty($USER->id) && $USER->id == $ra->userid) {\n load_all_capabilities();\n }\n $context = get_record('context', 'id', $ra->contextid);\n\n /// Ask all the modules if anything needs to be done for this user\n foreach ($mods as $mod) {\n include_once($CFG->dirroot.'/mod/'.$mod.'/lib.php');\n $functionname = $mod.'_role_unassign';\n if (function_exists($functionname)) {\n $functionname($ra->userid, $context); // watch out, $context might be NULL if something goes wrong\n }\n }\n\n /// now handle metacourse role unassigment and removing from goups if in course context\n if (!empty($context) and $context->contextlevel == CONTEXT_COURSE) {\n\n // cleanup leftover course groups/subscriptions etc when user has \n // no capability to view course\n // this may be slow, but this is the proper way of doing it\n if (!has_capability('moodle/course:view', $context, $ra->userid)) {\n // remove from groups\n if ($groups = get_groups($context->instanceid, $ra->userid)) {\n foreach ($groups as $group) {\n delete_records('groups_members', 'groupid', $group->id, 'userid', $ra->userid);\n }\n }\n\n // delete lastaccess records\n delete_records('user_lastaccess', 'userid', $ra->userid, 'courseid', $context->instanceid);\n }\n\n //unassign roles in metacourses if needed\n if ($parents = get_records('course_meta', 'child_course', $context->instanceid)) {\n foreach ($parents as $parent) {\n sync_metacourse($parent->parent_course);\n }\n }\n }\n }\n }\n }\n\n return $success;\n}", "function hs_courses_importer_post_update_8002() {\n $source = new FileStorage('../config/default');\n /** @var \\Drupal\\Core\\Config\\CachedStorage $config_storage */\n $config_storage = \\Drupal::service('config.storage');\n $config_storage->write('migrate_plus.migration.hs_courses', $source->read('migrate_plus.migration.hs_courses'));\n\n // I added the course id & course code to source.ids. Anytime the ids are\n // added/deleted the table must be deleted so that it can be rebuilt with the\n // additional columns on the next import.\n \\Drupal::database()->schema()->dropTable('migrate_map_hs_courses');\n drupal_flush_all_caches();\n}", "function shIsMultilingual()\n{\n\tShlSystem_Log::debug('sh404sef', 'Using deprecated ' . __FUNCTION__ . ', removed as not applicable anymore');\n}", "function upload_GenLicenceMod(){\n\n\tif(!extension_loaded('php_fidelylic'))\n\t\t//dl('php_fidelylic.dll');\n\t$module = 'php_fidelylic';\n\tif (extension_loaded($module))\n\t\t $str = \"module loaded\";\n\telse\n\t\t$str = \"Module $module is not compiled into PHP\";\n\n}", "function bigbluebuttonbn_get_extra_capabilities() {\n return array('moodle/site:accessallgroups');\n}", "function unilabel_get_coursemodule_info($coursemodule) {\n global $DB;\n\n if ($unilabel = $DB->get_record('unilabel', ['id' => $coursemodule->instance], 'id, name, intro, introformat, unilabeltype')) {\n $content = format_module_intro('unilabel', $unilabel, $coursemodule->id, false);\n\n $info = new cached_cm_info();\n // No filtering here because this info is cached and filtered later.\n $info->content = $content;\n $info->name = $unilabel->name;\n return $info;\n } else {\n return null;\n }\n}", "function upgrade_350()\n {\n }", "function languagelab_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {\n if (!empty($instances) && is_array($instances) && count($instances)) {\n $info = array();\n foreach ($instances as $id => $instance) {\n $info += languagelab_check_backup_mods_instances($instance,$backup_unique_code);\n }\n return $info;\n }\n\n //First the course data\n $info[0][0] = get_string(\"modulenameplural\",\"languagelab\");\n $info[0][1] = count_records(\"languagelab\", \"course\", \"$course\");\n return $info;\n }", "function xmldb_learnanalytics_upgrade($oldversion) {\n global $CFG, $DB;\n\n $dbman = $DB->get_manager();\n\n if ($oldversion < 2012061900) {\n if (!$dbman->table_exists('learnanalytics_cache')) {\n $dbman->install_one_table_from_xmldb_file($CFG->dirroot.'/mod/learnanalytics/db/install.xml', 'learnanalytics_cache');\n }\n upgrade_mod_savepoint(true, 2012061900, 'learnanalytics');\n }\n\n if ($oldversion < 2012080700) {\n $table = new xmldb_table('learnanalytics_cache');\n $field = new xmldb_field('rawdata');\n $field->set_attributes(XMLDB_TYPE_TEXT, 'big', null, null, null, null, null);\n if (!$dbman->field_exists($table, $field)) {\n $dbman->add_field($table, $field, 'settings');\n }\n\n upgrade_mod_savepoint(true, 2012080700, 'learnanalytics');\n }\n\n return true;\n}", "function wmfLabsSettings() {\nreturn array(\n\t'wgParserCacheType' => array(\n\t\t'default' => CACHE_MEMCACHED,\n\t),\n\n\t'wgSitename' => array(\n\t\t'deploymentwiki' => 'Deployment',\n\t\t'ee_prototypewiki' => 'Editor Engagement Prototype',\n\t\t'wikivoyage' => 'Wikivoyage',\n\t),\n\n\t'wgServer' => array(\n\t\t'default' => '//$lang.wikipedia.$variant.wmflabs.org',\n\t\t'wiktionary'\t=> '//$lang.wiktionary.$variant.wmflabs.org',\n\t\t'wikipedia' => '//$lang.wikipedia.$variant.wmflabs.org',\n\t\t'wikiversity'\t=> '//$lang.wikiversity.$variant.wmflabs.org',\n\t\t'wikispecies'\t=> '//$lang.wikispecies.$variant.wmflabs.org',\n\t\t'wikisource'\t=> '//$lang.wikisource.$variant.wmflabs.org',\n\t\t'wikiquote'\t=> '//$lang.wikiquote.$variant.wmflabs.org',\n\t\t'wikinews'\t=> '//$lang.wikinews.$variant.wmflabs.org',\n\t\t'wikibooks' => '//$lang.wikibooks.$variant.wmflabs.org',\n\t\t'wikivoyage' => '//$lang.wikivoyage.$variant.wmflabs.org',\n\n\t\t'commonswiki' => '//commons.wikimedia.$variant.wmflabs.org',\n\t\t'deploymentwiki' => '//deployment.wikimedia.$variant.wmflabs.org',\n\t\t'ee_prototypewiki' => '//ee-prototype.wikipedia.$variant.wmflabs.org',\n\t\t'loginwiki' => '//login.wikimedia.$variant.wmflabs.org',\n\t\t'metawiki' => '//meta.wikimedia.$variant.wmflabs.org',\n\t\t'testwiki' => '//test.wikimedia.$variant.wmflabs.org',\n\t\t'zerowiki' => '//zero.wikimedia.$variant.wmflabs.org',\n\t\t'wikidatawiki' => '//wikidata.$variant.wmflabs.org',\n\t),\n\n\t'wgCanonicalServer' => array(\n\t\t'default' => 'http://$lang.wikipedia.$variant.wmflabs.org',\n\t\t'wikipedia' => 'http://$lang.wikipedia.$variant.wmflabs.org',\n\t\t'wikibooks' => 'http://$lang.wikibooks.$variant.wmflabs.org',\n\t\t'wikiquote'\t=> 'http://$lang.wikiquote.$variant.wmflabs.org',\n\t\t'wikinews'\t=> 'http://$lang.wikinews.$variant.wmflabs.org',\n\t\t'wikisource'\t=> 'http://$lang.wikisource.$variant.wmflabs.org',\n\t\t'wikiversity' => 'http://$lang.wikiversity.$variant.wmflabs.org',\n\t\t'wiktionary' => 'http://$lang.wiktionary.$variant.wmflabs.org',\n\t\t'wikispecies' => 'http://$lang.wikispecies.$variant.wmflabs.org',\n\t\t'wikivoyage' => 'http://$lang.wikivoyage.$variant.wmflabs.org',\n\n\t\t'metawiki' => 'http://meta.wikimedia.$variant.wmflabs.org',\n\t\t'ee_prototypewiki' => 'http://ee-prototype.wikipedia.$variant.wmflabs.org',\n\t\t'commonswiki'\t=> 'http://commons.wikimedia.$variant.wmflabs.org',\n\t\t'deploymentwiki' => 'http://deployment.wikimedia.$variant.wmflabs.org',\n\t\t'loginwiki' => 'http://login.wikimedia.$variant.wmflabs.org',\n\t\t'testwiki' => 'http://test.wikimedia.$variant.wmflabs.org',\n\t\t'wikidatawiki' => 'http://wikidata.$variant.wmflabs.org',\n\t),\n\n\t'wmgUsabilityPrefSwitch' => array(\n\t\t'default' => ''\n\t),\n\n\t'wmgUseLiquidThreads' => array(\n\t\t'testwiki' => true,\n\t),\n\n\t'-wgUploadDirectory' => array(\n\t\t'default' => '/data/project/upload7/$site/$lang',\n\t\t'private' => '/data/project/upload7/private/$lang',\n\t),\n\n\t/* 'wmgUseOnlineStatusBar' => array( */\n\t/* \t'default' => false, */\n\t/* ), */\n\n\t'-wgUploadPath' => array(\n\t\t'default' => '//upload.$variant.wmflabs.org/$site/$lang',\n\t\t'private' => '/w/img_auth.php',\n\t//\t'wikimania2005wiki' => '//upload..org/wikipedia/wikimania', // back compat\n\t\t'commonswiki' => '//upload.$variant.wmflabs.org/wikipedia/commons',\n\t\t'metawiki' => '//upload.$variant.wmflabs.org/wikipedia/meta',\n\t\t'testwiki' => '//upload.$variant.wmflabs.org/wikipedia/test',\n\t),\n\n\t'-wgThumbnailBuckets' => array(\n\t\t'default' => array( 256, 512, 1024, 2048, 4096 ),\n\t),\n\n\t'-wgThumbnailMinimumBucketDistance' => array(\n\t\t'default' => 32,\n\t),\n\n\t'-wmgMathPath' => array(\n\t\t'default' => '//upload.$variant.wmflabs.org/math',\n\t),\n\n\t'wmgNoticeProject' => array(\n\t\t'deploymentwiki' => 'meta',\n\t),\n\n\t//'-wgDebugLogGroups' => array(),\n\t'-wgRateLimitLog' => array(),\n\t'-wgJobLogFile' => array(),\n\n\t// bug 60013, 56758\n\t'-wmgRC2UDPPrefix' => array(\n\t\t'default' => false,\n\t),\n\n\t'wmgUseWebFonts' => array(\n\t\t'mywiki' => true,\n\t),\n\n\t'wgLogo' => array(\n\t\t'commonswiki' => '$stdlogo',\n\t\t'dewiki' => '$stdlogo',\n\t\t'wikidatawiki' => '//upload.wikimedia.org/wikipedia/commons/thumb/4/43/Wikidata-logo-en-black.svg/135px-Wikidata-logo-en-black.svg.png',\n\t),\n\n\t'wgFavicon' => array(\n\t\t'dewiki' => '//upload.wikimedia.org/wikipedia/commons/1/14/Favicon-beta-wikipedia.png',\n\t),\n\n\t// Editor Engagement stuff\n\t'-wmfUseArticleCreationWorkflow' => array(\n\t\t'default' => false,\n\t),\n\t'wmgUseEcho' => array(\n\t\t'enwiki' => true,\n\t\t'en_rtlwiki' => true,\n\t),\n\n\t'-wmgUsePoolCounter' => array(\n\t\t'default' => false, # bug 36891\n\t),\n\t'-wmgUseAPIRequestLog' => array(\n\t\t'default' => false,\n\t),\n\t'-wmgEnableCaptcha' => array(\n\t\t'default' => true,\n\t),\n\t'-wmgEchoCluster' => array(\n\t\t'default' => false,\n\t),\n\t'wmgEchoUseJobQueue' => array(\n\t\t'default' => true,\n\t),\n\t# FIXME: make that settings to be applied\n\t'-wgShowExceptionDetails' => array(\n\t\t'default' => true,\n\t),\n\t'-wgUseContributionTracking' => array(\n\t\t'default' => false,\n\t),\n\t'-wmgUseContributionReporting' => array(\n\t\t'default' => false,\n\t),\n\n\t# To help fight spam, makes rules maintained on deploymentwiki\n\t# to be available on all beta wikis.\n\t'-wmgAbuseFilterCentralDB' => array(\n\t\t'default' => 'deploymentwiki',\n\t),\n\t'-wmgUseGlobalAbuseFilters' => array(\n\t\t'default' => true,\n\t),\n\n\t# Bug 37852\n\t'wmgUseWikimediaShopLink' => array(\n\t\t'default' => false,\n\t\t'enwiki' => true,\n\t\t'simplewiki' => true,\n\t),\n\n\t//enable TimedMediaHandler and MwEmbedSupport for testing on commons and enwiki\n\t'wmgUseMwEmbedSupport' => array(\n\t\t'commonswiki'\t=> true,\n\t\t'enwiki'\t=> true,\n\t),\n\t// NOTE: TMH *requires* MwEmbedSupport to function\n\t'wmgUseTimedMediaHandler' => array(\n\t\t'commonswiki'\t=> true,\n\t\t'enwiki'\t=> true,\n\t),\n\t'wmgMobileUrlTemplate' => array(\n\t\t'default' => '%h0.m.%h1.%h2.%h3.%h4',\n\t\t'commonswiki' => '',\n\t\t'mediawikiwiki' => '',//'m.%h1.%h2',\n\t\t'wikidatawiki' => 'm.%h0.%h1.%h2.%h3', // T87440\n\t),\n\n\t'wmgMFPhotoUploadEndpoint' => array(\n\t\t'default' => '//commons.wikimedia.$variant.wmflabs.org/w/api.php',\n\t),\n\t'wmgMFUseCentralAuthToken' => array(\n\t\t'default' => true,\n\t),\n\t'wmgMFEnableBetaDiff' => array(\n\t\t'default' => true,\n\t),\n\t'wmgMFSpecialCaseMainPage' => array(\n\t\t'default' => true,\n\t\t'enwiki' => false,\n\t),\n\t'wmgWikiGrokUIEnable' => array(\n\t\t'default' => false,\n\t\t'enwiki' => true, // prototype version is for en.wiki only\n\t),\n\t'wmgWikiGrokUIEnableOnAllDevices' => array(\n\t\t'default' => false,\n\t\t'enwiki' => true,\n\t),\n\t'wmgWikiGrokUIEnableInSidebar' => array(\n\t\t'default' => false,\n\t\t'enwiki' => true,\n\t),\n\t'wmgMFWikiDataEndpoint' => array(\n\t\t'default' => 'http://wikidata.beta.wmflabs.org/w/api.php',\n\t),\n\t'wmgWikiBasePropertyConfig' => array(\n\t\t'default' => array(\n\t\t\t'instanceOf' => 'P694',\n\t\t\t'bannerImage' => 'P964',\n\t\t),\n\t),\n\t'wmgMFInfoboxConfig' => array(\n\t\t'default' => array(\n\t\t\t// human\n\t\t\t44076 => array(\n\t\t\t\t'rows' => array(\n\t\t\t\t\t\t// Born\n\t\t\t\t\t\tarray( 'id' => 'P476' ),\n\t\t\t\t\t\t// Birthplace\n\t\t\t\t\t\tarray( 'id' => 'P965' ),\n\t\t\t\t\t\t// Place of death\n\t\t\t\t\t\tarray( 'id' => 'P994' ),\n\t\t\t\t\t\t// Country of citizenship\n\t\t\t\t\t\tarray( 'id' => 'P27' ),\n\t\t\t\t\t\t// Alma mater\n\t\t\t\t\t\tarray( 'id' => 'P998' ),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'default' => array(\n\t\t\t\t'rows' => array(\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t),\n\n\t'wmgWikiGrokDebug' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgGeoDataDebug' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgULSPosition' => array(\n\t\t# Beta-specific\n\t\t'ee-prototype' => 'personal',\n\t\t'deploymentwiki' => 'personal',\n\t),\n\n\t// (bug 39653) The plan is to enable it for testing on labs first, so add\n\t// the config hook to be able to do that.\n\t'wmgUseCodeEditorForCore' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgUseCommonsMetadata' => array(\n\t\t'default' => true,\n\t),\n\t'wmgCommonsMetadataForceRecalculate' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgUseGWToolset' => array(\n\t\t'default' => false,\n\t\t'commonswiki' => true,\n\t),\n\n\t// Don't use an http/https proxy\n\t'-wgCopyUploadProxy' => array(\n\t\t'default' => false,\n\t),\n\n\t// ----------- BetaFeatures start ----------\n\t'wmgUseBetaFeatures' => array(\n\t\t'default' => true,\n\t),\n\n\t// Enable all Beta Features in Beta Labs, even if not in production whitelist\n\t'wmgBetaFeaturesWhitelist' => array(\n\t\t'default' => false,\n\t),\n\n\t'wmgUseMultimediaViewer' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgNetworkPerformanceSamplingFactor' => array(\n\t\t'default' => 1,\n\t),\n\n\t'wmgUseImageMetrics' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgImageMetricsSamplingFactor' => array(\n\t\t'default' => 1,\n\t),\n\n\t'wmgImageMetricsCorsSamplingFactor' => array(\n\t\t'default' => 1,\n\t),\n\n\t'-wmgUseRestbaseUpdateJobs' => array(\n\t\t'default' => false,\n\t),\n\n\t'-wmgUseRestbaseVRS' => array(\n\t\t'default' => false,\n\t),\n\n\t'wmgUseVectorBeta' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgVectorBetaPersonalBar' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgVectorBetaWinter' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgVisualEditorExperimental' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgVisualEditorEnableTocWidget' => array(\n\t\t'enwiki' => true,\n\t),\n\t// ------------ BetaFeatures end -----------\n\n\t'wmgUseRSSExtension' => array(\n\t\t'dewiki' => true,\n\t),\n\n\t'wmgRSSUrlWhitelist' => array(\n\t\t'dewiki' => array( 'http://de.planet.wikimedia.org/atom.xml' ),\n\t),\n\n\t'wmgUseCampaigns' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgUseEventLogging' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgContentTranslationCluster' => array(\n\t\t'default' => false,\n\t),\n\n\t'wmgContentTranslationCampaigns' => array(\n\t\t'default' => array( 'newarticle' ),\n\t),\n\n\t'wmgUseNavigationTiming' => array(\n\t\t'default' => true,\n\t),\n\n\t'wgSecureLogin' => array(\n\t\t// Setting false throughout Labs for now due to untrusted SSL certificate\n\t\t// bug 48501\n\t\t'default' => false,\n\t\t'loginwiki' => false,\n\t),\n\n\t'wgSearchSuggestCacheExpiry' => array(\n\t\t'default' => 300,\n\t),\n\n\t'wmgUseCirrus' => array(\n\t\t'default' => true,\n\t\t'commonswiki' => true,\n\t\t'dewiki' => true,\n\t\t'enwiki' => true,\n\t\t'eswiki' => true,\n\t\t'frwiki' => true,\n\t\t'jawiki' => true,\n\t\t'nlwiki' => true,\n\t\t'plwiki' => true,\n\t\t'ruwiki' => true,\n\t\t'svwiki' => true,\n\t\t'zhwiki' => true,\n\t),\n\n\t'wmgUseFlow' => array(\n\t\t'enwiki' => true,\n\t\t'en_rtlwiki' => true,\n\t),\n\t# Extension:Flow's browsertests use Talk:Flow_QA.\n\t'wmgFlowOccupyPages' => array(\n\t\t'enwiki' => array( 'Talk:Flow QA', 'Talk:Flow' ),\n\t\t'en_rtlwiki' => array( 'Talk:Flow' ),\n\t),\n\t# No separate Flow DB or cluster (yet) for labs.\n\t'-wmgFlowDefaultWikiDb' => array(\n\t\t'default' => false,\n\t),\n\t'-wmgFlowCluster' => array(\n\t\t'default' => false,\n\t),\n\t'wmgUseGather' => array(\n\t\t'default' => false,\n\t\t'enwiki' => true,\n\t),\n\t'wmgUseGuidedTour' => array(\n\t\t'wikidatawiki' => true,\n\t),\n\t// Enable anonymous editor acquisition experiment across labs\n\t'wmgGettingStartedRunTest' => array(\n\t\t'default' => true,\n\t),\n\t'+wmgExtraLanguageNames' => array(\n\t\t'default' => array(),\n\t\t'en_rtlwiki' => array( 'en-rtl' => 'English (rtl)' ),\n\t),\n\t'wmgUseContentTranslation' => array(\n\t\t'default' => false,\n\t\t'wiki' => true,\n\t),\n\n\t// testing FundraisingTranslateWorkflow\n\t'wmgUseFundraisingTranslateWorkflow' => array(\n\t\t'default' => false,\n\t\t'metawiki' => true,\n\t),\n\n\t'wmgUsePetition' => array(\n\t\t'default' => false,\n\t\t'metawiki' => true,\n\t),\n\n\t'wmgUseSentry' => array(\n\t\t'default' => true,\n\t),\n\t'wmgSentryDsn' => array(\n\t\t'default' => '//[email protected]/4',\n\t),\n\n\t// Already true in production for some wikis, bug 49193\n\t'wgContentHandlerUseDB' => array(\n\t\t'default' => false,\n\t\t'enwiki' => true,\n\t),\n\n\t// Thumbnail prerendering at upload time\n\t'wgUploadThumbnailRenderMap' => array(\n\t\t'default' => array( 320, 640, 800, 1024, 1280, 1920, 2560, 2880 ),\n\t),\n\n\t'wgUploadThumbnailRenderMethod' => array(\n\t\t'default' => 'http',\n\t),\n\n\t'wgUploadThumbnailRenderHttpCustomHost' => array(\n\t\t'default' => 'upload.beta.wmflabs.org',\n\t),\n\n\t'wgUploadThumbnailRenderHttpCustomDomain' => array(\n\t\t'default' => 'deployment-cache-upload02.eqiad.wmflabs',\n\t),\n\n\t'wmgUseApiFeatureUsage' => array(\n\t\t'default' => true,\n\t),\n\n\t'wmgUseBounceHandler' => array(\n\t\t'default' => true,\n\t),\n\n\t'-wmgScorePath' => array(\n\t\t'default' => \"//upload.beta.wmflabs.org/score\",\n\t),\n\n\t'wgRateLimitsExcludedIPs' => array(\n\t\t'default' => array( '198.73.209.0/24' ), // T87841 Office IP\n\t),\n);\n\n}", "function con_externalmod($summary_id = NULL)\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t//$this->load->library('form_validation');\r\n //$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\r\n\t\t$data['title'] = 'Modules';\r\n $data['now_id'] = time();\r\n\t\t$data['form_purpose'] = $this->uri->segment(3);\r\n\t\t$data['current_db']\t\t= $this->db->database; \t\t\r\n\t\t$data['staff_id'] = $_SESSION['staff_id'];\r\n $data['patient_id'] = $this->uri->segment(4);\r\n $data['summary_id'] = $this->uri->segment(5);\r\n\t\t//$data['clinic_info'] = $this->mbio->get_clinic_info($_SESSION['location_id']);\r\n\t\t$data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n\t\t$data['broken_birth_date'] = $this->break_date($data['patient_id']['birth_date']);\r\n\t\t$data['patient_birthstamp']\t= mktime(0,0,0,$data['broken_birth_date']['mm'],$data['broken_birth_date']['dd'],$data['broken_birth_date']['yyyy']);\r\n //$data['patcon_info'] = $this->memr_rdb->get_patcon_details($data['patient_id']);\r\n\t\t$data['modules_list'] = $this->memr_rdb->get_externalmod_list('episode');\r\n\r\n\r\n\t\t$this->load->vars($data);\r\n // Run validation\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n\t\t\t$new_header = \"ehr/header_xhtml-mobile10\";\r\n\t\t\t$new_banner = \"ehr/banner_ehr_conslt_wap\";\r\n\t\t\t$new_sidebar= \"ehr/sidebar_ehr_patients_conslt_wap\";\r\n\t\t\t$new_body = \"ehr/ehr_indv_con_externalmod_html\";\r\n\t\t\t$new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n\t\t\t//$new_header = \"ehr/header_xhtml1-strict\";\r\n\t\t\t$new_header = \"ehr/header_xhtml1-transitional\";\r\n\t\t\t$new_banner = \"ehr/banner_ehr_conslt_html\";\r\n\t\t\t$new_sidebar= \"ehr/sidebar_ehr_patients_conslt_html\";\r\n\t\t\t$new_body = \"ehr/ehr_indv_con_externalmod_html\";\r\n\t\t\t$new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\t\r\n\r\n }", "function Yeelight() {\n $this->name=\"Yeelight\";\n $this->title=\"Устройства Yeelight\";\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}", "function sitemgr_upgrade1_4_002()\n{\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'] = '1.5.001';\n}", "function upgrade_290()\n {\n }", "function get_e2l_courses($USER){\n $_SESSION['offset'] = 0;\n\n $servername = \"localhost\";\n $username = \"moodleuser\";\n $password = \"password\";\n $dbname = \"moodle\";\n\n // Create connection\n $conn = mysqli_connect($servername, $username, $password, $dbname);\n\n // Check connection\n if (!$conn) {\n die(\"Connection failed: \" . mysqli_connect_error());\n } \n\n /*GET ALL ENROLLED CLASSES FOR A STUDENT*/\n/* $sql = \"SELECT mc.id as id, mu.id as uid, mc.fullname \".\n \"FROM mdl_user as mu, mdl_course as mc, mdl_user_students as mus \".\n\t \"WHERE mu.id = mus.userid \".\n\t \"AND mus.course = mc.id \".\n\t \"AND mu.id = \".$USER->id.\" order by mc.id\";*/\n\n //ALL COURSES NOT IN THE 'Tasks' CATEGORY\t \n $sql = \"SELECT mc.id as id, mu.id as uid, mc.fullname \".\n \"FROM mdl_user as mu, mdl_course as mc, mdl_user_students as mus, mdl_course_categories as mcc \".\n \"WHERE mu.id = mus.userid \".\n \"AND mus.course = mc.id \".\n \"AND mu.id = \".$USER->id.\" \".\n \"AND mc.category = mcc.id \".\n \"AND mcc.name = 'Tasks' order by mc.id\";\t \n\n //(select id, name from mdl_lesson where course=7) union (select id, name from mdl_assignment where course=7) order by id;\n $result = mysqli_query($conn, $sql);\n\n echo \"<table class=\\\"left_box\\\">\";\n echo \"<tr><td id=\\\"parent_box\\\">\";\n echo \"<div>\";\n echo \"<div id=\\\"course_label\\\"><b>Tasks:</b></div>\";\n $entries = mysqli_num_rows($result); \n if ($entries > 0) {\n while($row = mysqli_fetch_assoc($result)) {\n\t $arr[] = $row[\"id\"];\n\t echo \"<div class=\\\"e2l_tasks e2l_font\\\" id=\\\"e2l_\".$row['id'].\"\\\" onmouseout=\\\"end_hilite(\".$row[\"id\"].\")\\\" onmouseover=\\\"start_hilite(\".$row[\"id\"].\")\\\" onclick=\\\"generate_tasks(\".$row[\"id\"].\")\\\">\". $row[\"fullname\"].\"</div>\";\n }\n }\n echo \"</div>\";\n echo \"</td></tr>\";\n echo \"</table>\";\n/* echo \"<table border='0' style='width:100%; height: 665px; background: #CDF3F3; border-radius: 25px; margin: 0px;'>\";\n echo \"<tr><th style=\\\"width: 252px; height: 41px\\\">TASK NAME:</th></tr>\";\n echo \"<tr><td style=\\\"width: 252px; height: 41px\\\">&nbsp;</td></tr>\";\n $entries = mysqli_num_rows($result); \n if ($entries > 0) {\n // output data of each row\n\n while($row = mysqli_fetch_assoc($result)) {\n\t $arr[] = $row[\"id\"];\n// echo \"<tr ><td style=\\\"width: 252px; height: 42px\\\"><div onclick='( generate_lessons(\".$row[\"id\"].\") )'><center>\". $row[\"fullname\"].\"</center></div></td><tr>\";\n echo \"<tr id=\\\"e2l_courses\\\" ><td style=\\\"width: 252px; height: 41px\\\" onclick='( generate_tasks(\".$row[\"id\"].\") )'><div style='padding-left: 20px;'>\". $row[\"fullname\"].\"</div></td><tr>\";\n\n }\n } else {\n echo \"<tr><td style=\\\"width: 252px; height: 41px\\\" colspan='1'>No Enrolled Courses:</td></tr>\";\n }\n $total = 12;\n while($entries < $total){\n $entries++;\n echo \"<tr><td style=\\\"width: 252px; height: 41px\\\">&nbsp;</td></tr>\"; \n }\n echo \"<tr><td style=\\\"width: 252px; height: 41px\\\">&nbsp;</td></tr>\";\n echo \"</table>\";*/\n\n \n\n mysqli_close($conn); \n echo \"<script>window.onload = function() { init_hilite(\".$arr[0].\"); }</script>\";\n return $arr[0];\n}", "protected function getModuleHeadline() {}", "function dsq_manage() {\n\tinclude_once(dirname(__FILE__) . '/manage.php');\n}" ]
[ "0.62575316", "0.60665816", "0.5854582", "0.55352545", "0.55186826", "0.54335827", "0.54284585", "0.53425765", "0.5312826", "0.5292921", "0.5291211", "0.5282481", "0.52755326", "0.5269015", "0.5191571", "0.51738214", "0.51556224", "0.51469964", "0.51293355", "0.5085235", "0.5075755", "0.5073589", "0.5068979", "0.50604856", "0.5060402", "0.5037543", "0.50266045", "0.5008737", "0.5001764", "0.4996664", "0.49931517", "0.49912605", "0.4989162", "0.4987349", "0.49723008", "0.49667782", "0.49637717", "0.49520382", "0.49515957", "0.49505967", "0.49348313", "0.49344718", "0.4929878", "0.4929831", "0.49288723", "0.49198785", "0.49180597", "0.49166292", "0.49165356", "0.49052843", "0.48913032", "0.48902208", "0.48815948", "0.48810574", "0.487125", "0.486106", "0.48609877", "0.48534164", "0.48333418", "0.48306552", "0.4830608", "0.4827253", "0.48260644", "0.48229122", "0.4811951", "0.48081395", "0.47937065", "0.47926804", "0.4791217", "0.47859097", "0.47832832", "0.47831953", "0.47815004", "0.47752145", "0.47738734", "0.47667995", "0.4761024", "0.47591916", "0.47582728", "0.47552702", "0.4753409", "0.4752995", "0.47469553", "0.47461256", "0.4741781", "0.473672", "0.47356987", "0.47303224", "0.4729138", "0.47285974", "0.47257966", "0.4724935", "0.47218508", "0.47215453", "0.47203955", "0.4720313", "0.4719482", "0.4717859", "0.47149083", "0.47136492", "0.47034776" ]
0.0
-1
======================================================================= Group management pages ======================================================================= Index listing of groups
function index($page = 0) { $this->auth->restrict('groups.view'); $filter = $this->input->get(NULL, TRUE); $filter['pp'] = element('pp', $filter, 10); $this->load->library('pagination'); $config = array( 'base_url' => site_url('groups/index'), 'total_rows' => $this->groups_model->count_all(), 'per_page' => $filter['pp'], 'uri_segment' => 3, ); $this->pagination->initialize($config); $this->users_model->set_filter($filter); $this->users_model->order_by('g_name', 'asc'); $this->users_model->limit($config['per_page'], $page); $this->data['filter'] = $filter; $this->data['groups'] = $this->groups_model->get_all(); $this->layout->set_js('views/groups/index'); $this->layout->set_title(lang('configure_groups')); $this->data['subnav_active'] = 'groups'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $groups = Group::searchable()->paginate();\n\n return GroupResource::collection($groups);\n }", "public function group_list()\n\t{\n\t\t$data = [\n\t\t\t'group' => $this->todo->get_group_list((int) $this->session->userdata('uid'))\n\t\t];\n\t\t$this->page->set_title(\"Group List\");\n\t\t$this->page->build('friend/group_list', $data);\n\t}", "public function index() {\n\t\t$groups = AdminGroup::condition(Input::all())\n\t\t\t\t->orderBy('created_at', 'desc')\n\t\t\t\t->paginate();\n\t\treturn View::make('admin.groups.index', array(\n\t\t\t\t\t'groups' => $groups,\n\t\t\t\t\t'input' => Input::all(),\n\t\t));\n\t}", "function groups() {\n\t\t$this->validate();\n\t\t$this->setupTemplate();\n\n\t\t$journal =& Request::getJournal();\n\n\t\t$rangeInfo =& $this->getRangeInfo('groups');\n\n\t\t$groupDao =& DAORegistry::getDAO('GroupDAO');\n\t\t$groups =& $groupDao->getGroups(ASSOC_TYPE_JOURNAL, $journal->getId(), null, $rangeInfo);\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\t\t$templateMgr->addJavaScript('lib/pkp/js/lib/jquery/plugins/jquery.tablednd.js');\n\t\t$templateMgr->addJavaScript('lib/pkp/js/functions/tablednd.js');\n\t\t$templateMgr->assign_by_ref('groups', $groups);\n\t\t$templateMgr->assign('boardEnabled', $journal->getSetting('boardEnabled'));\n\t\t$templateMgr->display('manager/groups/groups.tpl');\n\t}", "function index() {\n $this->set('groups', $this->Group->find('all'));\n }", "public function actionIndex() {\n $searchModel = new GroupSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('group_index/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function groupList(){\n\t\techo json_encode($this->read_database->get_groups());\n\t}", "public function index()\n {\n //\n if(Auth::user()->hasRole('superadministrator')){\n $groups = Group::paginate(10);\n }else{\n $groups = Group::where('owner_client_id', Auth::user()->id)->paginate(10);\n }\n return view('manage.groups.index')->withGroups($groups);\n }", "public function actionGroup()\n {\n $query = $this->user->getContactGroups();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'sort'=> [\n 'defaultOrder' => [\n 'name' => SORT_ASC,\n ],\n ],\n ]);\n\n return $this->render('group/index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new GroupsSearch();\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 $groups = AdminGroups::latest()->paginate(10);\n return View('admin.groups.index',compact('groups'));\n }", "public function showAllGroups()\n {\n $groups = Group::paginate(10);\n return view('admin.groups.index', compact('groups'));\n }", "public function index()\n {\n //\n return static::getGroupsData();\n }", "public function index()\n {\n return Group::latest()->paginate(10);\n }", "function index( $page = 0 )\n{\n$this->model_group->pagination( TRUE );\n$data_info = $this->model_group->lister( $page );\n$fields = $this->model_group->fields( TRUE );\n\n$this->template->assign( 'pager', $this->model_group->pager );\n$this->template->assign( 'group_fields', $fields );\n$this->template->assign( 'group_data', $data_info );\n$this->template->assign( 'table_name', 'group' );\n$this->template->assign( 'template', 'list_group' );\n$this->template->display( 'frame_admin.tpl' );\n}", "public function index()\n\t{\n\t\t//\n\t\t$group = admin_group::all();\n\t\t\n\t\treturn view('admin.auth.group.index',['ret' => $group]);\n\t}", "public function index()\n {\n $groups = Group::paginate(10);\n\n return $this->showAll($groups);\n }", "public function index()\n {\n return Auth::user()->groups()->orderBy('order')->get();\n }", "private function _show_list_of_groups() {\n // show groups of current user\n // create group button\n $this->load->model('membership_model');\n \n $user_id = $this->session->userdata('user')['id'];\n\n $where = array(\n 'm.user_id' => $user_id,\n 'm.status' => 1,\n 'g.status' => 1\n );\n \n $groups = $this->membership_model->fetch($where);\n\n // 1 is owner\n $where['m.type'] = 1;\n // allow status 2 for my groups for hidden\n // 0 is deleted\n unset($where['g.status']);\n $where['g.status !='] = 0;\n $my_groups = $this->membership_model->fetch($where);\n \n // membership type 2 is normal member\n $where['m.type'] = 2;\n $where['g.status'] = 1;\n $other_groups = $this->membership_model->fetch($where);\n\n // can be any type for invited\n unset($where['m.type']);\n $where['m.status'] = 2;\n $invited_groups = $this->membership_model->fetch($where);\n \n $data = array(\n 'title' => 'Groups',\n 'msg' => $this->session->flashdata('msg'),\n 'groups' => $groups,\n 'my_groups' => $my_groups,\n 'other_groups' => $other_groups,\n 'invited_groups' => $invited_groups\n );\n $this->_view(\n array('templates/nav', 'pages/dashboard/groups', 'alerts/msg'),\n array_merge($this->_nav_items, $data)\n );\n }", "public function index()\n {\n //\n return view('groups.index')->with('groups',Group::all());\n }", "public function getAllGroups();", "protected function getGroupList() {}", "protected function getGroupList() {}", "public function index()\n {\n return view('backend.groups.index', [\n 'groups' => Group::latest()->get()\n ]);\n }", "public function getGroupsList(){\n return $this->_get(1);\n }", "public function index()\n {\n $groups = $this->groupsRepository->listGroups();\n \n $this->setPageTitle('Groups', 'List of all groups');\n return view('admin.groups.index', compact('groups'));\n }", "public function index() {\n $groups = Group::latest()->paginate(15);\n $group_count = Group::count();\n return view('groups.index', ['groups' => $groups, 'group_count' => $group_count]);\n }", "public function getGroups() {}", "public function index()\n\t{\n\t\t$groups = Group::all();\n //return $allGroups = Group::paginate(15); //returns JSON separated by pages with data\n\t\treturn view('groups.index', compact('groups'));\n\t}", "public function listgroups() {\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Groupmodel->countAll();\n\t\t$jTableResult['Records'] = $this->Groupmodel->ListAll($this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}", "public function getGroups();", "public function getGroups();", "public function getGroupsList(){\n return $this->_get(3);\n }", "public function index()\n {\n return Group::all()->toArray();\n }", "public function indexAction(){\n $this->title = '';\n \n $groupModel = new Group();\n $this->view->paginator = $groupModel->findAll($this->_getPage());\n }", "public function index()\n\t{\n\t\t$groups = Group::all();\n\t\treturn View::make('groups.index')\n\t\t\t->with('groups', $groups);\n\t}", "public function list()\n {\n\n $this->authorize('view', Group::class);\n\n $groups = Auth::user()->groups;\n\n return view('pages.groups_list', [\n 'groups' => $groups\n ]);\n }", "public function list_get(){\n $data['list'] = $this->group->list();\n $this->response($data);\n }", "public function admin_index(){\n \n $this->set(\"title_for_layout\",\"Manage Satellite Groups\");\n \n // Load all configured groups\n $this->set('groups', $this->Group->find('all'));\n }", "public function index()\n {\n return new GroupCollection(Group::all());\n }", "public function index()\n\t{\n\t\t$groups = Group::all();\n\n\t\treturn View::make('groups.index', compact('groups'));\n\t}", "public function index()\n {\n return view('groups.index' , ['groups' => Auth::user()->groups()->paginate(10)]);\n }", "public function index()\n {\n\n $query = $this->Groups->find();\n $myGroups = $query->matching('UsersGroup',function($q){\n return $q->where(['UsersGroup.user_id'=>$this->user['id'],'UsersGroup.invite_status'=>1]);\n })->order(['role'=>'DESC']);\n\n\n $groups = $this->paginate($myGroups);\n\n $this->set(compact('groups','myGroups'));\n $this->set('user',$this->user);\n $this->set('invites',$this->invites);\n $this->set('eventNotifications',$this->eventNotifications);\n $this->set('sortNotifications',$this->sortNotifications);\n $this->set('messageNotifications',$this->messageNotifications);\n $this->set('_serialize', ['groups']);\n }", "public function getGroupsList(){\n return $this->_get(4);\n }", "public function getGroupsList(){\n return $this->_get(4);\n }", "public function index() {\n return view('groups.index', ['groups'=>Auth::user()->groups]);\n }", "function index()\n {\n $data['groups'] = $this->Group_model->get_all_groups();\n \n $data['_view'] = 'group/index';\n $this->load->view('layouts/main',$data);\n }", "public function groups() {\n\t\t//variabel\n\t\t$data['datas'] = $this->PbkGroups_model->get_all();\n\t\t\n\t\t$template_data['title'] = 'SMS Gateway ';\n\t\t$template_data['subtitle'] = 'Kirim SMS';\n $template_data['crumb'] = ['SMS Gateway' => 'smsgateway', 'SMS Groups' => 'smsgateway/kirimsms/groups',];\n\t\t//view\n\t\t$this->layout->set_wrapper('groups_form', $data);\n\t\t$this->layout->auth();\n\t\t$this->layout->render('admin', $template_data);\n\t}", "public function index() {\n\t\t$data = Group::get()->map( function ( $s ) {\n\t\t\treturn [\n\t\t\t\t'id' => $s->id,\n\t\t\t\t'name' => $s->getShortName(),\n\t\t\t\t'content' => $s->getShortContent(),\n\t\t\t\t'created_at' => $s->created_at_formatted,\n\t\t\t\t'created_at_time' => $s->created_at_time,\n\t\t\t\t'active' => $s->getActiveFullResponse()\n\t\t\t];\n\t\t} );\n\n\t\t$this->page->response = $data;\n\t\t$this->page->create_option = 1;\n\t\treturn view('pages.settings.parts.groups.index' )\n\t\t\t->with( 'Page', $this->page );\n\t}", "public function listGroups()\n {\n\t\t$data = $this->call(array(), \"GET\", \"groups.json\");\n\t\t$data = $data->{'groups'};\n\t\t$groupArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$groupArray->append(new Group($data[$i], $this));\n\t\t}\n\t\treturn $groupArray;\n }", "public function index()\n\t{\n\t\treturn view('groups.index');\n\t}", "public function index()\n {\n if(Gate::denies('index', Group::class)) {\n return response()->json(['message' => 'У Вас недостаточно прав на просмотр списка рабочих групп!'], 422);\n }\n \n //return GroupResource::collection(Group::with('processes')->get());\n return new GroupCollection(Group::with('processes')->get());\n }", "public function index()\n {\n // Get search filter\n $searchStr = Utilities::makeInputSafe(request()->get('name'));\n\n // Get public groups and paginate (apply filters too)\n $groups = Group::ofName($searchStr)->paginate(Constants::GROUPS_COUNT_PER_PAGE);\n\n return view('groups.index')\n ->with('groups', $groups)\n ->with('pageTitle', config('app.name') . ' | Groups');\n }", "function fantacalcio_admin_groups_list() {\n $out = \"\";\n \n $out .= l(\"Aggiungi girone\", \"admin/fantacalcio/groups/add\", array(\n \"attributes\" => array(\"class\" => \"btn btn-info\"))) . \"<br/><br/>\";\n \n $groups = Group::all();\n $competitions = Competition::all();\n if ($groups) {\n $header = array(\n t(\"Girone\"), \n t(\"Attivo\"), \n t(\"Calendario\"), \n t(\"Classfica\"), \n t(\"Formazioni\"), \n t(\"Newsletter\"));\n foreach ($groups as $g_id => $group) {\n $rows[] = array(\n l($competitions[$group->competition_id]->name . \" - \" . $group->name, \"admin/fantacalcio/groups/\" . $g_id), \n fantacalcio_check_value($group->active), \n \n // \"<img src='\" .base_path() . drupal_get_path(\"module\", \"fantacalcio\") . \"/images/\" . get_image_check($group->active) . \"'>\",\n $group->matches_order, \n $group->standings_order, \n $group->lineups_order, \n $group->newsletters_order);\n }\n $out .= theme(\"table\", (array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table\", \"table-responsive\")), \n \"empty\" => t(\"Nessun gruppo\"))));\n }\n \n return $out;\n}", "public function actionGroupIndex(array $variables = array())\n\t{\n\t\t$variables['groups'] = linxy()->getAllGroups();\n\n\t\t$this->renderTemplate('linxy/groups/_index', $variables);\n\t}", "public function groups();", "public function groups();", "public function index()\n {\n\n // If User Logged Continue to display Users Group Page\n\n $this->html->setTitle('Users Group');\n\n // Fetch All Categories From DB\n $data['users_groups'] = $this->load->model('UsersGroups')->getAll();\n\n $data['success'] = $this->session->has('success') ? $this->session->pull('success') : null;\n\n\n // Calling Index View [ list ] and Passing Data to it\n // Notice: $data['categories'] is an Object NOT Array, it means that we will calling column as $category->id, $category->name\n $view = $this->view->render('admin/users-groups/list', $data);\n\n return $this->adminLayout->render($view);\n\n\n\n }", "public function index()\n {\n $item_groups= ItemGroup::all();\n return view('backend.group.index',compact('item_groups'));\n }", "function group_list()\n {\n //create model object\n $groupObj=new groupModel();\n \n \n //get all listing\n $groupObj->getgroupList();\n \n \n $jsData = Layout::bufferContent(URI::getAbsModulePath().\"/js/group_list.php\");\n \n \n //create javascript variable for ajax url\n Layout::addFooter($jsData);\n\n //render layout\n Layout::renderLayout();\n \n }", "public function ListGroups(){\n\t\t$query = \"SELECT groupTitle FROM [PUBLISH GROUPS TABLE] ORDER BY groupTitle ASC\";\n\t\treturn array(\"results\" => $this->SelectQueryHelper());\n\t}", "public static function getGroupList() {\n $params = $_GET;\n if (isset($params['parent_id'])) {\n // requesting child groups for a given parent\n $params['page'] = 1;\n $params['rp'] = 0;\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n }\n else {\n $requiredParams = [];\n $optionalParams = [\n 'title' => 'String',\n 'created_by' => 'String',\n 'group_type' => 'String',\n 'visibility' => 'String',\n 'component_mode' => 'String',\n 'status' => 'Integer',\n 'parentsOnly' => 'Integer',\n 'showOrgInfo' => 'Boolean',\n 'savedSearch' => 'Integer',\n // Ignore 'parent_id' as that case is handled above\n ];\n $params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();\n $params += CRM_Core_Page_AJAX::validateParams($requiredParams, $optionalParams);\n\n // get group list\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n\n // if no groups found with parent-child hierarchy and logged in user say can view child groups only (an ACL case),\n // go ahead with flat hierarchy, CRM-12225\n if (empty($groups)) {\n $groupsAccessible = CRM_Core_PseudoConstant::group();\n $parentsOnly = $params['parentsOnly'] ?? NULL;\n if (!empty($groupsAccessible) && $parentsOnly) {\n // recompute group list with flat hierarchy\n $params['parentsOnly'] = 0;\n $groups = CRM_Contact_BAO_Group::getGroupListSelector($params);\n }\n }\n\n //NYSS 5259 convert line breaks to html\n foreach ( $groups['data'] as &$group ) {\n $group['description'] = str_replace('\\r\\n', '\\n', $group['description']);\n $group['description'] = str_replace('\\r', '\\n', $group['description']);\n $group['description'] = str_replace('\\n', '<br />', $group['description']);\n } \n }\n\n CRM_Utils_JSON::output($groups);\n }", "public function index()\n {\n $this->groups->trackFilter();\n\n return view('site::admin.file_group.index', [\n 'repository' => $this->groups,\n 'groups' => $this->groups->paginate(config('site.per_page.file_group', 25), ['file_groups.*'])\n ]);\n }", "public function listGroupAdmin() {\n $group = (string)$this->object->info->info->form->group;\n $items = $this->object->getValues($group, true);\n $listItems = '';\n foreach ($items as $key=>$item) {\n $sortableListClass = ($this->object->hasOrd()) ? 'sortableList' : '';\n $list = new ListObjects($this->type, array('where'=>$group.'=\"'.$key.'\"',\n 'function'=>'Admin',\n 'order'=>$this->orderField()));\n $listItems .= '<div class=\"lineAdminBlock\">\n <div class=\"lineAdminTitle\">'.$item.'</div>\n <div class=\"lineAdminItems\">\n <div class=\"listAdmin '.$sortableListClass.'\" rel=\"'.url($this->type.'/sortSave/', true).'\">\n '.$list->showList(array('function'=>'Admin',\n 'message'=>'<div class=\"message\">'.__('noItems').'</div>'),\n array('userType'=>$this->login->get('type'))).'\n </div>\n </div>\n </div>';\n }\n return '<div class=\"lineAdminBlockWrapper\">'.$listItems.'</div>';\n }", "public function index()\n {\n $group = QueryBuilder::for(Group::class)\n ->allowedFilters([\n Filter::custom('name', GroupNameFilter::class),\n ]);\n\n $user = Auth::user();\n if ($user->role_id == 2)\n {\n $group = $group->whereHas('teachers', function ($query) use ($user) {\n $query->where('user_id', $user->id);\n });\n }\n\n return GroupResource::collection($group->get());\n }", "public function index()\n {\n\n $group = EmailGroup::paginate(20);\n return view('admin.email-marketing.Group.index')->with(['items' => $group]);\n }", "protected function readGroups() {\n\t\tif ($this->items) {\n\t\t\t$sql = \"SELECT\t\tuser_group.*, (SELECT COUNT(*) FROM wcf\".WCF_N.\"_user_to_groups WHERE groupID = user_group.groupID) AS members\n\t\t\t\tFROM\t\twcf\".WCF_N.\"_group user_group\n\t\t\t\tORDER BY\t\".($this->sortField != 'members' ? 'user_group.' : '').$this->sortField.\" \".$this->sortOrder;\n\t\t\t$result = WCF::getDB()->sendQuery($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);\n\t\t\twhile ($row = WCF::getDB()->fetchArray($result)) {\n\t\t\t\t$row['deletable'] = (!WCF::getUser()->getPermission('admin.user.canDeleteGroup') || Group::isMember($row['groupID']) || !Group::isAccessibleGroup($row['groupID']) || $row['groupType'] == Group::EVERYONE || $row['groupType'] == Group::GUESTS || $row['groupType'] == Group::USERS) ? 0 : 1;\n\t\t\t\t$row['editable'] = (WCF::getUser()->getPermission('admin.user.canEditGroup') && Group::isAccessibleGroup($row['groupID'])) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t$this->groups[] = $row;\n\t\t\t}\n\t\t}\n\t}", "public function ADStaff_Get_Group_List(){\n\t \n\t $result_key = parent::Initial_Result('groups');\n\t $result = &$this->ModelResult[$result_key];\n\t \n\t try{\n\t\t// 查詢資料庫\n\t\t$DB_OBJ = $this->DBLink->prepare(parent::SQL_Permission_Filter(SQL_AdStaff::SELECT_GROUP_LIST()));\n\t\tif(!$DB_OBJ->execute()){\n\t\t throw new Exception('_SYSTEM_ERROR_DB_ACCESS_FAIL'); \n\t\t}\n\t\t$groups = $DB_OBJ->fetchAll(PDO::FETCH_ASSOC);\n\t\t$result['action'] = true;\t\t\n\t\t$result['data'] = $groups;\t\t\n\t } catch (Exception $e) {\n $result['message'][] = $e->getMessage();\n }\n\t return $result;\n\t}", "public function index()\n {\n $paginationLength = pagination_length(PermissionGroup::class);\n $permissionGroups = PermissionGroup::paginate($paginationLength);\n return PermissionGroupResource::collection($permissionGroups);\n }", "public function index()\n {\n $groups = Group::withTrashed()->paginate(10);\n//\n\n //$groups = \\Auth::user()->groups()->paginate();\n return view('admin.groups.index', compact('groups'));\n }", "public function index()\n {\n //\n $groups = group::all()->sortByDesc('id');\n return view('player.group.group',[\n 'groups' => $groups\n ]);\n }", "function getGroupList() {\n return getAll(\"SELECT * FROM `group` WHERE admin_id = ?\", [getLogin()['uid']]);\n}", "public function actionLinkIndex()\n\t{\n\t\t$variables['groups'] = linxy()->getAllGroups();\n\n\t\t$this->renderTemplate('linxy/_index', $variables);\n\t}", "public static function getAllGroups($entriesOnly = FALSE) {\n global $lC_Database, $lC_Language, $_module;\n\n $lC_Language->loadIniFile('administrators.php');\n \n $media = $_GET['media']; \n\n $QadminGroups = $lC_Database->query('select id, name from :table_administrators_groups order by id');\n $QadminGroups->bindTable(':table_administrators_groups', TABLE_ADMINISTRATORS_GROUPS);\n $QadminGroups->execute();\n\n $result = array('entries' => array());\n $result = array('aaData' => array());\n while ( $QadminGroups->next() ) {\n $name = '<td>' . $QadminGroups->valueProtected('name') . '</td>';\n $modules = '<td class=\"hide-on-tablet\">' . self::getAccessBlocks($QadminGroups->valueInt('id')) . '</td>';\n $members = '<td>' . self::getTotalMembers($QadminGroups->valueInt('id')) . '</td>';\n $action = '<td class=\"align-right vertical-center\"><span class=\"button-group compact\">\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'administrators&set=access&gid=' . $QadminGroups->valueInt('id'))) . '\" class=\"button icon-pencil ' . ((int)($_SESSION['admin']['access'][$_module] < 3) ? 'disabled' : NULL) . '\">' . (($media === 'mobile-portrait' || $media === 'mobile-landscape') ? NULL : $lC_Language->get('icon_edit')) . '</a>\n <a href=\"' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? '#' : 'javascript://\" onclick=\"deleteGroup(\\'' . $QadminGroups->valueInt('id') . '\\', \\'' . urlencode($QadminGroups->valueProtected('name')) . '\\')') . '\" class=\"button icon-trash with-tooltip ' . ((int)($_SESSION['admin']['access'][$_module] < 4) ? 'disabled' : NULL) . '\" title=\"' . $lC_Language->get('icon_delete') . '\"></a></span></td>';\n // modification of default top level admin is prohibited\n if ($QadminGroups->valueInt('id') == '1' || $QadminGroups->value('name') == $lC_Language->get('text_top_administrator')) $action = '';\n $result['aaData'][] = array(\"$name\", \"$modules\", \"$members\", \"$action\");\n $result['entries'][] = $QadminGroups->toArray();\n }\n\n $QadminGroups->freeResult();\n\n if ($entriesOnly) return $result['entries'];\n return $result;\n }", "public function getIndex() {\n\t\t$title = Lang::get('admin/navigation/title.navigation_group_management');\n\t\t$navigationGroups = $this -> navigationGroup -> all();\n\n\t\treturn View::make('admin/navigationgroups/index', compact('title', 'navigationGroups'));\n\t}", "public function index() {\n\n\n //$search = \\Request::get('search');\n\n $title = ' Product Groups ';\n $subTitle = 'List of product groups';\n// $totalproducts = $this->productRepository->getPaginate(20);\n// $links = $totalproducts->setPath('')->render();\n //$product_groups = $this->productGroupRepository->getProductGroups($search);\n //dd($product_groups);\n return view('admin.product_groups.index', compact('title', 'subTitle'));\n }", "public function index() {\n\t\t$this->UserGroup->unbindModel( array('hasMany' => array('UserGroupPermission')));\n\t\t$userGroups=$this->UserGroup->find('all', array('order'=>'UserGroup.id'));\n\t\t$this->set('userGroups', $userGroups);\n\t}", "public function actionIndex()\n {\n $searchModel = new UserGroupSearch();\n //默认用户组状态\n $searchModel->status = UserGroup::STATUS_NORMAL;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function retrieveGroups()\n {\n return $this->start()->uri(\"/api/group\")\n ->get()\n ->go();\n }", "public function index()\n {\n hasPermission('View Permission Groups');\n\n return view('jawad_permission_uuid::permissionGroup.index');\n }", "public function getGroupList()\n\t{\n\t\t$db = FabrikWorker::getDbo(true);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('DISTINCT(group_id)')->from('#__{package}_formgroup');\n\t\t$db->setQuery($query);\n\t\t$usedgroups = $db->loadResultArray();\n\t\tJArrayHelper::toInteger($usedgroups);\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id AS value, name AS text')->from('#__{package}_groups');\n\t\tif (!empty($usedgroups)) {\n\t\t\t$query->where('id NOT IN('.implode(\",\", $usedgroups) .')');\n\t\t}\n\t\t$query->where('published <> -2');\n\t\t$query->order(FabrikString::safeColName('text'));\n\t\t$db->setQuery($query);\n\t\t$groups = $db->loadObjectList();\n\t\t$list = JHTML::_('select.genericlist', $groups, 'jform[groups]', \"class=\\\"inputbox\\\" size=\\\"10\\\" style=\\\"width:100%;\\\" \", 'value', 'text', null, $this->id . '-from');\n\t\treturn array($groups, $list);\n\t}", "function ajax_get_all_groups() {\r\n global $wpdb;\r\n\r\n $groups = $this->get_groups();\r\n\r\n if ( is_array( $groups ) && 0 < count( $groups ) ) {\r\n\r\n $i = 0;\r\n $n = ceil( count( $groups ) / 5 );\r\n\r\n $html = '';\r\n $html .= '<ul class=\"clients_list\">';\r\n\r\n\r\n\r\n foreach ( $groups as $group ) {\r\n if ( $i%$n == 0 && 0 != $i )\r\n $html .= '</ul><ul class=\"clients_list\">';\r\n\r\n $html .= '<li><label>';\r\n $html .= '<input type=\"checkbox\" name=\"groups_id[]\" value=\"' . $group['group_id'] . '\" /> ';\r\n $html .= $group['group_id'] . ' - ' . $group['group_name'];\r\n $html .= '</label></li>';\r\n\r\n $i++;\r\n }\r\n\r\n $html .= '</ul>';\r\n } else {\r\n $html = 'false';\r\n }\r\n\r\n die( $html );\r\n\r\n }", "public function index()\n {\n $paginate = Input::get('paginate', 'true') === 'true';\n\n return $paginate ? MemberGroup::paginate(15) : MemberGroup::all();\n }", "public function index()\n {\n $groups = \\App\\Group::withCount('players')->orderBy('players_count', 'desc')->orderBy('name', 'asc')->get();\n\n return view('groups.index', compact('groups'));\n }", "public function findGroups() {\n\t\t\n\t}", "public function index()\n {\n\n return view('usergroup.index')->with('groups',Company::find(Auth::User()->company_id)->hasUserGroups()->orderBy('id','desc')->get());\n\n }", "public function index()\n\t{\n\t\t$idgroup = grupo::orderBy('id_grupo','nombre_grupo')->paginate(2);\n\n\t\treturn view('grupos.index', compact('idgroup'));\n\n\t}", "public function index($groupid){\n // if(!Auth::check()){\n // return redirect()->route('login');\n // }\n // $participants = $this->participantRepo->findAll();\n $participants = $this->participantRepo->searchByGroupId($groupid);\n $messages = $this->messageRepo->searchByGroupId($groupid);\n\n return view('groups.index', ['participants' => $participants, 'messages' => $messages]);\n }", "public function index()\n {\n //Vind alle groeperingen waar de gebruiker id in voor komt\n //Daarna vind het alle groepen waar de gebruiker inzit met gebruik van groupeduser\n //returned de groups waar de gebruiker in zit naar de view\n\n $user = User::find(1)->groupedusers()->where('user_id', Auth::User()->id)->get();\n dump($user);\n $newarray = array();\n for ($i = 0; $i < count($user); $i++){\n array_push($newarray, DB::table('groups')->where('id', $user[$i]->group_id)->first());\n }\n\n\n\n\n dump($newarray);\n return view('group', ['groups' => $newarray]);\n\n }", "public function index()\n {\n removeSession('group');\n\n return view('group.index');\n }", "public function getGroups(){\n // Get newsletter emails\n $groups = NewsletterGroup::all();\n \n return view('Newsletter.Views.administrator.groups')->with([\n 'groups' => $groups\n ]);\n }", "public function index()\n {\n\t\t$list = InputGroup::all();\n return view('admin.input_groups.list', compact('list'));\n }", "function index() {\n $data['permission_groups'] = $this->Permission_group_model->get_all_permission_groups();\n\n $data['_view'] = 'permission_group/index';\n $this->load->view('layouts/main', $data);\n }", "public function index()\n {\n $groups = $this->groupService->showAll();\n\n return Response::json([\n 'groups' => $groups\n ], 201);\n }", "public function index()\n {\n $groups = SmsGroup::orderBy('id','desc')->paginate(20);\n return view('sms.groupsms.index',compact('groups'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $lsDefAssociationGroupings = $em->getRepository('CftfBundle:LsDefAssociationGrouping')->findAll();\n\n return [\n 'lsDefAssociationGroupings' => $lsDefAssociationGroupings,\n ];\n }", "private function _get_groups() {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$groups = [];\n\t\t$page_index = 1;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( \"groups?per_page=100&page=$page_index\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$groups = array_merge( $groups, $response_arr );\n\n\t\t\t$page_index = get_next_page( $response );\n\n\t\t} while ( ! empty( $page_index ) );\n\n\t\treturn $groups;\n\n\t}", "function getAllGroups() {\n return getAll(\"SELECT * FROM `group`\");\n}", "public function listgroup() { \n \n if (!is_null(auth()->guard('api')->user()->groups)){\n \n //$user->find(Auth::user()->id); \n $data = auth()->guard('api')->user()->groups->toArray();\n $response = [ \n 'success' => true, \n 'data' => $data, \n 'message' => 'Group retrieved successfully.' \n ]; \n return response()->json($response, 200);\n }\n else { \n return response()->json(['error' => 'Unauthorised'], 401); \n } \n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n return array(\n 'form' => $this->createForm(new GroupType(), new Group())->createView(),\n 'entities' => $em->getRepository('WhereGroupUserBundle:Group')->findAll(),\n );\n }" ]
[ "0.79750043", "0.795428", "0.7861284", "0.7784134", "0.769355", "0.76619333", "0.7659639", "0.76438755", "0.7638204", "0.7628353", "0.76227075", "0.7612808", "0.758189", "0.75797987", "0.7576925", "0.7563909", "0.75598276", "0.75546515", "0.7537449", "0.75330126", "0.7511521", "0.7508566", "0.7508566", "0.7507605", "0.75008816", "0.74925506", "0.7485459", "0.74821687", "0.74793524", "0.74531186", "0.7446681", "0.7446681", "0.7437126", "0.7424997", "0.74234873", "0.7417258", "0.74125147", "0.7403109", "0.7401565", "0.73950535", "0.73918366", "0.73877114", "0.7383625", "0.73753226", "0.73753226", "0.73741645", "0.7359722", "0.7342483", "0.73184276", "0.7314134", "0.7313984", "0.7275523", "0.7269945", "0.7268289", "0.7260245", "0.7259681", "0.7259681", "0.7249453", "0.723355", "0.72297454", "0.72274226", "0.72211224", "0.722077", "0.71837085", "0.71820724", "0.7174208", "0.71346235", "0.71255517", "0.7122846", "0.7115193", "0.71107733", "0.71028054", "0.71016574", "0.708845", "0.7086899", "0.70622116", "0.7030068", "0.70235354", "0.70211506", "0.70135266", "0.7013514", "0.69981664", "0.69817597", "0.697484", "0.6949279", "0.69458103", "0.6945346", "0.694501", "0.6941595", "0.69382966", "0.69343066", "0.6920719", "0.69192255", "0.69141316", "0.691129", "0.69049084", "0.68833375", "0.68649656", "0.6853743", "0.6852487" ]
0.749012
26
/ pdInitiate: Initiate API "connection"
function initiate( $Email, $Password, $partnerUserID ) { $this->request = new Polldaddy_Initiate( compact( 'Email', 'Password' ), array( 'partnerGUID' => $this->partnerGUID, 'partnerUserID' => $partnerUserID ) ); $this->send_request(); if ( isset( $this->response->userCode ) ) return $this->response->userCode; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function init_api() {\n\t\tinclude_once dirname( __FILE__ ) . '/includes/class-coinbase-api-handler.php';\n\n\t\tCoinbase_API_Handler::$log = get_class( $this ) . '::log';\n\t\tCoinbase_API_Handler::$api_key = $this->get_option( 'api_key' );\n\t}", "public function init()\n {\n $this->client = new Client(['base_uri' => Covalent::$host.\"/\".Covalent::$version.\"/\", 'auth' => [Covalent::$config['API_KEY'], ''], 'verify' => false ]);\n }", "abstract public function initClient();", "public function init()\n {\n $this->curl = (new Curl())->setOption(\n CURLOPT_HTTPHEADER, [\n 'Authorization: Basic ' . $this->apiKey,\n 'Content-Type: application/json'\n ]\n );\n }", "public function __construct()\n\t{\t\t\n\t\terror_reporting(E_ALL);\n\t\t$this->api = new ApiDirect('data');\n\t}", "public function init()\n {\n parent::init();\n $this->configureClient();\n }", "function rest_api_init()\n {\n }", "protected function initializeConnection() {\n GatherContent\\Configuration::configure($this->email, $this->api_key);\n\n if (!$this->project_id) {\n $project = $this->retrieveProject($this->account_slug, $this->project_name);\n $this->project_id = $project->id;\n }\n\n if (!$this->template) {\n if ($this->template_id) {\n $this->template = $this->retrieveTemplate($this->template_id);\n }\n elseif ($this->template_name) {\n $this->template = $this->retrieveTemplateByName($this->project_id, $this->template_name);\n $this->template_id = $this->template->id;\n }\n }\n\n if ($this->template_id) {\n $this->include_filters['template_id'] = $this->template_id;\n }\n }", "function initCP($hostname=null, $username=null, $password=null, $log=false){\n global $counterparty;\n $counterparty = new Client($hostname);\n $counterparty->authentication($username, $password);\n $status = $counterparty->execute('get_running_info');\n // If we have a successfull response, store it in 'status'\n if(isset($status)){\n $counterparty->status = $status;\n } else {\n // If we failed to establish a connection, bail out\n $msg = 'Counterparty Connection Failure';\n if($log){\n byeLog($msg);\n } else {\n print $msg;\n exit;\n }\n }\n}", "private function init() {\n $apiParts = $this->request->getApiParts();\n $this->requestedId = array_shift($apiParts);\n $this->apiParts = $apiParts;\n \n $this->siteDriver = Datastore::getSiteDriver();\n }", "protected function connect()\n {\n $url = $this->createUrl(\"\");\n // create curl resource\n $this->connection = curl_init();\n\n // set url\n curl_setopt($this->connection, CURLOPT_URL, $url);\n\n //return the transfer as a string\n curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, 1);\n\n }", "public function init()\n {\n try {\n $id = $this->getIdOrName();\n $client = KongClient::getInstance();\n $res = $client->getService($id);\n dd($res);\n } catch (\\Exception $e) {\n dump($e->getMessage());\n }\n }", "public function __construct(){\n $this->api = new Concierge();\n }", "private function init() {\n $this->_cm = curl_init();\n curl_setopt($this->_cm, CURLOPT_PROXY, $config['curl']['proxy']);\n curl_setopt($this->_cm, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_DIGEST);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($this->_cm, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($this->_cm, CURLOPT_TIMEOUT, $config['curl']['timeout']);\n curl_setopt($this->_cm, CURLOPT_POST, true); \n }", "private function setConnection(){\n\n\n\t\t\t$this->apiKey = Settings::get( 'apiKey' );\n\n\t\t\tif( $this->apiKey ){\n\n\t\t\t\t$this->gateway = new MailChimp( $this->apiKey );\n\n\t\t\t}else{\n\n\t\t\t\t//log an error\n\n\t\t\t}\n\n\t\t}", "public static function init() {\n if (self::$apiClient === null)\n self::$apiClient = new ApiClient();\n }", "protected function connect() {}", "private function setup_api() {\n\t\trequire_once 'includes/class-themeisle-ob-rest-server.php';\n\t\tif ( ! class_exists( 'Themeisle_OB_Rest_Server' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$api = new Themeisle_OB_Rest_Server();\n\t\t$api->init();\n\t\trequire_once 'includes/importers/helpers/trait-themeisle-ob.php';\n\t}", "public function connect()\n {\n }", "public function connect()\n {\n }", "public function connect()\n {\n }", "public function startCommunication()\n {\n if ($this->restAPI->login()) {\n $this->restAPI->keepAuth = true;\n }\n }", "private function init()\n {\n $this->curl = curl_init();\n }", "public function connect(): void\n {\n }", "function init_call() {\n\tdomain_check();\n\tsession_check();\n\n\t$db = connect_database(); // Connect... to the... database...\n\n\tcreate_structure(); // Ensure the data tables exist\n\tprocess_action(); // Work how to respond\n\n\tsend_message('error', array('reason' => 'none', 'message' => 'Something went wrong'));\n}", "protected function onInit()\n {\n //Set up connection\n }", "public function __construct()\r\n {\r\n $this->constructApiUrl();\r\n }", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->OpenConnect();\n\t\t}", "public function init()\n {\n $this->curl = curl_init();\n }", "public function __construct()\r\n {\r\n parent::__construct();\r\n\r\n $this->url = Configure::read('cdr_url') . \":\" . Configure::read('cdr_api.async_port');\r\n }", "public function preconnect(): void\n {\n }", "public function api_connect($url);", "public function connect(): void;", "public function __construct()\n\t{\n\t\t$this->api = new ApiDirect('fio');\n\n\t}", "protected function initialize()\n {\n if ($this->get('serverData') === null) {\n $this->set('serverData', (array) $_SERVER);\n }\n\n if ($this->get('getData') === null) {\n $this->set('getData', (array) $_GET);\n }\n\n if ($this->get('postData') === null) {\n $this->set('postData', (array) $_POST);\n }\n\n if ($this->get('sessionData') === null && isset($_SESSION)) {\n $this->set('sessionData', (array) $_SESSION);\n }\n\n $serverData = $this->get('serverData');\n\n if (!$this->get('projectRoot')) {\n $projectRoot = isset($serverData['_']) ? $serverData['_'] : $serverData['DOCUMENT_ROOT'];\n $this->set('projectRoot', $projectRoot);\n }\n\n if (!$this->get('url')) {\n if (isset($serverData['REDIRECT_URL'])) {\n $this->set('url', $serverData['REDIRECT_URL']);\n } elseif (isset($serverData['SCRIPT_NAME'])) {\n $this->set('url', $serverData['SCRIPT_NAME']);\n }\n }\n\n if (!$this->get('hostname')) {\n $this->set('hostname', isset($serverData['HTTP_HOST']) ? $serverData['HTTP_HOST'] : 'No Host');\n }\n\n $protocol = $this->get('secure') ? 'https' : 'http';\n $endPoint = $this->get('apiEndPoint') ?: $protocol . '://' . $this->get('host') . $this->get('resource');\n $this->set('apiEndPoint', $endPoint);\n }", "protected function initiateSubRequest() {}", "public function __construct() {\n $dotenv = new Dotenv();\n $dotenv->load(dirname(__DIR__).'/.env');\n\n $this->api = new Api($_ENV['CLODUI_API']);\n\n $client_id = $_ENV['CLODUI_CLIENT_ID'];\n $user_pool_id = $_ENV['CLODUI_USER_POOL_ID'];\n $identity_pool_id = $_ENV['CLODUI_IDENTITY_POOL_ID'];\n\n Logger::debug('Config Client ID '. $client_id. ', User pool id '. $user_pool_id. ', Identity pool id '. $identity_pool_id);\n $this->auth = new Auth($client_id, $user_pool_id, $identity_pool_id);\n }", "protected function connect_api() {\n\t\t$key = edd_get_option('eddmc_api', false);\n\n\t\tif ( $key ) {\n\t\t\t$this->api = new MailChimp( trim( $key ) );\n\n\t\t\tif ( defined('EDD_MC_VERIFY_SSL') && EDD_MC_VERIFY_SSL === false ) {\n\t\t\t\t$this->api->verify_ssl = false;\n\t\t\t}\n\t\t}\n\t}", "public function __construct(){\n $this->connection = curl_init();\n }", "public function __construct()\n {\n $this->client = new Client();\n $this->apiKey = Api::platform('TikApi')->first()->api_key;\n }", "public function init()\n\t{\n\t\tYii::import('application.vendors.Mailchimp.*'); //Required to set our include path so the required_once's everywhere work\n\t\trequire_once('MCAPI.class.php');\n\n\n\t\t$this->objModule = Modules::LoadByName(get_class($this)); //Load our module entry so we can access settings\n\t\t$this->api = new MCAPI($this->objModule->getConfig('api_key'));\n\n\t}", "protected function init()\n {\n $config = $this->getConfig();\n $this->service = new \\Vimeo\\Vimeo(\n $config->vimeo->client_id, $config->vimeo->client_secret\n );\n\n $token = $this->service->clientCredentials();\n $this->service->setToken($token['body']['access_token']);\n }", "public function init(): void{\n $this->handler = curl_init();\n }", "public function init()\n {\n $this->tickometer = new Tickometer();\n\n $this->timer = new Timer();\n\n $this->last = time();\n\n // initialize http client\n $this->client = new Client([\n 'timeout' => 5.0,\n 'headers' => [\n 'Referer' => 'https://fucking-great-advice.ru/',\n 'Accept' => 'application/json',\n 'User-Agent' => 'Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0',\n ],\n ]);\n\n // request information about tags\n try\n {\n $response = $this->client->get(self::TAGS_ENDPOINT);\n $body = json_decode($response->getBody(),true);\n foreach ($body['data'] as $item)\n {\n $this->tags[$item['alias']] = \"{$item['title']}, {$item['advicesCount']} advices\";\n }\n } catch (ConnectException $exception){\n /** nothing to do */\n }\n\n }", "public function init()\n {\n try {\n if (!defined('ITEMBASE_PLUGIN_BUILD')) {\n throw new \\Exception(\"No build key is set!\");\n }\n\n if (!defined('ITEMBASE_PLUGIN_SERVICE')) {\n define('ITEMBASE_PLUGIN_SERVICE', self::PLUGIN_SERVER_URL);\n }\n\n try {\n $httpClient = new HttpClient();\n $response = $httpClient->sendData(ITEMBASE_PLUGIN_SERVICE . '/builds/' . ITEMBASE_PLUGIN_BUILD);\n $response = json_decode($response, true);\n\n if (empty($response)) {\n throw new \\Exception(\"No configuration data is available for the plugin!\");\n }\n\n if (!empty($response['constants'])) {\n foreach ($response['constants'] as $constant => $value) {\n if (!defined($constant)) {\n define('ITEMBASE_' . strtoupper($constant), $value);\n }\n }\n }\n\n if (!empty($response['client_id']) && !defined('ITEMBASE_BRANDED_ID')) {\n define('ITEMBASE_BRANDED_ID', $response['client_id']);\n }\n } catch (\\Exception $ex) {\n define('ITEMBASE_OAUTH_SERVER_URL', self::OAUTH_SERVER_URL);\n }\n\n if (!defined('ITEMBASE_VENDOR_DIR')) {\n // according to composer (and PSR-4) folder structure vendor dir is the 6th level from current file\n define('ITEMBASE_VENDOR_DIR', dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));\n }\n\n $extensionLoader = new ExtensionsLoader($this->serviceContainer);\n $extensionLoader->loadExtensions();\n\n $this->eventDispatcher->initAwareServices();\n\n $this->serviceContainer->verifyServices(array(\n array(self::SERVICE_STORAGE => 'Itembase\\Psdk\\Platform\\StorageInterface'),\n array(self::SERVICE_MULTISHOP => 'Itembase\\Psdk\\Platform\\MultiShop\\MultishopAbstract'),\n array(self::SERVICE_PLATFORM => 'Itembase\\Psdk\\Platform\\PlatformInterface')\n ));\n\n // adding ping service to handle ping request\n $pingService = new PingHandler();\n $this->serviceContainer->bindService($pingService->getExtensionName(), $pingService);\n\n // we are ready to go\n $this->eventDispatcher->dispatch(self::EVENT_INITIALIZED);\n } catch (\\Exception $ex) {\n $this->logger->log(Logger::IB_LOG_ERR, $ex);\n\n $this->eventDispatcher->dispatch(self::EVENT_EXCEPTION, $ex);\n $this->httpHandler->sendResponses();\n exit;\n }\n\n return $this;\n }", "public function __construct()\n {\n $this->Connect();\n $this->parameters = array();\n }", "public function set_up() {\n\n\t\t$this::base_set_up();\n\t\tdo_action( 'rest_api_init' );\n\t\t$this->server = rest_get_server();\n\n\t}", "private function initConnection()\n {\n //NewJs_Slave Connection\n $this->m_objNewJs_Jprofile_Slave = new PROFILE_PROFILE_COMPLETION_SCORE('newjs_slave');\n }", "public function pconnect(): void\n {\n }", "public function __construct()\n {\n $this->ch = curl_init();\n $this->initialize();\n }", "private function initializeTransport() {}", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function connect();", "public function __construct() {\n if (!$this->api) {\n $this->api = new Wrapper();\n }\n }", "public function __construct()\r\n\t\t{\r\n\t\t\t$this->api_id = self::API_ID;\r\n\t\t\t$this->api_secret = self::API_SECRET;\r\n\t\t}", "protected function connect() {\n if (!$this->solr) {\n $this->solr = new Client();\n\n // The parent method is overridden so that this alternate adapter class\n // can be set. This line is the only difference from the parent method.\n $this->solr->setAdapter('Drupal\\search_api_pantheon\\Solarium\\PantheonCurl');\n\n $this->solr->createEndpoint($this->configuration + ['key' => 'core'], TRUE);\n $this->attachServerEndpoint();\n }\n }", "public function __construct()\n {\n //setup connection\n $this->api = new Connector();\n $this->api->setAuth(config('swimtimes.username'), config('swimtimes.password'));\n\n //setup style json file for fast calculation styles\n $this->createStylesJsonCache();\n }", "public function __construct()\n {\n parent::__construct();\n $this->client = new APIClient();\n }", "public function init()\n {\n $this\n ->instantiateNewCacher()\n ->instantiateNewClient()\n ->authenticateClient()\n ->getUsers(\n $this->getAppParam('s.github.api.organization')\n )\n ->getRepositories(\n $this->getAppParam('s.github.api.organization')\n )\n ;\n }", "public function initialize()\n {\n parent::initialize();\n\n // Constroi a resposta da API\n $this->response = new stdClass();\n $this->response->errorCode = 0;\n $this->response->errorMessage = '';\n $this->response->successMessage = '';\n $this->response->data = NULL;\n }", "private function _init() {\n\n global $admin_settings;\n global $payment_list;\n\n new KP_Korapay_Shortcode;\n\n $admin_settings = KP_Korapay_Admin_Settings::get_instance();\n $payment_list = KP_Korapay_Payment_List::get_instance();\n\n if ( is_admin() ) {\n KP_Tinymce_Plugin::get_instance();\n }\n\n if ($admin_settings->get_option_value( 'go_live' ) === 'yes' ) {\n $this->api_base_url = 'https://api.korapay.com/merchant';\n }\n\n }", "public function connect()\r\n\t{\r\n\t\t//$this->link = qracle_connect();\r\n\t}", "protected function _initialize(){\n\t\t// $service_token = md5(api_md5(red_panda) + md5(123456) + md5(timestamp)_api);\n\n\t\t// $this -> request = Request::instance();\n\t\t// // 判断传过来的时间戳是否超时\n\t\t// $this -> check_time($this->request->only(['time']));\n\t\t// // 验证token\n\t\t// $this -> check_token($this->request->param());\n\t}", "public function __construct()\n {\n parent::setup();\n\n $this->client = new Client([\n \"base_uri\" => self::URL\n ]);\n }", "public function __construct() {\n # returns the base portal URL as defined in conf file\n $configServ = new config();\n $this->baseUrl = $configServ->getServerBaseUrl() . \"/gocdbpi\";\n $this->docsURL = $configServ->getWriteApiDocsUrl();\n\n #Define some generic exception messages (remaining ones will be generated once entity type and value are known)\n $this->genericExceptionMessages[\"URLFormat\"] =\n \"API requests should take the form $this->baseUrl\" .\n \"/APIVERSION/ENTITYTYPE/ENTITYID/ENTITYPROPERTY/[ENTITYPROPERTYKEY]. \" .\n \"For more details see: $this->docsURL\";\n }", "final public function p_connect() {\n \t$this->connect('', '', '', '', true);\n \t}", "public function __construct()\n {\n $this->logger = new APILogger();\n $this->ChatDB = HelperDBConnections::getPDOChatDB(); \n }", "function init() {\n if ( empty( $this->hostname ) ) {\n $this->hostname = $this->gCI->gPZ['db_config'][\"hostname\"];\n }\n if ( empty( $this->username ) ) {\n $this->username = $this->gCI->gPZ['db_config'][\"username\"];\n }\n if ( empty( $this->password ) ) {\n $this->password = $this->gCI->gPZ['db_config'][\"password\"];\n }\n if ( strstr( $this->hostname, \":\" ) ) {\n list( $this->hostname, $this->port ) = explode( \":\", $this->gCI->gPZ['db_config']['hostname'] );\n } else {\n $this->port = 0;\n }\n $this->database = ( empty( $this->database ) ? $this->gCI->gPZ['db_config'][\"database\"] : $this->database );\n $this->db_conn = new mysqli( $this->hostname, $this->username, $this->password, $this->database, $this->port );\n\n if ( mysqli_connect_errno() ) {\n\n $this->gCI->fatal_error( \"Database Connect failed: %s\\n\", mysqli_connect_error()) ;\n }\n }", "public function __construct()\n {\n $this->client = new Client(['base_uri' => 'http://192.168.43.75:8888/apex/obe/']);\n }", "public function __construct($config){\n $this->api = new LeadBIAPI($config);\n }", "public function __construct($config){\n $this->api = new LeadBIAPI($config);\n }", "public function startup();", "private function __construct()\n {\n $this->connect();\n }", "function permly_api($api_key=''){\n\t\t$this->api_key = $api_key;\n\t\t$this->url = $this->api_server_protocol.\"://\".$this->api_server.\"/?remote_service=rs_external_api&key=1&interface=eai_permly&version=\".$this->api_version;\n\t}", "function humcore_deposit_api_classes_init() {\n\n\tglobal $ezid_api, $fedora_api, $solr_client;\n\n\t// Create an ezid client instance.\n\trequire_once dirname( __FILE__ ) . '/ezid-api.php';\n\t$ezid_api = new Humcore_Deposit_Ezid_Api;\n\n\t// Create a fedora client instance.\n\trequire_once dirname( __FILE__ ) . '/fedora-api.php';\n\t$fedora_api = new Humcore_Deposit_Fedora_Api;\n\n\t// Create a solr client instance.\n\trequire_once dirname( __FILE__ ) . '/solr-api.php';\n\t$solr_client = new Humcore_Deposit_Solr_Api;\n\n}", "private function init() {\n\n\t\tif ( ! $this->should_load() ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->setup_admin();\n\t\t$this->setup_api();\n\t}", "public function connect(): mixed;", "private function init()\n {\n $this->apiLive = false;\n\n $this->returnUrl = \"\";\n $this->cancelUrl =\"\";\n \n //Whether we are in sandbox or in live environment\n if ((bool)$this->apiLive === true) {\n //live\n $this->X_SYCA_MERCHANDID = 'C_57359E9C95103';\n $this->X_SYCA_APIKEY='pk_syca_753413334715da0c50e0a6adaf4d12abd9be1aa3';\n $this->sycapayUrlInit = \"https://secure.sycapay.com/login\";\n $this->sycapayUrl = 'https://secure.sycapay.com/checkresponsive';\n } else {\n //test\n $this->X_SYCA_MERCHANDID = 'C_56713FBF3E6A4';\n $this->X_SYCA_APIKEY='pk_syca_d49497468317152423d42aaff0d1166fc1b9522d';\n $this->sycapayUrlInit = \"https://secure.sycapay.net/login\";\n $this->sycapayUrl = \"https://secure.sycapay.net/checkresponsive\";\n }\n }", "public function __construct()\n {\n $CSO = new Api_Resources_CSO();\n $CSO->authenticate('timojong', 'FG4d%!k3hU');\n $this->addResource('CSO', $CSO);\n\n $OpenOnderwijs = new Api_Resources_OpenOnderwijs();\n $this->addResource('OpenOnderwijs', $OpenOnderwijs);\n }", "static function init(){\n if (!self::$conn) {\n $KEYS = new Keys();\n $hostname = $KEYS->DATABASE_HOST;\n $dbname = $KEYS->DATABASE_NAME;\n $username = $KEYS->DATABASE_USERNAME;\n $password = $KEYS->DATABASE_PASSWORD;\n $db = $db = ($KEYS->DATABASE_TYPE == \"\")? \"mysql\": $KEYS->DATABASE_TYPE;\n $port = $port = ($KEYS->DATABASE_PORT == \"\")? \"\": \"port={$KEYS->DATABASE_PORT};\";\n \n self::$conn = null;\n \n try {\n self::$conn = new PDO(\"{$db}:host={$hostname};{$port}dbname={$dbname}\", $username, $password);\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch(PDOException $exception) {\n Response::send(null, 500, \"Connection error: \" . $exception->getMessage());\n }\n }\n }", "public abstract function Connect();", "abstract protected function _connect(array $inConfiguration);", "private function initCurl()\n {\n $this->curlObj = curl_init();\n curl_setopt_array($this->curlObj, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_FORBID_REUSE => true,\n CURLOPT_HEADER => false,\n CURLOPT_TIMEOUT => 120,\n CURLOPT_CONNECTTIMEOUT => 2,\n CURLOPT_HTTPHEADER => [\"Connection: Keep-Alive\", \"Keep-Alive: 120\"]\n ));\n }", "private function settings_api_init() {\r\n\t\tif ( ! isset( $this->hook_suffix ) )\r\n\t\t\treturn;\r\n\r\n\t\t// Infusion API settings\r\n\t\t$section = 'infusion-api';\r\n\t\tadd_settings_section(\r\n\t\t\t$section,\r\n\t\t\t__( 'Infusion API Settings', 'inf-member' ),\r\n\t\t\tarray( &$this, 'section_header' ),\r\n\t\t\t$this->hook_suffix\r\n\t\t);\r\n\r\n\t\tadd_settings_field(\r\n\t\t\t'inf_url',\r\n\t\t\t_x( 'Infusion API Service URL', 'inf-member' ),\r\n\t\t\tarray( &$this, 'display_inf_url' ),\r\n\t\t\t$this->hook_suffix,\r\n\t\t\t$section,\r\n\t\t\tarray( 'label_for' => 'inf_url' )\r\n\t\t);\r\n\t\tadd_settings_field(\r\n\t\t\t'inf_key',\r\n\t\t\t_x( 'Infusion API key', 'inf-member' ),\r\n\t\t\tarray( &$this, 'display_api_key' ),\r\n\t\t\t$this->hook_suffix,\r\n\t\t\t$section,\r\n\t\t\tarray( 'label_for' => 'inf_key' )\r\n\t\t);\r\n\r\n /*if(Inf_Member::app_credentials_exist())\r\n $this->db_install();*/\r\n\t}", "public function connect() {\n if ($this->client) {\n $this->client->connect();\n }\n }", "public function run()\n {\n DLocalConfig::create([\n 'name' => 'api.andeanwide.com',\n 'url' => 'https://dpayout.andeanwide.com/',\n 'grant_type' => 'client_credentials'\n ]);\n }", "public static function init() {\n\t\trequire \"Client/Init.php\";\n\t}", "public function init()\n {\n parent::init();\n $config = \\Yii::$app->params['idBrokerConfig'];\n $this->client = new IdBrokerClient(\n $config['baseUrl'],\n $config['accessToken'],\n [\n IdBrokerClient::TRUSTED_IPS_CONFIG => $config['validIpRanges'] ?? [],\n IdBrokerClient::ASSERT_VALID_BROKER_IP_CONFIG => $config['assertValidBrokerIp'] ?? true,\n 'http_client_options' => [\n 'timeout' => 10, // An (optional) custom HTTP timeout, in seconds.\n ],\n ]\n );\n }", "function __construct() {\n parent::bdConnect();\n }", "public function initialize() {}", "public function initialize() {}", "public function initialize() {}" ]
[ "0.6415489", "0.6408781", "0.6401347", "0.6328864", "0.6098539", "0.6091732", "0.6087282", "0.6079691", "0.60554177", "0.6032719", "0.6013034", "0.6009287", "0.6008723", "0.5989981", "0.5985584", "0.598024", "0.59743875", "0.594125", "0.5941073", "0.5941073", "0.5941073", "0.59406966", "0.5929734", "0.59087825", "0.5886625", "0.5883512", "0.58681655", "0.58593553", "0.5855379", "0.5849623", "0.5847973", "0.5843696", "0.5842367", "0.5841777", "0.58334523", "0.5820969", "0.5818713", "0.5804205", "0.57997346", "0.57824993", "0.5778557", "0.5769314", "0.57681245", "0.576158", "0.5760645", "0.5744409", "0.57432085", "0.57391137", "0.57390916", "0.573032", "0.5725551", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.57207376", "0.5700904", "0.5698674", "0.56918186", "0.56908566", "0.5686344", "0.56847465", "0.5680137", "0.5667666", "0.5660856", "0.56592834", "0.56572336", "0.5653971", "0.5651125", "0.5644072", "0.5633062", "0.56296766", "0.56201994", "0.56201994", "0.5619198", "0.5616844", "0.5605173", "0.5604809", "0.5597832", "0.55944836", "0.5593214", "0.5588837", "0.5585857", "0.55812573", "0.5578575", "0.55767226", "0.55737126", "0.5572459", "0.5571829", "0.5570919", "0.5570611", "0.55657977", "0.55542076", "0.5554", "0.5554" ]
0.0
-1
/ pdAccess: API Access Control
function get_usercode( $partnerUserID ) { $this->request = new Polldaddy_Access( array( // 'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => __FUNCTION__ ) ) ) ) 'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => 'getusercode' ) ) ) ) ), array( 'partnerGUID' => $this->partnerGUID, 'partnerUserID' => $partnerUserID ) ); $this->send_request(); if ( isset( $this->response->userCode ) ) { return $this->response->userCode; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function access();", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "abstract public function require_access();", "public function checkAccess()\n {\n // need to be modified for security\n }", "function checkAccess() ;", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "public function isAccess();", "function access() {\n\t\treturn true;\n\t}", "private static function access()\n {\n $files = ['Path', 'Url'];\n $folder = static::$root.'Access'.'/';\n\n self::call($files, $folder);\n }", "function getAllAccess() {\n return ['download', 'remoteAccess', 'remoteService', 'enclave','notAvailable'];\n}", "abstract protected function canAccess();", "function index(){\n $this->APICONTROLLERID = 8;\n $this->accessNumberID = 8;\n echo \"Asd\";\n $this->checkACL();\n }", "public function grantAccess(): AccessResultInterface;", "public function testUpdateUnauthenticatedAccess(): void { }", "function access()\n{\nreturn app('access');\n}", "public function testAccess() {\n\n $this->drupalGet('udb3/api/1.0/user');\n $this->assertResponse('403');\n\n }", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function permissions();", "public function sendAccess() {\n $request = \\Drupal::request();\n $acquia_key = Storage::getKey();\n if (!empty($acquia_key) && $request->get('key')) {\n $key = sha1(\\Drupal::service('private_key')->get());\n if ($key === $request->get('key')) {\n return AccessResultAllowed::allowed();\n }\n }\n return AccessResultForbidden::forbidden();\n }", "public function mikrotik_access() {\n\t\treturn true;\n\t}", "function access()\n {\n return app('access');\n }", "function access()\n {\n return app('access');\n }", "protected function serviceAccessGates()\n {\n //\n }", "public function authorize()\n {\n return true; // I do not know how to create authorisation for the back-end and the time constraints of the project did not allow me to get to this stage either. It is something I would like to learn to do in the future however.\n }", "public function getAcl() {\n\n //throw new \\Exception(\"something\");\n\n\n\n $acl = new AclList();\n\n $acl->setDefaultAction(Acl::DENY);\n\n //Register roles\n $roles = array(\n 'users' => new Role('Users'),\n 'guests' => new Role('Guests'),\n 'operators' => new Role('Operators')\n );\n foreach ($roles as $role) {\n $acl->addRole($role);\n }\n\n //Private area resources\n $privateResources = array(\n 'report' => array('index', 'main', 'operator', 'mjump', 'network', 'statistics', 'getavgdata', 'payoutreport', 'aggSummary', 'reportbyhour', 'notworking', 'getCarrier', 'getCarrier2', 'statisticsNew', 'index2', 'statistics2', 'lpreport'),\n 'reportmb' => array('index', 'main', 'operator', 'mjump', 'network', 'statistics', 'getavgdata', 'payoutreport', 'aggSummary', 'reportbyhour', 'getCarrier', 'getCarrier2', 'statisticsNew', 'index2', 'statistics2'),\n 'operation' => array('index', 'mainstreamsourcenewname', 'getClientInfo', 'jump', 'updateCampaign', 'getCampaignLink', 'createSource', 'createAggregator', 'getAggInfo', 'link_checker', 'campaign_url', 'createCategory', 'findLatestConv', 'copySource'),\n 'slink' => array('index', 'ajaxtable', 'ajaxinsertgroup', 'ajaxgroupcombo', 'ajaxname', 'ajaxclone', 'ajaxdelete', 'ajaxupdatecell', 'ajaxdeleterow', 'ajaxclonerow', 'ajaxinsertmgroup', 'set_country', 'unset_country'),\n 'smlink' => array('index', 'ajaxtable', 'ajaxinsertgroup', 'ajaxgroupcombo', 'ajaxname', 'ajaxclone', 'ajaxdelete', 'ajaxupdatecell', 'ajaxdeleterow', 'ajaxclonerow', 'ajaxinsertmgroup'),\n 'affiliate' => array('index', 'removeAffiliation', 'updatePayout', 'newAffiliation'),\n 'isp' => array('index', 'get_groups', 'get_group', 'create_group', 'create_isp', 'delete_isp'),\n 'mainstream' => array('index', 'main', 'getCountriesWithDomainid', 'getAllCategories', 'getNjumps', 'getMainstreamHistory', 'saveNewRow'),\n 'mainstreambulk' => array('index', 'gallery', 'updateBannerId', 'insertbanners', 'editbanner', 'searchbanners', 'createBulk', 'editBulk', 'cloneBulk', 'downloadZip', 'tableBulk', 'getNjump', 'getCountry', 'getSources', 'getBulk', 'getBanners', 'downloadXlsx'),\n 'alert' => array('index', 'getSourcesAlerts', 'getClientsAlerts', 'getCountriesAlerts', 'getTablesAlerts', 'newAlert', 'editAlert', 'editTables', 'removeAlert', 'newCountryAlert', 'newAggAlert', 'newSrcAlert', 'getSourceTypeAlerts', 'newSourceTypeAlert'),\n 'invest' => array('index', 'upload', 'report', 'setfilter', 'campaigns', 'getReportExcel', 'totalsRow'),\n 'security' => array('index', 'deletei'),\n 'google' => array('index', 'downloadreport', 'addgooglesource'),\n 'vuclipsreport' => array('index', 'addOne', 'removeOne', 'editOne'),\n 'integration' => array('index', 'save_agregator', 'save_source', 'get_excel', 'report_conversion', 'save_user', 'save_domain', 'delete_domain', 'new_domain', 'get_clicksInfo', 'setEditClicks', 'reverse_multiclick', 'save_risqiq', 'delete_risqiq'),\n 'dashboard' => array('index', 'last7Days', 'percentageShift'),\n 'ticketing' => array('index', 'createTicket', 'editTicket'),\n 'jump' => array('index', 'uploadCsv'),\n 'crm' => array('index', 'getClient', 'createClient', 'editClient', 'getClients', 'last7Days'),\n 'autobid' => array('index', 'addcampaign', 'editcampaign', 'deletecampaign', 'refreshTable', 'downloadReport', 'addAccount', 'resetpass'),\n 'ip' => array('index', 'getIps', 'getCustomIPs', 'getcarriers', 'getclientips', 'testphalconshit', 'addNewCarrier', 'addNewCountry'),\n 'freporting' => array('index', 'upload', 'setFilter', 'updateComment', 'downloadCsv', 'getChart', 'uploadMultiAgg', 'getAffs', 'getAggs'),\n 'sourcesapi' => array('index', 'downloadReport'),\n 'permission' => array('index', 'countries', 'srcagr', 'updatecountry', 'updateAgregators', 'updateSources'),\n 'customreport' => array('index', 'getAttributes', 'savecustomreport', 'createcustom', 'getMyCustomReports', 'echoReport', 'deleteSavedReport', 'downloadReport'),\n 'campaignblocker' => array('index', 'getAffected', 'executeblock', 'executerestore', 'getcampaigns', 'executetemprestore', 'blockbyname'),\n 'rates' => array('index', 'getRateThreeMonths'),\n 'offerpack' => array('index', 'getDims', 'getCarriers', 'newOfferpack', 'newOfferpack2', 'offerpackedit', 'getCarriersMultiple', 'getCampaignJumpName', 'setFilter', 'updateCpa', 'addOffersExcel', 'disableOffer', 'getScreenshot', 'getBanners', 'getCM', 'getAccount', 'deletebanner', 'deletescreenshot', 'getofferinfo', 'updateStatus', 'index2', 'offerpackedit2', 'setFilter2'),\n 'ticketsystem' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel'),\n 'ticketsystem2' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel', 'editticket_itsdes', 'editTicket', 'sendToValidation', 'putOnHold', 'putInProgress', 'refuse', 'request', 'assign', 'ticketok', 'ticketnotok', 'closeticket', 'infosent', 'reopenticket', 'changeDeadline'),\n 'njump' => array('index', 'changeGlobalName', 'getStatistics', 'favoriteNjump', 'getNjumps', 'getnjump', 'newnjump', 'njumpedit', 'njumpclone', 'njumpdelete', 'njumpdeleterow', 'njumpnewrow', 'updatecell', 'njumpsortby', 'indexm', 'njumpeditm', 'mreset', 'getnjumpsbycountry', 'njumpclonemultiplelines', 'njumpdeletemultiplerow'),\n 'landingmanager' => array('index', 'createeditlp', 'getDims', 'setFilter', 'getlpinfo', 'newEditLp', 'getFilters', 'getOfferByGeo', 'insertNewLp', 'newlp', 'getLpInformation', 'saveLp', 'deleteLp', 'viewlp', 'getLpInformationView'),\n 'admin' => array('index', 'displayAgregators', 'removeAgregators', 'removeCountries', 'addAgregators', 'getAllAgregatorsUsers', 'displayCountries', 'getAllCountriesUsers', 'addCountries'),\n 'client' => array('index', 'searchAll', 'getData', 'searchData', 'createClient', 'saveClient', 'updateClient', 'getClientUpdated', 'getTotalRows', 'hideClient', 'getGraphData', 'chatSave', 'getHistoryInfo', 'getIssueInfo'),\n 'sales' => array('index', 'getData', 'createExcel', 'getCarriers')\n );\n foreach ($privateResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n //operation area resources\n $operationResources = array(\n 'operation' => array('index', 'jump', 'updateCampaign', 'getCampaignLink', 'createSource', 'createAggregator', 'getAggInfo', 'link_checker', 'campaign_url', 'createCategory', 'findLatestConv', 'copySource'),\n 'report' => array('index', 'statistics', 'getavgdata', 'aggSummary', 'getCarrier', 'index2', 'statistics2', 'getCarrier2'),\n 'reportmb' => array('index', 'statistics', 'getavgdata', 'aggSummary', 'getCarrier', 'index2', 'statistics2', 'getCarrier2'),\n 'security' => array('index', 'deletei'),\n 'mainstream' => array('index', 'main', 'getCountriesWithDomainid', 'getAllCategories', 'getNjumps', 'getMainstreamHistory', 'saveNewRow'),\n 'mainstreambulk' => array('index'),\n 'vuclipsreport' => array('index', 'addOne', 'removeOne', 'editOne'),\n 'integration' => array('index', 'save_agregator', 'save_source', 'get_excel', 'report_conversion', 'save_user', 'save_domain', 'delete_domain', 'new_domain', 'get_clicksInfo', 'setEditClicks', 'reverse_multiclick', 'save_risqiq', 'delete_risqiq'),\n 'dashboard' => array('index', 'chartinfo', 'reportbyhour', 'percentageShift', 'last7Days', 'getRateThreeMonths'),\n 'ticketing' => array('index', 'createTicket', 'editTicket'),\n 'jump' => array('index', 'uploadCsv'),\n 'crm' => array('index', 'getClient', 'createClient', 'editClient', 'getClients', 'last7Days'),\n 'autobid' => array('index', 'addcampaign', 'editcampaign', 'deletecampaign', 'refreshTable', 'downloadReport', 'addAccount', 'resetpass'),\n 'ip' => array('index', 'getIps', 'getCustomIPs', 'getcarriers', 'getclientips', 'addNewCarrier', 'addNewCountry'),\n 'freporting' => array('index', 'upload', 'setFilter', 'updateComment', 'downloadCsv', 'getChart', 'uploadMultiAgg', 'getAffs', 'getAggs'),\n 'sourcesapi' => array('index', 'downloadReport'),\n 'rates' => array('index', 'getRateThreeMonths'),\n 'offerpack' => array('index', 'getDims', 'getCarriers', 'newOfferpack', 'offerpackedit', 'getCarriersMultiple', 'getCampaignJumpName', 'setFilter', 'updateCpa', 'addOffersExcel', 'disableOffer', 'getScreenshot', 'getBanners', 'getCM', 'getAccount', 'deletebanner', 'deletescreenshot', 'getofferinfo', 'updateStatus', 'index2', 'offerpackedit2', 'setFilter2'),\n 'ticketsystem' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel'),\n 'ticketsystem2' => array('index', 'editTicket', 'createTicket', 'getUsersMultiple', 'create_ticket', 'sendMessage', 'refreshChat', 'downloadFile', 'uploadFile', 'edit_ticket', 'pickTicket', 'closeTicket', 'reopenTicket', 'setFilter', 'downloadExcel', 'editticket_itsdes', 'editTicket', 'sendToValidation', 'putOnHold', 'putInProgress', 'refuse', 'request', 'assign', 'ticketok', 'ticketnotok', 'closeticket', 'infosent', 'reopenticket', 'changeDeadline'),\n 'njump' => array('index'),\n 'campaignblocker' => array('index', 'getAffected', 'executeblock', 'executerestore', 'getcampaigns'),\n 'landingmanager' => array('index', 'createeditlp', 'getDims', 'setFilter', 'getlpinfo', 'newEditLp', 'getFilters', 'getOfferByGeo', 'insertNewLp', 'newlp', 'getLpInformation', 'saveLp', 'deleteLp', 'viewlp', 'getLpInformationView'),\n 'admin' => array('index', 'displayAgregators', 'removeAgregators', 'removeCountries', 'addAgregators', 'getAllAgregatorsUsers', 'displayCountries', 'getAllCountriesUsers', 'addCountries'),\n 'client' => array('index', 'searchAll', 'getData', 'searchData', 'createClient', 'saveClient', 'updateClient', 'getClientUpdated', 'getTotalRows', 'hideClient', 'getGraphData', 'chatSave', 'getHistoryInfo', 'getIssueInfo'),\n 'sales' => array('index', 'getData', 'createExcel', 'getCarriers')\n );\n foreach ($operationResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Public area resources\n $publicResources = array(\n 'index' => array('index'),\n 'errors' => array('show404', 'show500'),\n 'session' => array('index', 'register', 'start', 'end'),\n 'offerpack' => array('getzip')\n );\n foreach ($publicResources as $resource => $actions) {\n $acl->addResource(new Resource($resource), $actions);\n }\n\n //Grant access to public areas to both users and guests\n foreach ($roles as $role) {\n foreach ($publicResources as $resource => $actions) {\n $acl->allow($role->getName(), $resource, '*');\n }\n }\n\n //Grant acess to private area to role Users\n foreach ($privateResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('Users', $resource, $action);\n }\n }\n //Grant acess to operations area to role Operations\n foreach ($operationResources as $resource => $actions) {\n foreach ($actions as $action) {\n $acl->allow('Operators', $resource, $action);\n }\n }\n\n //The acl is stored in session, APC would be useful here too\n $this->persistent->acl = $acl;\n\n\n return $this->persistent->acl;\n }", "public function rest_api_permission() {\n return apply_filters('h5p_rest_api_all_permission', current_user_can('edit_others_h5p_contents'));\n }", "public function denyAccess(): AccessResultInterface;", "public function hasAccess(): bool;", "abstract public function authorize();", "abstract public function authorize();", "function _campaign_resource_access($op = 'view', $args = array()) {\n if (DOSOMETHING_REPORTBACK_LOG) {\n watchdog('dosomething_api', '_campaign_resource_access args:' . json_encode($args));\n }\n\n if ($op == 'index') {\n return TRUE;\n }\n\n $node = node_load($args[0]);\n if (!$node) {\n return services_error(t('No node found for @nid', array('@nid' => $args[0])), 403);\n }\n\n if ($op == 'view') {\n return node_access($op, $node);\n }\n\n if (!user_is_logged_in()) {\n return services_error(t('Must be logged in!'), 403);\n }\n\n if (dosomething_campaign_is_active($node)) {\n return TRUE;\n //@todo: If op==reportback and SMS Game, return 403 error.\n }\n\n return services_error(t('Campaign node @nid is not active.', array('@nid' => $node->nid)), 403);\n}", "public function accessAction() {\n if (!$_SESSION['request_token']) {\n return self::redirect('request');\n }\n\n $tok = $_SESSION['request_token'];\n $this->api->setOAuthToken($tok->getKey(), $tok->getSecret());\n $this->api->login('access')->post()->loadTokenFromResponse();\n $_SESSION['access_token'] = $this->api->getOAuthToken();\n $_SESSION['username'] = $this->api->getUsername();\n $_SESSION['subdomain'] = $this->api->getSubdomain();\n\n return self::redirect('index');\n }", "function CheckLibraryAccess(){\n if ($this->listSettings->HasSection(\"ACCESS\")) {\n if ($this->listSettings->HasItem(\"ACCESS\", \"GROUPS\")) {\n $this->Page->access_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"GROUPS\"));\n\n }\n if ($this->listSettings->HasItem(\"ACCESS\", \"USERS\")) {\n $this->Page->access_user_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"USERS\"));\n }\n if ($this->listSettings->HasItem(\"ACCESS\", \"ROLES\")) {\n $this->Page->access_role_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"ROLES\"));\n }\n\n $this->Page->Auth->isLogged();\n }\n }", "public function testPrivs()\n {\n return true; ///< Every client sees only it's own information\n }", "public function testShowUnauthicatedAccess(): void { }", "public function authorize();", "public function authorize();", "public function checkPermission()\n\t{\n\t\tif (empty($this->controller->headers['x-token'])) {\n\t\t\tthrow new \\Api\\Core\\Exception('No sent token', 401);\n\t\t}\n\t\t$apiType = strtolower($this->controller->app['type']);\n\t\t$sessionTable = \"w_#__{$apiType}_session\";\n\t\t$userTable = \"w_#__{$apiType}_user\";\n\t\t$db = \\App\\Db::getInstance('webservice');\n\t\t$row = (new \\App\\Db\\Query())->select([\n\t\t\t\"$userTable.*\",\n\t\t\t\"$sessionTable.id\",\n\t\t\t'sessionLanguage' => \"$sessionTable.language\",\n\t\t\t\"$sessionTable.created\",\n\t\t\t\"$sessionTable.changed\",\n\t\t\t\"$sessionTable.params\"\n\t\t])->from($userTable)\n\t\t\t->innerJoin($sessionTable, \"$sessionTable.user_id = $userTable.id\")\n\t\t\t->where([\"$sessionTable.id\" => $this->controller->headers['x-token'], \"$userTable.status\" => 1])\n\t\t\t->one($db);\n\t\tif (empty($row)) {\n\t\t\tthrow new \\Api\\Core\\Exception('Invalid token', 401);\n\t\t}\n\t\t$this->session = new \\App\\Base();\n\t\t$this->session->setData($row);\n\t\t\\App\\User::setCurrentUserId($this->session->get('user_id'));\n\t\t$userModel = \\App\\User::getCurrentUserModel();\n\t\t$userModel->set('permission_type', $row['type']);\n\t\t$userModel->set('permission_crmid', $row['crmid']);\n\t\t$userModel->set('permission_app', $this->controller->app['id']);\n\t\t$namespace = ucfirst($apiType);\n\t\t\\App\\Privilege::setPermissionInterpreter(\"\\\\Api\\\\{$namespace}\\\\Privilege\");\n\t\t\\App\\PrivilegeQuery::setPermissionInterpreter(\"\\\\Api\\\\{$namespace}\\\\PrivilegeQuery\");\n\t\t\\Vtiger_Field_Model::setDefaultUiTypeClassName('\\\\Api\\\\Core\\\\Modules\\\\Vtiger\\\\UiTypes\\\\Base');\n\t\t$db->createCommand()\n\t\t\t->update($sessionTable, ['changed' => date('Y-m-d H:i:s')], ['id' => $this->session->get('id')])\n\t\t\t->execute();\n\t\treturn true;\n\t}", "public function resource(){\n\t\tif (!$this->server->verifyResourceRequest(OAuth2\\Request::createFromGlobals())) {\n\t\t $this->server->getResponse()->send();\n\t\t echo json_encode(array('status' => false, 'message' => 'NO ACCESS TOKEN'));\n\t\t die;\n\t\t}\t\t\n }", "function authGet() { }", "function Access()\n\t{\n\t\t$this->clear_authentication(false);\n\t\t$this->identify();\n\t}", "public function action_api($unused = null) {\n\t\tif (!Auth::instance()->has_permission('update_profile', $this->_model_name)) {\n\t\t\tthrow new Oxygen_Access_Exception;\n\t\t}\n\n\t\tparent::action_api(true);\n\n\t\t$this->favorites->title('API Access');\n \t\t$this->breadcrumbs->delete('Edit '.$this->_model->meta('one_text'));\n\t}", "function cfwprapi_can_user_have_access( WP_REST_Request $request ) {\n return current_user_can( 'manage_options' );\n}", "function control_access($sKey, $id){ \r\n\t$permiso=false;\r\n\t$permisosAdmin=$_SESSION[\"R0l3sp3rM1s0s\"];\r\n\tif($permisosAdmin[$sKey][$id]==\"SI\"){\r\n\t\t$permiso=true;\r\n\t}\r\n\treturn $permiso;\r\n}", "private function metodo_privado() {\n }", "public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }", "public function authorize($serviceName, $methodName, $methodAccess);", "public function testApikeyGetPermissionsV1()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function access(): mixed\n {\n return new Access('access');\n }", "public function show() {\r\n\t\t@header('HTTP/1.0 403 Forbidden');\r\n\t\tWCF::getTPL()->display('permissionDenied');\r\n\t}", "public function index()\n {\n $this->cpAuthorize();\n }", "public function setAuthorized() {}", "public function api_call() {\n\n }", "function check_access() {\n trigger_error('Admin class does not implement method <strong>check_access()</strong>', E_USER_WARNING);\n return;\n }", "public function getAccess()\n {\n return $this->_params['access'];\n }", "public function indexAction()\n {\n echo 'Forbidden access';\n }", "public function createAccessControlSession():void;", "function userAccess(){\n Q::db()->query('INSERT INTO access (REQUEST,METHOD,REMOTE,AGENT,ACCEPT,ENCODING,LANGUAGE,IDATE)\n VALUES (:req,:met,:rem,:age,:acc,:enc,:lan,:idate)',\n [':req'=>$_SERVER['REQUEST_URI'],\n ':met'=>$_SERVER['REQUEST_METHOD'],\n ':rem'=>$_SERVER['REMOTE_ADDR'],\n ':age'=>$_SERVER['HTTP_USER_AGENT'],\n ':acc'=>$_SERVER['HTTP_ACCEPT'],\n ':enc'=>$_SERVER['HTTP_ACCEPT_ENCODING'],\n ':lan'=>$_SERVER['HTTP_ACCEPT_LANGUAGE'],\n ':idate'=>date('Y-m-d H:I:s')]);\n Q::db()->query('DELETE FROM access WHERE DATE(access.IDATE) <= DATE(DATE(NOW())-30)');\n }", "public function accessRules()\r\n\t{\r\n\t\t//Metodo localizado dentro da classe WebbeeController em protected/components/\r\n\t\treturn WebbeeController::controlAccess();\r\n\t}", "private function fetchPermissions(): void\n {\n try {\n $clientPermissions = (new HomeCareApi)->permissions($this->client->agencyId, $this->client->patientContactId, $this->client->id);\n\n $this->isPayor = $clientPermissions->isPayor ?? false;\n $this->isAgencyBankAccountSetup = $clientPermissions->isAgencyBankAccountSetup ?? false;\n $this->canViewDocumentation = $clientPermissions->familyViewDocumentationAccess ?? false;\n\n } catch (Exception $e) {\n $this->isPayor = false;\n $this->isAgencyBankAccountSetup = false;\n $this->canViewDocumentation = false;\n\n Log::channel('teams')->error($e->getMessage());\n Log::channel('teams')->info('Can not obtain client permissions, invoicing disabled');\n }\n }", "public function checkPermissions();", "public function canGet()\n {\n if ( !$this->actor ) \n {\n $this->actor = get_viewer(); \n }\n \n if ( !$this->actor ) \n {\n return false; \n }\n \n if ( !$this->actor->authorize('administration') ) \n {\n return false; \n }\n \n $this->getService('repos://site/connect.session');\n \n $api = $this->actor->sessions->{$this->getIdentifier()->name}; \n \n if ( !$api ) \n return false;\n \n $this->api = $api;\n }", "public function checkPermissions() {\n if ($this->checkIp()) {\n \\BDSCore\\Errors\\Errors::returnError(403);\n }\n }", "public function authorizeAction();", "function VisibleToAdminUser()\n {\n\tinclude (\"dom.php\");\n return $this->CheckPermission($pavad.' Use');\n }", "public function revoke_access() {\r\n // Nothing to do!\r\n }", "public function access($what = 'all') {\n\t\treturn FALSE;\n\t}", "abstract public function url_authorize();", "function permly_api($api_key=''){\n\t\t$this->api_key = $api_key;\n\t\t$this->url = $this->api_server_protocol.\"://\".$this->api_server.\"/?remote_service=rs_external_api&key=1&interface=eai_permly&version=\".$this->api_version;\n\t}", "function getaccess($ctrl=SESSION_CTRL_CUSTOMER,$module=0,$priv=0){\n\t\t$this->release();\n\t\treturn $this->ctrl == $ctrl;\n\t}", "public function getAccessionsList(){\n return $this->_get(2);\n }", "public function getAccessionsList(){\n return $this->_get(2);\n }", "function do_introspection($token, $scopes, $subject)\r\n{\r\n // Call Authlete's /auth/introspection API.\r\n $response = call_introspection_api($token, $scopes, $subject);\r\n\r\n // The content of the response to the client.\r\n $content = $response['responseContent'];\r\n\r\n // \"action\" denotes the next action.\r\n switch ($response['action'])\r\n {\r\n case 'INTERNAL_SERVER_ERROR':\r\n // 500 Internal Server Error\r\n // The API request from this implementation was wrong\r\n // or an error occurred in Authlete.\r\n (new WebResponse(500))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'BAD_REQUEST':\r\n // 400 Bad Request\r\n // The request from the client application does not\r\n // contain an access token.\r\n (new WebResponse(400))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'UNAUTHORIZED':\r\n // 401 Unauthorized\r\n // The presented access token does not exist or has expired.\r\n (new WebResponse(401))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'FORBIDDEN':\r\n // 403 Forbidden\r\n // The access token does not cover the required scopes\r\n // or the subject associated with the access token is\r\n // different.\r\n (new WebResponse(403))->wwwAuthenticate($content)->finish();\r\n return null; // Not reach here.\r\n\r\n case 'OK':\r\n // The access token is valid (= exists and has not expired).\r\n return $response;\r\n\r\n default:\r\n // This never happens.\r\n (new WebResponse(500, \"Unknown action\"))->plain()->finish();\r\n return null; // Not reach here.\r\n }\r\n}", "static function access () {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n $return = onapp_has_permission( array( 'roles' ) );\n onapp_debug( 'return => '.$return );\n return $return;\n }", "function allow($operation,$params=array(),$allowCaching=true)\n{\n\treturn Yii::app()->user->checkAccess($operation,$params,$allowCaching);\n}", "function access_denied() {\n\t\tif ( ! php_version_at_least( '4.1.0' ) ) {\n\t\t\tglobal $_SERVER;\n\t\t}\n\n\t\t// Si viene por webservice no necesita estar logueado.\n\t\tif($_POST['code']=='14149989'){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! auth_is_user_authenticated() ) {\n\t\t\t$p_return_page = string_url( $_SERVER['REQUEST_URI'] );\n\t\t\tprint_header_redirect( 'index.php?m=webtracking&a=login_page&return=' . $p_return_page );\n\t\t} else {\n\t\t\tglobal $AppUI;\n\t\t\t$AppUI->redirect(\"m=public&a=access_denied\");\n\t\t\t\n\t\t\t/*\n\t\t\tprint '<center>';\n\t\t\tprint '<p>'.error_string(ERROR_ACCESS_DENIED).'</p>';\n\t\t\tprint_bracket_link( 'index.php?m=webtracking&a=main_page', lang_get( 'proceed' ) );\n\t\t\tprint '</center>';*/\n\t\t}\n\t\texit;\n\t}", "abstract public function getAccessRights(): array;", "protected function authorityControl()\n {\n return Authority::can(Permission::ACTION_R, 'Queries');\n }", "public function & GetPermissions ();", "public function rol_conductor_only_access()\n {\n if ($this->rol != 3) {\n exit($this->httpResponse(\"error\", \"forbbiden\", \"Your role do not have permission\", 403)->json());\n }\n }", "function get_privileged_status($host_data)\n{\n global $API_version;\n global $CGM_version;\n\n if ($API_version >= 1.2 )\n {\n $arr = array ('command'=>'privileged','parameter'=>'');\n $response = send_request_to_host($arr, $host_data);\n\n if ($response['STATUS'][0]['STATUS'] == 'S')\n return true;\n }\n else \n return true;\n\n return false;\n}", "function assignToken($domain,$accesslevel) {\n\n}", "public function processApi() {\r\n\tif($this->securedRest){\r\n\t if(!isset($this->requestSecure) || !isset($this->requestPublicKey)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t if(!$this->verifyKeys($this->requestPublicKey, $this->requestSecure)){\r\n\t\t$this->response('Utilisateur non authentifié', 401);\r\n\t }\r\n\t}\r\n\t\r\n\t$func = $this->_method;\r\n\tif ((int) method_exists($this, $func) > 0){\r\n\t $this->$func();\r\n\t}else{\r\n\t $this->response('', 404);\r\n\t}\r\n\t\r\n }", "public function providerTestAccess() {\n $data = [];\n $data[] = [TRUE, TRUE, AccessResult::allowed()];\n $data[] = [FALSE, TRUE, AccessResult::neutral()];\n $data[] = [TRUE, FALSE, AccessResult::neutral()];\n $data[] = [FALSE, FALSE, AccessResult::neutral()];\n\n return $data;\n }", "function isAllowedPermission()\n {\n $retObj = array();\n try {\n\n if (isset($_REQUEST['user_id']) && isset($_REQUEST['is_backend']) && isset($_REQUEST['method']))\n {\n $retObj['allowed'] = false;\n\n $params = array(\n 'user_id' => $_REQUEST['user_id'],\n 'is_backend' => $_REQUEST['is_backend'],\n 'method' => $_REQUEST['method']\n );\n\n $aclObj = new AclManager();\n $permissions = $aclObj->getUserPermissions($params);\n\n //c. check if method valid\n foreach($permissions as $permission)\n {\n if($permission['title'] == $params['method']) {\n $retObj['allowed'] = true;\n }\n }\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }", "function amap_ma_not_permit_public_access() {\n \n return false;\n}", "public function helpPrivacy()\n {\n\t// make the call\n\treturn $this->doCall(\n\t 'help/privacy.json'\n\t);\n }", "public function authorize()\n {\n return auth()->user()->ability('admin','update_pages');\n }", "public function setAccess($value)\n {\n if ($value !== null) {\n $this->_params['access'] = $value;\n } else {\n unset($this->_params['access']);\n }\n }" ]
[ "0.72119594", "0.697185", "0.697185", "0.69711167", "0.69711167", "0.69711167", "0.6970756", "0.6970756", "0.6970756", "0.682641", "0.6818453", "0.67971754", "0.67358977", "0.65923697", "0.65923697", "0.65734756", "0.64353657", "0.6432701", "0.6407741", "0.63887227", "0.6214821", "0.6202502", "0.6201077", "0.6198486", "0.61774945", "0.61032647", "0.61032647", "0.61032647", "0.61032647", "0.61032647", "0.60882115", "0.6087591", "0.60419285", "0.60419285", "0.6027355", "0.5999721", "0.59966373", "0.5944249", "0.5938323", "0.59170645", "0.58848584", "0.58848584", "0.58772963", "0.5864951", "0.5856212", "0.583391", "0.5829982", "0.5829058", "0.5829058", "0.5824585", "0.5811837", "0.5805704", "0.5778445", "0.577394", "0.57707477", "0.5768551", "0.5750516", "0.574683", "0.573344", "0.57268584", "0.57200056", "0.5713542", "0.57109034", "0.5683601", "0.5680833", "0.56791735", "0.56785154", "0.5654403", "0.56503415", "0.5639883", "0.56307214", "0.5629405", "0.5628788", "0.5624605", "0.5615452", "0.5603464", "0.56023", "0.5598355", "0.5595565", "0.5587869", "0.5584901", "0.55788285", "0.55751294", "0.55751294", "0.55724937", "0.5571357", "0.55640966", "0.5563382", "0.5552361", "0.55435723", "0.5541827", "0.5540941", "0.5536901", "0.5535705", "0.5525936", "0.5523851", "0.55076754", "0.550422", "0.5502608", "0.54962075", "0.5492784" ]
0.0
-1
/ pdRequest: Request API Objects / Accounts
function get_account() { // $pos = $this->add_request( __FUNCTION__ ); $pos = $this->add_request( 'getaccount' ); $this->send_request(); $r = $this->response_part( $pos ); if ( isset( $r->account ) && !is_null( $r->account->email ) ) return $r->account; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function ringbaAccountGetRequest()\n {\n\n $resourcePath = '/RingbaAccounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\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\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function accountDetailsRequest()\n {\n\n $resourcePath = '/accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\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/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function retrieveAccountDetails()\n {\n $segments = \"/account\";\n\n return $this->createRequest($segments);\n }", "protected function getAccountRequest()\n {\n\n $resourcePath = '/shipping/v1/account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'GET', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function bankAccountsV2GetRequest()\n {\n\n $resourcePath = '/v2/bankaccounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function queryAccountsRequest($include = null, $filter = null, $top = null, $skip = null, $order_by = null, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n\n $resourcePath = '/api/v2/accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($include !== null) {\n $queryParams['$include'] = ObjectSerializer::toQueryValue($include);\n }\n // query params\n if ($filter !== null) {\n $queryParams['$filter'] = ObjectSerializer::toQueryValue($filter);\n }\n // query params\n if ($top !== null) {\n $queryParams['$top'] = ObjectSerializer::toQueryValue($top);\n }\n // query params\n if ($skip !== null) {\n $queryParams['$skip'] = ObjectSerializer::toQueryValue($skip);\n }\n // query params\n if ($order_by !== null) {\n $queryParams['$orderBy'] = ObjectSerializer::toQueryValue($order_by);\n }\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getCurrentAccountRequest()\n {\n\n $resourcePath = '/v1/account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function authorizeAccount() {\n $url = 'https://api.backblaze.com/b2api/v1/b2_authorize_account';\n\n // Execute\n $response = self::execCurl(\n $url, 'GET', array(\n 'Accept: application/json',\n 'Authorization: Basic '.$this->getEncodedCredentials(),\n ));\n\n // Parse and get back a sane JSON value.\n $json = self::isValidJson($response);\n\n // Check the JSON map has every key-value pair we expect.\n self::jsonHasKeys(\n $json, array(\n 'apiUrl',\n 'authorizationToken',\n 'accountId',\n 'downloadUrl',\n ));\n\n // And, just to be sure: make sure we get the right account ID back.\n self::jsonKeyIs($json, 'accountId', $this->getAccountId());\n\n // Done: return the needed values\n return array(\n $json['apiUrl'],\n $json['authorizationToken'],\n $json['downloadUrl'],\n );\n }", "public function get_accounts(){\n $items = array();\n if( ! $this->is_connect() ){\n return array();\n }\n //$this->new_request( \"GET\", \"/accounts\" );//$this->is_connect() hace la petición de las cuentas\n $response = json_decode( $this->ironman->get_response_body(), true );\n $accounts = isset( $response['accounts'] ) ? $response['accounts'] : array();\n foreach( $accounts as $account ){\n $items[$account['id']] = $account['name'];\n }\n return $items;\n }", "public function requestTargetAccounts($token, $page, $size) {\n $ch = curl_init('https://api.azalead.com/latest/account?page='. $page .'&size='. $size .'&target=true');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'X-Auth-Token:Bearer '.$token)\n );\n\n $apiResults = requestAPI($ch);\n return $apiResults;\n }", "public function getAccounts();", "public function getAccountDetails(){\n\t\t$url = \"/account/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}", "public function getAccounts()\n {\n }", "public function getAccounts()\n\t{\n\t\treturn $this->send($this->getHttp()->get($this->url.'accounts'));\n\t}", "public function testGetAccountsUsingGET()\n {\n }", "protected function infoGetAccountTypesRequest()\n {\n\n $resourcePath = '/info/Plans';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\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\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function describeAccountsWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->accountName)) {\n $query['AccountName'] = $request->accountName;\n }\n if (!Utils::isUnset($request->instanceId)) {\n $query['InstanceId'] = $request->instanceId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeAccounts',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeAccountsResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function getAccounts()\n\t{\n\t\treturn $this->send($this->getHttp()->get(static::URL.'accounts'));\n\t}", "function media_theplatform_mpx_get_accounts_select() {\n // Check for the signIn token.\n $mpx_token = media_theplatform_mpx_variable_get('token', NULL);\n if (!$mpx_token) {\n return t('There was an error with your request.');\n }\n // Get the list of accounts from thePlatform.\n $url = 'http://access.auth.theplatform.com/data/Account?schema=1.3.0&form=json&byDisabled=false&token=' . $mpx_token;\n $result = drupal_http_request($url);\n $result_data = drupal_json_decode($result->data);\n\n global $user;\n\n if (empty($result_data['entryCount']) || $result_data['entryCount'] == 0) {\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => '0 accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n //return FALSE;\n drupal_set_message(t('The logged in user does not have the privilege to set the account.'), 'warning');\n return array();\n }\n $accounts = array();\n $accounts_data = array();\n\n foreach ($result_data['entries'] as $entry) {\n $title = $entry['title'];\n $key = rawurlencode($title);\n $accounts[$key] = $title;\n }\n $log = array(\n 'uid' => $user->uid,\n 'type' => 'request',\n 'type_id' => NULL,\n 'action' => 'account',\n 'details' => count($accounts) . ' accounts returned.',\n );\n media_theplatform_mpx_insert_log($log);\n // Sort accounts alphabetically.\n natcasesort($accounts);\n return $accounts;\n}", "public function index(Request $request)\n {\n $accounts = $this->accountRepository->all(\n $request->except(['skip', 'limit']),\n $request->get('skip'),\n $request->get('limit')\n );\n\n return $this->sendResponse($accounts->toArray(), 'Accounts retrieved successfully');\n }", "public function testGetAccountUsingGET()\n {\n }", "public function get_accounts() {\n\t\t$url = $this->api_end_point . 'accounts';\n\t\t$res = $this->make_request( $url );\n\n\t\treturn empty( $res ) ? false : $res;\n\t}", "public function getAccount();", "public function account_info() {\r\n return $this->request_info(\"v2/account\");\r\n }", "public function getReferralAccounts () \n {\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/referral/accounts';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ClickSendSDK'\n );\n\n //set HTTP basic auth parameters\n Request::auth(Configuration::$username, Configuration::$key);\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n //Error handling using HTTP status codes\n if ($response->code == 400) {\n throw new APIException('BAD_REQUEST', 400, $response->body);\n }\n\n else if ($response->code == 401) {\n throw new APIException('UNAUTHORIZED', 401, $response->body);\n }\n\n else if ($response->code == 403) {\n throw new APIException('FORBIDDEN', 403, $response->body);\n }\n\n else if ($response->code == 404) {\n throw new APIException('NOT_FOUND', 404, $response->body);\n }\n\n else if ($response->code == 405) {\n throw new APIException('METHOD_NOT_FOUND', 405, $response->body);\n }\n\n else if ($response->code == 429) {\n throw new APIException('TOO_MANY_REQUESTS', 429, $response->body);\n }\n\n else if ($response->code == 500) {\n throw new APIException('INTERNAL_SERVER_ERROR', 500, $response->body);\n }\n\n else if (($response->code < 200) || ($response->code > 206)) { //[200,206] = HTTP OK\n throw new APIException(\"HTTP Response Not OK\", $response->code, $response->body);\n }\n\n return $response->body;\n }", "public function getAccountInformation()\n {\n return $this->api->getBinanceApiRequest('v3/account');\n }", "public function describeAccounts($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->describeAccountsWithOptions($request, $runtime);\n }", "public function getAccountInfo() {\n\t\treturn $this->get($this->api_url . 'account/info');\n\n $data = $this->http_oauthed($this->api_url . 'account/info');\n return json_decode($data,true);\n\n }", "function mint_get_account($session, $token, $account_name) {\n // mint needs some info to log in\n $_post = array(\n \"input\" => '[' . json_encode(array(\n \"args\" => array(\n \"types\" => array(\"OTHER_PROPERTY\"),\n ),\n \"id\" => \"115485\",\n \"service\" => \"MintAccountService\",\n \"task\" => \"getAccountsSorted\", \n )) . ']',\n );\n $session->URLFetch(\"https://wwws.mint.com/bundledServiceController.xevent?token=\" . $token, $_post);\n $_obj = json_decode($session->response);\n \n // 115485 seems to be a magic/arbitrary number that mint labels the object in it's return json\n foreach ($_obj->response->{115485}->response as $account) {\n if ($account->name == $account_name) {\n return $account->accountId;\n }\n }\n Debug::trace('could not find an account named ' . $account_name . ' in your mint.com account');\n}", "public function accountsAction(Request $request){\n\n $currentUser = $this->getUser();\n $currentUserID = $currentUser->getID();\n\n if ($request->isXmlHttpRequest()){\n $em = $this->getDoctrine()->getManager();\n $userRepo = $em->getRepository(User::class);\n\n $ub = $userRepo->createQueryBuilder('u');\n\n if($currentUser->isAdherent()){\n $userRepo->whereEnabled($ub,true)->whereRole($ub,'ROLE_PRO')->whereConfirmed($ub);\n }else{\n $userRepo->whereReferent($ub, $currentUserID);\n }\n\n $users = $ub->getQuery()->getResult();\n\n $returnArray = array();\n foreach ($users as $user){\n $image = $user->getImage();\n $returnArray[] = array('id'=>$user->getID(),'username'=> $user->getUsername(), 'name' => $user->getAutocompleteLabel(true) ,'icon' => (($image && $image->getId()) ? '/'.$image->getWebPath() : '')) ;\n }\n return new JsonResponse($returnArray);\n }\n return new Response(\"Ajax only\",400);\n }", "public function index(Request $request)\n {\n if ($select = request()->query('list')) {\n return $this->accountRepository->listAll($this->formatFields($select));\n } else\n $data = AccountResource::collection($this->accountRepository->getAllPaginate());\n\n return $this->respondWithData($data);\n }", "public function findAccounts() {\n\t\t\n\t}", "protected function getCheckAccountsRequest($limit = '100', $offset = '0', $embed = null)\n {\n\n $resourcePath = '/CheckAccount';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($limit !== null) {\n $queryParams['limit'] = ObjectSerializer::toQueryValue($limit);\n }\n // query params\n if ($offset !== null) {\n $queryParams['offset'] = ObjectSerializer::toQueryValue($offset);\n }\n // query params\n if (is_array($embed)) {\n $embed = ObjectSerializer::serializeCollection($embed, 'csv', true);\n }\n if ($embed !== null) {\n $queryParams['embed'] = ObjectSerializer::toQueryValue($embed);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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('token');\n if ($apiKey !== null) {\n $queryParams['token'] = $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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function index()\n {\n $accounts = $this->accountRepo->findAll();\n return $this->apiResponse($accounts);\n //\n }", "public function index()\n {\n $accountId = $this->account->id;\n $url = \"/api/accounts/$accountId/account-api-keys\";\n $response = $this->json('GET', $url);\n\n $response->assertStatus(200);\n $response->assertJsonStructure([\n 'data' => [\n '*' => [\n 'account_id',\n 'token',\n ],\n ],\n ]);\n }", "public function testGetAccountDirectDebitsUsingGET()\n {\n }", "public function accounts()\n {\n return $this->get('ach/relationships');\n }", "protected function accountGetListRequest($select = null, $filter = null, $expand = null, $custom = null, $skip = null, $top = null)\n {\n\n $resourcePath = '/Account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($select !== null) {\n $queryParams['$select'] = ObjectSerializer::toQueryValue($select);\n }\n // query params\n if ($filter !== null) {\n $queryParams['$filter'] = ObjectSerializer::toQueryValue($filter);\n }\n // query params\n if ($expand !== null) {\n $queryParams['$expand'] = ObjectSerializer::toQueryValue($expand);\n }\n // query params\n if ($custom !== null) {\n $queryParams['$custom'] = ObjectSerializer::toQueryValue($custom);\n }\n // query params\n if ($skip !== null) {\n $queryParams['$skip'] = ObjectSerializer::toQueryValue($skip);\n }\n // query params\n if ($top !== null) {\n $queryParams['$top'] = ObjectSerializer::toQueryValue($top);\n }\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\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\\Query::build($formParams);\n }\n }\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function auditAccountRequest($id, $start = null, $end = null, $top = '10', $skip = '0', $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling auditAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/audit';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start !== null) {\n $queryParams['start'] = ObjectSerializer::toQueryValue($start);\n }\n // query params\n if ($end !== null) {\n $queryParams['end'] = ObjectSerializer::toQueryValue($end);\n }\n // query params\n if ($top !== null) {\n $queryParams['$top'] = ObjectSerializer::toQueryValue($top);\n }\n // query params\n if ($skip !== null) {\n $queryParams['$skip'] = ObjectSerializer::toQueryValue($skip);\n }\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createAccount($request)\n {\n\n }", "function procRequestAnAccount($ar=NULL){\n $p=new XParam($ar,NULL);\n $this->captcha=true;\n $ar['PUBLISH']=2;\n $ar['alias']='user'.uniqid();\n $ar['ldata']=XShell::getLangUser();\n $ar['luser']=XShell::getLangUser();\n $ret=$this->procInsert($ar);\n \n if(!empty($ret) && !empty($ret['oid']) && !empty($this->send_account_request_to_email)) {\n $olduser=$GLOBALS['XUSER'];\n $GLOBALS['XUSER']=new XUser(array(\"UID\"=>'root'));\n setSessionVar(\"UID\",$GLOBALS['XUSER']->_curoid);\n $this->procSendACopyTo(array('oid'=>$ret['oid'], \n\t\t\t\t 'sendinmail' => array($ret['oid']=>true),\n\t\t\t\t 'showdest'=>false,\n\t\t\t\t 'dest_aemails' => $this->send_account_request_to_email,\n\t\t\t\t 'asubject' => 'Account request : '.$p->get('fullnam'),\n\t\t\t\t 'amessage' => 'You have received a new account request',\n\t\t\t\t 'tplentry' => TZR_RETURN_DATA, '_local'=>true), TZR_SENDER_ADDRESS);\n if(!empty($olduser)) {\n\tsetSessionVar(\"UID\",$olduser->uid());\n\t$GLOBALS[\"XUSER\"]=$olduser;\n }\n \n }\n return $r;\n }", "function bunq_StatusRequest($id, $user = 0, $account = 0) {\n\n\t$apiContext = ApiContext::restore(ApiContext::FILENAME_CONFIG_DEFAULT);\n\t$users = User::listing($apiContext)->getValue();\n\t$user = $users[$user]->getUserCompany();\n\t$userId = $user->getId();\n\t$monetaryAccounts = MonetaryAccount::listing($apiContext, $userId)->getValue();\n\t$monetaryAccount = $monetaryAccounts[$account]->getMonetaryAccountBank();\n\t$monetaryAccountId = $monetaryAccount->getId();\n\t$bunqMeRequest = BunqMeTab::get($apiContext, $userId, $monetaryAccountId, $id)->getValue();\n\t$r[\"id\"] = $bunqMeRequest->getId();\n\t$r[\"uuid\"] = $bunqMeRequest->getBunqmeTabEntry()->getUuid();\n\t$r[\"amount\"] = $bunqMeRequest->getBunqmeTabEntry()->getAmountInquired()->getValue();\n\t$r[\"paymentlink\"] = $bunqMeRequest->getBunqmeTabShareUrl();\n\t$r[\"status\"] = $bunqMeRequest->getBunqmeTabEntry()->getStatus();\n\t$r[\"description\"] = $bunqMeRequest->getBunqmeTabEntry()->getDescription();\n\t$r[\"redirecturl\"] = $bunqMeRequest->getBunqmeTabEntry()->getRedirectUrl();\n\t// We still need to add the contents of resultInquiries[], but I can't test it so I didn't implement it.\n\t$r[\"raw\"] = $bunqMeRequest;\n\treturn $r;\n\n}", "public function index(Request $request)\n {\n return Account::all();\n }", "function SearchAccountsByUserId($userId)\n{\n $GLOBALS['proxy'] = $GLOBALS['customerProxy']; \n \n // Specify the page index and number of customer results per page.\n\n $pageInfo = new Paging();\n $pageInfo->Index = 0; // The first page\n $pageInfo->Size = 100; // The first 100 accounts for this page of results\n\n $ordering = new OrderBy();\n $ordering->Field = OrderByField::Number;\n $ordering->Order = SortOrder::Ascending; \n\n $predicate = new Predicate();\n $predicate->Field = \"UserId\";\n $predicate->Operator = PredicateOperator::Equals;\n $predicate->Value = $userId; \n\n $request = new SearchAccountsRequest();\n $request->Ordering = $ordering;\n $request->PageInfo = $pageInfo;\n $request->Predicates = array($predicate);\n\n return $GLOBALS['proxy']->GetService()->SearchAccounts($request)->Accounts;\n}", "public function request()\n {\n return new GuzzleHttp\\Psr7\\Request('GET', 'Persons/'.$this->id);\n }", "protected function getPrivateKeysRequest()\n {\n\n $resourcePath = '/v1/account/privkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public static function list () {\n // Retrieve account resources.\n $accounts = Json::get('account', null);\n\n // If account resource is not avaiable, internal server error.\n if ($accounts == 1)\n return 1;\n\n // Return accounts.\n return $accounts;\n }", "public function showTransactionCardAccountRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling showTransactionCardAccount'\n );\n }\n\n $resourcePath = '/transactions/{id}/card_accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\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 []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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 HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function index(Request $request)\n {\n $accounts = ChartOfAccount::from('chart_of_accounts as '.ChartOfAccount::$alias)->eloquentFilter($request);\n\n $accounts = ChartOfAccount::joins($accounts, $request->get('join'));\n\n if ($request->get('is_archived')) {\n $accounts = $accounts->whereNotNull('account.archived_at');\n } else {\n $accounts = $accounts->whereNull('account.archived_at');\n }\n\n $accounts = pagination($accounts, $request->get('limit'));\n\n return new ApiCollection($accounts);\n }", "private function ga_api_account_summaries() {\n\t\t$request = Ga_Lib_Api_Request::get_instance();\n\t\t$request = $this->sign( $request );\n\t\t$response = $request->make_request( self::GA_ACCOUNT_SUMMARIES_ENDPOINT );\n\n\t\treturn new Ga_Lib_Api_Response( $response );\n\t}", "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 list(AccountListParameters $request)\n {\n $response = $this->getRequest(\n self::API_URL,\n AccountListParametersConverter::convertRequest($request)\n );\n\n $content = array();\n foreach ($response[\"content\"] ?? [] as $value) {\n array_push($content, AccountConverter::convertResponse($value));\n }\n return AccountConverter::convertPageResponse($response, $content);\n }", "public function showTransactionBankAccountRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling showTransactionBankAccount'\n );\n }\n\n $resourcePath = '/transactions/{id}/bank_accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\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 []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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 HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function updateAccount(Request $request)\n {\n $user_id = Util::getUserIdFromApiToken($request->data[\"api_token\"]);\n if ($user_id === null) {\n return Util::getInvalidApiTokenResponse();\n } else {\n return Accounts::updateAccount($user_id, $request->data);\n }\n }", "public function availableTenantResourceOperationsRequest()\n {\n\n $resourcePath = '/tenant';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\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 []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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\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 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testGetAccountPeriodicPaymentsUsingGET()\n {\n }", "function bunq_CreateRequest($amount, $description, $redirect, $user = 0, $account = 0) {\n\n\t$apiContext = ApiContext::restore(ApiContext::FILENAME_CONFIG_DEFAULT);\n\t$users = User::listing($apiContext)->getValue();\n\t//$user = $users[$user]->getUserPerson();\n\t$user = $users[$user]->getUserCompany();\n\t$userId = $user->getId();\n\t$monetaryAccounts = MonetaryAccount::listing($apiContext, $userId)->getValue();\n\t$monetaryAccount = $monetaryAccounts[$account]->getMonetaryAccountBank();\n\t$monetaryAccountId = $monetaryAccount->getId();\n\t$requestMap = [\n\t\tBunqMeTab::FIELD_BUNQME_TAB_ENTRY => [\n\t\t\tBunqMeTabEntry::FIELD_AMOUNT_INQUIRED => new Amount($amount, 'EUR'),\n\t\t\tBunqMeTabEntry::FIELD_REDIRECT_URL => $redirect,\n\t\t\tBunqMeTabEntry::FIELD_DESCRIPTION => $description\n\t\t]\n\t];\n\t$createBunqMeTab = BunqMeTab::create($apiContext, $requestMap, $userId, $monetaryAccountId)->getValue();\n\t$bunqMeRequest = BunqMeTab::get($apiContext, $userId, $monetaryAccountId, $createBunqMeTab)->getValue();\n\t$r[\"id\"] = $bunqMeRequest->getId();\n\t$r[\"uuid\"] = $bunqMeRequest->getBunqmeTabEntry()->getUuid();\n\t$r[\"amount\"] = $bunqMeRequest->getBunqmeTabEntry()->getAmountInquired()->getValue();\n\t$r[\"paymentlink\"] = $bunqMeRequest->getBunqmeTabShareUrl();\n\t$r[\"status\"] = $bunqMeRequest->getBunqmeTabEntry()->getStatus();\n\t$r[\"description\"] = $bunqMeRequest->getBunqmeTabEntry()->getDescription();\n\t$r[\"redirecturl\"] = $bunqMeRequest->getBunqmeTabEntry()->getRedirectUrl();\n\t$r[\"raw\"] = $bunqMeRequest;\n\treturn $r;\n\n}", "Public function getADSs(request $request)\n\t\t {\n\t\t \t//$request->acc_name\n\n\t\t \t$responce = Accounts::whereIn('account_name', $request->acc_name)->with(['BusinessManager' => function($q) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $q->select(['acc_name', 'acc_id','id']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},'BusinessManager.ACT' => function($q) {$q->select('act_id', 'bm_id'); }])->get();\n\t\t \t\n\t\t\treturn response()->json($responce);\n\n\t\t }", "public function getAPI(Request $request)\n {\n }", "public function showTransactionWalletAccountRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling showTransactionWalletAccount'\n );\n }\n\n $resourcePath = '/transactions/{id}/wallet_accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\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 []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\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 HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_bl_customers(){\r\n\t\t//ClientId: ed4d82fc-b6d7-4518-a292-abad6eadb9fb\r\n\t\t//ClientSecret: d8a11026-4a8c-4650-b159-32c791e7a1b9\r\n\r\n\t\t$post_data = array(\r\n\t\t\t\"grant_type\"=>\"client_credentials\",\r\n\t\t\t\"scope\"=>\"\",\r\n\t\t\t\"client_id\"=>\"ed4d82fc-b6d7-4518-a292-abad6eadb9fb\",\r\n\t\t\t\"client_secret\"=>\"d8a11026-4a8c-4650-b159-32c791e7a1b9\"\r\n\t\t);\r\n\r\n\t\t$this->call_bl_api_auth($post_data);\r\n\t\t//$result = CallAPI(\"POST\",\"https://apigateway.blinfo.se/auth/oauth/v2/token\")\r\n\t}", "public function getTillAccounting(Request $request) {\n try {\n $restaurant_token = getRestaurantToken();\n $url = Config::get('pos.base_path').'accounting?startDate='.$request->startDate.'&endDate='.$request->endDate.'&restaurant_token='.$restaurant_token.'&provider_token='.Config::get('pos.provider_token');\n $response = Curl::to($url)->get();\n return customResponse(Config::get(\"http_status.OK\"), true, \"accounting\",json_decode($response));\n } catch (\\Exception $e) {\n return customResponse(Config::get(\"http_status.ISE\"), false, \"ISE\", new stdClass());\n }\n }", "abstract function do_api_request();", "function getBOCAccount($accountid = 'a746637b91b19a261a67d8bd') {\n\t//bankid bda8eb884efcef7082792d45\n\t//accountid a746637b91b19a261a67d8bd\n\t//viewid 5710bba5d42604e4072d1e92\n\t//\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\t\t\t 'Auth-Provider-Name: 01460900080600',\n\t\t\t\t\t\t\t 'Auth-ID: 123456789',\n\t\t\t\t\t\t\t 'Ocp-Apim-Subscription-Key: f1817e51b3fb4d2ca3fc279d0df3a061'\n\t\t\t\t\t\t\t ),\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => \"http://api.bocapi.net/v1/api/banks/bda8eb884efcef7082792d45/accounts/$accountid/5710bba5d42604e4072d1e92/account\",\n\t // CURLOPT_URL => \"192.168.88.202:8080/customer/$custId/goals\",\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\treturn $resp_decode;\n}", "protected function getTermsRequest()\n {\n\n $resourcePath = '/v1/account/terms';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getPublicKeysRequest()\n {\n\n $resourcePath = '/v1/account/pubkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testInitiateAccountRequestUsingPOST()\n {\n }", "function getGetAccountId(Request $request)\n {\n $user_id = $request->user_id;\n\n $account_id = Accounts::where('user_id', $user_id)->pluck('id');\n\n return response()->json(['account_id' => $account_id]);\n }", "protected function ringbaAccountGet_0Request($account_id, $get_user_info = null)\n {\n // verify the required parameter 'account_id' is set\n if ($account_id === null || (is_array($account_id) && count($account_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $account_id when calling ringbaAccountGet_0'\n );\n }\n\n $resourcePath = '/RingbaAccounts/{accountId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($get_user_info !== null) {\n $queryParams['getUserInfo'] = ObjectSerializer::toQueryValue($get_user_info);\n }\n\n // path params\n if ($account_id !== null) {\n $resourcePath = str_replace(\n '{' . 'accountId' . '}',\n ObjectSerializer::toPathValue($account_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\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\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function & GetRequest ();", "public function createAccount($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->createAccountWithOptions($request, $runtime);\n }", "public function index(Request $request)\n {\n $user = Auth::getUser();\n\n $patientId = $user->client()->Id;\n $agencyId = $user->client()->AgencyId;\n $unpaid = (int) $request->get('unpaid');\n\n $invoices = Api::request('BillingService\\ClientInvoices', compact('patientId', 'agencyId', 'unpaid'));\n\n return response()->json($invoices);\n }", "public function testComAdobeCqAccountApiAccountManagementService()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.account.api.AccountManagementService';\n\n $crawler = $client->request('POST', $path);\n }", "protected function getAccountRequest($id, $include = null, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling getAccount'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($include !== null) {\n $queryParams['$include'] = ObjectSerializer::toQueryValue($include);\n }\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\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 OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createAccountWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->accountDescription)) {\n $query['AccountDescription'] = $request->accountDescription;\n }\n if (!Utils::isUnset($request->accountName)) {\n $query['AccountName'] = $request->accountName;\n }\n if (!Utils::isUnset($request->accountPassword)) {\n $query['AccountPassword'] = $request->accountPassword;\n }\n if (!Utils::isUnset($request->accountPrivilege)) {\n $query['AccountPrivilege'] = $request->accountPrivilege;\n }\n if (!Utils::isUnset($request->accountType)) {\n $query['AccountType'] = $request->accountType;\n }\n if (!Utils::isUnset($request->instanceId)) {\n $query['InstanceId'] = $request->instanceId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'CreateAccount',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return CreateAccountResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "function getClientURL($id, $username, $businessSector, $name, $phone, $email, $fax, $search)\n{\n $url = getAPIBaseDomain().'/api/Client/'.$id.'?username='.$username.'&businessSector='.$businessSector.'&name='.$name.'&phone='.$phone.'&email='.$email.'&fax='.$fax.'&search='.$search;\n return $url;\n}", "public function account($id)\n {\n return $this->get(\"ach/relationships/{$id}\");\n }", "public function accountsAutocomplete(){\r\n\r\n\t\t$user_id = $this->flexi_auth->get_user_id();\r\n\t\t//uacc_uid\r\n\t\t$user = $this->flexi_auth->get_user_by_id_query($user_id,'uacc_uid')->row();\r\n\r\n\t\t$hint = $this->input->get('q');\r\n\r\n\r\n\t\t//load id, label and name for the jQuery Autocomplete from the model fields_autocomplete\r\n\t\t$this->load->model(\"fields_autocomplete\");\r\n\t\t$companies_list = $this->fields_autocomplete->getAccountsList($hint, '');\r\n\t\techo json_encode($companies_list);\r\n\t}", "public function authorizeOnBillingAgreement($requestParameters = array());", "public function show(Request $request, $id)\n {\n $account = ChartOfAccount::from('chart_of_accounts as '.ChartOfAccount::$alias)->eloquentFilter($request);\n\n $account = ChartOfAccount::joins($account, $request->get('join'));\n\n $account = $account->where(ChartOfAccount::$alias.'.id', $id)->first();\n\n return new ApiResource($account);\n }", "public function dnbAccountsBAL($api,$args) {\n //invoke dnb api based on query type and query data\n $extDnbApi = $this->getEAPM();\n if (is_array($extDnbApi) && isset($extDnbApi['error'])) {\n throw new SugarApiExceptionRequestMethodFailure(null, array(), null, 424, $extDnbApi['error']);\n }\n $queryData = $args['qdata']; //data posted\n $result = $extDnbApi->dnbBALAccounts($queryData);\n if (is_array($result) && isset($result['error'])) {\n throw new SugarApiExceptionRequestMethodFailure(null, array(), null, 424, $result['error']);\n }\n return $result;\n }", "public function account(Request $request)\n {\n if ($request->user()->artist) {\n return new ArtistResource($request->user()->artist);\n } else {\n return response()->json(['message' => 'NOT_FOUND'], 404);\n }\n }", "public function getAccountSetForGraph(Request $request){\n \t\tif($request->ajax()){\n\t\t\tif($_POST['length'] == 0){\n\t\t\t Session::put('checkedAccountsForGraph', array());\n\t\t\t return;\n\t\t\t}\n\n\t\t\t$sDate = $_POST['sDate'];\n\t\t\t$eDate = $_POST['eDate'];\n\t\t\t$today = $_POST['today'];\n\n\t\t\tif($sDate == \"\")\n\t\t\t\t$sDate = \"01/01/1990\";\n\t\t\tif($eDate == \"\")\n\t\t\t\t$eDate = $today;\n\n\t\t\t//check that the dates are valid\n\t\t\t$tm = new TransactionManager();\n\t\t\tif($tm->rawDateCompare($today, $sDate) > 0) //if startDate in future\n\t\t\t\treturn;\n\t\t\tif($tm->rawDateCompare($eDate, $sDate) > 0) //if end date bfore start\n\t\t\t\treturn;\n\t\t\tif($tm->rawDateCompare($today, $eDate) > 0) //if end date after today\n\t\t\t\treturn;\n\n\t\t\t$accountNames = $_POST['accountSet'];\n\t\t\t//need to create an array based on id, not name\n\t\t\t$user = Session::get('user');\n\t\t\t\n\t\t\t$graphData = array();\n\n\t\t\tforeach($accountNames as $name){\n\t\t\t $account = Account::where('name', '=', $name)\n\t\t\t ->where('user_id', '=', $user->id)\n\t\t\t ->get()->first();\n\t\t\t $aid = $account->id;\n\t\t\t $data = $this->getGraphDataForAnAccount($sDate, $eDate, $aid);\n\t\t\t $graphData[$name] = $data;\n\t\t\t}\n\n\t\t\t$assetsAndLiabilities = $this->calculateAssetsAndLiabilities($sDate, $eDate);\n\t\t\treturn array_merge($assetsAndLiabilities, $graphData);\n \t}\t\t\n\t}", "public function testReadAllWithAccount()\n {\n }", "function ciniki_poma_customerAccountGet($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 'customer_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Customer'),\n 'order_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Order'),\n 'sections'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'name'=>'Return Orders'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'checkAccess');\n $rc = ciniki_poma_checkAccess($ciniki, $args['tnid'], 'ciniki.poma.customerAccountGet');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Load poma maps\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'maps');\n $rc = ciniki_poma_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki, 'php');\n\n $rsp = array('stat'=>'ok', 'customer_details'=>array(), 'orders'=>array());\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'hooks', 'customerDetails');\n\n //\n // Get the customer details\n //\n if( isset($args['sections']) && in_array('details', $args['sections']) ) {\n $rc = ciniki_customers_hooks_customerDetails($ciniki, $args['tnid'], array('customer_id'=>$args['customer_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['details']) ) {\n $rsp['customer_details'] = $rc['details'];\n }\n if( isset($rc['customer']['member_status_text']) && $rc['customer']['member_status_text'] != '' ) {\n if( isset($rc['customer']['member_lastpaid']) && $rc['customer']['member_lastpaid'] != '' ) {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Membership',\n 'value'=>$rc['customer']['member_status_text'] . ' <span class=\"subdue\">[' . $rc['customer']['member_lastpaid'] . ']</span>',\n ));\n } else {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Membership',\n 'value'=>$rc['customer']['member_status_text'],\n ));\n }\n }\n\n //\n // Get the current account balance\n //\n $strsql = \"SELECT ciniki_poma_customer_ledgers.id, \"\n . \"ciniki_poma_customer_ledgers.description, \"\n . \"ciniki_poma_customer_ledgers.transaction_date, \"\n . \"ciniki_poma_customer_ledgers.transaction_type, \"\n . \"ciniki_poma_customer_ledgers.customer_amount, \"\n . \"ciniki_poma_customer_ledgers.balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 15 \"\n . \"\";\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'entries', 'fname'=>'id', \n 'fields'=>array('id', 'description', 'transaction_date', 'transaction_type', 'customer_amount', 'balance'),\n 'utctotz'=>array('transaction_date'=>array('timezone'=>$intl_timezone, 'format'=>$date_format)),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['recent_ledger'] = array();\n if( isset($rc['entries']) ) {\n foreach($rc['entries'] as $entry) {\n if( !isset($balance) ) {\n $balance = $entry['balance'];\n }\n if( $entry['transaction_type'] == 10 ) {\n $entry['amount'] = '$' . number_format($entry['customer_amount'], 2);\n } elseif( $entry['transaction_type'] == 30 ) {\n $entry['amount'] = '-$' . number_format($entry['customer_amount'], 2);\n } elseif( $entry['transaction_type'] == 60 ) {\n $entry['amount'] = '$' . number_format($entry['customer_amount'], 2);\n }\n $entry['balance_text'] = ($entry['balance'] < 0 ? '-':'') . '$' . number_format(abs($entry['balance']), 2);\n// array_unshift($rsp['recent_ledger'], $entry);\n }\n if( isset($balance) ) {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Account',\n 'value'=>($balance < 0 ? '-' : '') . '$' . number_format(abs($balance), 2),\n ));\n // if( $balance < 0 && $balance != $rsp['order']['balance_amount'] ) {\n // $rsp['order']['default_payment_amount'] = abs($balance);\n // }\n // if( $balance < 0 ) {\n // $rsp['checkout_account'] = array(\n // array('label'=>'Account Balance Owing', 'status'=>'red', 'value'=>'$' . number_format(abs($balance), 2)),\n // );\n // }\n }\n }\n }\n\n //\n // Get the orders\n //\n if( isset($args['sections']) && in_array('orders', $args['sections']) ) {\n $strsql = \"SELECT orders.id, \"\n . \"orders.customer_id, \"\n . \"orders.order_number, \"\n . \"orders.order_date, \"\n . \"orders.status, \"\n . \"orders.status AS status_text, \"\n . \"orders.payment_status, \"\n . \"orders.payment_status AS payment_status_text, \"\n . \"orders.billing_name, \"\n . \"orders.total_amount \"\n . \"FROM ciniki_poma_orders AS orders \"\n . \"WHERE orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY orders.order_date DESC \"\n . \"\";\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'orders', 'fname'=>'id', 'fields'=>array('id', 'customer_id', 'order_number', 'order_date', \n 'status', 'status_text', 'payment_status', 'payment_status_text', 'billing_name', 'total_amount'),\n 'utctotz'=>array('order_date'=>array('timezone'=>'UTC', 'format'=>$date_format)),\n 'maps'=>array('status_text'=>$maps['order']['status'],\n 'payment_status_text'=>$maps['order']['payment_status']),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['orders']) ) {\n $rsp['orders'] = $rc['orders'];\n foreach($rsp['orders'] as $oid => $order) {\n $rsp['orders'][$oid]['total_amount_display'] = '$' . number_format($order['total_amount'], 2);\n }\n }\n }\n\n //\n // Get the records for the account\n //\n if( isset($args['sections']) && in_array('records', $args['sections']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'accountRecords');\n $rc = ciniki_poma_accountRecords($ciniki, $args['tnid'], array('customer_id'=>$args['customer_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['records'] = isset($rc['records']) ? $rc['records'] : array();\n }\n\n //\n // Get the order\n //\n $rsp['order_messages'] = array();\n if( isset($args['order_id']) && $args['order_id'] > 0 ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderLoad');\n $rc = ciniki_poma_orderLoad($ciniki, $args['tnid'], $args['order_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['order']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.28', 'msg'=>'Unable to find order'));\n }\n $rsp['order'] = $rc['order'];\n// $rsp['order']['default_payment_amount'] = $rc['order']['balance_amount'];\n\n //\n // Build the nplists\n //\n// foreach($rsp['order']['items'] as $item) {\n// $rsp['nplists']['orderitems'][] = $item['id'];\n// }\n //\n // Check if there are any messages for this order\n //\n if( isset($ciniki['tenant']['modules']['ciniki.mail']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'mail', 'hooks', 'objectMessages');\n $rc = ciniki_mail_hooks_objectMessages($ciniki, $args['tnid'], array('object'=>'ciniki.poma.order', 'object_id'=>$args['order_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['order_messages'] = isset($rc['messages']) ? $rc['messages'] : array();\n } \n }\n\n return $rsp;\n}", "protected function updateAccountJsonRequest($body = null)\n {\n\n $resourcePath = '/v1/account';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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 $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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\\Query::build($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getCredentials(Request $request)\n {\n }", "public function getCredentials(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n\n $fields = [\n 'time' => 'is_numeric',\n 'nonce' => 'is_string',\n 'hash' => 'is_string',\n ];\n $result = $this->basicAuthenticator($fields, $data);\n if (!empty($result['error'])) {\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n\n if (!empty($data['body']['email'])) {\n $account = user_load_by_mail($data['body']['email']);\n \\Drupal::logger('getCredentials password')->debug($account->getPassword());\n if (empty($account) || $account->isAnonymous()) {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Account not found')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Invalid arguments')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n\n $hash = CryptConnector::acquiaHash($account->getPassword(), $data['authenticator']['time'] . ':' . $data['authenticator']['nonce']);\n if ($hash === $data['authenticator']['hash']) {\n $result = [];\n $result['is_error'] = FALSE;\n $result['body']['subscription'][] = [\n 'identifier' => self::ACQTEST_ID,\n 'key' => self::ACQTEST_KEY,\n 'name' => self::ACQTEST_ID,\n ];\n return new JsonResponse($result);\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Incorrect password.')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }", "public function get_account_data() {\n return array(\n 'accountId' => $this->accountId,\n 'email' => $this->email,\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'type' => $this->type,\n 'subscription' => $this->subscription\n );\n }", "public function test_get_account_method() {\n if($this->API_KEY == \"demo\") {\n return;\n }\n $client = new GoogleSearchResults($this->API_KEY);\n $info = $client->get_account();\n $this->assertEquals($this->API_KEY , $info->api_key);\n }", "protected function accountGetAdHocSchemaRequest()\n {\n\n $resourcePath = '/Account/$adHocSchema';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\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\\Query::build($formParams);\n }\n }\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\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function get_accounts($user_id) {\n\t if ($this->ensure_portal() != -1) {\n\t\t $this->login();\n\t\t\t$ger_params = array(\n\t\t\t 'session' => $this->session,\n\t\t\t 'module_name' => 'Contacts',\n\t\t\t 'module_id' => $user_id,\n\t\t\t 'link_field_name' => 'accounts',\n\t\t\t 'related_module_query' => '',\n\t\t\t 'related_fields' => array(\n\t\t\t 'id',\n\t\t\t 'name',\n\t\t\t ),\n\t\t\t 'related_module_link_name_to_fields_array' => array(\n\t\t\t ),\n\t\t\t 'deleted'=> '0',\n\t\t\t 'order_by' => '',\n\t\t\t 'offset' => 0,\n\t\t\t 'limit' => 5,\n\t\t );\n\n\t\t $ger_result = $this->call(\"get_relationships\", $ger_params);\n\t\t $accounts = [];\n\n\t\t foreach($ger_result->entry_list as $entry) {\n\t\t \t$id = $entry->name_value_list->id->value;\n\t \t\t$name = $entry->name_value_list->name->value;\n\t \t\t$accounts[]= array(\"id\" => $id, \"name\" => $name);\n\t \t}\n\t \treturn $accounts;\n\t } else {\n\t $this->kick();\n\t }\n\t}", "function getAllOrders() {\n\techo \"Getting All Order </br>\";\n\t$response = getRequest('/api/order');\n\tprintInfo($response);\n}", "public function getAccounts()\n\t{\n\t\treturn $this->accounts; \n\n\t}", "function get_account_id($account_name){\n $arResult = sendCurl('get_account_id', [$account_name]);\n return $arResult;\n}", "public function requestFromApi() \n {\n $clientApi = new \\GuzzleHttp\\Client([\n \"base_uri\" => \"https://services.mysublime.net/st4ts/data/get/type/\",\n \"timeout\" => 4.0]);\n \n try { \n $response = $clientApi->request(\"GET\", $this->_urlEndPoint);\n if ($response->getStatusCode() == \"200\") {\n $body = $response->getBody();\n $this->_jsonRequestedArr = json_decode($body); \n }\n else { \n $this->_error .= \"Bad status code: . \" . $response->getStatusCode(); \n }\n }\n catch (Exception $exc) {\n $this->_error .= $exc->getMessage();\n }\n\n }", "public function getAmount(Request $request)\n {\n // $account = '14286217741';\n // $account_type = 'kplc_prepaid';\n // $vid = 'mrent';\n\n // $datastring = \"account=\".$account.\"&account_type=\".$account_type.\"&vid=\".$vid;\n // $hashkey = \"gchygyt65t6fgtr\";\n // $hashid = hash_hmac(\"sha256\", $datastring, $hashkey);\n\n // $ch = curl_init();\n \n // curl_setopt($ch, CURLOPT_URL, 'https://apis.ipayafrica.com/ipay-billing/billing/validate/account');\n \n // curl_setopt($ch, CURLOPT_POST, 1);\n // curl_setopt($ch, CURLOPT_POSTFIELDS,\"account=$account&account_type=$account_type&vid=$vid&hash=$hashid\");\n\n // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n // $data = curl_exec($ch);\n \n // curl_close($ch);\n\n // return $data;\n \n // return response()->json(json_decode($data));\n }", "public function GetPaymentAccounts($token);", "public function getrequest()\n {\n $request = User::getrequest();\n return result::repsonse(true,$request);\n }", "#[Route(methods: ['GET'])]\n #[OA\\Get(\n path: \"/api/{version}/courses\",\n summary: \"Fetch all courses.\",\n parameters: [\n new OA\\Parameter(name: 'version', description: 'API Version', in: 'path'),\n new OA\\Parameter(\n name: 'my',\n description: 'My courses only. (any non-falsy value applies)',\n in: 'query',\n required: false,\n schema: new OA\\Schema(type: 'integer')\n ),\n new OA\\Parameter(\n name: 'offset',\n description: 'Offset',\n in: 'query',\n required: false,\n schema: new OA\\Schema(type: 'string')\n ),\n new OA\\Parameter(\n name: 'limit',\n description: 'Limit results',\n in: 'query',\n required: false,\n schema: new OA\\Schema(type: 'integer')\n ),\n new OA\\Parameter(\n name: 'order_by',\n description: 'Order by fields. Must be an array, i.e. <code>&order_by[id]=ASC&order_by[x]=DESC</code>',\n in: 'query',\n required: false,\n schema: new OA\\Schema(\n type: 'array',\n items: new OA\\Items(type: 'string'),\n ),\n style: \"deepObject\"\n ),\n new OA\\Parameter(\n name: 'filters',\n description: 'Filter by fields. Must be an array, i.e. <code>&filters[id]=3</code>',\n in: 'query',\n required: false,\n schema: new OA\\Schema(\n type: 'array',\n items: new OA\\Items(type: 'string'),\n ),\n style: \"deepObject\"\n )\n ],\n responses: [\n new OA\\Response(\n response: '200',\n description: 'An array of courses.',\n content: new OA\\JsonContent(\n properties: [\n new OA\\Property(\n 'courses',\n type: 'array',\n items: new OA\\Items(\n ref: new Model(type: CourseDTO::class)\n )\n )\n ],\n type: 'object'\n )\n )\n ]\n )]\n public function getAll(\n string $version,\n Request $request,\n AuthorizationCheckerInterface $authorizationChecker,\n ApiResponseBuilder $builder\n ): Response {\n $my = $request->get('my');\n $parameters = ApiRequestParser::extractParameters($request);\n\n if (null !== $my) {\n /** @var SessionUserInterface $currentUser */\n $currentUser = $this->tokenStorage->getToken()->getUser();\n $dtos = $this->courseRepository->findByUserId(\n $currentUser->getId(),\n $parameters['criteria'],\n $parameters['orderBy'],\n $parameters['limit'],\n $parameters['offset']\n );\n\n $filteredResults = array_filter(\n $dtos,\n fn($object) => $authorizationChecker->isGranted(AbstractVoter::VIEW, $object)\n );\n\n //Re-index numerically index the array\n $values = array_values($filteredResults);\n\n return $builder->buildResponseForGetAllRequest($this->endpoint, $values, Response::HTTP_OK, $request);\n }\n\n return $this->handleGetAll($version, $request, $authorizationChecker, $builder);\n }" ]
[ "0.6702632", "0.6668782", "0.6414164", "0.63559896", "0.63529974", "0.6284415", "0.6273072", "0.60243577", "0.60216594", "0.60212547", "0.5915012", "0.58916306", "0.58902234", "0.58090085", "0.57854044", "0.57817745", "0.57570183", "0.5751557", "0.57487667", "0.5734569", "0.57210404", "0.5698033", "0.56764567", "0.5663406", "0.5631561", "0.56298345", "0.56283295", "0.560069", "0.5599468", "0.5548509", "0.5538869", "0.5524727", "0.5516835", "0.5512049", "0.5511814", "0.5499238", "0.5470654", "0.5466339", "0.5453823", "0.5442733", "0.5439721", "0.5436153", "0.5416345", "0.5356143", "0.53496057", "0.5348584", "0.53262204", "0.5322259", "0.5266289", "0.52659196", "0.52576256", "0.5247741", "0.52302116", "0.5218833", "0.5205672", "0.5201253", "0.52008", "0.51933235", "0.5181008", "0.51735777", "0.517285", "0.51720273", "0.51717955", "0.5149919", "0.514816", "0.5143332", "0.51394564", "0.51367635", "0.51160175", "0.51125026", "0.51052505", "0.51032907", "0.5095623", "0.50853336", "0.50824255", "0.5077461", "0.5074442", "0.50716555", "0.50649637", "0.50608635", "0.5053914", "0.5050893", "0.50474876", "0.5037749", "0.5030396", "0.50295764", "0.5018709", "0.50090224", "0.50051033", "0.50038874", "0.50024474", "0.49740005", "0.49724746", "0.4959657", "0.49590012", "0.4957188", "0.4953888", "0.4950807", "0.49461606", "0.49412775" ]
0.5137712
67
Get dashboard items from Crowdsignal platform.
public function get_items( $start = 0, $end = 0, $folder_id = 0, $source_link_match = '' ) { $start = (int) $start; $end = (int) $end; $folder_id = (int) $folder_id; $source_link_match = (string) $source_link_match; if ( ! $start && ! $end && ! $folder_id && ! $source_link_match ) { $pos = $this->add_request( 'getitems' ); } else { $pos = $this->add_request( 'getitems', new Polldaddy_List( null, compact( 'start', 'end', 'source_link_match' ) ) ); } $this->send_request(); $r = $this->response_part( $pos ); if ( isset( $r->items ) ) { if ( isset( $r->items->item ) ) { if ( ! is_array( $r->items->item ) ) { $r->items->item = array( $r->items->item ); } } return $r->items; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDashboardActions(): array;", "protected function dashboards()\n {\n return [];\n }", "protected function dashboards()\n {\n return [];\n }", "public function getData()\n\t{\n\t\t$dataReader = (new Query())->select(['vtiger_module_dashboard.*', 'vtiger_links.linklabel'])\n\t\t\t->from('vtiger_module_dashboard')\n\t\t\t->innerJoin('vtiger_module_dashboard_blocks', 'vtiger_module_dashboard_blocks.id = vtiger_module_dashboard.blockid')\n\t\t\t->innerJoin('vtiger_links', 'vtiger_links.linkid = vtiger_module_dashboard.linkid')\n\t\t\t->where([\n\t\t\t\t'vtiger_module_dashboard_blocks.dashboard_id' => $this->dashboardType,\n\t\t\t\t'vtiger_module_dashboard_blocks.tabid' => Module::getModuleId($this->moduleName),\n\t\t\t\t'vtiger_module_dashboard_blocks.authorized' => $this->application,\n\t\t\t])\n\t\t\t->createCommand()->query();\n\t\t$widgets = [];\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$row['linkid'] = $row['id'];\n\t\t\tif ('Mini List' === $row['linklabel']) {\n\t\t\t\t$minilistWidgetModel = new \\Vtiger_MiniList_Model();\n\t\t\t\t$minilistWidgetModel->setWidgetModel(\\Vtiger_Widget_Model::getInstanceFromValues($row));\n\t\t\t\t$headers = $records = [];\n\t\t\t\t$headerFields = $minilistWidgetModel->getHeaders();\n\t\t\t\tforeach ($headerFields as $fieldName => $fieldModel) {\n\t\t\t\t\t$headers[$fieldName] = Language::translate($fieldModel->getFieldLabel(), $fieldModel->getModuleName());\n\t\t\t\t}\n\t\t\t\tforeach ($minilistWidgetModel->getRecords('all') as $recordModel) {\n\t\t\t\t\tforeach ($headerFields as $fieldName => $fieldModel) {\n\t\t\t\t\t\t$records[$recordModel->getId()][$fieldName] = $recordModel->getDisplayValue($fieldName, $recordModel->getId(), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$widgets[] = [\n\t\t\t\t\t'type' => $row['linklabel'],\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'title' => \\App\\Language::translate($minilistWidgetModel->getTitle(), $minilistWidgetModel->getTargetModule()),\n\t\t\t\t\t\t'modulename' => $minilistWidgetModel->getTargetModule(),\n\t\t\t\t\t\t'headers' => $headers,\n\t\t\t\t\t\t'records' => $records\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t} elseif ('ChartFilter' == $row['linklabel']) {\n\t\t\t\t$chartFilterWidgetModel = new \\Vtiger_ChartFilter_Model();\n\t\t\t\t$chartFilterWidgetModel->setWidgetModel(\\Vtiger_Widget_Model::getInstanceFromValues($row));\n\t\t\t\t$widgets[] = [\n\t\t\t\t\t'type' => $row['linklabel'],\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'title' => $chartFilterWidgetModel->getTitle(),\n\t\t\t\t\t\t'modulename' => $chartFilterWidgetModel->getTargetModule(),\n\t\t\t\t\t\t'stacked' => $chartFilterWidgetModel->isStacked() ? 1 : 0,\n\t\t\t\t\t\t'colorsFromDividingField' => $chartFilterWidgetModel->areColorsFromDividingField() ? 1 : 0,\n\t\t\t\t\t\t'filterIds' => $chartFilterWidgetModel->getFilterIds(),\n\t\t\t\t\t\t'typeChart' => $chartFilterWidgetModel->getType(),\n\t\t\t\t\t\t'widgetData' => $chartFilterWidgetModel->getChartData(),\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $widgets;\n\t}", "public function loadDashboards($params)\r\n {\r\n $dbh = $this->ant->dbh;\r\n $ret = array();\r\n $numRecords = 500;\r\n $offset = 0;\r\n \r\n // Instantiate Dashboard Object\r\n $dashboardList = new CAntObjectList($dbh, \"dashboard\", $this->user);\r\n \r\n // Additional fields to query\r\n $dashboardList->addMinField(\"name\"); \r\n $dashboardList->addMinField(\"scope\"); \r\n \r\n // Add to get either system or user\r\n $dashboardList->addCondition(\"and\", \"app_dash\", \"is_equal\", \"\");\r\n $dashboardList->addCondition(\"and\", \"scope\", \"is_equal\", \"system\");\r\n $dashboardList->addCondition(\"or\", \"owner_id\", \"is_equal\", $this->user->id);\r\n \r\n $dashboardList->getObjects($offset, $numRecords);\r\n $num = $dashboardList->getNumObjects();\r\n $total = $dashboardList->getTotalNumObjects();\r\n \r\n for ($i = 0; $i < $num; $i++)\r\n { \r\n $obj = $dashboardList->getObject($i);\r\n \r\n // Gather Data\r\n\t\t\tif ($obj->dacl->checkAccess($this->user, \"View\", ($this->user->id==$obj->owner_id)?true:false))\r\n\t\t\t{\r\n\t\t\t\t$ret[] = array(\r\n\t\t\t\t\t\"id\" => $obj->id, \r\n\t\t\t\t\t\"name\" => $obj->getValue(\"name\"), \r\n\t\t\t\t\t\"scope\" => $obj->getValue(\"scope\"),\r\n\t\t\t\t\t\"uname\" => $obj->getValue(\"uname\"),\r\n\t\t\t\t);\r\n\t\t\t}\r\n \r\n $offset++; \r\n // If result set is larger than $numRecords\r\n if ($i == ($num-1) && $offset < $total)\r\n { \r\n $dashboardList->getObjects($offset, $numRecords); // Get next batch\r\n $num = $dashboardList->getNumObjects();\r\n $i = -1;\r\n }\r\n }\r\n \r\n $this->sendOutput($ret);\r\n return $ret;\r\n }", "public function get_all(){ \n\t\treturn $this->call('GET', '/admin/collects.json', array()); \n\t}", "public static function getDashboardToDisplay()\n {\n $getData = Doctrine_Query::create()->from('Dashboard')->fetchOne(null, Doctrine::HYDRATE_ARRAY);\n return $getData;\n\n }", "public function getDashboardPanelRecords() {\n\t\t$isql=\"select i.item_name as prod_name, i.quantity as prod_qty from inventory i limit 5\";\t\t\n\t\t$iresult=$this->runQuery('getAll',$isql);\n\t\t\n\t\t$sosql=\"SELECT p.item_name as inv_name,so.customer_name,date(so.sell_date) as sell_date FROM sales_order so, inventory p where p.id = so.product_id limit 5\";\t\t\n\t\t$soresult=$this->runQuery('getAll',$sosql);\n\t\t\n\t\t$drsql=\"select count(prod_qty) as qty, date(sell_date) as date from sales_order group by sell_date\";\t\t\n\t\t$drresult=$this->runQuery('getAll',$drsql);\n\t\t\n\t\techo '[{\"topFiveInvList\":'.json_encode($iresult).',\"topFiveSalesList\":'.json_encode($soresult).',\"dailySalesGraph\":'.json_encode($drresult).'}]';\n\t}", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "function monstroid_dashboard() {\n\treturn Monstroid_Dashboard::get_instance();\n}", "private function getDashboardNews(){\n $this->dashboard->findDashboardNewsData();\n }", "function getItems();", "function getItems();", "public function dashboard(){\r\n\t\t\r\n\t\treturn $this->module_dashboard();\r\n\t}", "public static function cardsInDashboards()\n {\n $dashboards = static::$dashboards;\n\n foreach ($dashboards as $dashboard) {\n DashboardNova::cards($dashboard->cards());\n }\n }", "public static function dashboardCards(): array\n {\n return [];\n }", "public function getItems(){\n\t\treturn $this->_makeCall('items?');\n\t}", "public function getNewsLettertList()\n { \n $widgets = HomePageWidget::where('status', HomePageWidget::ACTIVE)->where('type', HomePageWidget::TYPE_NEWS_LETTER)->first();\n return $widgets;\n }", "public function getDashboardGroups(): array;", "public function getWidgetList()\n { \n $widgets = HomePageWidget::where('status', HomePageWidget::ACTIVE)->where('type', HomePageWidget::TYPE_SLIDER)->orderBy('id', 'asc')->take(3)->get();\n return $widgets;\n }", "public function index()\n {\n return DiveResource::collection(auth()->user()->dives()->latest()->paginate(5));\n }", "public function index()\n {\n return ChannelResource::collection(Channel::all());\n }", "public function getDashboardCinemaList(){\n $cinema_ads = Cinemas::all();\n return view('backend.mediatypes.cinemas.cinema-list', ['cinema_ads' => $cinema_ads]);\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n $accessToken = $this->currentUser->pocket_access_token;\n $lastArticleTime = $this->currentUser->last_article_time;\n\n return $this->pocketClient->getList($accessToken, $lastArticleTime);\n }", "public function loadWidgets($params)\r\n {\r\n $ret = array();\r\n \r\n $dashboardId = $params['dashboardId'];\r\n \r\n if($dashboardId)\r\n {\r\n $dashObj = CAntObject::factory($this->ant->dbh, \"dashboard\", $dashboardId, $this->user);\r\n $ret = $dashObj->getWidgets();\r\n }\r\n \r\n $this->sendOutput($ret);\r\n return $ret;\r\n }", "public function prepare_items() {\n\t\t$per_page = $this->get_items_per_page( 'cert_dashboards_per_page', 1 );\n\t\t$this->items = self::get_cert_dashboards( $per_page );\n\t}", "public function getItems()\n {\n }", "public function index()\n {\n return Item::join('categories', 'categories.id', '=', 'items.category_id')\n ->select('categories.name AS category_name', 'items.name', 'items.serial', 'items.description', 'items.max_quantity', 'items.created_at', 'items.category_id AS category', 'items.id', 'items.availability')\n ->latest()\n ->paginate(5);\n }", "function ciniki_artcatalog_categoryList($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 )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.categoryList'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Load the status maps for the text description of each status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'maps');\n $rc = ciniki_artcatalog_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Get the settings for the artcatalog\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash'); \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_web_settings', \n 'tnid', $args['tnid'], 'ciniki.web', 'settings', 'page-gallery-artcatalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['settings']) ) {\n $settings = $rc['settings'];\n } else {\n $settings = array();\n }\n\n if( isset($settings['page-gallery-artcatalog-split']) \n && $settings['page-gallery-artcatalog-split'] == 'yes' \n ) {\n $strsql = \"SELECT DISTINCT type, type AS name, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY type, category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'types', 'fname'=>'type', 'name'=>'type',\n 'fields'=>array('number'=>'type', 'name'),\n 'maps'=>array('name'=>$maps['item']['type'])),\n// 'maps'=>array('name'=>array('1'=>'Paintings', '2'=>'Photographs', '3'=>'Jewelry', '4'=>'Sculptures', '5'=>'Fibre Arts', '6'=>'Crafts', '8'=>'Pottery'))),\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['types']) ) {\n return array('stat'=>'ok', 'types'=>array());\n }\n return array('stat'=>'ok', 'types'=>$rc['types']);\n } else {\n $strsql = \"SELECT DISTINCT '0' AS type, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok', 'categories'=>array());\n }\n return array('stat'=>'ok', 'categories'=>$rc['categories']);\n }\n}", "public function getDashboard() {\n $clientWithoutComments = $this->getClientByUserRole()\n ->where('state', '=', 'ActiveSeller')\n ->orWhere('state', '=', 'ActiveBuyer')\n ->leftJoin('histories', 'clients.id', '=', 'histories.client_id')\n ->groupBy('clients.id', 'clients.firstname', 'clients.lastname')\n ->having('last_comment', '>', 'DATE_SUB(NOW(),INTERVAL 3 MONTH)')\n ->select('clients.id', 'clients.firstname', 'clients.lastname', DB::raw('MAX(histories.created_at) as last_comment'))\n ->remember(10)\n ->get();\n\n // Nombre & liste de clients sans envoi mails depuis 1 mois (pour acheteur actifs)\n $clientWithoutMailings = $this->getClientByUserRole()\n ->where('clients.state', '=', 'ActiveBuyer')\n ->where('mailings.state', '=', 'Success')\n ->leftJoin('mailings', 'clients.id', '=', 'mailings.client_id')\n ->groupBy('clients.id', 'clients.firstname', 'clients.lastname')\n ->having('last_comment', '>', 'DATE_SUB(NOW(),INTERVAL 1 MONTH)')\n ->select('clients.id', 'clients.firstname', 'clients.lastname', DB::raw('MAX(mailings.created_at) as last_comment'))\n ->remember(10)\n ->get();\n\n // Nombre de clients acheteurs de la session (acheteur actifs)\n $activeBuyers = $this->getClientByUserRole()\n ->where('state', '=', 'ActiveBuyer')\n ->remember(10)\n ->get();\n\n // Nombre de clients vendeurs de la session (vendeur actifs)\n $activeSellers = $this->getClientByUserRole()\n ->where('state', '=', 'ActiveSeller')\n ->remember(10)\n ->get();\n\n return View::make('users.dashboard',array(\n 'clientWithoutComments' => $clientWithoutComments,\n 'clientWithoutMailings' => $clientWithoutMailings,\n 'activeBuyers' => $activeBuyers,\n 'activeSellers' => $activeSellers\n ));\n }", "public function warehousesList()\n {\n if(Auth::user()->activities != '')\n {\n $warehouses = Auth::user()->warehouseList;\n\n return ($warehouses);\n }\n }", "function index()\n\t{\n\t\techo Modules::run('dashboard');\n\t\t\n\t\t$data['sms_client']= get_sms_clients();\n\t\t//var_dump($data);\n\t\t//die();\n\t\t$this->load->view('data_list',$data);\n\t\t$this->footer(); \n\t}", "public function index($date)\n {\n // $dashboard = Buildings::whereMonth('created_at', '=', '10/19/2019')->get();\n // return DashboardResource::collection($dashboard);\n }", "public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }", "public function index()\n {\n return Channel::all();\n }", "public function setupDashboards()\n {\n $dashboardColumnCount = 3;\n $dashboardCount = 4;\n\n $layout = array();\n for ($j = 0; $j != $dashboardColumnCount; ++$j) {\n $layout[] = array();\n }\n\n $dashboards = array();\n for ($i = 0; $i != $dashboardCount; ++$i) {\n $dashboards[] = $layout;\n }\n\n $oldGet = $_GET;\n $_GET['idSite'] = 1;\n\n // collect widgets & sort them so widget order is not important\n $allWidgets = array();\n foreach (WidgetsList::get() as $category => $widgets) {\n $allWidgets = array_merge($allWidgets, $widgets);\n }\n usort($allWidgets, function ($lhs, $rhs) {\n return strcmp($lhs['uniqueId'], $rhs['uniqueId']);\n });\n\n $widgetsPerDashboard = ceil(count($allWidgets) / $dashboardCount);\n\n // group widgets so they will be spread out across 3 dashboards\n $groupedWidgets = array();\n $dashboard = 0;\n foreach ($allWidgets as $widget) {\n if ($widget['uniqueId'] == 'widgetSEOgetRank'\n || $widget['uniqueId'] == 'widgetReferrersgetKeywordsForPage'\n || $widget['uniqueId'] == 'widgetLivegetVisitorProfilePopup'\n || $widget['uniqueId'] == 'widgetActionsgetPageTitles'\n || strpos($widget['uniqueId'], 'widgetExample') === 0\n ) {\n continue;\n }\n\n $widgetEntry = array(\n 'uniqueId' => $widget['uniqueId'],\n 'parameters' => $widget['parameters']\n );\n\n // dashboard images must have height of less than 4000px to avoid odd discoloration of last line of image\n $widgetEntry['parameters']['filter_limit'] = 5;\n\n $groupedWidgets[$dashboard][] = $widgetEntry;\n\n if (count($groupedWidgets[$dashboard]) >= $widgetsPerDashboard) {\n $dashboard = $dashboard + 1;\n }\n\n // sanity check\n if ($dashboard >= $dashboardCount) {\n throw new Exception(\"Unexpected error: Incorrect dashboard widget placement logic. Something's wrong w/ the code.\");\n }\n }\n\n // distribute widgets in each dashboard\n $column = 0;\n foreach ($groupedWidgets as $dashboardIndex => $dashboardWidgets) {\n foreach ($dashboardWidgets as $widget) {\n $column = ($column + 1) % $dashboardColumnCount;\n\n $dashboards[$dashboardIndex][$column][] = $widget;\n }\n }\n\n foreach ($dashboards as $id => $layout) {\n if ($id == 0) {\n $_GET['name'] = self::makeXssContent('dashboard name' . $id);\n } else {\n $_GET['name'] = 'dashboard name' . $id;\n }\n $_GET['layout'] = Common::json_encode($layout);\n $_GET['idDashboard'] = $id + 1;\n FrontController::getInstance()->fetchDispatch('Dashboard', 'saveLayout');\n }\n\n // create empty dashboard\n $dashboard = array(\n array(\n array(\n 'uniqueId' => \"widgetVisitsSummarygetEvolutionGraphcolumnsArray\",\n 'parameters' => array(\n 'module' => 'VisitsSummary',\n 'action' => 'getEvolutionGraph',\n 'columns' => 'nb_visits'\n )\n )\n ),\n array(),\n array()\n );\n\n $_GET['name'] = 'D4';\n $_GET['layout'] = Common::json_encode($dashboard);\n $_GET['idDashboard'] = 5;\n $_GET['idSite'] = 2;\n FrontController::getInstance()->fetchDispatch('Dashboard', 'saveLayout');\n\n $_GET = $oldGet;\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 getToolbarItems();", "public function getItems(): array;", "public function getItems(): array;", "public function getAll(){\n\t\t$Channels = \\Channel::all();\n\t\treturn $Channels;\n\t}", "public function indexAction() {\n $service = $this->getItemService();\n\n $items = $service->findAll();\n \n return array(\n 'items' => $items,\n );\n }", "public function index()\n {\n $budgets = Budget::where(\"user_id\", \"=\", Auth::user()->id)->paginate(\n Config::get(\"constants.pagination.per_page\")\n );\n return BudgetResource::collection($budgets);\n }", "function backup_migrate_crud_get_items($type) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->all_items();\n }\n}", "public function getDashboardData()\n {\n $summary = DB::select('select * from vw_dashboard');\n $rekap_per_unit = DB::select('select * from vw_demografi_unit');\n\n return response()->json([$summary[0], $rekap_per_unit]);\n }", "public function index()\n {\n return CategoryResource::collection(Category::latest()->get());\n }", "public function index()\n {\n return $this->menu->all();\n }", "public function dashboard() {\n\t\t//populate data: tasks, forum discussions, timeline, burndown chart\n\t}", "function pbi_get_dashboard($method, $display) {\n $url = \"https://api.powerbi.com/v1.0/myorg/groups/\";\n\n $powerbi = new PowerBiService();\n $embedData = $powerbi->getembeddedURL($url, $method, $display);\n $debuMode = variable_get('bpi_debug', 0);\n $content[] = array(\n '#theme' => 'get-pbi-dashboard',\n '#debug' => $debuMode,\n '#response' => $embedData,\n );\n // Get access token from cookie instead of making call to the server.\n $access_token = (isset($_COOKIE[\"access_token\"])) ? $_COOKIE[\"access_token\"] : $powerbi->getAccessToken();\n $data = array(\n 'powerBI' => $embedData,\n 'accessToken' => $access_token,\n 'debug' => $debuMode,\n 'display' => 'dashboard'\n );\n drupal_add_js($data, 'setting');\n return $content;\n}", "public function what_ever_you_want()\n {\n $sql = \"Make a custom sql query for grabbing your data\";\n return static::custom_list($sql);\n }", "function wb_get_breadcrumbs()\n{\n return Westudio_Bootstrap_Breadcrumbs::items();\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 list()\n\t{\n\t\treturn $this->widgets()->orderBy('order')->get();\n\t}", "public function show($date)\n { \n $dashboard = Buildings::whereMonth('created_at', '=', $date)->get();\n return DashboardResource::collection($dashboard);\n }", "public function index()\n {\n return PodcastResource::collection(Podcast::with('subscription')->orderBy('title', 'ASC')->get());\n }", "public function index()\n {\n $client = new Clients;\n return $client->allClients();\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function index()\n {\n return ClientResource::collection(Client::orderBy('id', 'DESC')->paginate());\n }", "public function index()\n {\n $containers = Container::with(['loads.agencieses', 'ships'])->paginate(10);\n return Inertia::render('Dashboard', [\n 'canLogin' => Route::hasMacro('login'),\n 'canRegister' => Route::hasMacro('register'),\n 'containers' => response()->json($containers)\n ]);\n }", "public function get()\n\t{\n\t\t$url = WEIXIN_GET_MENU_URL;\n\t\t$access_token = Weixin_Class_AccessToken::getInstance()->load_access_token();\n\t\t$params = array(\n\t\t\t'access_token' => !empty($access_token->access_token) ? $access_token->access_token : 'false',\n\t\t);\n\n\t\t$url .= \"?\" . http_build_query($params);\n\n\t\t$xcurl = new Lib_Curl($url);\n\t\t$ret = $xcurl->get();\n\n\t\tif (!empty($ret)) {\n\t\t\t$result = json_decode($ret);\n\t\t\tvar_dump($result);\n\t\t} else {\n\t\t\techo 'Get Menu Failed!' . PHP_EOL;\n\t\t}\n\t}", "public function index(): array\n {\n// Co::create(function () {\n// echo date('Y-m-d H:i:s');\n// Co::sleep(5);\n// Log::info('swoft go');\n// });\n \\Swoft::trigger('event.demosss');\n return ['item0', 'item1'];\n }", "public function registerDashboardWidgets()\n {\n return [];\n }", "public function getItems() {\n if (empty($this->items)) {\n $session = new Session();\n $this->items = json_decode($session->get('inspiration_board', '[]'));\n }\n\n return $this->items;\n }", "private function callWarehouse(){\n\t\t$data = $this->connection->createCommand('select id, name from warehouse where status = 1 and tenant_id = '. $this->tenant)->queryAll();\n\t\treturn $data;\n\t}", "public function dashboard()\n {\n //$products = Product::with('category', 'subcategory')->get();\n return Inertia::render('Dashboard');\n }", "public function getDashboard()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('dashboard');\n }", "public function getOurClients()\n {\n $data = HomeController::getPage('our-clients');\n return view('our_clients')->with(['data' => $data]);\n }", "public static function availableDashboardCardsForDashboard($dashboard, NovaRequest $request)\n {\n return collect(static::$dashboards)->filter->authorize($request)->filter(function ($board) use ($dashboard) {\n return $board->uriKey() === $dashboard;\n })->flatMap(function ($dashboard) {\n return $dashboard->cards();\n })->filter->authorize($request)->values();\n }", "public function homeScreen(): array\n {\n $Banners = BannerSlider::all();\n $Categories = Category::root()->get();\n\n return [\n 'status' => 1,\n 'banners' => $Banners,\n 'categories' => $Categories,\n ];\n }", "function loading_circuits($idSeason)\n{\n $list_circuits = get_circuits_season($idSeason);\n return $list_circuits;\n}", "static function findAll($dashboard_id=NULL)\n\t{\n return fRecordSet::build(\n __CLASS__,\n array('dashboard_id=' =>$dashboard_id),\n array('weight' => 'asc')\n );\n\t}", "public function actionIndex()\n {\n return $this->render('index', [\n 'dashboardData' => [\n [\n Yii::t('app', 'WEBME_EMAIL'),\n Yii::t('app', 'WEBME_EMAIL_INFO'),\n Email::findIdentityCount('id_user',User::getUserId()),\n 'email',\n 'info'\n ],\n [\n Yii::t('app', 'WEBME_LETTER'),\n Yii::t('app', 'WEBME_LETTER_INFO'),\n Letter::findIdentityCount('id_user',User::getUserId()),\n 'letter',\n 'secondary'\n ],\n [\n Yii::t('app', 'WEBME_MAILING'),\n Yii::t('app', 'WEBME_MAILING_INFO'),\n Mailing::findIdentityCount('id_user',User::getUserId()),\n 'mailing',\n 'success'\n ]\n ],\n ]);\n }", "public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}", "public function index()\n {\n $clients = Client::all();\n\n return $this->showAll($clients);\n }", "public function getItems() : array;", "public function index()\n {\n //\n $result = Item::get();\n return $result;\n }", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function getInsightListAction() {\n $content = $this->getRequest()->getContent();\n $postJson = \\Zend\\Json\\Json::decode($content);\n $channel = $postJson->channel;\n if ($channel ==\"googleanalytics\") {\n $insightService = $this->getServiceLocator()->get('jimmybase_analytics_insights_service');\n $insights = $insightService->getInsightType();\n \n \n }\n //This is to match the Chosen directive in the frontend!\n $insightList = array();\n foreach ($insights as $i) {\n $insightList[] = array(\"id\" => $i, \"label\" => $i);\n }\n return new JsonModel(array(\"success\" => true, \"insights\" => $insightList));\n }", "public function getData(): ContuctUsPage;", "public function collectData()\n {\n $jsonSite = getContents($this->getJSONURI());\n\n $jsonFile = json_decode($jsonSite, true);\n $posts = $jsonFile['posts'];\n\n foreach ($posts as $post) {\n $item = $this->getItemFromPost($post);\n\n //empty when 'noreblogs' is checked and current post is a reblog.\n if (!empty($item)) {\n $this->items[] = $item;\n }\n }\n }", "public function dashboard()\n {\n\n // Create a client with a base URI\n try {\n\n $client = new GuzzleHttp\\Client(\n ['base_uri' => 'http://103.8.249.17/mongo/api/']\n );\n\n $response = $client->request('GET', 'res');\n\n // $response = $client->get('/res');\n\n if ($response->getStatusCode() === 200) {\n\n $body = $response->getBody();\n\n $this->send_response(json_decode($body, true), 200);\n } else {\n // Handler HTTP Error\n }\n\n } catch (RequestException $ex) {\n // echo Psr7\\str($ex->getRequest());\n echo Psr7\\str($ex->getResponse());\n }\n }", "public function items()\n {\n $items = $this->getCache(__FUNCTION__, []);\n\n if($items) return $items;\n\n try {\n\n $reader = new Reader;\n $resource = $reader->download('https://sentinel.christianscience.com/layout/set/rss/content/view/full/272173');\n\n $parser = $reader->getParser(\n $resource->getUrl(),\n $resource->getContent(),\n $resource->getEncoding()\n );\n\n $feed = $parser->execute();\n\n $thumb = $this->thumb;\n\n foreach ($feed->getItems() as $item)\n {\n //most of the shows require a login, only first one doesn't, usually\n $url = $item->getEnclosureUrl();\n if(!$url) continue;\n\n $dt = $item->getPublishedDate();\n $day = $dt->format('F j, Y');\n\n $podcast = [\n 'type' => 'track',\n 'url' => $url,\n 'title' => $item->getTitle(),\n 'summary' => $day . ': ' . $item->getContent(),\n 'thumb' => $thumb,\n 'date' => $dt->getTimestamp()\n ];\n\n $items[] = $podcast;\n }\n }\n catch (\\Exception $e)\n {\n\n }\n\n if($items)\n {\n $this->putCache(__FUNCTION__, $items, 360);\n }\n\n return $items;\n }", "public static function availableDashboards(Request $request)\n {\n return collect(static::$dashboards)\n ->filter\n ->authorize($request)\n ->all();\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n {\n $calories = FitInfo::weeklyCalories(Auth::user());\n $series = [];\n $dataCalories = [];\n foreach ($calories['activities-calories'] as $calorie) {\n// dd($calorie);\n $series[] = $calorie['dateTime'];\n $dataCalories[] = $calorie['value'];\n }\n $steps = FitInfo::weeklySteps(Auth::user());\n $dataSteps = [];\n foreach ($steps['activities-steps'] as $step) {\n $dataSteps[] = $step['value'];\n }\n $distance = FitInfo::weeklyDistance(Auth::user());\n $dataDistance = [];\n foreach ($distance['activities-distance'] as $distance) {\n $dataDistance[] = $distance['value'];\n }\n return['categories' => $series, 'calories' => $dataCalories, 'steps' => $dataSteps, 'distance' => $dataDistance];\n }", "public function index()\n {\n $caballerizas = Stable::with('sanciones')->get();\n activity()\n ->withProperties(['IP_add' => request()->ip()])\n ->log('Acceso a listado de caballerizas.');\n\n return $caballerizas;\n }", "public function index()\n {\n return MonitoreoResource::collection(Monitoreo::all());\n //return MonitoreoResource::collection(Conexione::orderBy('ipe_id', 'asc')->get());\n }" ]
[ "0.63773996", "0.6269016", "0.6269016", "0.585443", "0.57682276", "0.57606906", "0.57119507", "0.57035726", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.56974274", "0.5694477", "0.5692691", "0.5691554", "0.5691554", "0.5641264", "0.5638383", "0.56082416", "0.559514", "0.5593682", "0.5574664", "0.55444026", "0.5503603", "0.5481382", "0.5465994", "0.5446733", "0.54264927", "0.54220146", "0.54205817", "0.541656", "0.54147565", "0.5405664", "0.54026103", "0.53956604", "0.53928804", "0.53896356", "0.53754264", "0.5371989", "0.5370396", "0.536654", "0.5364588", "0.53497344", "0.53497344", "0.5348937", "0.5333635", "0.5332308", "0.53232974", "0.53196514", "0.5317568", "0.5312332", "0.53066605", "0.53044474", "0.52974004", "0.5293344", "0.5291653", "0.52872115", "0.5286045", "0.5282229", "0.5280319", "0.5272272", "0.52695763", "0.5268441", "0.5266043", "0.5255151", "0.5253698", "0.52533907", "0.52519315", "0.52420795", "0.5239021", "0.523755", "0.5236911", "0.5230955", "0.5226444", "0.5224315", "0.52090734", "0.5202287", "0.52009606", "0.5199946", "0.51951283", "0.51892495", "0.51855433", "0.5183835", "0.5182182", "0.517822", "0.51762724", "0.51748407", "0.51706123", "0.5170612", "0.5170487", "0.5170037", "0.5167978" ]
0.0
-1
Merge user defined arguments into defaults array. This function is used throughout WordPress to allow for both string or array to be merged into another array.
function wp_parse_args( $args, $defaults = '' ) { if ( is_object( $args ) ) $r = get_object_vars( $args ); elseif ( is_array( $args ) ) $r = $args; else wp_parse_str( $args, $r ); if ( is_array( $defaults ) ) return array_merge( $defaults, $r ); return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseArgs($args, $defaults) {\n\tif (is_object($args)) {\n\t\t$r = get_object_vars( $args );\n\t} elseif (is_array($args)) {\n\t\t$r =& $args;\n\t}\n\n\tif (is_array($defaults)) {\n\t\treturn array_merge($defaults, $r);\n\t}\n\treturn $r;\n}", "static function merge() {\n\t\t$base = array();\n\t\t$args = func_get_args();\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tself::array_merge( $base, $arg );\n\t\t}\n\n\t\treturn $base;\n\t}", "public function mergeArguments(array $arguments);", "function wp_parse_args($args, $defaults = array())\n {\n }", "function apply_default_args($args) {\r\n\t\t$defaults = array(\r\n\t\t\t'width'=>'',\r\n\t\t\t'height'=>'',\r\n\t\t\t'placeholder'=>'',\r\n\t\t\t'description'=>''\r\n\t\t);\r\n\t\t$args = wp_parse_args( $args, $defaults );\r\n\t\treturn $args;\t\r\n\t}", "function array_merge() {\n\t\t$args = func_get_args();\n\t\tforeach ($args as $k=>$value) {\n\t\t\tif (!is_array($value)) $value=array();\n\t\t\t$args[$k]=$value;\n\t\t}\n\t\treturn call_user_func_array(\"array_merge\", $args);\n\t}", "protected function get_default_args() {\n\t\t$existing = parent::get_default_args();\n\n\t\t$new = array(\n\t\t\t'id' => '',\n\t\t\t'id__in' => array(),\n\t\t\t'id__not_in' => array(),\n\t\t\t'transaction' => '',\n\t\t\t'transaction__in' => array(),\n\t\t\t'transaction__not_in' => array(),\n\t\t\t'customer' => '',\n\t\t\t'customer__in' => array(),\n\t\t\t'customer__not_in' => array(),\n\t\t\t'membership' => '',\n\t\t\t'membership__in' => array(),\n\t\t\t'membership__not_in' => array(),\n\t\t\t'seats' => '',\n\t\t\t'seats_gt' => '',\n\t\t\t'seats_lt' => '',\n\t\t\t'active' => ''\n\t\t);\n\n\t\treturn wp_parse_args( $new, $existing );\n\t}", "function extract_args(&$args, $defaults)\n {\n if (!is_array($args) && !is_object($args)) {\n return $args = $defaults;\n }\n\n // Overwrite the default key with the given one\n foreach ($defaults as $key => $val) {\n if (is_array($args)) {\n if (isset($args[$key]))\n $defaults[$key] = $args[$key];\n } elseif (is_object($args)) {\n if (isset($args->$key))\n $defaults[$key] = $args->$key;\n }\n }\n // Pass any additional arguments as well, though might not be used\n foreach ($args as $key => $val) {\n if (!array_key_exists($key, $defaults))\n $defaults[$key] = $val;\n }\n // Change the return value to an object if the input args were an object.\n if (is_object($args)) {\n $return = new stdClass();\n foreach ($defaults as $key => $val) {\n $return->$key = $val;\n }\n return $args = $return;\n }\n\n return $args = $defaults;\n }", "function _default($defaults, $options)\n\t{\n\t\treturn array_merge($defaults, $options);\n\t}", "function acf_parse_args($args, $defaults = array())\n{\n}", "static public function array_merge()\r\n\t{\r\n\t\t$args \t\t= func_get_args();\r\n\t\t$results\t= array();\r\n\t\tforeach($args as $array) {\r\n\t\t\tforeach($array as $key => $value) {\r\n\t\t\t\t$results[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $results;\r\n\t}", "function erp_parse_args_recursive( &$args, $defaults = [] ) {\n $args = (array) $args;\n $defaults = (array) $defaults;\n $r = $defaults;\n\n foreach ( $args as $k => &$v ) {\n if ( is_array( $v ) && isset( $r[ $k ] ) ) {\n $r[ $k ] = erp_parse_args_recursive( $v, $r[ $k ] );\n } else {\n $r[ $k ] = $v;\n }\n }\n\n return $r;\n}", "public function get_args(){ \n\t\n\t\t$args = $this->get_default_args();\n\t\t\n\t\tforeach( $this->args as $key => $value ){\n\t\t\t\n\t\t\t$args[ $key ] = $value;\n\t\t\t\n\t\t} // end foreach\n\t\n\t\treturn $args;\n\t\t \n\t}", "public function merge() {\n\t\t// Holds all the arrays passed\n\t\t$params = &func_get_args();\n\t\t\n\t\t// First array is used as the base, everything else overwrites on it\n\t\t$return = array_shift ( $params );\n\t\t\n\t\t// Merge all arrays on the first array\n\t\tforeach ( $params as $array ) {\n\t\t\tforeach ( $array as $key => $value ) {\n\t\t\t\t// Numeric keyed values are added (unless already there)\n\t\t\t\tif (is_numeric ( $key ) && (! in_array ( $value, $return ))) {\n\t\t\t\t\tif (is_array ( $value )) {\n\t\t\t\t\t\t$return [] = $this->merge ( $return [$key], $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$return [] = $value;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// String keyed values are replaced\n\t\t\t\t} else {\n\t\t\t\t\tif (isset ( $return [$key] ) && is_array ( $value ) && is_array ( $return [$key] )) {\n\t\t\t\t\t\t$return [$key] = $this->merge ( $return[$key], $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$return [$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "protected function _defaults($arr)\n\t{\n\t\t$defaults = array(\n\t\t\t'enable_realtime' => false, \n\t\t\t'check_callbacks' => true, \n\t\t\t'qbxml_version' => '4.0',\n\t\t\t'qbxml_onerror' => 'stopOnError', \n\t\t\t'map_create_handler' => null, \n\t\t\t'map_to_quickbooks_handler' => null,\n\t\t\t'map_to_application_handler' => null,\n\t\t\t'map_to_editsequence_handler' => null, \n\t\t\t);\n\t\t\t\n\t\treturn array_merge($defaults, $arr);\n\t}", "function slider_theme_settings_default($default_arr = array()){\n $slider_default = array(\n 'slider_speed' => '700',\n 'slider_effect' => 'fade',\n 'slider_pause' => '3000',\n 'slider_num' => '5',\n 'use_slider' => '0'\n );\n\n return array_merge($default_arr, $slider_default);\n}", "protected function _create_defaults( $args ) {\n\t\t\t$defaults = array(\n\t\t\t\t'help_tabs' => array(),\n\t\t\t\t'help_sidebar' => '',\n\t\t\t);\n\t\t\t$args = wp_parse_args( $args, $defaults );\n\t\t\t$this->args = json_decode( json_encode( $args ) );\n\t\t}", "private function default_args() {\n\t\n\t\t$defaults = array(\n\t\t\t'container' \t=> 'nav',\n\t\t\t'separator' \t=> '&raquo;',\n\t\t\t'before' \t\t=> 'Viewing:',\n\t\t\t'home' \t\t\t=> 'Home',\n\t\t);\n\t\treturn $defaults;\n\t}", "private function setDefaultArgs()\n {\n $args = [\n 'title' => get_bloginfo('name'),\n 'url' => get_bloginfo('url'),\n 'desc' => get_bloginfo('description'),\n ];\n\n if (is_page() || is_singular()) {\n $args = [\n 'title' => get_the_title(),\n 'url' => get_permalink(),\n 'desc' => $this->getPostExcerpt(),\n ];\n }\n\n $this->setArgs(apply_filters('cgit_socialize_default_args', $args));\n }", "public static function merge()\n {\n $output = [];\n\n foreach( func_get_args() as $arg )\n {\n $output = array_merge( $output, Sanitize::toArray( $arg ) );\n }\n return $output;\n }", "private static function get_default_args() {\n $careerjet_api_key = get_option('jobsearch_integration_careerjet_affid');\n \n return array(\n 'affid' => $careerjet_api_key,\n 'keywords' => '',\n 'location' => '',\n 'page' => 1,\n );\n }", "public static function mergeArgs(array $args) {\n\t\treturn call_user_func_array('array_merge', array_map(function($param) {return (array) $param;}, (array) $args));\n\t}", "protected function mergeDefaultsIntoArgv($argv)\n\t{\n\t\t//\n\t\t// if so, the command in $argv takes precedence\n\t\t$argvCount = count($argv);\n\t\t$argvHasCommand = false;\n\t\t$defaultsCount = count($this->defaults);\n\t\t$defaultsHasCommand = false;\n\n\t\t// special case - no defaults\n\t\tif ($defaultsCount == 0) {\n\t\t\tlist($argvCommand, $commandArgvIndex) = $this->determineCommand($argv, 1);\n\t\t\tif ($argvCommand === null) {\n\t\t\t\t// something went wrong\n\t\t\t\treturn array(null, null, null);\n\t\t\t}\n\t\t\t$switches = $this->buildSwitchListFor($argvCommand);\n\t\t\t$parsed = $this->parseSwitches($argvCommand, $argv, 1, $switches);\n\t\t\treturn array($argvCommand, $switches, $parsed);\n\t\t}\n\n\t\t// special case - nothing on the command-line\n\t\tif ($argvCount == 1) {\n\t\t\tlist($defaultsCommand, $commandDefaultsIndex) = $this->determineCommand($this->defaults, 0);\n\t\t\tif ($defaultsCommand === null) {\n\t\t\t\t// something went wrong\n\t\t\t\treturn array(null, null, null);\n\t\t\t}\n\t\t\t$switches = $this->buildSwitchListFor($defaultsCommand);\n\t\t\t$parsed = $this->parseSwitches($defaultsCommand, $this->defaults, 0, $switches);\n\t\t\treturn array($defaultsCommand, $switches, $parsed);\n\t\t}\n\n\t\t// at this point, the user has given us both:\n\t\t//\n\t\t// 1. some defaults from their config file, and\n\t\t// 2. something on the command-line\n\t\t//\n\t\t// what is the user trying to do on the command-line? Here are the\n\t\t// scenarios that we currently support\n\t\t//\n\t\t// 1a. use extra flags to tailor the default behaviour\n\t\t//\n\t\t// in this scenario, the user wants the default behaviour, and\n\t\t// their flags applied too\n\t\t//\n\t\t// we will add their flags to the command line before we parse\n\t\t// and process it\n\t\t//\n\t\t// 1b. change the settings for flags in the defaults list\n\t\t//\n\t\t// in this scenario, the user wants to override a flag that\n\t\t// has been set in the list of defaults\n\t\t//\n\t\t// this is currently really tricky to support well\n\t\t//\n\t\t// 1c. use alternative command args\n\t\t//\n\t\t// in this scenario, the user wants the flags from the default\n\t\t// behaviour, they just don't want the default args\n\t\t//\n\t\t// 2. use alternative command\n\t\t//\n\t\t// in this scenario, the user wants to ignore the defaults\n\t\t// completely\n\t\t//\n\t\t// any combination of scenario 1a, 1b and 1c are valid, and we need\n\t\t// to support them well\n\t\t//\n\t\t// there's a lot of complexity here, and it's impossible to be sure\n\t\t// that a user won't have an unsupported scenario in mind when they\n\t\t// come to use the software :(\n\n\t\t// do we have a command in the defaults list?\n\t\tlist($defaultsCommand, $commandDefaultsIndex) = $this->determineCommand($this->defaults, 0);\n\t\tif ($defaultsCommand !== null && $commandDefaultsIndex !== null) {\n\t\t\t$defaultsHasCommand = true;\n\t\t}\n\n\t\t// do we have a command in the argv list?\n\t\tlist($argvCommand, $commandArgvIndex) = $this->determineCommand($argv, 1);\n\t\tif ($argvCommand !== null && $commandArgvIndex !== null) {\n\t\t\t$argvHasCommand = true;\n\t\t}\n\n\t\t// special case - no command found\n\t\tif ($defaultsCommand === null && $argvCommand === null) {\n\t\t\treturn array(null, null, null);\n\t\t}\n\n\t\t// are they the same command?\n\t\tif ($argvCommand !== $defaultsCommand) {\n\t\t\t// no - so this is scenario 2\n\t\t\t//\n\t\t\t// we abandon the defaults, and let the command-line take charge\n\t\t\t// var_dump(\"scenario 2\");\n\t\t\t$switches = $this->buildSwitchListFor($argvCommand);\n\t\t\t$parsed = $this->parseSwitches($argvCommand, $argv, 1, $switches);\n\t\t\treturn array($argvCommand, $switches, $parsed);\n\t\t}\n\n\t\t// at this point, we are in scenario 1\n\t\t//\n\t\t// we don't yet know which part(s) of scenario 1 we are facing\n\t\t//\n\t\t// let's start by understanding both command-lines\n\t\t$switches = $this->buildSwitchListFor($argvCommand);\n\t\t$parsedDefaults = $this->parseSwitches($argvCommand, $this->defaults, 0, $switches);\n\t\t$parsedArgv = $this->parseSwitches($argvCommand, $argv, 1, $switches);\n\t\tif ($parsedDefaults === null || $parsedArgv === null) {\n\t\t\t// an error occurred\n\t\t\treturn array(null, null, null);\n\t\t}\n\n\t\t// at this point, we have parsed both command-lines, and now need\n\t\t// to selectively merge them into one final, returnable list\n\t\t//\n\t\t// this is crude, but it should do the trick\n\t\tforeach ($parsedArgv->switches as $key => $parsedSwitch) {\n\t\t\t// do not let a switch's default value override anything\n\t\t\t// that has been set in the config file\n\t\t\tif ($parsedSwitch->testIsDefaultValue() && isset($parsedDefaults->switches[$key])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// if we get here, override the switch in the config file!\n\t\t\t$parsedDefaults->switches[$key] = $parsedSwitch;\n\t\t}\n\n\t\t// don't forget to override command-line args if needed\n\t\tif (count($parsedArgv->args) > 0) {\n\t\t\t$parsedDefaults->args = $parsedArgv->args;\n\t\t}\n\n\t\t// all done\n\t\treturn array($argvCommand, $switches, $parsedDefaults);\n\t}", "public function setDefaultArgs($args);", "function extend_array()\n\t{\n\t\t$args = func_get_args();\n\t\t$extended = array();\n\n\t\tif ( is_array( $args ) && count( $args ) )\n\t\t{\n\t\t\tforeach ( $args as $array )\n\t\t\t{\n\t\t\t\tif ( ! is_array( $array ) )\tcontinue;\n\t\t\t\t$extended = array_merge( $extended, $array );\n\t\t\t}\n\t\t}\n\n\t\treturn $extended;\n\t}", "public static function mergeAttr(){\n\t\t$all_attr = func_get_args();\n\t\t$all_attr = array_filter($all_attr);\n\t\tforeach($all_attr as $x=>$attr){\n\t\t\tif(is_string($attr))parse_str($attr, $all_attr[$x]);\n\t\t}\n\t\treturn call_user_func_array('array_replace', $all_attr);\n\t}", "function _wp_register_meta_args_whitelist($args, $default_args)\n {\n }", "function ajan_parse_args( $args, $defaults = array(), $filter_key = '' ) {\n\n\t// Setup a temporary array from $args\n\tif ( is_object( $args ) ) {\n\t\t$r = get_object_vars( $args );\n\t} elseif ( is_array( $args ) ) {\n\t\t$r =& $args;\n\t} else {\n\t\twp_parse_str( $args, $r );\n\t}\n\n\t// Passively filter the args before the parse\n\tif ( !empty( $filter_key ) ) {\n\t\t$r = apply_filters( 'ajan_before_' . $filter_key . '_parse_args', $r );\n\t}\n\n\t// Parse\n\tif ( is_array( $defaults ) && !empty( $defaults ) ) {\n\t\t$r = array_merge( $defaults, $r );\n\t}\n\n\t// Aggressively filter the args after the parse\n\tif ( !empty( $filter_key ) ) {\n\t\t$r = apply_filters( 'ajan_after_' . $filter_key . '_parse_args', $r );\n\t}\n\n\t// Return the parsed results\n\treturn $r;\n}", "function _prep_args($args)\n\t{\n\t\t// If there is no $args[0], skip this and treat as an associative array\n\t\t// This can happen if there is only a single key, for example this is passed to table->generate\n\t\t// array(array('foo'=>'bar'))\n\t\tif (isset($args[0]) AND (count($args) == 1 && is_array($args[0])))\n\t\t{\n\t\t\t// args sent as indexed array\n\t\t\tif ( ! isset($args[0]['data']))\n\t\t\t{\n\t\t\t\tforeach ($args[0] as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val) && isset($val['data']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$args[$key] = $val;\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$args[$key] = array('data' => $val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tforeach ($args as $key => $val)\n\t\t\t{\n\t\t\t\tif ( ! is_array($val))\n\t\t\t\t{\n\t\t\t\t\t$args[$key] = array('data' => $val);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $args;\n\t}", "abstract protected function defaults(): array;", "public function set_defaults($args, $overwrite=false) {\n\t\t\n\t\t$args = (array) $args;\n\t\t$overwrite = (bool) $overwrite;\n\t\t\n\t\tif ($overwrite) {\n foreach ($this->defaults as $k =>$v) {\n if (isset($args[$k])) {\n $this->defaults[$k] = $v;\n }\n else {\n $this->defaults[$k] = null;\n }\n }\n\t\t}\n\t\t// Line item override\n\t\telse {\n\t\t\tforeach ($args as $k => $v) {\n\t\t\t\t$this->defaults[$k] = $v;\n\t\t\t\t$this->$k = $v; // set the args\n\t\t\t}\n\t\t}\t\t\n\t}", "public function get_default_args(){ return $this->default_args; }", "function myplugin_merge_all_options( $options = array() ) {\n\n\tglobal $myplugin_options_all;\n\n\tif (!empty($options)) $myplugin_options_all = array_merge( $myplugin_options_all, $options );\n\n}", "function caldol_hook_widget_tag_cloud_args($args = array()){\n\n\n$newArgs = array(\n'smallest' => 8,\n'largest' => 15,\n'number' => 20,\n\n);\nreturn array_merge($args, $newArgs);\n}", "private function getDefaultArguments()\n {\n return [\n 'help' => [\n 'prefix' => 'h',\n 'longPrefix' => 'help',\n 'description' => 'Display this help message',\n 'noValue' => true,\n 'castTo' => 'bool',\n ],\n 'version' => [\n 'prefix' => 'V',\n 'longPrefix' => 'version',\n 'description' => 'Display this application version',\n 'noValue' => true,\n 'castTo' => 'bool',\n ],\n 'command' => [\n 'description' => 'Command name',\n ],\n ];\n }", "function am() {\n\t\t$r = array();\n\t\tforeach(func_get_args()as $a) {\n\t\t\tif (!is_array($a)) {\n\t\t\t\t$a = array($a);\n\t\t\t}\n\t\t\t$r = array_merge($r, $a);\n\t\t}\n\t\treturn $r;\n\t}", "private static function processArgs( $arguments )\n\t {\n\t\t$args = array();\n\t\tforeach ( $arguments as $arg ) {\n\t\t\tif ( is_array( $arg ) ) {\n\t\t\t\t$args = array_merge( $args, $arg );\n\t\t\t} else {\n\t\t\t\t$exp = explode( '=', $arg, 2 );\n\t\t\t\t$args[$exp[0]] = $exp[1];\n\t\t\t}\n\t\t}\n\t\treturn $args;\n\t }", "protected function mergeDefaults(array $opts) {\n // Merges with defaults.\n $opts = parent::mergeDefaults($opts);\n\n // Converts types.\n $opts['active'] = $this->convertToBoolean($opts['active']);\n $opts['voided'] = $this->convertToBoolean($opts['voided']);\n $opts['related_agents'] = $this->convertToBoolean($opts['related_agents']);\n $opts['related_activities'] = $this->convertToBoolean($opts['related_activities']);\n $opts['attachments'] = $this->convertToBoolean($opts['attachments']);\n $opts['ascending'] = $this->convertToBoolean($opts['ascending']);\n $opts['limit'] = $this->convertToInt($opts['limit']);\n $opts['offset'] = $this->convertToInt($opts['offset']);\n\n if ($opts['limit'] === 0) $opts['limit'] = 100;\n return $opts;\n }", "public function moveAllOtherUserdefinedPropertiesToAdditionalArguments() {}", "private function build_args(array $args = array())\n {\n return array_merge_recursive($args,\n array(\n 'headers' => array(\n 'Authorization' => 'Basic '.$this->token,\n ),\n ));\n }", "public static function mergeConfig(): array\n {\n $args = \\func_get_args();\n $res = array_shift($args) ?: [];\n foreach ($args as $items) {\n if (!\\is_array($items)) {\n continue;\n }\n foreach ($items as $k => $v) {\n if ($v instanceof \\yii\\helpers\\UnsetArrayValue || $v instanceof \\Yiisoft\\Arrays\\UnsetArrayValue) {\n unset($res[$k]);\n } elseif ($v instanceof \\yii\\helpers\\ReplaceArrayValue || $v instanceof \\Yiisoft\\Arrays\\ReplaceArrayValue) {\n $res[$k] = $v->value;\n } elseif (\\is_int($k)) {\n /// XXX skip repeated values\n if (\\in_array($v, $res, true)) {\n continue;\n }\n if (isset($res[$k])) {\n $res[] = $v;\n } else {\n $res[$k] = $v;\n }\n } elseif (\\is_array($v) && isset($res[$k]) && \\is_array($res[$k])) {\n $res[$k] = self::mergeConfig($res[$k], $v);\n } else {\n $res[$k] = $v;\n }\n }\n }\n\n return $res;\n }", "function getArguments(array $argumentNames, array $defaultArgumentValues = [], $prefixArgumentHeaderNames = true, array $excludedSources = [])\n{\n $arguments = [];\n\n foreach ($argumentNames as $key => $argumentName)\n {\n $arguments[$argumentName] = null;\n\n // Use default argument value if specified\n if (array_key_exists($key, $defaultArgumentValues) && $defaultArgumentValues[$key] !== null)\n {\n $arguments[$argumentName] = $defaultArgumentValues[$key];\n }\n }\n\n if (in_array('headers', $excludedSources) === false)\n {\n // Look for arguments in headers\n // Laravel auto-checks for blank or empty values and considers them equal to null\n foreach ($argumentNames as $argumentName)\n {\n $argumentHeaderName = $argumentName;\n if ($prefixArgumentHeaderNames)\n {\n $argumentHeaderName = 'x-' . $argumentHeaderName;\n }\n\n $header = Request::header($argumentHeaderName);\n if ($header !== null)\n {\n $arguments[$argumentName] = $header;\n }\n }\n }\n\n if (in_array('input', $excludedSources) === false) {\n // Look for arguments in form input (or JSON equivalent) or query string\n // Laravel auto-checks for blank or empty values and considers them equal to null\n $inputs = Input::only($argumentNames);\n foreach ($inputs as $argumentName => $input) {\n if ($input !== null) {\n $arguments[$argumentName] = $input;\n }\n }\n }\n\n return $arguments;\n}", "private static function addDateValues($args, array $post_types) {\n if (!empty($args['values'])) return $args;\n\n $date_format = (empty($args['date_format'])) ? false : $args['date_format'];\n $date_type = (empty($args['date_type'])) ? 'year' : $args['date_type'];\n\n $args['values'] = self::getDates($date_type, $date_format, $post_types);\n return $args;\n }", "function _wp_register_meta_args_allowed_list($args, $default_args)\n {\n }", "function padma_merge_options($data){\n\n if(!empty(get_option('padma_communication_username'))){\n $data = array_merge(array('padma_username' => get_option('padma_communication_username')),$data);\n }\n\n if(!empty(get_option('padma_api_key'))){\n $data = array_merge($data,array('api_key' => get_option('padma_api_key')));\n }\n\n if(!empty(get_option('padma_site_name'))){\n $data = array_merge($data,array('contacted_from_site' => get_option('padma_site_name')));\n }\n\n return $data;\n}", "function get_partial_options($options = array(), $defaults = array()) {\n\treturn (object) array_merge($defaults, $options);\n}", "function comments_args( $defaults ): array {\n\n\t$user = wp_get_current_user();\n\n\t/**\n\t * Comment field template.\n\t */\n\tob_start();\n\t?>\n\t\t<p class=\"comment-form-comment\">\n\t\t\t<textarea\n\t\t\t\tid=\"comment\"\n\t\t\t\tname=\"comment\"\n\t\t\t\taria-required=\"true\"\n\t\t\t\taria-labelledby=\"submit\"\n\t\t\t></textarea>\n\t\t</p>\n\t<?php\n\t$comment_field = ob_get_clean();\n\n\t/**\n\t * Logged in as template.\n\t */\n\tob_start();\n\t?>\n\t\t<p class=\"logged-in-as\">\n\t\t\t<?php\n\t\t\t\techo wp_kses(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// translators: $1: profile url, $2: user's display name.\n\t\t\t\t\t\t__( 'Commenting as <a href=\"%1$s\">%2$s</a>', 'aliemu' ),\n\t\t\t\t\t\tesc_url( \"/user/{$user->data->user_login}\" ),\n\t\t\t\t\t\t$user->data->display_name\n\t\t\t\t\t),\n\t\t\t\t\t[\n\t\t\t\t\t\t'a' => [\n\t\t\t\t\t\t\t'href' => [],\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</p>\n\t<?php\n\t$logged_in_as = ob_get_clean();\n\n\t$defaults = array_merge(\n\t\t$defaults,\n\t\t[\n\t\t\t'cancel_reply_before' => '',\n\t\t\t'cancel_reply_after' => '',\n\t\t\t'comment_field' => $comment_field,\n\t\t\t'logged_in_as' => $logged_in_as,\n\t\t\t'title_reply' => '',\n\t\t\t'title_reply_before' => '',\n\t\t\t'title_reply_after' => '',\n\t\t]\n\t);\n\n\treturn $defaults;\n}", "function filter_theme_options( $args ) {\r\n $args['settings'] = array_merge($args['settings'], $this->get_theme_option_args());\r\n \r\n return $args;\r\n }", "public static function set_shortcode_defaults( $defaults, $args ) {\n\n\t\tif ( empty( $args ) || ! is_array( $args ) ) {\n\t\t\t$args = [];\n\t\t}\n\n\t\t$args = shortcode_atts( $defaults, $args );\n\n\t\tforeach ( $args as $key => $value ) {\n\t\t\tif ( '' === $value ) {\n\t\t\t\t$args[ $key ] = $defaults[ $key ];\n\t\t\t}\n\t\t}\n\n\t\treturn $args;\n\n\t}", "protected function prepareArgs(array $arguments = [])\n {\n $arguments = $arguments + array_filter(array_map(function ($arg) {\n if (isset($this->args[$arg->getName()])) {\n return $this->args[$arg->getName()];\n }\n\n if ($arg->isDefaultValueAvailable()) {\n return $arg->getDefaultValue();\n }\n\n return null;\n }, $this->reflection->getParameters()));\n\n return $arguments;\n }", "public function array_merge_recursive_overwrite()\n {\n $arrays = func_get_args();\n $base = array_shift($arrays);\n\n foreach ($arrays as $array) {\n reset($base); //important\n //while (list($key, $value) = @each($array)) { // Deprecated php 7.2\n foreach ($array as $key => $value) {\n if (is_array($value) && @is_array($base[$key])) {\n $base[$key] = $this->array_merge_recursive_overwrite($base[$key], $value);\n } else {\n $base[$key] = $value;\n } // else\n } // while / for each\n } // foreach\n\n return $base;\n }", "static function merge(/*...*/){\n $ar = array_filter(func_get_args(),'is_array'); // remove non-arrays\n $nc = count($ar);\n if($nc==0) return(NULL);\n if($nc==1) return($ar[0]);\n $res = call_user_func_array('array_merge_recursive',$ar);\n $res = ops_narray::_merge_reduce($res);\n return($res);\n }", "private function _optionsMerge(array $options = array()) : array\n {\n \t$options_merge = $this->_optionsDefault();\n\n \tif(count($options) > 0) {\n \t\tforeach ($options as $key => $value) {\n \t\t\tswitch ($key) {\n \t\t\t\tcase \"method\":\n \t\t\t\t\t$key = CURLOPT_CUSTOMREQUEST;\n \t\t\t\t\tbreak;\n \t\t\t\tcase \"data\":\n \t\t\t\t\t$key = CURLOPT_POSTFIELDS;\n // Codifica la data de array a formato json string.\n \t\t\t\t\t$value = json_encode($value, JSON_UNESCAPED_UNICODE);\n \t\t\t\t\tbreak;\n \t\t\t\tdefault:\n \t\t\t\t\t$key = null;\n \t\t\t\t\tbreak;\n \t\t\t}\n\n \t\t\tif(!is_null($key)) $options_merge[$key] = $value;\n \t\t}\n \t}\n\n \treturn $options_merge;\n }", "private function init_func_args( array $args, $bookmark = null ) {\n\t\t// The defaults sets the order to match the function's arguments as well as setting the default values.\n\t\t$defaults = array(\n\t\t\t'bookmark' => self::$bookmark,\n\t\t\t'output' => OBJECT,\n\t\t\t'filter' => 'raw',\n\t\t);\n\t\t$args = array_merge( $defaults, $args );\n\n\t\t// When given a bookmark, use it.\n\t\tif ( ! is_null( $bookmark ) ) {\n\t\t\t$args['bookmark'] = $bookmark;\n\t\t}\n\n\t\t/*\n\t\t * Strip out the keys. Why? The splat operator (...) does not work with associative arrays,\n\t\t * except for in PHP 8 where the keys are named arguments.\n\t\t */\n\t\treturn array_values( $args );\n\t}", "public function addDefaultEntriesAndValues() {}", "protected function getArrayableAppends()\n {\n $defaults = ['settings'];\n\n if (!count($this->appends)) {\n return $defaults;\n }\n\n return array_merge($defaults, $this->appends);\n }", "function atk_array_merge_keys()\n{\n\t$args = func_get_args();\n\t$result = array();\n\tforeach($args as $array)\n\t{\n\t\tforeach($array as $key=>$value)\n\t\t{\n\t\t\t$result[$key] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "function als_alert_default_args() {\n\n\t/**\n\t * Filters the default alert args.\n\t *\n\t * @since 1.0.0\n\t */\n\treturn apply_filters( 'als_alert_default_args', array(\n\t\t'post_ID' => 0,\n\t\t'content' => '',\n\t\t'color' => 'default',\n\t\t'type' => 'inset-banner',\n\t\t'icon' => 'default',\n\t\t'time_range' => '',\n\t\t'popup_image' => '',\n\t\t'popup_image_small'=> '',\n\t\t'user_interaction' => 'none',\n\t\t'button_text' => '',\n\t\t'button_link' => '',\n\t\t'button_new_tab' => '',\n\t) );\n}", "protected function setDefaultParams()\n {\n foreach ($this->allowedParams as $param => $options) {\n $this->params[$param] = null;\n if (! empty($options['arguments'])) {\n $this->params[$param] = array();\n foreach ($options['arguments'] as $arg => $opts) {\n if (! empty($opts['default'])) {\n $cast = ! empty($opts['cast']) ? $opts['cast'] : 'string';\n $this->params[$param][$arg] = $this->castValue($cast, $opts['default']);\n }\n }\n } elseif (! empty($options['default'])) {\n $cast = ! empty($options['cast']) ? $options['cast'] : 'string';\n $this->params[$param] = $this->castValue($cast, $options['default']);\n }\n }\n }", "public static function am() {\n\t\t$r = array();\n\t\tforeach (func_get_args()as $a) {\n\t\t\tif (!is_array($a)) {\n\t\t\t\t$a = array($a);\n\t\t\t}\n\t\t\t$r = array_merge($r, $a);\n\t\t}\n\t\treturn $r;\n\t}", "static function merge($x,$y){\n\t\t$arrays = func_get_args();\n\t\t$result = [];\n\t\tforeach($arrays as $array){\n\t\t\tif(is_object($array)){\n\t\t\t\t$array = self::from($array);\n\t\t\t}\n\t\t\tif(is_array($array)){\n\t\t\t\t$result = array_merge($result,$array);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function options($default) {\r\n $default = array_merge(\r\n $default,\r\n array(\r\n \"maximum_result_set\" => \"3\",\r\n \"default_title\" => __(\"Find nearby locations\", 'slp-experience'),\r\n 'radius_label' => __('Within', 'slp-experience'),\r\n \"search_label\" => __(\"Zip Code\", 'slp-experience'),\r\n \"button_label\" => __(\"Go!\", 'slp-experience'),\r\n )\r\n );\r\n\r\n return $default;\r\n }", "function get_defaults_multi($defaults,$param)\n{\n\t$values=array();\n\tforeach ($defaults as $key=>$val)\n\t{\n\t\tif (substr($param,0,2)=='x_')\n\t\t{\n\t\t\tif (preg_match('#^'.str_replace('x','\\d',preg_quote($param,'#')).'$#',$key)!=0)\n\t\t\t{\n\t\t\t\t$values[]=$val;\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tif (substr($key,0,strlen($param)+1)==$param.'_')\n\t\t\t{\n\t\t\t\t$values[]=$val;\n\t\t\t}\n\t\t}\n\t}\n\treturn $values;\n}", "protected function _options(array $defaults, array $scope) {\n\t$scope += $defaults;\n\t$options = array_diff_key($scope, $defaults);\n\treturn array($scope, $options);\n }", "private function setArgs(){\n\t\t$this->args = array(\n\t\t\t'label' => $this->label,\n\t\t\t'labels' => $this->labels,\n\t\t\t'description' => $this->description,\n\t\t\t'public' => $this->public,\n\t\t\t'exclude_from_search' => $this->excludeSearch,\n\t\t\t'publicly_queryable' => $this->publiclyQueryable,\n\t\t\t'show_ui' => $this->show_ui ,\n\t\t\t'show_in_nav_menus' => $this->showInNavMenus,\n\t\t\t'show_in_menu' => $this->showInMenu,\n\t\t\t'show_in_admin_bar' => $this->showInAdminBar,\n\t\t\t'menu_position' => $this->menuPosition,\n\t\t\t'menu_icon' => $this->menuIcon,\n\t\t\t'capability_type' => $this->capabilityType,\n\t\t\t'map_meta_cap' => $this->mapMetaCap,\n\t\t\t'hierarchical' => $this->hierarchical,\n\t\t\t'supports' => $this->supports,\n\t\t\t'register_meta_box_cb' => $this->registerMetaBoxCb,\n\t\t\t'taxonomies' => $this->taxonomies,\n\t\t\t'has_archive' => $this->hasArchive,\n\t\t\t'permalink_epmask' => $this->permalinkEpmask,\n\t\t\t'rewrite' => $this->rewrite,\n\t\t\t'query_var' => $this->queryVar,\n\t\t\t'can_export' => $this->canExport,\n\t\t\t'_builtin' => $this->builtin\n\t\t);\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "function jb_option_defaults() {\n\t \t$arr = array(\n\t\t'jb_featured_cat_slug' => 'home',\n\t\t'jb_featured_content_limit' => 55,\n\t\t'jb_post_content_limit' => 40\n\t);\n\treturn $arr;\n}", "public static function getShortcodeDefaults()\n\t{\n\t\treturn array_merge( static::$JETPACK_SHORTCODE_EXTRAS, static::$SHORTCODE_DEFAULTS );\n\t}", "public function getDefaultParams()\n {\n $defaults = array(\n );\n return $defaults;\n }", "public static function assignArguments (&$errors, $suppliedArguments, $argumentDefaults, $functionName, $subargument = NULL, $handleErrors = false)\r\n\t{\r\n\t\t# Merge the defaults: ensure that arguments with a non-null default value are set (throwing an error if not), or assign the default value if none is specified\r\n\t\t$arguments = array ();\r\n\t\tforeach ($argumentDefaults as $argument => $defaultValue) {\r\n\t\t\tif (is_null ($defaultValue)) {\r\n\t\t\t\tif (!isSet ($suppliedArguments[$argument])) {\r\n\t\t\t\t\t$errors['absent' . ucfirst ($functionName) . ucfirst ($argument)] = \"No '<strong>{$argument}</strong>' has been set in the '<strong>{$functionName}</strong>' specification.\";\r\n\t\t\t\t\t$arguments[$argument] = $defaultValue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$arguments[$argument] = $suppliedArguments[$argument];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t# If a subargument is supplied, deal with subarguments\r\n\t\t\t} elseif ($subargument && ($argument == $subargument)) {\r\n\t\t\t\tforeach ($defaultValue as $subArgument => $subDefaultValue) {\r\n\t\t\t\t\tif (is_null ($subDefaultValue)) {\r\n\t\t\t\t\t\tif (!isSet ($suppliedArguments[$argument][$subArgument])) {\r\n\t\t\t\t\t\t\t$errors['absent' . ucfirst ($fieldType) . ucfirst ($argument) . ucfirst ($subArgument)] = \"No '<strong>$subArgument</strong>' has been set for a '<strong>$argument</strong>' argument in the $fieldType specification.\";\r\n\t\t\t\t\t\t\t$arguments[$argument][$subArgument] = $fieldType;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$arguments[$argument][$subArgument] = $suppliedArguments[$argument][$subArgument];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$arguments[$argument][$subArgument] = (isSet ($suppliedArguments[$argument][$subArgument]) ? $suppliedArguments[$argument][$subArgument] : $subDefaultValue);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t# Otherwise assign argument as normal\r\n\t\t\t} else {\r\n\t\t\t\t$arguments[$argument] = (isSet ($suppliedArguments[$argument]) ? $suppliedArguments[$argument] : $defaultValue);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Handle the errors directly if required if any arise\r\n\t\tif ($handleErrors) {\r\n\t\t\tif ($errors) {\r\n\t\t\t\techo self::showUserErrors ($errors);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Return the arguments\r\n\t\treturn $arguments;\r\n\t}", "function config_merge(array $array1) {\n\t$result = array();\n\tforeach (func_get_args() as $param) {\n\t\tforeach ($param as $key=>$value) {\n\t\t\tif (is_array($value) && array_key_exists($key, $result) && is_array($result[$key])) {\n\t\t\t\t$result[$key] = config_merge($result[$key], $value);\n\t\t\t} else {\n\t\t\t\t$result[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "function setting_defaults( $defaults ) {\n\n }", "public static function merge(array $arguments) {\n\t\tif($_GET === $arguments) {\n\t\t\t$query = Router::$query_string;\n\t\t} elseif($query = http_build_query(array_merge($_GET, $arguments))) {\n\t\t\t$query = '?'.$query;\n\t\t}\n\n\t\t// Return the current URI with the arguments merged into the query string\n\t\treturn Router::$current_uri.$query;\n\t}", "function evoSE_add_shortcode_defaults($arr){\r\n\t\t\r\n\t\treturn array_merge($arr, array(\r\n\t\t\t'id'=>0,\r\n\t\t\t'show_excerpt'=>'no',\r\n\t\t\t'show_exp_evc'=>'no',\r\n\t\t\t'open_as_popup'=>'no'\r\n\t\t));\r\n\t\t\r\n\t}", "protected function getDefaults()\n {\n $defaults = [\n \"query\" => [],\n \"headers\" => [\n \"Content-Type\" => \"application/json\",\n \"Accept\" => \"application/hal+json\",\n ],\n ];\n\n if (!empty($this->defaults)) {\n $defaults = call_user_func($this->defaults, $defaults);\n }\n\n return $defaults;\n }", "protected function getDefaultAtts() {\n \t\t\n \t\treturn array_combine(\n array_map(function($param) { \n \t\treturn $param['param_name'];\n }, $this->params),\n \t\tarray_map(function($param) { \n \t\treturn ! empty( $param['default'] ) ? $param['default'] : '';\n }, $this->params)\n );\n \t\t\n\t\t}", "public function overrideDefaults( array $options ) {\n\t\tstatic::$options = \n\t\t\\array_merge( static::$options, $options );\n\t\t\n\t\tforeach ( static::$options as $k => $v ) {\n\t\t\tstatic::$options[$k] = \n\t\t\t\t$this->placeholders( $v );\n\t\t}\n\t}", "function pixgraphy_get_option_defaults_values() {\n\t\tglobal $pixgraphy_default_values;\n\t\t$pixgraphy_default_values = array(\n\t\t\t'pixgraphy_responsive'\t=> 'on',\n\t\t\t'pixgraphy_column_post'\t=>'four',\n\t\t\t'pixgraphy_border_column'\t=>'on',\n\t\t\t'pixgraphy_design_layout' => 'wide-layout',\n\t\t\t'pixgraphy_animate_css'\t=> 'on',\n\t\t\t'pixgraphy_sidebar_layout_options' => 'right',\n\t\t\t'pixgraphy_photography_layout' => 'photography_layout',\n\t\t\t'pixgraphy_search_custom_header' => 0,\n\t\t\t'pixgraphy-img-upload-footer-image' => '',\n\t\t\t'pixgraphy-footer-title'\t=> '',\n\t\t\t'pixgraphy-footer-link'\t=> '#',\n\t\t\t'pixgraphy_header_display'=> 'header_text',\n\t\t\t'pixgraphy_categories'\t=> array(),\n\t\t\t'pixgraphy_custom_css'\t=> '',\n\t\t\t'pixgraphy_scroll'\t=> 0,\n\t\t\t'pixgraphy_tag_text' => esc_html__('Read More','pixgraphy'),\n\t\t\t'pixgraphy_excerpt_length'\t=> '20',\n\t\t\t'pixgraphy_single_post_image' => 'off',\n\t\t\t'pixgraphy_reset_all' => 0,\n\t\t\t'pixgraphy_stick_menu'\t=>0,\n\t\t\t'pixgraphy_blog_post_image' => 'on',\n\t\t\t'pixgraphy_entry_format_blog' => 'excerptblog_display',\n\t\t\t'pixgraphy_search_text' => esc_html__('Search &hellip;','pixgraphy'),\n\t\t\t'pixgraphy_blog_content_layout'\t=> '',\n\t\t\t'pixgraphy_display_page_featured_image'=>0,\n\t\t\t/* Slider Settings */\n\t\t\t'pixgraphy_slider_type'\t=> 'default_slider',\n\t\t\t'pixgraphy_slider_link' =>0,\n\t\t\t'pixgraphy_enable_slider' => 'frontpage',\n\t\t\t'pixgraphy_transition_effect' => 'fade',\n\t\t\t'pixgraphy_transition_delay' => '4',\n\t\t\t'pixgraphy_transition_duration' => '1',\n\t\t\t/* Front page feature */\n\t\t\t'pixgraphy_entry_format_blog' => 'show',\n\t\t\t'pixgraphy_entry_meta_blog' => 'show-meta',\n\t\t\t/*Social Icons */\n\t\t\t'pixgraphy_top_social_icons' =>0,\n\t\t\t'pixgraphy_buttom_social_icons'\t=>0,\n\t\t\t'pixgraphy_social_facebook'=> '',\n\t\t\t'pixgraphy_social_twitter'=> '',\n\t\t\t'pixgraphy_social_pinterest'=> '',\n\t\t\t'pixgraphy_social_dribbble'=> '',\n\t\t\t'pixgraphy_social_instagram'=> '',\n\t\t\t'pixgraphy_social_flickr'=> '',\n\t\t\t'pixgraphy_social_googleplus'=> '',\n\t\t\t'pixgraphy_remove_parallax_fromheader'=>0,\n\t\t\t);\n\t\treturn apply_filters( 'pixgraphy_get_option_defaults_values', $pixgraphy_default_values );\n\t}", "public function hookConfig($args)\n {\n $post = $args['post'];\n\n // Sanitize first.\n $post['clean_url_identifier_prefix'] = trim($post['clean_url_identifier_prefix']);\n foreach (array(\n 'clean_url_main_path',\n 'clean_url_collection_generic',\n 'clean_url_item_generic',\n 'clean_url_file_generic',\n ) as $posted) {\n $value = trim($post[$posted], ' /');\n $post[$posted] = empty($value) ? '' : trim($value) . '/';\n }\n\n // The default url should be allowed for items and files.\n $post['clean_url_item_alloweds'][] = $post['clean_url_item_default'];\n $post['clean_url_item_alloweds'] = array_values(array_unique($post['clean_url_item_alloweds']));\n $post['clean_url_file_alloweds'][] = $post['clean_url_file_default'];\n $post['clean_url_file_alloweds'] = array_values(array_unique($post['clean_url_file_alloweds']));\n\n foreach ($this->_options as $optionKey => $optionValue) {\n if (in_array($optionKey, array(\n 'clean_url_item_alloweds',\n 'clean_url_file_alloweds',\n 'clean_url_route_plugins',\n ))) {\n $post[$optionKey] = empty($post[$optionKey]) ? serialize(array()) : serialize($post[$optionKey]);\n }\n if (isset($post[$optionKey])) {\n set_option($optionKey, $post[$optionKey]);\n }\n }\n }", "public function get_default()\n\t{\n\t\t$return = $this->default;\n\n\t\tif (count($args = func_get_args()) >= 1) \n\t\t{\n\t\t\tisset($args[0]) && is_array($args[0]) && $args = $args[0];\n\t\t\t$_return = array();\n\t\t\tforeach ($args as $arg)\n\t\t\t{\n\t\t\t\tif (isset($return[$arg]))\n\t\t\t\t{\n\t\t\t\t\t$_return[$arg] = $return[$arg];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tempty($_return) OR $return = $_return;\n\t\t\tunset($_return);\n\t\t}\n\t\treturn $return;\n\t}", "function alist($args){\n return array_fill_keys(array_keys($args), array());\n}", "public function defaultArguments()\n {\n static $arguments;\n\n if ($arguments === null) {\n $validateLanguages = function ($response) {\n if (strlen($response) === 0) {\n return true;\n }\n\n try {\n $this->parseAsArray($response);\n } catch (Exception $e) {\n unset($e);\n return false;\n }\n\n return true;\n };\n $validateLanguages = $validateLanguages->bindTo($this);\n\n $validatePaths = function ($response) {\n if (strlen($response) === 0) {\n return true;\n }\n\n try {\n $this->processMultiplePaths($response);\n } catch (Exception $e) {\n unset($e);\n return false;\n }\n\n return true;\n };\n $validatePaths = $validatePaths->bindTo($this);\n\n $validateCatalog = function ($response) {\n if (strlen($response) === 0) {\n return true;\n }\n\n try {\n $this->filterWritablePath($response);\n } catch (Exception $e) {\n unset($e);\n return false;\n }\n\n return true;\n };\n $validateCatalog = $validateCatalog->bindTo($this);\n\n $arguments = [\n 'max_depth' => [\n 'longPrefix' => 'max-depth',\n 'castTo' => 'int',\n 'description' => 'Descend at most the given number of levels of directories. '.\n 'Zero means no limit.',\n 'defaultValue' => static::DEFAULT_MAX_DEPTH,\n 'prompt' => 'Scan Depth (of directories)',\n 'acceptValue' => function ($response) {\n return (strlen($response) === 0) || is_numeric($response);\n }\n ],\n 'base_path' => [\n 'prefix' => 'b',\n 'longPrefix' => 'base',\n 'required' => true,\n 'description' => 'Specify an alternate base path.',\n 'defaultValue' => $this->basePath(),\n 'prompt' => 'Base Path',\n 'acceptValue' => function ($response) {\n return (strlen($response) === 0) || is_dir($response);\n }\n ],\n 'included_paths' => [\n 'prefix' => 'i',\n 'longPrefix' => 'include',\n 'required' => true,\n 'description' => 'Paths to search for source files (glob patterns).',\n 'defaultValue' => implode(', ', $this->defaultIncludedPaths()),\n 'prompt' => 'Included Paths',\n 'acceptValue' => $validatePaths\n ],\n 'excluded_paths' => [\n 'prefix' => 'x',\n 'longPrefix' => 'exclude',\n 'description' => 'Paths to ignore among the included paths (glob patterns).',\n 'defaultValue' => implode(', ', $this->defaultExcludedPaths()),\n 'prompt' => 'Excluded Paths (within included paths)',\n 'acceptValue' => $validatePaths\n ],\n 'output_path' => [\n 'prefix' => 'o',\n 'longPrefix' => 'output-path',\n 'required' => true,\n 'description' => 'Where the translatable strings are saved to.',\n 'defaultValue' => $this->defaultOutputPath(),\n 'prompt' => 'Store translatable text in',\n 'acceptValue' => $validateCatalog\n ],\n 'source_language' => [\n 'prefix' => 's',\n 'longPrefix' => 'source-language',\n 'required' => true,\n 'description' => 'The language in which the text in the source code is written.',\n 'defaultValue' => $this->sourceLanguage(),\n 'prompt' => 'Source Language'\n ],\n 'merge_languages' => [\n 'longPrefix' => 'merge-languages',\n 'description' => 'How to resolve unexpected languages from the translations file.',\n 'defaultValue' => static::DEFAULT_LANGUAGE_MERGE,\n 'prompt' => 'How to handle unexpected languages from the translations file?',\n 'inputType' => 'radio',\n 'options' => $this->supportedLanguageMergeStrategies()\n ],\n 'languages' => [\n 'prefix' => 'l',\n 'longPrefix' => 'languages',\n 'required' => true,\n 'description' => 'The languages the text will be translated to.',\n 'defaultValue' => implode(', ', $this->languages()),\n 'prompt' => 'Languages to translate into',\n 'acceptValue' => $validateLanguages\n ]\n ];\n }\n\n return array_merge(parent::defaultArguments(), $arguments);\n }", "public function defaultValues($items = array()){\n //Merge the default vales entered with any existing ones\n $this->defaultValues = array_merge($this->defaultValues, $items);\n }", "protected function mergeOptions( $options )\n {\n $defaults = $this->getDefaultOptions();\n\n $this->options = array_merge( $defaults, $options );\n\n foreach ( $this->options as $key => $value )\n {\n if ( ! is_array( $value ) || ! isset( $options[$key] ) ) continue;\n\n $this->options[$key] = array_merge( $defaults[$key], $options[$key] );\n }\n }", "private function createOptions(array $defaults = [], array $params = []) : array\n {\n return array_merge($defaults, $params);\n }", "public function merge()\n {\n $args = func_get_args();\n array_unshift($args, $this->data);\n $this->data = call_user_func_array('array_merge', $args);\n\n return $this; \n }", "private function mergeOptions($options) {\n $allOptions = $this->defaultOptions;\n\n return $this->parseOptions(array_merge($allOptions, $options));\n }", "function change_defaults($defaults) {\n $defaults['str_replace'] = 'Testing filter hook!';\n\n return $defaults;\n }", "public static function args(array $args, $skipOrName = 0, $defaults = array(), $mode = self::RELAXED)\n {\n if ($skipOrName) {\n if (is_integer($skipOrName)) {\n // TEST RESULT\n //\n // As expected array_slice() is an order of magnitude faster than\n // using array_shift() repeatedly. It is even faster to use\n // array_slice() repeatedly than to use array_shift().\n $args = array_slice($args, $skipOrName);\n\n } else {\n $laxTypes = (self::RELAXED === $mode);\n\n if (is_array($skipOrName)) {\n $names = $skipOrName;\n } else {\n $names = array($skipOrName);\n }\n\n // Assign numbered array items to the names specified (if any)\n foreach ($names as $n1 => $n2) {\n // The current element is always the first in the args array,\n // as long as the corresponding key is numeric.\n //\n // When the \"supply\" of numeric keys is finished we have processed\n // all the keys that were passed.\n reset($args);\n $current = key($args);\n if (! is_int($current)) {\n break;\n }\n\n // The parameter type\n if (is_int($n1)) {\n $ntype = null;\n $name = $n2;\n } else {\n $ntype = $n2;\n $name = $n1;\n }\n\n if (is_array($ntype)) { // Algebraic type!\n foreach ($ntype as $stype) {\n if (self::argsSearchKey($name, $stype, $args, $laxTypes)) {\n break;\n }\n $ntype = $stype; // Allows using null as a last type\n }\n } else {\n self::argsSearchKey($name, $ntype, $args, $laxTypes);\n }\n\n // 1: Not yet set && 2: lax types used\n if ((! isset($args[$name])) &&\n ($laxTypes || (null === $ntype)) &&\n array_key_exists($current, $args)) {\n\n $args[$name] = $args[$current];\n unset($args[$current]);\n }\n }\n }\n }\n\n $output = array();\n\n if ($args) {\n // flatten out all sub-arrays with a numeric key\n self::argsRenumber($args, $output);\n }\n\n if ($defaults) {\n // Add array with default values/\n $output = $output + $defaults;\n }\n\n return $output;\n }", "public function setDefaultArgs($args)\n {\n $this->defaultArgs = (array)$args;\n return $this;\n }", "private function default(&$args) {\n\n\t\t// Check args\n\t\tif (empty($args) || !is_array($args))\n\t\t\t$args = [];\n\n\t\t// Set agency slug\n\t\t$args['agency'] = $this->agency;\n\n\t\t// Check language\n\t\tif (!isset($args['language']) && isset($this->language))\n\t\t\t$args['language'] = $this->language;\n\t}", "public function set_conditional_args( $args ) {\n\t\t\tif ( ! empty( $this->args['quality'] ) ) {\n\t\t\t\t$args['quality'] = $this->args['quality'];\n\t\t\t}\n\t\t\t// Remove cropping if crop is false.\n\t\t\tif ( isset( $this->args['crop'] ) && false === $this->args['crop'] ) {\n\t\t\t\tunset( $args['crop'] );\n\t\t\t}\n\t\t\treturn $args;\n\t\t}", "protected function defaultParams()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function _init($args)\n {\n return is_array($args) && !empty($args) ? array_shift($args) : (array) $args;\n }", "private function setArguments()\n {\n return array(\n 'labels' => $this->labels,\n 'public' => $this->public,\n 'menuIcon' => $this->menuIcon,\n 'capabilities' => $this->capabilities,\n 'supports' => $this->supports,\n );\n }", "private function skyword_defaults() {\n\t\t$tmp = get_option('skyword_plugin_options');\n\t if(!is_array($tmp)) {\n\t\t\t$arr = array(\n\t\t\t\"skyword_api_key\"=>null, \n\t\t\t\"skyword_enable_ogtags\" => true, \n\t\t\t\"skyword_enable_metatags\" => true, \n\t\t\t\"skyword_enable_googlenewstag\" => true,\n\t\t\t\"skyword_enable_pagetitle\" => true,\n\t\t\t\"skyword_enable_sitemaps\" => true,\n\t\t\t\"skyword_generate_all_sitemaps\" => true,\n\t\t\t\"skyword_generate_news_sitemaps\" => true,\n\t\t\t\"skyword_generate_pages_sitemaps\" => true,\n\t\t\t\"skyword_generate_categories_sitemaps\" => true,\n\t\t\t\"skyword_generate_tags_sitemaps\" => true\n\t\t\t);\n\t\t\tupdate_option('skyword_plugin_options', $arr);\n\t\t}\n\t}", "public static function get_default_search( $array_or_defaults = array(), $array = array() ){\n\t\t$defaults = array(\n\t\t\t'status' => false,\n\t\t\t'person' => true, //to add later, search by person's bookings...\n\t\t\t'blog' => get_current_blog_id(),\n\t\t\t'ticket_id' => false,\n\t\t\t'array' => false //returns an array of results if true, if an array or text it's assumed an array of specific table fields or single field name requested \n\t\t);\n\t\t//sort out whether defaults were supplied or just the array of search values\n\t\tif( empty($array) ){\n\t\t\t$array = $array_or_defaults;\n\t\t}else{\n\t\t\t$defaults = array_merge($defaults, $array_or_defaults);\n\t\t}\n\t\t//clean up array value\n\t\tif( !empty($args['array']) ){\n\t\t\t$EM_Booking = new EM_Booking();\n\t\t\tif( is_array($args['array']) ){\n\t\t\t\t$clean_arg = array();\n\t\t\t\tforeach( $args['array'] as $k => $field ){\n\t\t\t\t\tif( array_key_exists($field, $EM_Booking->fields) ){\n\t\t\t\t\t\t$clean_arg[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$args['array'] = !empty($clean_arg) ? $clean_arg : true; //if invalid args given, just return all fields\n\t\t\t}elseif( is_string($args['array']) && array_key_exists($args['array'], $EM_Booking->fields) ){\n\t\t\t\t$args['array'] = array($args['array']);\n\t\t\t}else{\n\t\t\t\t$args['array'] = true;\n\t\t\t}\n\t\t}else{\n\t\t\t$args['array'] = false;\n\t\t}\n\t\t//figure out default owning permissions\n\t\tif( !current_user_can('edit_others_events') ){\n\t\t\t$defaults['owner'] = get_current_user_id();\n\t\t}else{\n\t\t\t$defaults['owner'] = false;\n\t\t}\n\t\tif( EM_MS_GLOBAL && !is_admin() ){\n\t\t\tif( empty($array['blog']) && is_main_site() && get_site_option('dbem_ms_global_events') ){\n\t\t\t $array['blog'] = false;\n\t\t\t}\n\t\t}\n\t\treturn apply_filters('em_bookings_get_default_search', parent::get_default_search($defaults,$array), $array, $defaults);\n\t}", "private static function arguments($arguments=false) {\n\t\t//convert arguments to array\n\t\tif (empty($arguments)) return array();\n\n\t\t//arguments can be string for shorthand, class or prepend with # for id\n\t\tif (is_string($arguments)) {\n\t\t\tif ($id = str::starts($arguments, '#')) {\n\t\t\t\t$arguments = array('id'=>$id);\n\t\t\t} else {\n\t\t\t\t$arguments = array('class'=>$arguments);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//clean up classes\n\t\tif (!empty($arguments['class']) && stristr($arguments['class'], ' ')) {\n\t\t\t$arguments['class'] = implode(' ', array_values(array_filter(array_unique(explode(' ', $arguments['class'])))));\n\t\t}\n\t\t\n\t\treturn $arguments;\n\t}" ]
[ "0.7040863", "0.6745437", "0.67285293", "0.6685397", "0.661991", "0.65552485", "0.6529801", "0.6468227", "0.63273174", "0.63267624", "0.63092214", "0.6218957", "0.621821", "0.61366427", "0.6066908", "0.6064905", "0.60529333", "0.60257405", "0.60228634", "0.6018155", "0.59748363", "0.59734017", "0.59698653", "0.59330845", "0.5919869", "0.5904531", "0.5869274", "0.58685625", "0.58384895", "0.5793703", "0.5774198", "0.576799", "0.57674956", "0.5734316", "0.57216424", "0.5720645", "0.57140714", "0.5689251", "0.5674016", "0.56697935", "0.5664922", "0.5652286", "0.56465393", "0.563054", "0.5623263", "0.56020665", "0.5601703", "0.55879647", "0.557951", "0.55585694", "0.55276316", "0.5527435", "0.55006135", "0.54798174", "0.5457085", "0.54269457", "0.5426251", "0.5417306", "0.54137456", "0.54125816", "0.5407639", "0.53950816", "0.5378055", "0.5366456", "0.5365355", "0.5357267", "0.5357267", "0.5357267", "0.5353629", "0.5346355", "0.5338963", "0.5330871", "0.5329733", "0.53295016", "0.5317276", "0.5314592", "0.5312837", "0.53120095", "0.5309051", "0.5299741", "0.529795", "0.52919316", "0.52720344", "0.5267619", "0.525753", "0.5254585", "0.52466947", "0.52321726", "0.5226402", "0.52177113", "0.51984334", "0.51838773", "0.51821995", "0.5164839", "0.5158926", "0.51309043", "0.5115595", "0.5113852", "0.5113808", "0.51121134" ]
0.7403255
0
Parses a string into variables to be stored in an array.
function wp_parse_str( $string, &$array ) { parse_str( $string, $array ); $array = apply_filters( 'wp_parse_str', $array ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse(string $string): array;", "public function get_variables_from_str($str) {\n\t\tforeach($this->offsets as $k => $v) {\n\t\t\t$bin = mb_substr($str, $v, 2);\n\t\t\t$vars[$k] = implode(unpack(\"n\",$bin));\n\t\t}\n\t\treturn $vars;\n\t}", "public function fromString(string $string): array;", "function variables_from_string($markup) {\r\n\t\t$regexp = new LiquidRegexp('/\\s*('.LIQUID_QUOTED_FRAGMENT.')\\s*/');\r\n\t\t$parts = explode(',', $markup);\r\n\t\t$result = array();\r\n\t\t\r\n\t\tforeach($parts as $part) {\r\n\t\t\t$regexp->match($part);\r\n\t\t\t\r\n\t\t\tif ($regexp->matches[1]) {\r\n\t\t\t\t$result[] = $regexp->matches[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t\t\r\n\t}", "public function parse($string);", "public function parse($string)\n {\n return [];\n }", "abstract public function parse($string);", "function stringtoarray($string) {\r\n\t/**\r\n\t * Probamos que sea un array sin comprimir\r\n\t */\r\n\tif (is_string($string)) {\r\n\t\tif (strstr($string, 'array')) {\r\n\t\t\teval(\"\\$arrayAux = $string;\");\r\n\t\t\treturn $arrayAux;\r\n\t\t}\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "protected function processFrom(string $string): array\n {\n return \\json_decode($string, true);\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}", "public function parse(string $input);", "protected function parse_args($string)\r\n\t{\r\n\t\t$arguments = array();\r\n\t\t\r\n\t\tpreg_match_all('@(\\w+?)\\s*=\\s*(\\'|\")(.*?)\\2@', $string, $matches, PREG_SET_ORDER);\r\n\t\t\r\n\t\tforeach($matches as $match)\r\n\t\t{\r\n\t\t\t$arguments[$match[1]] = $match[3];\r\n\t\t}\r\n\t\t\r\n\t\treturn $arguments;\r\n\t}", "public static function parse(string $number): array\r\n {\r\n return Parse::extract($number);\r\n }", "public static function parsingToArray($string) {\n\n\t\t//remove punctuation\n\t\t\n\t\tforeach(WordsParser::$Punctuation as $pun)\n\t\t{\n\t\t\t$string = str_replace($pun, \" \", $string);\n\t\t}\n\t\t\n\t\t//remove newline,Tab, and double space.\n\t\t$string = str_replace(\"\\n\", \" \", $string);\n\t\t$string = str_replace(\"\\r\", \" \", $string);\n\t\t$string = str_replace(\" \", \" \", $string); \n\t\t$string = str_replace(\"\t\", \" \", $string);\n\t\t$arrtext = explode(\" \", $string);\n\t\tforeach($arrtext as $keyword)\n\t\t{\n\t\t\t$wordsArr[] = $keyword;\n\t\t}\n\t\t\n\t\treturn $wordsArr;\n\t}", "public function parse($input) {\n\t//--\n\treturn (array) $this->loadWithSource((array)$this->loadFromString((string)$input));\n\t//--\n}", "function fusion_string_to_array( $string ) {\n\n\t// If already an array, return early.\n\tif ( is_array( $string ) ) {\n\t\treturn $string;\n\t}\n\n\t$string = stripslashes( $string );\n\n\tif ( empty( $string ) ) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\t$pairs = explode( '&', $string );\n\n\tforeach ( $pairs as $key => $pair ) {\n\t\t// Use the original parse_str() on each element.\n\t\tparse_str( $pair, $params );\n\n\t\t$k = key( $params );\n\n\t\tif ( ! isset( $result[ $k ] ) ) {\n\t\t\t$result += $params;\n\t\t} else {\n\t\t\t$result[ $k ] = fusion_array_merge_recursive( $result[ $k ], $params[ $k ] );\n\t\t}\n\t}\n\n\treturn $result;\n}", "private function parseVar($string, $type = self::VAR_TYPE)\n {\n if (false === $pos = strpos($string, $type)) {\n return null;\n }\n\n $varSubstring = substr(\n $string,\n $pos + strlen($type),\n strlen($string)-1\n );\n $varSubstring = trim($varSubstring);\n\n if (empty($varSubstring)) {\n return null;\n }\n\n $elements = explode(' ', $varSubstring);\n return $elements[0];\n }", "private function parseVar($string, $type = self::VAR_TYPE)\n {\n if (false === $pos = strpos($string, $type)) {\n return null;\n }\n\n $varSubstring = substr(\n $string,\n $pos + strlen($type),\n strlen($string)-1\n );\n $varSubstring = trim($varSubstring);\n\n if (empty($varSubstring)) {\n return null;\n }\n\n $elements = explode(' ', $varSubstring);\n return $elements[0];\n }", "public static function parseString(string $string): array\n {\n $e = 0;\n $q1 = false;\n $q2 = false;\n $q = false;\n $a = [];\n $f = '';\n for ($i = 0; $i < strlen($string); $i++) {\n $c = $string[$i];\n if ($c === '\\\\') {\n $e++;\n }\n if ($e % 2 == 0) {\n if ($c === \"'\" && !$q2) {\n $q1 = !$q1;\n $q = true;\n } elseif ($c === '\"' && !$q1) {\n $q2 = !$q2;\n $q = true;\n }\n }\n if (!$q) {\n if ($c === ' ' && !$q1 && !$q2 && $e % 2 == 0) {\n if (strlen($f) > 0) $a[] = $f;\n $f = '';\n } else {\n if ($c !== '\\\\' || $e % 2 === 0) {\n $f .= $c;\n }\n }\n }\n if ($c !== '\\\\') {\n $e = 0;\n }\n $q = false;\n }\n if (strlen($f) > 0) $a[] = $f;\n return $a;\n }", "abstract public static function decode($string): array;", "public function parse(string $str): ?array;", "private static function parseStringTerm($string)\n {\n $r = explode(' - ', $string);\n\n if (count($r) === 1) {\n return [(int)$r[0], (int)$r[0]];\n }\n\n if (count($r) === 2) {\n return [(int)$r[0], (int)$r[1]];\n }\n\n return [null, null];\n }", "function parseAbstractString($string) {\r\n\t$array_ensembe = array();\r\n\t$ensembles = explode(';', $string);\r\n\tforeach($ensembles as $k=>$ensemble) {\r\n\t\tlist($ensemble_valeur, $valeurs) = explode(':', $ensemble);\r\n\t\t$array_ensembe[$k]['ensemble'] = $ensemble_valeur;\r\n\t\t$valeurs = explode(',', $valeurs);\r\n\t\t$array_ensembe[$k]['valeurs'] = array();\r\n\t\tforeach($valeurs as $j=>$valeur) {\r\n\t\t\tlist($array_ensembe[$k]['valeurs'][$j]['titre'], $array_ensembe[$k]['valeurs'][$j]['nom'], $type) = explode('|', $valeur);\r\n\t\t\tlist($type, $array_ensembe[$k]['valeurs'][$j]['defaut']) = explode('(', $type);\r\n\t\t\tlist($type, $enum) = explode('[', $type);\r\n\t\t\tif (!empty($enum)) $array_ensembe[$k]['valeurs'][$j]['enum'] = explode('/', $enum);\r\n\t\t\t$array_ensembe[$k]['valeurs'][$j]['type'] = $type;\r\n\t\t}\r\n\t}\r\n\treturn $array_ensembe;\r\n}", "function parse_response_array($string) {\n $response_string_array = explode(\"&\", $string);\n\n $proper_array = array();\n\n foreach ($response_string_array as $value) {\n list($key, $val) = explode(\"=\", $value);\n\n $val = urldecode($val);\n\n $proper_array[\"$key\"] = $val;\n }\n unset($key);\n unset($val);\n\n return $proper_array;\n }", "public function parse(string $value);", "protected function _parseIndexerString($string)\n {\n $processes = array();\n if ($string == 'all') {\n $collection = $this->_getIndexer()->getProcessesCollection();\n foreach ($collection as $process) {\n $processes[] = $process;\n }\n } else if (!empty($string)) {\n $codes = explode(',', $string);\n foreach ($codes as $code) {\n $process = $this->_getIndexer()->getProcessByCode(trim($code));\n if (!$process) {\n echo 'Warning: Unknown indexer with code ' . trim($code) . \"\\n\";\n } else {\n $processes[] = $process;\n }\n }\n }\n return $processes;\n }", "function toArray($str)\n\t{\n\t\t$tmpItemArr = array_filter(explode('-dlm-',$str));\n\t\tforeach ($tmpItemArr as &$value) {\n \t\t$ItemArr = explode('-spl-', $value);\n\t\t\t$arr[$ItemArr[0]]['id'] = &$ItemArr[0]; // Item ID\n\t\t\t$arr[$ItemArr[0]]['qty'] = &$ItemArr[1]; // Item Quantity\n\t\t\t$arr[$ItemArr[0]]['cp'] = &$ItemArr[2]; // Item custom price\n\t\t\t$arr[$ItemArr[0]]['order'] = &$ItemArr[3]; // Item order\n\t\t}\n\t\treturn $arr;\n\t}", "protected function get_interpolated_variables( $string ) {\n\t\t$variables = array();\n\t\tif ( preg_match_all( '/(?P<backslashes>\\\\\\\\*)\\$(?P<symbol>\\w+)/', $string, $match_sets, PREG_SET_ORDER ) ) {\n\t\t\tforeach ( $match_sets as $matches ) {\n\t\t\t\tif ( ( strlen( $matches['backslashes'] ) % 2 ) === 0 ) {\n\t\t\t\t\t$variables[] = $matches['symbol'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $variables;\n\t}", "private function parseGrid($str){\n\t\t//TODO\n\t\treturn array();\n\t}", "public static function toArray($string)\n\t{\n if(is_array($string))\n {\n return $string;\n }\n\n if (empty($string))\n {\n return null;\n }\n\n $timer = dmDebug::timer(\"dmString::toArray\");\n\n $array = array();\n\n // JQUERY STYLE - css expression\n self::retrieveCssFromString($string, $array);\n\n // DMS STYLE - string opt in name\n self::retrieveOptFromString($string, $array);\n\n $timer->addTime();\n\n return $array;\n\t}", "public static function parse($str)\n {\n $uri = new self($str);\n\n return array(\n $uri->driver,\n $uri->username,\n $uri->password,\n $uri->host,\n $uri->path,\n );\n }", "private function parse($input) {\n $tokens= [];\n foreach (new Tokens(new StringTokenizer($input)) as $type => $value) {\n $tokens[]= [$type, $value];\n }\n return $tokens;\n }", "public function stringToArray(string $string): array;", "public function parse_str_raw($str, &$array=array()) {\n\t\t$str = rawurldecode($str);\n\t\t$str = trim($str, $sep1.' ');\n\t\t$arr = explode($sep1, $str);\n\t\t\n\t\t$result = array();\n\t\tif (count($arr)) {\n\t\t\tforeach ($arr AS $_str) {\n\t\t\t\t$_arr = explode($sep2, $_str);\n\t\t\t\t$_arr[0] = trim($_arr[0]);\n\t\t\t\tif ($_arr[0] !== '') {\n\t\t\t\t\t$result[$_arr[0]] = isset($_arr[1])?trim($_arr[1]):'';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$array = $result;\n\t}", "private function _convertArrayStringToArray($string): array {\n $array = [];\n $explode = explode(',', $string);\n\n foreach($explode as $dataset) {\n $array[] = $dataset;\n }\n\n return $array;\n }", "public function parse($line) {\r\n $data = array();\r\n \r\n foreach ($this->regx_parse as $types => $parser) {\r\n\t\t\t$subject = $this->_get_subject($parser,$data,$line);\r\n\t\t\t\r\n\t\t\tif ((!is_null($subject)) && (isset($parser['value']))) {\r\n\t\t\t\t$test = $parser['value'];\r\n\t\t\t\tpreg_match($test,$subject,$matches);\r\n\t\t\t\t\r\n\t\t\t\t$count = 1;\r\n $types = explode(' ',$types);\r\n foreach ($types as $type) {\r\n if (!empty($matches)) {\r\n $data[$type] = $matches[$count];\r\n } else {\r\n $data[$type] = null;\r\n }\r\n $count++;\r\n }\r\n\t\t\t\t\r\n\t\t\t}\r\n }\r\n \r\n return $data;\r\n }", "public static function extractSettingValues($string)\n {\n $values = [];\n $errors = [];\n\n $list = \\explode(\"\\n\", $string);\n $list = \\array_map('trim', $list);\n $list = \\array_filter($list, 'strlen');\n\n foreach ($list as $position => $text) {\n // Check for an explicit key.\n $matches = [];\n if (\\preg_match('/(.*)=(.*)/', $text, $matches)) {\n // Trim key and value to avoid unwanted spaces issues.\n $key = \\trim($matches[1]);\n $value = \\trim($matches[2]);\n $values[$key] = $value;\n } else {\n $errors[] = $position;\n }\n }\n\n return [$values, $errors];\n }", "function parse_string($string, $data = array(), $options = array()) {\n\n if (!$this->string_has_params($string)) {\n return $string;\n }\n\n //check if string is once param\n if ($this->parse_string_is_once_param($string)) {\n $param_key = $this->parse_string_extract_param($string);\n //print_r(compact('param_key'));\n if ($this->parse_param_exists($param_key, $data)) {\n return $this->parse_param_value($param_key, $data);\n }\n return $string; //param_key not exists, return string as is\n }\n\n $string1 = str_replace(\n array(\n $this->parse['before'],\n $this->parse['after']), array(\n '!-=0=-!' . $this->parse['before'],\n $this->parse['after'] . '!-=0=-!'), $string);\n\n $parsed = explode('!-=0=-!', $string1);\n $finded = array();\n foreach ($parsed as $ix => $item) {\n if ($item) {\n if ($this->parse_string_is_once_param($item)) {\n $param_key = $this->parse_string_extract_param($item);\n\n if ($this->parse_param_exists($param_key, $data)) {\n $parsed[$ix] = $this->parse_param_value($param_key, $data);\n }\n }\n }\n }\n return join($parsed);\n }", "private function parserString($producString){\n $arrayProduc = preg_split(\"/[\\t]/\", $producString);\n \n $initDate = $this->createDataTime($arrayProduc[3]);\n $expiryDate = $this->createDataTime($arrayProduc[4]);\n \n $producData = array(\n \"title\" => $arrayProduc[0],\n \"description\" => $arrayProduc[1],\n \"price\" => $arrayProduc[2],\n \"init\" => $initDate,\n \"expiry\" => $expiryDate,\n \"address\" => $arrayProduc[5],\n \"name\" => $arrayProduc[6],\n \"textOrigiin\" => $producString\n );\n \n return $producData;\n }", "function parseCoordFromString($coord){\n $coord = trim($coord,\"[]\");\n $pieces = explode(\",\",$coord);\n $p1 = (double)$pieces[0];\n $p2 = (double)$pieces[1];\n\n return array($p1,$p2);\n\n }", "protected static function parseInlineValues($string)\n {\n $values = array();\n $value = '';\n $string = str_replace(array('\\\\', \"''\"), array('\\\\\\\\', \"\\\\'\"), $string);\n $strLen = strlen($string);\n $cursor = 0;\n while ($cursor < $strLen) {\n switch ($string[$cursor]) {\n case '\\\\':\n $value .= $string[$cursor + 1];\n $cursor++;\n break;\n case ',':\n $values[] = $value;\n $value = '';\n break;\n case \"'\":\n if (empty($value)) {\n $value = $string[$cursor + 1];\n $cursor++;\n }\n break;\n default:\n $value .= $string[$cursor];\n }\n $cursor++;\n }\n\n if (!empty($value)) {\n $values[] = $value;\n }\n\n return $values;\n }", "function ussd_string_to_array($ussd_string){\n return explode(\"*\",$ussd_string);\n}", "function getArrayFromList($string) {\n\t\t$i = 0;\n\t\t#remove all leading and trailing spaces\n\t\t$string = trim($string);\n\t\t#find the first ocurrence of a comma\n\t\t$pos = strpos($string, \",\");\n\t\twhile(!($pos === false)) {\n\t\t\t#set the new starting position\n\t\t\t$firstpos = $pos + 1;\n\t\t\t#if the string is in the second position, set the first array value\n\t\t\t$lastpos = $pos;\n\t\t\t$array[$i] = substr($string, 0, $lastpos);\t\t\n\t\t\t#reduce the string to start from the new starting position. $firstpos\n\t\t\t$string = substr($string, $firstpos);\t\t\n\t\t\t$string = trim($string);\n\t\t\t#locate the first occurence of a comma in the string\n\t\t\t$pos = strpos($string, \",\");\n\t\t\t$i++;\n\t\n\t\t}\n\t\t$array[$i] = $string;\n\t\treturn $array;\n\t}", "static function parseLine(string $line): array {\n preg_match('/^#(\\d+) @ (\\d+),(\\d+): (\\d+)x(\\d+)$/', $line, $matches);\n return [\n 'id'=> intval($matches[1]),\n 'x' => intval($matches[2]),\n 'y' => intval($matches[3]),\n 'w' => intval($matches[4]),\n 'h' => intval($matches[5])\n ];\n }", "public function parseLine($line) {\n\t\t// Comment or empty line\n\t\tif ( $line === '' || preg_match('/^[\\\\t ]*?(?:\\#.*)?$/', $line) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tpreg_match(\n\t\t\t'/^\\s*?(?:(?:declare|export|local)\\s+?)?(\\S+?)=(.*)\\s*$/',\n\t\t\t$line,\n\t\t\t$matches\n\t\t);\n\n\t\tif ( empty($matches) ) {\n\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t'Unexpected character in line: %s',\n\t\t\t\t$line\n\t\t\t));\n\t\t}\n\n\t\t$name = $matches[1];\n\t\t$value = $matches[2];\n\n\t\tif ( ! $this->isLegalName($name) ) {\n\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t\"Illegal variable name '%s' in line: %s\",\n\t\t\t\t$name,\n\t\t\t\t$line\n\t\t\t));\n\t\t}\n\n\t\t// Empty value\n\t\tif ( $value === '' || $value === '\"\"' || $value === \"''\" ) {\n\t\t\treturn [$name, ''];\n\t\t}\n\n\t\t$chars = preg_split('//u', $value, -1, \\PREG_SPLIT_NO_EMPTY);\n\t\t$charsLen = count($chars);\n\n\t\t// Quoted value\n\t\tif ( $chars[0] === '\"' || $chars[0] === \"'\" ) {\n\t\t\t$quote = $chars[0];\n\t\t\t$end = -1;\n\n\t\t\t// Scan for end of value\n\t\t\tfor ( $i = 1; $i < $charsLen; $i++ ) {\n\t\t\t\tif ( $chars[$i] === '\\\\' ) {\n\t\t\t\t\t$i++;\n\t\t\t\t\tcontinue;\n\t\t\t\t} elseif ( $chars[$i] === $quote ) {\n\t\t\t\t\t$end = $i - 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$after = implode('', array_slice($chars, $end + 2));\n\n\t\t// Unquoted value\n\t\t} else {\n\t\t\t$quote = null;\n\t\t\t$end = -1;\n\n\t\t\t// Scan for end of value\n\t\t\tfor ( $i = 0; $i < $charsLen; $i++ ) {\n\t\t\t\tif ( $chars[$i] === '\\\\' ) {\n\t\t\t\t\t$i++;\n\t\t\t\t} elseif ( in_array($chars[$i], static::UNQUOTED_MUST_ESCAPE, true) ) {\n\t\t\t\t\t$end = $i - 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$end = $i;\n\t\t\t}\n\n\t\t\t$after = implode('', array_slice($chars, $end + 1));\n\n\t\t\t// Illegal line continuation\n\t\t\tif ( $end >= $charsLen ) {\n\t\t\t\t$end = -1;\n\t\t\t}\n\t\t}\n\n\t\t// End not found\n\t\tif ( $end < 0 ) {\n\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t'End of value not found on line: %s',\n\t\t\t\t$line\n\t\t\t));\n\t\t}\n\n\t\t// Garbage found after end\n\t\tif ( $after !== '' && ! preg_match('/^(?:\\s*;(?:\\s*#.*)?|\\s+#.*)?\\s*$/', $after) ) {\n\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t'Garbage found after value on line: %s',\n\t\t\t\t$line\n\t\t\t));\n\t\t}\n\n\t\t$chars = array_slice($chars, $quote ? 1 : 0, $end + ($quote ? 0 : 1));\n\n\t\t// Single-quoted value — easy because everything is literal\n\t\tif ( $quote === \"'\" ) {\n\t\t\t$value = implode('', $chars);\n\n\t\t\t// The value must not contain single-quotes though\n\t\t\tif ( strpos($value, \"'\") !== false ) {\n\t\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t\t'Illegal single-quote in single-quoted value on line: %s',\n\t\t\t\t\t$line\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tif ( ! $this->isLegalValue($value) ) {\n\t\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t\t'Illegal character in value on line: %s',\n\t\t\t\t\t$line\n\t\t\t\t));\n\t\t\t}\n\n\t\t\treturn [$name, $value];\n\t\t}\n\n\t\t$newValue = '';\n\t\t$escape = false;\n\n\t\tforeach ( $chars as $c ) {\n\t\t\t// Back-slash — start escape\n\t\t\tif ( ! $escape && $c === '\\\\' ) {\n\t\t\t\t$escape = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Certain special characters must be escaped in double-quotes in\n\t\t\t// bash if they're to be treated literally. Since we don't support\n\t\t\t// functionality like variable expansion here, we'll say that they\n\t\t\t// always need to be escaped — otherwise the variables would have\n\t\t\t// different values here vs in bash. Note that bash does allow some\n\t\t\t// special characters, notably $, to go unescaped if it can deduce\n\t\t\t// that the following character isn't going to trigger expansion;\n\t\t\t// we're going to make it simple here and just be strict about it\n\t\t\tif ( $quote === '\"' && in_array($c, static::DOUBLE_QUOTED_MUST_ESCAPE, true) ) {\n\t\t\t\tif ( ! $escape ) {\n\t\t\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t\t\t'Unescaped special character in double-quoted value on line: %s',\n\t\t\t\t\t\t$line\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\t$newValue .= $c;\n\t\t\t\t$escape = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Unquoted values have some additional characters that need\n\t\t\t// escaped; otherwise our rationale is the same as above\n\t\t\tif ( $quote === null && in_array($c, static::UNQUOTED_MUST_ESCAPE, true) ) {\n\t\t\t\t// This should never happen — our scan above would have blown up\n\t\t\t\tif ( ! $escape ) {\n\t\t\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t\t\t'Unescaped special character in unquoted value on line: %s',\n\t\t\t\t\t\t$line\n\t\t\t\t\t));\n\t\t\t\t}\n\n\t\t\t\t$newValue .= $c;\n\t\t\t\t$escape = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Escaped non-special character\n\t\t\tif ( $escape ) {\n\t\t\t\t// Treat back-slash literally if double-quoted\n\t\t\t\tif ( $quote === '\"' ) {\n\t\t\t\t\t$newValue .= '\\\\' . $c;\n\t\t\t\t// Strip it out back-slash if unquoted\n\t\t\t\t} else {\n\t\t\t\t\t$newValue .= $c;\n\t\t\t\t}\n\n\t\t\t\t$escape = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$newValue .= $c;\n\t\t}\n\n\t\tif ( ! $this->isLegalValue($newValue) ) {\n\t\t\tthrow new \\UnexpectedValueException(sprintf(\n\t\t\t\t'Illegal character in value on line: %s',\n\t\t\t\t$line\n\t\t\t));\n\t\t}\n\n\t\treturn [$name, $newValue];\n\t}", "protected function parse($string)\n {\n $this->setStringToBeParsed($string);\n\n // save for source map generation\n // $this->env->setFileContent($this->env->currentFileInfo->importedFile->getPath(), $this->input);\n\n $rules = $this->parsePrimary();\n // has the whole string been parsed?\n if ($this->position < $this->length) {\n throw new ILess_Exception_Parser(sprintf('There was an error while parsing the string. Near `%s`.',\n // FIXME: what about utf8?\n substr($this->input, $this->position, strpos($this->input, \"\\n\", $this->position) - $this->position)),\n null, $this->position, $this->env->currentFileInfo);\n }\n\n return $rules;\n }", "abstract public function parseInput(array $input): array;", "function strToArray(&$string, &$array){\r\n $array = explode(\"\\n\", $string);\r\n }", "public static function parse(string $content): array\n {\n $lines = explode(\"\\n\", $content);\n\n $object = [];\n\n foreach ($lines as $line) {\n if (preg_match('/^\\s*([\\w\\.\\-]+)\\s*=\\s*(.*)?\\s*$/', $line, $matches)) {\n $key = $matches[1];\n $value = $matches[2] ?? '';\n\n $length = $value ? strlen($value) : 0;\n if ($length > 0 && strpos($value, '\"') === 0 && substr($value, -1) === '\"') {\n $value = preg_replace('/\\\\n/gm', \"\\n\", $value);\n }\n\n $value = trim(preg_replace('/(^[\\'\"]|[\\'\"]$)/', '', $value));\n\n $object[$key] = $value;\n }\n }\n\n return $object;\n }", "function vcex_vc_param_group_parse_atts( $atts_string ) {\n\tif ( function_exists( 'vc_param_group_parse_atts' ) ) {\n\t\treturn vc_param_group_parse_atts( $atts_string );\n\t}\n\t$array = json_decode( urldecode( $atts_string ), true );\n\treturn $array;\n}", "public function createArray($str) {\n\t\t$str = substr($str, 0, -1);\n\t\treturn explode(',', $str);\n\t}", "private function getArrayKey($string, $vars) {\n\t $keys = explode('][', substr($string, 1, -1 ));\n\t\t\n\t foreach( $keys as $key ) {\n\t $vars = $vars[$key];\n\t }\n\t\t\n\t return $vars;\n\t}", "protected function parseAnnotations($str)\n {\n $annotations = [];\n preg_match_all($this->dataPattern, $str, $found);\n foreach ($found[2] as $key => $value) {\n $annotations[ $this->sanitizeKey($found[1][$key]) ][] = $this->parseValue(trim($value), $found[1][$key]);\n }\n\n return $annotations;\n }", "public static function parse_str($str)\n {\n }", "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 buildArray($string)\r\n {\r\n if (strlen($string))\r\n {\r\n return explode(',', preg_replace('/\\{|\\}/', '', $string));\r\n }\r\n \r\n return array();\r\n }", "public function variable($string);", "public static function StringToMetadata($string){\r\n $string = explode(\",\", $string);\r\n foreach($string as $v){\r\n $tmp = explode(\"=>\", $v);\r\n $data[$tmp[0]] = $tmp[1];\r\n }\r\n return $data;\r\n }", "public function extract($string);", "function pg_array_parse($array, $asText = true) {\n $s = $array;\n if ($asText) {\n $s = str_replace(\"{\", \"array('\", $s);\n $s = str_replace(\"}\", \"')\", $s); \n $s = str_replace(\",\", \"','\", $s); \n } else {\n $s = str_replace(\"{\", \"array(\", $s);\n $s = str_replace(\"}\", \")\", $s);\n }\n\t$ss = \"\\$retval = $s;\";\n eval($ss);\n\treturn $retval;\n}", "public static function parseAttributeString(string $string) : array\n\t{\n\t\t$str = trim($string);\n\t\t$attributes = [];\n\n\t\tif ($str[0] !== '<') {\n\t\t\t// String does not start with a tag\n\t\t\t$str = \"<div $str></div>\";\n\t\t}\n\n\t\t$simpleXML = new SimpleXMLElement($str);\n\n\t\tforeach($simpleXML->attributes() as $name => $value) {\n\t\t\t$attributes[$name] = (string)$value;\n\t\t}\n\n\t\treturn $attributes;\n\t}", "public function convertExtraToArray( $string ) {\n\t\tif( !$string )\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$_temp = array();\n\t\t\n\t\tif( $string == '#show_roles#' )\n\t\t{\n\t\t\t$roles = Yii::app()->authManager->getRoles();\n\t\t\tif( count($roles) )\n\t\t\t{\n\t\t\t\tforeach( $roles as $role )\n\t\t\t\t{\n\t\t\t\t\t$_temp[ $role->name ] = $role->name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$exploded = explode(\"\\n\", $string);\n\n\t\t\tif( count($exploded) )\n\t\t\t{\n\t\t\t\tforeach( $exploded as $explode )\n\t\t\t\t{\n\t\t\t\t\tlist($key, $value) = explode('=', $explode);\n\t\t\t\t\t$_temp[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t\n\t\treturn $_temp;\n\t}", "function smarty_modifier_array ($str, $blnLabels = FALSE)\n{\n\t\n\t$arr\t= explode (',', $str);\n\t\n\tif ($blnLabels)\n\t{\n\t\t\n\t\t$arrTmp\t= array ();\n\t\t\n\t\tforeach ($arr as $strVal)\n\t\t{\n\t\t\t\n\t\t\t$arrTmp[$strVal]\t= $strVal;\n\t\t\t\n\t\t}\n\t\t\n\t\t$arr\t= $arrTmp;\n\t\t\n\t}\n\t\n\treturn $arr;\n\t\n}", "public function fromString(string $string);", "private function set_up_replacements( $string ) {\n\t\t$replacements = [];\n\t\tif ( ! preg_match_all( '/{(.*?)}/iu', $string, $matches ) ) {\n\t\t\treturn $replacements;\n\t\t}\n\n\t\tforeach ( $matches[1] as $index => $variable ) {\n\t\t\t$value = Variables\\Variables::from( $variable, $this->args );\n\t\t\tif ( false !== $value ) {\n\t\t\t\t$replacements[ $matches[0][ $index ] ] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $replacements;\n\t}", "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 toArray($string)\n {\n return preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);\n }", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "function parseINI($str) {\n list(, $data) = preg_split('/^\\\\[Data\\\\]\\\\s*$/mu', $str, 2);\n preg_match_all('/^([^=]+)=(.*)$/mu', $data, $matches);\n return array_combine(array_map('trim', $matches[1]), array_map('trim', $matches[2]));\n}", "public function parseLine(string $line): array;", "private function _readNvp($string)\r\n\t{\r\n\t\twhile (strlen($string))\r\n\t\t{\r\n\t\t\t$keypos = strpos($string, '=');\r\n\t\t\t$valuepos = strpos($string, '&') ? strpos($string, '&') : strlen($string);\r\n\t\t\t$nvp_array[urldecode(substr($string, 0, $keypos))] = urldecode(substr($string, $keypos + 1, $valuepos - $keypos - 1));\r\n\t\t\t$string = substr($string, $valuepos + 1, strlen($string));\r\n\t\t}\r\n\r\n\t\treturn $nvp_array;\r\n\t}", "function tokenText($str)\n{\n $matches = preg_split(\"/\\;\\s*\\\\$/uism\", $str);\n $object = array();\n foreach ($matches as $match) {\n preg_match(\"/\\\\$?(\\w+)\\:(.*)/uism\", trim($match), $_matches);\n $object[$_matches[1]] = rtrim($_matches[2], \";\");\n }\n return $object;\n}", "function string_to_array($array)\n{\n $arr = explode(',', $array);\n foreach($arr as $item)\n $result[$item] = $item;\n\n return $result;\n}", "public function unserialize($string)\n {\n $result = array();\n parse_str($string, $result);\n\n return $result;\n }", "public function stringtoarray($stringa,$delimitatore=','){\n\t\treturn explode($delimitatore,$stringa);\n\t}", "public final function parse($param_str) {\n $params = explode(\",\", $param_str);\n foreach ($params as $param_item) {\n $param_kv = explode(\"=\", $param_item);\n $param_key = trim($param_kv[0]);\n $param_value = trim($param_kv[1]);\n if ('\"' === substr($param_key, 0, 1) && '\"' === substr($param_key, -1, 1)) {\n $param_key = substr($param_key, 1, strlen($param_key) - 2);\n }\n if ('\"' === substr($param_value, 0, 1) && '\"' === substr($param_value, -1, 1)) {\n // This param_value is a string type, which could be set directly\n if (property_exists($this, $param_key)) {\n $this->$param_key = substr($param_value, 1, strlen($param_value) - 2);\n } else {\n // @TODO support special variables like from `@use`\n }\n }\n }\n }", "function stringToClassArray($coursesString='')\n\t{\n\t\t$array = array();\n\t\t$courses = explode(\";\", $coursesString);\n\t\tforeach ($courses as $key => $course) {\n\t\t\t$course = explode(\" \", $course);\n\t\t\tarray_push($array, $course);\n\t\t}\n\t\treturn $array;\n\t}", "function sizesToArray($string){\n $sizesArray = explode(',',$string);\n $returnArray = array();\n foreach($sizesArray as $size){\n $s =explode(':',$size);\n $returnArray[] = array('size'=> $s[0], 'price' => $s[1],'quantity' => $s[2],'threshold' => $s[3]);\n }\n return $returnArray;\n}", "private function loadFromString($input) {\n\t//--\n\t$lines = explode(\"\\n\", (string)$input);\n\t//--\n\tforeach($lines as $k => $v) {\n\t\t$lines[$k] = (string) rtrim((string)$v, \"\\r\");\n\t} //end foreach\n\t//--\n\treturn (array) $lines;\n\t//--\n}", "function string_parse($string, $data = array(), $return = FALSE)\n\t{\n\t\treturn $this->_parse($string, $data, $return);\n }", "function http_spreaker_parse($txt)\n{\n $needed_parts = array('nonce'=>1, 'username'=>1, 'timestamp'=>1, 'response'=>1);\n $data = array();\n $data = explode(\":\",$txt);\n $arrayReturn = array();\n if(count($needed_parts) != count($data)){\n \treturn false;\n }\n $i = 0;\n foreach($needed_parts as $key => $val){\n \t$arrayReturn[$key] = $data[$i];\n \t$i++;\n }\n return $arrayReturn;\n}", "public function parseString($rawString)\n\t{\n\t\t$lines = explode(\"\\n\", trim((string) $rawString));\n\t\treturn $this->parseLines($lines);\n\t}", "#[\\JetBrains\\PhpStorm\\ArrayShape([0 => 'int[]', 1 => 'Board[]'])]\nfunction parse_input(string $input): array\n{\n [$n, $b] = explode(\"\\n\\n\", $input, 2);\n\n $numbers = toIntArray(explode(',', $n));\n\n $boards = collect(explode(\"\\n\\n\", $b))\n ->map(function ($board) {\n return new Board($board);\n });\n\n return [$numbers, $boards];\n}", "public function parse($string)\n {\n $array = json_decode($string, true);\n if (!is_array($array)) {\n $error = function_exists('json_last_error_msg') ? json_last_error_msg() : null;\n throw InvalidFormatException::create('JSON', $string, $error);\n }\n return $array;\n }", "public function key_value_from_string( $text = '' ) {\n\t\tpreg_match( '/([^:]+)(;[^:]+)?[:]([\\w\\W]*)/', $text, $matches );\n\n\t\tif ( 0 == count( $matches ) )\n\t\t\treturn false;\n\n\t\treturn array( $matches[1], $matches[3] );\n\t}", "public function parseStr($str, array &$arr = null) {\n return parse_str($str, $arr);\n }", "public static function parseArgs($args) {\n if (preg_match_all ( \"/([^\\\\[^\\\\]]+)/\", $args, $matches )) {\n $params = explode ( ',', $matches [1] [0] );\n $toReturn = array ( );\n foreach ( $params as $p ) {\n @list ( $key, $value ) = explode ( '=>', $p );\n $toReturn [preg_replace ( \"/[\\\\' ]+/\", \"\", $key )] = preg_replace ( \"/[\\\\' ]+/\", \"\", $value );\n }\n return $toReturn;\n }\n return $args;\n }", "private function getDataItem(string $part): array\n {\n $item = explode('=', $part, 2);\n $item = array_map('rawurldecode', $item);\n $item += [null, null];\n\n return $item;\n }", "function parse($string)\r\n\t{\r\n\r\n\t\t$str = explode('{', $string);\r\n\r\n\t\t$res = '';\r\n\r\n\t\tfor ($i = 0; isset($str[$i]); $i++)\r\n\t\t{\r\n\t\t\tif ($i === 0)\r\n\t\t\t{\r\n\t\t\t\t$res .= $str[$i];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$line = explode('}', $str[$i]);\r\n\t\t\t\t$key = $line[0];\r\n\t\t\t\tunset($line[0]);\r\n\r\n\t\t\t\tif ( $key && isset($this->vars[$key]) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$res .= $this->vars[$key].implode('}', $line);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tswitch ($this->unknowns)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase \"keep\":\r\n\t\t\t\t\t\t\t$res .= '{'.$key;\r\n\t\t\t\t\t\t\tif (count ($line) >\t0) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$res .= '}';\r\n\t\t\t\t\t\t\t\t$res .= implode('}', $line);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"remove\":\r\n\t\t\t\t\t\t\t\t$res .= implode('', $line);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"remove_nonjs\":\r\n\t\t\t\t\t\t\t\tif (!empty($key) && ((false === strpos($key, ' ')) && (false === strpos($key, \"\\n\")) && (false === strpos($key, \"\\t\"))))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$res .= implode('}', $line);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$res .= '{'.$key;\r\n\t\t\t\t\t\t\t\t\tif (count ($line) >\t0) \r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$res .= '}';\r\n\t\t\t\t\t\t\t\t\t\t$res .= implode('}', $line);\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\tbreak;\r\n\r\n\t\t\t\t\t\tcase \"comment\":\r\n\t\t\t\t\t\t\t\t$res .= '<!-- '.$key.' -->'.implode('', $line);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase \"space\":\r\n\t\t\t\t\t\t\t\t$res .= '&nbsp;'.implode('', $line);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $res;\r\n\t}", "public static function stringToArray($str)\n {\n $parsed = [];\n $addresses = explode(',', $str);\n\n foreach ($addresses as $address) {\n $split = explode(' <', trim($address));\n\n if (trim($split[0]) === '') {\n continue;\n }\n\n if (!empty($split[1])) { // eg. John Doe <[email protected]>\n $name = trim($split[0]);\n $addr = trim(rtrim($split[1], '>'));\n } else { // eg. [email protected]\n $name = null;\n $addr = trim($split[0]);\n }\n\n $parsed[$addr] = $name;\n }\n\n return $parsed;\n }", "public function fromString($string)\n {\n if (empty($string)) {\n return array();\n }\n\n return \\Zend\\Json\\Json::decode(\n $string,\n \\Zend\\Json\\Json::TYPE_ARRAY\n );\n }", "private function parseInputValues()\r\n {\r\n parse_str(file_get_contents(\"php://input\"),$data);\r\n\r\n $data = reset($data);\r\n \r\n $data = preg_split('/------.*\\nContent-Disposition: form-data; name=/', $data);\r\n \r\n $this->inputValues = array();\r\n \r\n foreach($data as $input)\r\n {\r\n // get key\r\n preg_match('/\"([^\"]+)\"/', $input, $key);\r\n \r\n // get data\r\n $input = preg_replace('/------.*--/', '', $input);\r\n \r\n // Store to an array\r\n $this->inputValues[$key[1]] = trim(str_replace($key[0], '', $input));\r\n }\r\n }", "function loadString($s)\n{\n\t$templ = $this->parser->parse($s);\t\n\t$this->elements = $templ[0];\n\t$this->document = $templ[1];\n}", "public function parse_result($str) {\n if (empty($str)) {\n throw new moodle_exception('error');\n }\n $parts = explode('&', $str);\n $result = array();\n foreach ($parts as $part){\n list($k, $v) = explode('=', $part, 2);\n $result[urldecode($k)] = urldecode($v);\n }\n if (empty($result)) {\n throw new moodle_exception('error');\n }\n return $result;\n }", "public function _parse_to_array($in) {\n\t\t$string = str_replace(' ', '', trim($in));\n\t\t\n\t\tif ( ! empty($string)) {\n\t\t\treturn (array) explode('|', $string);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t}\n\t}", "public function parse(string $virin): array\n {\n $matches = [];\n $parsed = preg_match('/' . self::CAPTURE_PATTERN . '/', $virin, $matches);\n\n if (!$parsed) {\n throw new Exception(\"Unable to parse input VIRIN string (is it syntactically valid?)\");\n }\n\n // Shift the first match off the beginning, it's the full string match\n array_shift($matches);\n\n // Set the matched parts for retrieval\n $this->field1 = $matches[0];\n $this->field2 = $matches[1];\n $this->field3 = $matches[2];\n $this->field4 = $matches[3];\n $this->field5 = $matches[4] ?? null;\n\n return $matches;\n }", "function _parseLine($line) {\n\t$line = trim($line);\n\n\t$array = array();\n\n\tif (preg_match('/^-(.*):$/',$line)) {\n\t\t// It's a mapped sequence\n\t\t$key = trim(substr(substr($line,1),0,-1));\n\t\t$array[$key] = '';\n\t} elseif ($line[0] == '-' && substr($line,0,3) != '---') {\n\t\t// It's a list item but not a new stream\n\t\tif (strlen($line) > 1) {\n\t\t$value = trim(substr($line,1));\n\t\t// Set the type of the value. Int, string, etc\n\t\t$value = $this->_toType($value);\n\t\t$array[] = $value;\n\t\t} else {\n\t\t$array[] = array();\n\t\t}\n\t} elseif (preg_match('/^(.+):/',$line,$key)) {\n\t\t// It's a key/value pair most likely\n\t\t// If the key is in double quotes pull it out\n\t\tif (preg_match('/^([\"\\'](.*)[\"\\'](\\s)*:)/',$line,$matches)) {\n\t\t$value = trim(str_replace($matches[1],'',$line));\n\t\t$key = $matches[2];\n\t\t} else {\n\t\t// Do some guesswork as to the key and the value\n\t\t$explode = explode(':',$line);\n\t\t$key = trim($explode[0]);\n\t\tarray_shift($explode);\n\t\t$value = trim(implode(':',$explode));\n\t\t}\n\n\t\t// Set the type of the value. Int, string, etc\n\t\t$value = $this->_toType($value);\n\t\tif (empty($key)) {\n\t\t$array[] = $value;\n\t\t} else {\n\t\t$array[$key] = $value;\n\t\t}\n\t}\n\treturn $array;\n\t}", "static protected function str2var( $string )\n {\n $trimmed = trim($string);\n $private_denotation = '__';\n if( strpos($trimmed,'$') === 0 && preg_match(\"/([a-zA-Z0-9]+)/\",$string,$match) ){\n $key = end($match);\n if( array_key_exists($key, static::$_temp_data)){\n return static::$_temp_data[$key];\n }\n elseif( strpos($key,$private_denotation) === 0 && property_exists(static::class,substr($key,strlen($private_denotation))) ){\n return constant(static::class.'::'.$key);\n }\n }\n return $string;\n }", "function splitvalues($str)\n{\n\t$arr=array();\n\tif($str==\"\")\n\t{\n\t\t$arr[] = \"\";\n\t\treturn $arr;\n\t}\n\t$start=0;\n\t$i=0;\n\t$inquot=false;\n\twhile($i<=strlen($str))\n\t{\n\t\tif($i<strlen($str) && substr($str,$i,1)=='\"')\n\t\t\t$inquot=!$inquot;\n\t\telse if($i==strlen($str) || !$inquot && substr($str,$i,1)==',')\n\t\t{\n\t\t\t$val=substr($str,$start,$i-$start);\n\t\t\t$start=$i+1;\n\t\t\tif(strlen($val) && substr($val,0,1)=='\"')\n\t\t\t{\n\t\t\t\t$val=substr($val,1,strlen($val)-2);\n\t\t\t\t$val=str_replace('\"\"','\"',$val);\n\t\t\t}\n\t\t\t\n\t\t\tif( $val !== FALSE )\n\t\t\t$arr[]=$val;\n\t\t}\n\t\t$i++;\n\t}\n\treturn $arr;\n}", "protected function parse(): void\n {\n $lines = preg_split('/\\r\\n|\\r|\\n/', $this->content);\n\n foreach ($lines as $line) {\n if (mb_strlen(trim($line)) && ! (mb_strpos(trim($line), '#') === 0)) {\n [$key, $value] = explode('=', (string) $line);\n $this->variables[$key] = $this->formatValue($value);\n }\n }\n }" ]
[ "0.7176752", "0.700465", "0.68121237", "0.67182225", "0.6583742", "0.63982105", "0.63031846", "0.609481", "0.5979684", "0.5968513", "0.59452", "0.59375817", "0.58911055", "0.5856128", "0.5817651", "0.5747777", "0.5739411", "0.5739411", "0.5708598", "0.5706053", "0.5694177", "0.5681982", "0.56781286", "0.5646548", "0.56356996", "0.5621599", "0.55822676", "0.55701303", "0.55549544", "0.55364484", "0.5533817", "0.54960304", "0.5483136", "0.54706794", "0.5436977", "0.5407742", "0.54009706", "0.5387758", "0.53766847", "0.5375378", "0.537342", "0.5368816", "0.5346745", "0.53464025", "0.5345932", "0.53449196", "0.53333426", "0.53290284", "0.5327256", "0.5326104", "0.5321661", "0.53216106", "0.53208494", "0.53158313", "0.52812904", "0.52758396", "0.5274231", "0.52738976", "0.52733165", "0.5272403", "0.52681845", "0.5267999", "0.5267141", "0.5264131", "0.5260499", "0.52588874", "0.5255752", "0.52481025", "0.52480066", "0.52433664", "0.5242231", "0.5241346", "0.5238267", "0.52319956", "0.5227305", "0.52272964", "0.5226363", "0.52209014", "0.521495", "0.521305", "0.5191366", "0.5190996", "0.5190607", "0.5190101", "0.5181628", "0.5174478", "0.51675904", "0.51602083", "0.51595616", "0.51589453", "0.515422", "0.5147896", "0.5146543", "0.5144602", "0.5136152", "0.5120157", "0.51200205", "0.5112713", "0.51079214", "0.50997704" ]
0.5667751
23
Navigates through an array and removes slashes from the values. If an array is passed, the array_map() function causes a callback to pass the value back to the function. The slashes from this value will removed.
function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "private function stripSlashes(&$array)\n\t{\n\t\tforeach($array as $key => $value) {\n\t\t\t$array[$key] = (is_array($value) ? array_map('stripslashes', $value) : stripslashes($value));\n\t\t}\n\t}", "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 stripSlashesDeep($value) \n{\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\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 stripslashes_array( $value ){\n\t$value = is_array( $value ) ? array_map( 'stripslashes_array', $value ) : stripslashes( $value );\n\n\treturn $value;\n}", "function stripSlashesDeep($value)\n{\n $value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n return $value;\n}", "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 stripSlashesDeep($value) {\n\t$value = is_array($value) ? array_map('stripSlashesDeep', $value) : stripslashes($value);\n\treturn $value;\n}", "function stripslashes_array( $given ) {\n return is_array( $given ) ? array_map( 'stripslashes', $given ) : stripslashes( $given );\n}", "private function removeSlashes(&$var) {\r\n\t\tif (is_array($var)) {\r\n\t\t\tforeach ($var as $name => $value) {\r\n\t\t\t\tif (is_array($value)) {\r\n\t\t\t\t\t$this->removeSlashes($value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$var[$name] = stripslashes($value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$var = stripslashes($var);\r\n\t\t}\r\n\t}", "function stripSlashesDeep($value) {\r\n $value = is_array($value) ? array_map('cleanInputs', $value) : stripslashes($value);\r\n return $value;\r\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}", "private function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map(array($this, 'stripSlashesDeep'), $value) : stripslashes($value);\n return $value;\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 stripslashes_deep($value) {\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n return $value;\n}", "function StripslashesArray($arr) {\n /* \n from php.net/slipslashes\n [email protected]\n 28-Jun-2001 09:07\n Very useful for using on all the elements in say $HTTP_POST_VARS, or\n elements returned from an database query. (to addslashes, just change\n strip to add =)\n */\n\n $rs = array();\n\n foreach ($arr as $key => $val) {\n $rs[$key] = stripslashes($val);\n }\n\n return $rs;\n}", "public function stripSlashesDeep($value) {\n $value = is_array($value) ? array_map(array($this, 'stripSlashesDeep'), $value) : $this->stripslashes($value);\n return $value;\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 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 stripslashes_deep($value)\n{\n $value = is_array($value) ?\n array_map('stripslashes_deep', $value) :\n stripslashes($value);\n return $value;\n}", "public static function stripSlashesDeep($value) {\r\n $value = is_array($value) ? array_map(self::stripSlashesDeep, $value) : stripslashes($value);\r\n return $value;\r\n }", "function removeSlashes($data){\n foreach($data as $key => $value){\n $data[$key] = stripslashes($value);\n }\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 }", "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}", "protected static function stripSlashesRecursive($value)\n {\n $value = is_array($value)\n ? array_map(array('XoopsRequest', 'stripSlashesRecursive'), $value)\n : stripslashes($value);\n\n return $value;\n }", "private static function doFixArray(array &$array){\n if( get_magic_quotes_gpc() == 1 ){\n foreach($array as $key => $value){\n if( is_array($value) )\n $array[$key] = self::doFixArray($value);\n else\n $array[$key] = stripslashes($value);\n }\n }\n }", "function stripslashes_deep($value)\n{\n $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);\n\n return $value;\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 array_trim_recursive($values, $charlist = \" \\t\\n\\r\\0\\x0B\")\n {\n if (is_array($values)) {\n return array_map('array_trim_recursive', $values);\n }\n\n return is_string($values) ? trim($values, $charlist) : $values;\n }", "function StripGPCArray($arr)\n{\n\tif (get_magic_quotes_gpc() != 0)\n\t\tforeach ($arr as $key=>$value)\n\t\t\tif (is_string($value))\n\t\t\t\t$arr[$key] = stripslashes($value);\n\treturn ($arr);\n}", "public function prep_url_array($array,$unset = 0){\n for($i = 0; $i < $unset; $i++){\n unset($array[$i]);\n }\n return implode($array, '/');\n }", "function trim_r(array $array, $to_trim=' ') {\n\tforeach ( $array as $key => $val ) {\n\t\tif ( is_array($val) ) {\n\t\t\t$array[$key] = trim_r($val);\n\t\t}\n\t\telse {\n\t\t\t$array[$key] = trim($val, $to_trim);\n\t\t}\n\t}\n\treturn $array;\n}", "public static function stripSlashesDeep($value)\n {\n $value = is_array($value) ? array_map(array('self',__METHOD__), $value) : stripslashes($value);\n return $value;\n }", "private function removePrefix($array)\n {\n $result = [];\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n if ($subResult = $this->removePrefix($value)) {\n $result[$key] = $subResult;\n }\n continue;\n }\n\n $value = str_replace('\\\\', '/', realpath($value));\n if (empty($value)) {\n continue;\n }\n\n if (substr($value, 0, $this->stripLength) === $this->strip) {\n $value = substr($value, $this->stripLength);\n if (!isset($this->whitelist[$value])) {\n continue;\n }\n\n $result[$key] = '@@BASEDIR@@' . $value;\n continue;\n }\n\n $result[$key] = $value;\n }\n\n return $result;\n }", "function stripslashes_deep($value)\r\n{\r\n\treturn is_array($value)?array_map('stripslashes_deep',$value):stripslashes($value);\r\n}", "public static function trim($array) {\n\t\t\treturn array_map(function($item) {\n\t\t\t\treturn trim($item);\n\t\t\t}, $array);\n\t\t}", "function trim_array($input)\n{\n if (!is_array($input))\n {\n return trim($input);\n }\n\n return array_map('trim_array', $input);\n}", "protected static function removeAllLeadingAndTrailingSlashes(array $components): array {\n return array_map(function ($component) {\n return trim($component, '/');\n }, $components);\n }", "function trim_array(&$arr) \n {\n foreach ($arr as $k => $v) {\n if (is_array($v))\n App::trim_array($arr[$k]);\n else\n $arr[$k] = trim($v);\n }\n }", "function trim_deep($value)\n{\n $value = is_array($value) ? array_map('trim_deep', $value) : trim($value);\n\n return $value;\n}", "private function _strip_slashes_deep($value)\n {\n $value = is_array($value) ? array_map(array($this, '_strip_slashes_deep'), $value) : stripslashes($value);\n return $value;\n }", "static function recursiveUnescape($value)\n\t{\n\t\tif (is_array($value))\n\t\t{\n\t\t\treturn array_map([__CLASS__, 'recursiveUnescape'], $value);\n\t\t}\n\n\t\treturn str_replace(['\\r', '\\n', '\\t', '\\\"'], [\"\\r\", \"\\n\", \"\\t\", '\"'], $value);\n\t}", "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 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 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}", "function f_clean($link, $array) {\r\n return array_map('f_mysqlEscape', $array);\r\n}", "function stripslashesDeep( $data)\r\n {\r\n return is_array($data) ? array_map( 'stripslashesDeep', $data) : stripslashes($data) ;\r\n }", "public static function clean(array $array): array\n {\n /* loop overt all the values in the array */\n array_walk_recursive($array, function (&$item) {\n /* Check if the value is a string */\n if (is_string($item)) {\n /* Clean the string */\n $item = StringHelper::clean($item);\n }\n });\n /* Return the cleaned array */\n return $array;\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 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}", "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}", "public static function StripSlashes($value)\n\t{\n\t\tif (get_magic_quotes_runtime())\n\t\t{\n\t\t\tif (is_array($value))\n\t\t\t{\n\t\t\t\tforeach ($value as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (is_array($val)) $value[$key] = self::StripSlashes($val);\n\t\t\t\t\telse $value[$key] = stripslashes($val);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse $value = stripslashes($value);\n\t\t}\n\t\treturn $value;\n\t}", "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 unfck($v) {\n return is_array($v) ? array_map('unfck', $v) : addslashes($v);\n}", "function removeDoubles($array) {\n $result = array();\n \n foreach ($array as $string) {\n if (!in_array($string, $result))\n $result[] = $string;\n }\n\n return $result;\n}", "private function array_map ( $n ) {\r\n\t\treturn trim( $n );\r\n\t}", "function wp_unslash($value)\n {\n }", "private function arrayClean($array)\n {\n foreach ($array as $key=>$value) {\n if(is_array($value))\n $this->arrayClean($value);\n else if($value!==null)\n unset($value);\n }\n }", "public static function trim_stripslashes_deep($value){\n\t\tif ( is_array($value) ) {\n\t\t\t$value = array_map(array(get_called_class(), 'trim_stripslashes_deep'), $value);\n\t\t} elseif ( is_object($value) ) {\n\t\t\t$vars = get_object_vars( $value );\n\t\t\tforeach ($vars as $key=>$data) {\n\t\t\t\t$value->{$key} = self::trim_stripslashes_deep( $data );\n\t\t\t}\n\t\t} elseif ( is_string( $value ) ) {\n\t\t\t$value = trim(stripslashes($value));\n\t\t}\n\t\treturn $value;\n\t}", "private function _strip_deep2($d) {\n $d = is_array($d) ? array_map(array($this, '_strip_deep2'), $d) : stripslashes($d);\n return $d;\n }", "function wp_unslash( $value ) {\n\treturn stripslashes_deep( $value );\n}", "public function stripSlashes(&$data)\n\t{\n\t\treturn is_array($data) ? array_map(array($this,\"stripslashes\"),$data) : stripslashes($data);\n\t}", "function addslashes_array( $value ){\n\t$value = is_array( $value ) ? array_map( 'addslashes_array', $value ) : addslashes( $value );\n\n\treturn $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}", "public static function arrayTrim ($array, $trimKeys = false)\r\n\t{\r\n\t\t# Return the value if not an array\r\n\t\tif (!is_array ($array)) {return $array;}\r\n\t\t\r\n\t\t# Loop and replace\r\n\t\t$cleanedArray = array ();\r\n\t\tforeach ($array as $key => $value) {\r\n\t\t\t\r\n\t\t\t# Deal with recursive arrays\r\n\t\t\tif (is_array ($value)) {$value = self::arrayTrim ($value);}\r\n\t\t\t\r\n\t\t\t# Trim the key if requested\r\n\t\t\tif ($trimKeys) {$key = trim ($key);}\r\n\t\t\t\r\n\t\t\t# Trim value\r\n\t\t\t$cleanedArray[$key] = trim ($value);\r\n\t\t}\r\n\t\t\r\n\t\t# Return the new array\r\n\t\treturn $cleanedArray;\r\n\t}", "static function array_clean($array) {\n\t\treturn array_diff($array,array(null,'',\"\\n\",\"\\s\",\"\\r\",\"\\r\\n\",\"\\n\\r\"));\n\t}", "function sanitize($mixed = null)\n{\n if (!is_array($mixed)) {\n return convertHtmlEntities($mixed);\n }\n function array_map_recursive($callback, $array)\n {\n $func = function ($item) use (&$func, &$callback) {\n return is_array($item) ? array_map($func, $item) : call_user_func($callback, $item);\n };\n return array_map($func, $array);\n }\n return array_map_recursive('convertHtmlEntities', $mixed);\n}", "function revertArrayForSanitizing($array, &$dst)\n{\n foreach ($array as $v) {\n list($key, $val) = preg_split(\"/=/\", $v, 2);\n $dst[$key] = $val;\n }\n}", "protected function _sanitizeStrings(&$array)\n {\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n $value = $this->_sanitizeStrings($value);\n }\n elseif (is_string($value) && strpos($value, self::JS_RAW) === false) {\n // sanitize\n $value = str_replace('\"', '', $value);\n }\n\n $array[$key] = $value;\n }\n\n return $array;\n }", "function rest_sanitize_array($maybe_array)\n {\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 unslashify($str)\n{\n return preg_replace('/\\/$/', '', $str);\n}", "function clean($array){\n\n\t\treturn array_map('mysql_real_escape_string', $array);\n\n\t}", "function cleanSlash($str){\n $str = implode(\"/\", explode(\"\\\\\", $str));\n while( count(explode(\"//\", $str)) > 1){\n $str = implode(\"/\", explode(\"//\", $str));\n }\n\n return $str;\n}", "public function sanitize($value)\r\n\t{\r\n\t\tarray_walk(\r\n\t\t\t$value,\r\n\t\t\tfunction(&$value) {\r\n\t\t\t\t$value=trim($value);\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\treturn $value;\r\n\t}", "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_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}", "public function reverseTransform($val)\n {\n if (!$val) {\n return null;\n }\n\n return array_map(function($item) {\n return trim($item);\n }, explode($this->delimiter, $val));\n }", "function trimElementInArray($array = []) {\n $result = [];\n foreach ($array as $item) {\n array_push($result, trim($item));\n }\n return $result;\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 static function stripslashes($value)\n {\n if (Kohana::$magic_quotes === TRUE)\n {\n if (is_array($value) OR is_object($value))\n {\n foreach ($value as $key => $val)\n {\n // Recursively clean each value\n $value[$key] = Kohana::stripslashes($val);\n }\n }\n elseif (is_string($value))\n {\n // Remove slashes added by magic quotes\n $value = stripslashes($value);\n }\n }\n\n return $value;\n }", "public function stringifyPaths(array $array, array $path = [])\n {\n $result = [];\n foreach ($array as $key => $val) {\n $currentPath = array_merge($path, [$key]);\n if (is_array($val)) {\n $result[] = join('/', $currentPath);\n $result = array_merge($result, $this->stringifyPaths($val, $currentPath));\n } else {\n $result[] = join('/', $currentPath);\n }\n }\n\n return $result;\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 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 }", "protected function _cleanupArray(&$array)\n\t{\n\t\tif( !$array ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tforeach( $array as $key => $value ) {\n\t\t\tif( is_object( $value ) ) {\n\t\t\t\tunset( $array[ $key ] );\n\t\t\t}\n\t\t\telseif( is_array( $value ) ) {\n\t\t\t\t$this->_cleanupArray( $array[ $key ] );\n\t\t\t}\n\t\t}\n\t}", "function transcribe($array, $is_top_level = true) {\n $result = array();\n $is_magic = get_magic_quotes_gpc();\n\n foreach ($array as $key => $value) {\n $decoded_key = ($is_magic && !$is_top_level) ? stripslashes($key) : $key;\n\n if (is_array($value)) {\n $decoded_value = transcribe($value, false);\n } else {\n $decoded_value = ($is_magic) ? stripslashes($value) : $value;\n }\n\n $result[$decoded_key] = $decoded_value;\n }\n\n return $result;\n}", "public function slug(string|array $value, bool $allow_slash = false) : string|array\n\t{\n\t\treturn $this->handlers->map($value, function ($value) use ($allow_slash) {\n\t\t\treturn $this->handlers->get('slug')->filter($value, $allow_slash);\n\t\t});\n\t}", "function query_string(array $array, $replace = null, $remove = null) {\n if ($replace !== null) {\n foreach ((array) $replace as $path => $v) {\n array_path_replace($array, $path, $v);\n }\n }\n if ($remove !== null) {\n foreach ((array) $remove as $path) {\n array_path_unset($array, $path);\n }\n }\n return array_url_encode($array);\n}", "public static function deleteValue(&$array, $key)\n {\n if (is_string($key)) {\n // Iterate path\n $keys = explode('.', $key);\n $last = array_pop($keys);\n foreach ($keys as $key) {\n if (!isset($array[$key])) {\n return;\n }\n $array = &$array[$key];\n }\n if (isset($array[$last])) {\n // Detele path\n unset($array[$last]);\n }\n } elseif (is_array($key)) {\n // Iterate array of paths\n foreach ($key as $k) {\n self::delete($k);\n }\n }\n }", "public static function unmapStitky($value)\n {\n if (is_array($value)) {\n return $value ? implode(\",\", array_map(\"trim\", $value)) : \"\";\n }\n return \"\";\n }", "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 }", "public static function trim($array, $charlist = null)\n\t{\n\t\t$arr = $array;\n\t\tforeach ($arr as & $value) {\n\t\t\tif (is_string($value)) $value = is_string($charlist) ? trim($value, $charlist) : trim($value);\n\t\t}\n\t\treturn $arr;\n\t}", "protected static function clean_array() {\n\t\treturn array( '<', '>', '&', \"'\", '\"' );\n\t}", "function cleanseInput(&$data)\r\n{\r\n if (is_array($data))\r\n {\r\n foreach ($data as &$subItem)\r\n {\r\n $subItem = cleanseInput($subItem);\r\n }\r\n }\r\n \r\n else\r\n { \r\n $data = trim($data, \"';#\");\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n }\r\n \r\n return $data;\r\n}", "public static function atrim(array $array) {\n\t\tif (is_array($array)) {\n\t\t\tforeach ($array as &$a) {\n\t\t\t\tif (is_array($a)) {\n\t\t\t\t\t// Right\n\t\t\t\t\tfor ($i = sizeof($a) - 1; $i >= 0; $i--) {\n\t\t\t\t\t\tif ($a[$i] == '') unset($a[$i]);\n\t\t\t\t\t\telse break;\n\t\t\t\t\t}\n\t\t\t\t\t// Left\n\t\t\t\t\tforeach ($a as $k => $v) {\n\t\t\t\t\t\tif ($v == '') unset($a[$k]);\n\t\t\t\t\t\telse break;\n\t\t\t\t\t}\n\t\t\t\t\t$a = array_values($a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "function emptystr_tonull($arr)\n {\n return array_map(function ($val) {\n if ($val === '') {\n $val = null;\n }\n\n return $val;\n }, $arr);\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 }", "public static function trim_all_elements($array) {\n $trimmed = array_map(function($a) { return array_map('trim', $a); }, $array);\n return $trimmed;\n }" ]
[ "0.7270096", "0.6963123", "0.6783153", "0.6783153", "0.6764093", "0.67389023", "0.67257607", "0.67183363", "0.6705006", "0.66512424", "0.65324175", "0.64670616", "0.642976", "0.6416264", "0.63952607", "0.63908106", "0.63461155", "0.63395864", "0.63357943", "0.6297767", "0.6295067", "0.62883353", "0.6281317", "0.62438977", "0.61897933", "0.6183051", "0.61788946", "0.6153814", "0.6152641", "0.6098564", "0.6092167", "0.60722446", "0.60667914", "0.6058058", "0.60430133", "0.6026143", "0.5978185", "0.5949183", "0.59369093", "0.5912389", "0.5892775", "0.5879239", "0.5877374", "0.586757", "0.58638716", "0.58561736", "0.5852031", "0.5835185", "0.5799626", "0.5792041", "0.5776702", "0.57616484", "0.5740404", "0.57311857", "0.5654916", "0.56144553", "0.5588835", "0.55663115", "0.5545313", "0.554475", "0.5529113", "0.5523224", "0.5515947", "0.55046296", "0.5474575", "0.5474485", "0.546754", "0.5458775", "0.54549044", "0.5423141", "0.5385075", "0.53844714", "0.53827757", "0.5372118", "0.53659886", "0.5362458", "0.5347662", "0.53426206", "0.533727", "0.53316265", "0.53263646", "0.531873", "0.53078413", "0.5297903", "0.52900577", "0.5283549", "0.527646", "0.52613205", "0.52544755", "0.52410156", "0.5236583", "0.52333945", "0.52271634", "0.52205503", "0.52036005", "0.52025706", "0.518581", "0.51813775", "0.5177198", "0.51694435" ]
0.6040077
35
execute. 1. init container. 2. load config 3. routing 4. action chain 5. filter chain
public function execute() { // init container. $this->initContainer(); // routing $this->routing(); // action chain. while ($action = $this->actionChain->getCurrentAction()) { // clear. $this->filterChain->clear(); $this->container->register('errorList', $this->actionChain->getCurrentErrorList()); $this->filterChain->setAction($action['controller'], $action['action']); $this->filterChain->build(); $this->filterChain->execute(); $this->actionChain->next(); } // response. $this->response->execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n $this->run_configuration();\n\n $this->request->plugins = $this->pluggins;\n\n $app = $this;\n\n $this->router->start($app);\n }", "public function run() {\n //fire off any events that are a associated with this event\n $event = new Event(KernelEvents::REQUEST_START);\n\n $this->container->get('EventDispatcher')->dispatch('all', KernelEvents::REQUEST_START, $event);\n\n $this->container->get('EventDispatcher')->dispatch($this->httpRequest->getRequestParams()->getYmlKey(), KernelEvents::REQUEST_START, $event);\n\n //initialize the MVC\n $nodeConfig = $this->httpRequest->getNodeConfig();\n \n $cmd = $this->getKernelRunner();\n\n\n $result = $cmd->execute($nodeConfig);\n\n $this->httpResponse->setAttribute('result', $result['data']);\n\n //file_put_contents('/var/www/glenmeikle.com/logs/db-debug.log', print_r($this->httpRequest, true), FILE_APPEND);\n // echo \"node filters\\r\\n\";\n runFilters($this->httpRequest->getSiteParams()->getSitePath(). DIRECTORY_SEPARATOR . $this->httpRequest->getNodeConfig()['componentPath'] . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'filters.yml', $this->httpRequest->getRequestParams()->getYmlKey(),FilterEvents::FILTER_REQUEST_FORWARD);\n // echo \"all filters\\r\\n\";\n runFilters($this->httpRequest->getSiteParams()->getConfigPath() . 'filters.yml', 'all',FilterEvents::FILTER_REQUEST_FORWARD);\n\n \n $event = new Event(KernelEvents::RESPONSE_END, $result);\n $this->container->get('EventDispatcher')->dispatch('all', KernelEvents::RESPONSE_END, $event);\n $this->container->get('EventDispatcher')->dispatch($this->httpRequest->getRequestParams()->getYmlKey(), KernelEvents::RESPONSE_END, $event);\n\n /**\n * now we dump the response to the page\n */\n renderResult($result, $this->httpResponse->getHeaders(), $this->httpResponse->getCookies());\n }", "protected function _init(){\n\t\tparent::_init();\n\t\t$this->applyFilter('__invoke', function($self, $params, $chain) {\n\t\t\textract($params);\n\t\t\t$action = $request->action;\n\t\t\t$config = $configKey = null;\n\t\t\tif (!empty($request->params['config'])) {\n\t\t\t\t$configKey = $request->params['config'];\n\t\t\t\t$self->runtime = Registry::get(\"sli_users.{$configKey}\");\n\t\t\t}\n\t\t\tif (!$self->runtime) {\n\t\t\t\t$actionKey = \"sli_users.{$configKey}.controller.actions.{$action}\";\n\t\t\t\t$handledAction = Registry::get($actionKey);\n\t\t\t\tif (isset($handledAction)) {\n\t\t\t\t\t$class = get_class($self);\n\t\t\t\t\t$exception = \"{$class}::{$action} cannot be run without a runtime config.\";\n\t\t\t\t\tthrow new \\RuntimeException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($self->runtime) {\n\t\t\t\t$self->_user =& Authorized::instance($self->runtime['name'], false, $self->runtime['class']);\n\t\t\t\t$library = Libraries::get('sli_users');\n\t\t\t\tMedia::setDefaults('html');\n\t\t\t\tMedia::addPaths('html', array(\n\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\"{:library}/views/{$configKey}/{:template}.{:type}.php\",\n\t\t\t\t\t\t$library['path'] . '/views/{:controller}/{:template}.{:type}.php',\n\t\t\t\t\t)\n\t\t\t\t), false);\n\t\t\t\t$self->set(array('sliUserConfig' => $configKey));\n\t\t\t}\n\t\t\treturn $chain->next($self, $params, $chain);\n\t\t});\n\t}", "public function run()\n {\n \t$router = Injector::call('\\Nanozen\\Providers\\CustomRouting\\CustomRoutingProvider');\n \t\n \t// Setting up the routes.\n\t\t$this->setupRoutes($router);\n\n // Invoking the router.\n $router->invoke();\n }", "public function run()\n {\n $this->executeStaticRoutes();\n $this->executeGroupRoutes();\n }", "public function run() {\n // 1. Getting the request string\n $uri = $this->getURI();\n $uri_arr = explode('/', $uri);\n if ($uri_arr !== false) {\n $flag = false;\n foreach ($uri_arr as $key=>$item) {\n if (($item === 'articles' or $item === 'auth') and $key > 0) {\n define('FOLDER_NAME', $uri_arr[$key - 1]);\n $flag = true;\n }\n }\n if (!$flag) {\n define('FOLDER_NAME', '');\n }\n }\n\n // 2. Checking if the request exists in routes\n foreach ($this->routes as $req=>$act) {\n // 3. If getting match then define the controller and action\n if (preg_match('@'.$req.'@', $uri)) {\n // 4. Importing file of chosen controller\n if ($req !== '') {\n $internal = preg_replace('@' . $req . '@', $act, $uri);\n }\n else {\n $internal = $act;\n }\n $matches = array();\n preg_match('@(articles/.*$|main/.*$|auth/.*$)@', $internal, $matches);\n $internal = $matches[0];\n $full_request = explode('/', $internal);\n $controller = ucfirst($full_request[0].'Controller');\n $action = 'action'.explode('?', ucfirst($full_request[1]))[0];\n $params = array();\n for ($i = 2; $i < count($full_request); $i++) {\n $params[$i - 2] = $full_request[$i];\n }\n $file = ROOT.'/controllers/'.$controller.'.php';\n if (file_exists($file)) {\n include_once($file);\n }\n // 5. Creating object and doing action\n try {\n $chosenController = new $controller;\n $is_done = call_user_func_array(array($chosenController, $action), $params);\n }\n catch (TypeError $e) {\n header(\"HTTP/1.0 404 Not Found\");\n $is_done = false;\n }\n if ($is_done) break;\n }\n }\n\n }", "public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }", "public static function boot() {\n $controller = Router::getController();\n\n // todo: perhaps transfer here some server, get, post and cookie parameters as context?\n if ($controller instanceof Controller) $controller->run(Tools::get('action','string',''));\n }", "public function run(): void\n {\n $requestBody = $this->getConfig()->getInputAdapter()::getParsedBody();\n $request = ServerRequestFactory::fromGlobals(\n $_SERVER,\n $_GET,\n $requestBody,\n $_COOKIE,\n $_FILES\n );\n\n $queue = [];\n\n $queue[] = new \\Middlewares\\Emitter();\n $queue[] = new ErrorHandler([new JsonFormatter()]);\n $queue[] = (new \\Middlewares\\PhpSession())->name('VENUSSESSID')\n ->regenerateId(60); // Prevent session fixation attacks\n\n $queue[] = (new \\Middlewares\\FastRoute(\n $this->getConfig()->getDispatcher()\n ))->attribute('handler');\n\n $queue = array_merge($queue, $this->getConfig()->getMiddlewares());\n\n // Use router access permission check\n if ($this->getConfig()->usePermission()) {\n $queue[] = (new Permission(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n }\n\n $queue[] = (new RequestHandler(\n $this->getConfig()->getContainer()\n ))->handlerAttribute('handler');\n\n $dispatcher = new Dispatcher($queue);\n $dispatcher->dispatch($request);\n }", "public function run() {\n $this->load_dependencies();\n $this->load_localization();\n $this->load_admin();\n $this->load_public();\n }", "abstract protected function preConfigure();", "function Execute()\n\t\t{\n\t\t\t$controller = new $this->CONTROLLER();\n\t\t\t$controller->Initialise($this->get, $this->post, $this->files);\n\t\t\t$controller->StartFilters();\n\t\t\t$controller->{$this->ACTION}();\n\t\t\t$controller->StopFilters();\n\t\t}", "public function configure()\n {\n $this->container = require __DIR__ . '/../../config/configure-services.php';\n $this->scratchSpace = vfsStream::setup('scratch')->url();\n }", "public function runRouter(Container $container) : void\n {\n $dispatcher = \\FastRoute\\simpleDispatcher(function(RouteCollector $router) {\n $this->includeRoutes($router);\n });\n // call route\n $this->setParams($dispatcher)->callHandler($container);\n }", "public function run()\n {\n $routeFile = app('path.bootstrap') . '/api.php';\n if (file_exists($routeFile)) {\n $router = $this;\n $routes = require $routeFile;\n add_action('rest_api_init', [$this, 'register']);\n }\n\n if (class_exists('acf')) {\n $this->createAcfRoutes();\n }\n }", "public static function do($container, $lazyLoad = true)\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\Loader\\\\LoaderInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\Loader\\\\Loader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\Loader\\\\DelegatingLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Routing\\\\DelegatingLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\Loader\\\\LoaderResolverInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\Loader\\\\LoaderResolver.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\Loader\\\\FileLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\Configurator\\\\Traits\\\\HostTrait.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\Configurator\\\\Traits\\\\LocalizedRouteTrait.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\Configurator\\\\Traits\\\\PrefixTrait.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\XmlFileLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\FileLocatorInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\config\\\\FileLocator.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\http-kernel\\\\Config\\\\FileLocator.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\YamlFileLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\PhpFileLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\GlobFileLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\DirectoryLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\ObjectLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\ContainerLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\AnnotationClassLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Routing\\\\AnnotatedRouteControllerLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\AnnotationFileLoader.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\routing\\\\Loader\\\\AnnotationDirectoryLoader.php';\n\n $a = new \\Symfony\\Component\\Config\\Loader\\LoaderResolver();\n\n $b = new \\Symfony\\Component\\HttpKernel\\Config\\FileLocator(($container->services['kernel'] ?? $container->get('kernel', 1)));\n $c = new \\Symfony\\Bundle\\FrameworkBundle\\Routing\\AnnotatedRouteControllerLoader(($container->privates['annotations.cached_reader'] ?? $container->getAnnotations_CachedReaderService()));\n\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\XmlFileLoader($b));\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\YamlFileLoader($b));\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\PhpFileLoader($b));\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\GlobFileLoader($b));\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\DirectoryLoader($b));\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\ContainerLoader(new \\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator($container->getService, [\n 'kernel' => ['services', 'kernel', 'getKernelService', false],\n ], [\n 'kernel' => 'App\\\\Kernel',\n ])));\n $a->addLoader($c);\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\AnnotationDirectoryLoader($b, $c));\n $a->addLoader(new \\Symfony\\Component\\Routing\\Loader\\AnnotationFileLoader($b, $c));\n\n return $container->services['routing.loader'] = new \\Symfony\\Bundle\\FrameworkBundle\\Routing\\DelegatingLoader($a, ['utf8' => true], []);\n }", "private function run()\n {\n error_reporting(E_ALL|E_STRICT);\n $namespace = 'cli';\n if (defined('NAMESPACE')) {\n $namespace = constant('NAMESPACE');\n }\n elseif (isset($_SERVER, $_SERVER['SERVER_NAME'])) {\n $namespace = $_SERVER['SERVER_NAME'];\n }\n if (!defined('BOOTSTRAP_FILE')) {\n die('Please define BOOTSTRAP_FILE before calling Init::run()');\n }\n Zend_Registry::set('namespace', $namespace);\n try {\n $this->startTimer();\n $this->loadConfig(str_replace(array('.','-'), '_', $namespace));\n $this->setDebug();\n $this->initResources();\n $this->initTimezone();\n $this->initRequest(constant('BOOTSTRAP_FILE'), $namespace);\n $this->initLocale();\n $this->initTranslate();\n $this->initLogging($namespace);\n $this->parseRequest($namespace);\n } catch (WrappedException $we) {\n $this->spawnInitError($we);\n }\n }", "public function beforeExecuteRoute()\n {\n if (method_exists($this, 'initialize')) {\n $this->initialize();\n }\n\n $this->middlewareHandler();\n }", "protected function _run()\n\t{\n\t\t$this->_oBootstrap->beforeRoute(self::$_oInstance, $this->_oDispatcher);\n\t\t//Begin Route\n\t\tRouter::BeginRoute($this->_oRequest);\n\t\t//After Route\n\t\t$this->_oBootstrap->afterRoute(self::$_oInstance, $this->_oDispatcher);\n\n\t\t//Dispatcher Initialize\n\t\t$this->_oDispatcher = Dispatcher::GetInstance();\n\n\n\t\t//Prepare to Begin Dispatch\n\t\t$this->_oBootstrap->beforeDispatch(self::$_oInstance, $this->_oDispatcher);\n\t\t//Dispatch\n\t\t$this->_oDispatcher->dispatch();\n\t\t//After Dispatch\n\t\t$this->_oBootstrap->afterDispatch(self::$_oInstance, $this->_oDispatcher);\n\n\t\t//Output Result\n\t\t$this->_oDispatcher->outputResult();\n\t}", "public function run(){\n\n try{\n //get the resource form route service\n $resource = $this->app['route']->match($_SERVER, $_POST); \n\n if(is_array($resource)){\n if(isset($resource['handler']))\n call_user_func_array($resource['handler'], [$resource['args'], $this->app]);\n else\n $this->controllerDispatcher($resource);\n }\n else\n throw new \\Exception(\"route not match\"); \n }\n catch(\\Exception $e){\n if($this->app->environment('PRODUCTION'))\n $this->app['view']->view('error',['message'=>$e->getMessage()]);\n else\n throw $e;\n }\n }", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "protected function startUp()\n {\n if (file_exists(APPDIR . '/Config/Bootstrap.php')) {\n try {\n include_once APPDIR . '/Config/Bootstrap.php';\n } catch (Exception $exc) {\n throw new Exception($exc->getMessage() . PHP_EOL . $exc->getTraceAsString());\n }\n }\n $config = new Config\\ParseConfig();\n $this->config = $config->getConfigData();\n System::getInstance()->configuration($this->config);\n $this->viewConfigData = new View\\ConfigData();\n\n $this->setController($this->getRequest()->getControllerName())\n ->setAction($this->getRequest()->getAction())\n ->prepareDatabase();\n $this->viewConfigData->addJavascriptFilesFromConfig();\n $this->viewConfigData->addCssFilesFromConfig();\n $this->viewConfigData->addExternalDataToView();\n }", "public function run()\n {\n $this->start = time();\n\n if (isset($_SERVER['REQUEST_METHOD'])) {\n $session = '[' . $_SERVER['REQUEST_METHOD'] . ']';\n if (isset($_SERVER['REMOTE_ADDR'])) {\n $session .= ' ' . $_SERVER['REMOTE_ADDR'];\n if (isset($_SERVER['SERVER_PORT'])) {\n $session .= ':' . $_SERVER['SERVER_PORT'];\n }\n if (isset($_SERVER['HTTP_USER_AGENT'])) {\n $session .= ' ' . $_SERVER['HTTP_USER_AGENT'];\n }\n }\n } else {\n $session = '[CLI]';\n }\n\n $this->log($session, time());\n\n // Populate necessary variables\n $route = $this->routes[strtolower($this->request->getMethod())];\n $uri = $this->getUriMatch($this->request->getRequestUri(), $route);\n $params = array();\n\n // Trigger any pre-route events\n if (null !== $this->events->get('route.pre')) {\n $this->log('[Event] Pre-Route', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('route.pre', array('project' => $this));\n\n // If still alive after 'route.pre'\n if ($this->events->alive()) {\n $this->log('Route Start', time());\n\n // Get params for the route\n if (isset($route[$uri])) {\n $params = $this->getRequestParams($uri, $route[$uri]);\n }\n\n // If the request and parameters are valid, call the assigned action\n if ($this->isValidRequest($uri) &&\n $this->isValidParams($uri, $route[$uri]['params'], $params) &&\n (count($params) == count($route[$uri]['params']))) {\n $params = $this->getRequestParams($uri, $route[$uri], $route[$uri]['asArray']);\n $method = (substr($uri, -1) == '/') ? 'index' : substr($uri, strrpos($uri, '/'));\n if (substr($method, 0, 1) == '/') {\n $method = substr($method, 1);\n }\n $this->result = call_user_func_array($this->getCallable($route[$uri]['action'], $method), $params);\n // Else, trigger the error action\n } else {\n $method = 'error';\n $error = $this->getErrorMatch($this->request->getRequestUri());\n if (isset($this->routes['error'][$error])) {\n if (!headers_sent()) {\n $this->response->setCode(404);\n $this->response->sendHeaders();\n }\n $this->result = call_user_func_array($this->getCallable($this->routes['error'][$error], 'error'), array());\n } else {\n throw new \\Pop\\Exception('Error: No error action has been defined to handle errors.');\n }\n }\n\n // Trigger any post-route events\n if (null !== $this->events->get('route.post')) {\n $this->log('[Event] Post-Route', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('route.post', array('project' => $this));\n\n // If still alive after 'route.post'\n if ($this->events->alive()) {\n // If the result is an array of data, send it to the view object and send response\n if ((null !== $this->result) && is_array($this->result)) {\n if ($this->response->getCode() == 200) {\n $viewFile = (substr($uri, -1) == '/') ? $uri . 'index.phtml' : $uri . '.phtml';\n } else {\n $viewFile = '/error.phtml';\n }\n\n // Create the view object\n $this->view = \\Pop\\Mvc\\View::factory($this->viewPath . $viewFile, $this->result);\n\n // Trigger any pre-dispatch events\n if (null !== $this->events->get('dispatch.pre')) {\n $this->log('[Event] Pre-Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch.pre', array('project' => $this));\n\n // If still alive after 'dispatch.pre'\n if ($this->events->alive()) {\n if (null !== $this->logger) {\n $this->log(\"Dispatch ['\" . ((null !== $this->controllerClass) ? $this->controllerClass : 'Callable') . \"']->\" . $method . \"\\t\" . $this->request->getRequestUri() . \"\\t\" . $this->request->getFullUri(), time());\n $this->log(\"Response [\" . $this->response->getCode() . \"]\", time());\n }\n // Set the response body and send the response\n $this->response->setBody($this->view->render(true));\n if (null !== $this->events->get('dispatch')) {\n $this->log('[Event] Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch', array('project' => $this));\n\n if (null !== $this->events->get('dispatch.send')) {\n $this->log('[Event] Dispatch Send', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->response->send();\n\n\n // Trigger any post-dispatch events\n if (null !== $this->events->get('dispatch.post')) {\n $this->log('[Event] Post-Dispatch', time(), \\Pop\\Log\\Logger::NOTICE);\n }\n $this->events->trigger('dispatch.post', array('project' => $this));\n }\n } else {\n $this->log(\"Response [\" . $this->response->getCode() . \"]\", time());\n }\n }\n }\n\n $this->log('Route End', time());\n }", "public function run(){\n $this->session->start();\n $this->request->prepareUrl();\n $this->file->require('App/index.php');\n list($controller,$method,$arguments) = $this->route->getProperRoute();\n }", "public function run() {\n\t\tforeach ( $this->filters as $hook ) {\n\t\t\tadd_filter( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );\n\t\t}\n\n\t\tforeach ( $this->actions as $hook ) {\n\t\t\tadd_action( $hook['hook'], $hook['callback'], $hook['priority'], $hook['accepted_args'] );\n\t\t}\n\t}", "public function run() {\n\t\tforeach ( $this->filters as $hook ) {\n\t\t\tadd_filter( $hook['hook'], [\n\t\t\t\t$hook['component'],\n\t\t\t\t$hook['callback']\n\t\t\t], $hook['priority'], $hook['acc_args'] );\n\t\t}\n\t\tforeach ( $this->actions as $hook ) {\n\t\t\tadd_action( $hook['hook'], [\n\t\t\t\t$hook['component'],\n\t\t\t\t$hook['callback']\n\t\t\t], $hook['priority'], $hook['acc_args'] );\n\t\t}\n\t}", "public function run()\n {\n Bouncer::allow('administrator')->everything();\n Bouncer::allow('shop-manager')->to('view', Order::class);\n Bouncer::allow('shop-manager')->to('view', Product::class);\n\n }", "public function configure() {}", "public function configure() {}", "abstract public function configure();", "public function configure() {\n\t\t}", "public function preDispatch()\n {\n // Get the instance of the front controller\n $this->_front = Zend_Controller_Front::getInstance();\n \n // Get the container from the front controller\n $this->_container = $this->_front->getParam('bootstrap')->getContainer();\n \n // Get the Zend_Config from the front container\n $this->_config = $this->_container->getConfig(); \n }", "function run() {\n global $url;\n session_start();\n\n if (class_exists('AppHelper')) {\n $url = AppHelper::validate_and_authorize($url);\n } else {\n error_log ('this app has no AppHandler defined, hence no secutiy ');\n }\n\n # Parse our 3 part URL\n # Format: controller[/action[.type][/query_string]] \n # Example: login/get/3\n # Example: login/listall.json\n list($controller, $action, $content_type, $query_string) = parse_rest_url($url);\n\n $controller = ucwords($controller).'Controller';\n $dispatch = new $controller($action, $content_type);\n\n if ((int)method_exists($controller, $action)) {\n call_user_func_array(array($dispatch,$action),array($query_string));\n } else {\n AppHelper::not_found($dispatch, $url); \n }\n}", "public function init() {\n\t\t$this->load_actions();\n\t}", "public function execute()\n\t{\t\n\t\t$this->controller = new Controller($this->path);\n\t\t$this->static_server = new StaticServer($this->path);\n\t\t\n\t\tCurrent::$plugins->hook('prePathParse', $this->controller, $this->static_server);\n\t\t\n\t\tif ( $this->static_server->isFile() )\n\t\t{\n\t\t\tCurrent::$plugins->hook('preStaticServe', $this->static_server);\n\t\t\t\n\t\t\t// Output the file\n\t\t\t$this->static_server->render();\n\t\t\t\n\t\t\tCurrent::$plugins->hook('postStaticServe', $this->static_server);\n\t\t\t\n\t\t\texit;\n\t\t}\n\t\t\n\t\t// Parse arguments from path and call appropriate command\n\t\tCowl::timer('cowl parse');\n\t\t$request = $this->controller->parse();\n\t\tCowl::timerEnd('cowl parse');\n\t\n\t\tif ( COWL_CLI )\n\t\t{\n\t\t\t$this->fixRequestForCLI($request);\n\t\t}\n\t\t\n\t\t$command = new $request->argv[0];\n\t\t\n\t\t// Set template directory, which is the command directory mirrored\n\t\t$command->setTemplateDir(Current::$config->get('paths.view') . $request->app_directory);\n\t\t\n\t\tCurrent::$plugins->hook('postPathParse', $request);\n\t\t\n\t\tCowl::timer('cowl command run');\n\t\t$ret = $command->run($request);\n\t\tCowl::timerEnd('cowl command run');\n\t\t\n\t\tCurrent::$plugins->hook('postRun');\n\t\t\n\t\tif ( is_string($ret) )\n\t\t{\n\t\t\tCowl::redirect($ret);\n\t\t}\n\t}", "public static function start()\n {\n if (self::$config === null) {\n self::$config = Config::get('routes');\n self::$mimeTypes = Config::get('mimetypes');\n }\n\n foreach (self::$config['routes'] as $route) {\n include self::$config['path'].$route.'.php';\n }\n }", "public static function run()\n\t{\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tif(substr(Request::getUri(), -1) !== '/') {\n\t\t\t\t\tif(Router::getMatchedRoute(true)) {\n\t\t\t\t\t\tself::redirect(Request::getBaseUri() . Request::getUri() . '/' . Request::getQueryString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// log the uri\n\t\t\t\tLog::out(__METHOD__ . ' URI: ' . Request::getBaseUri() . Request::getUri(), Log::LEVEL_DEBUG);\n\t\t\t\t\n\t\t\t\t// only starts output buffering in development mode\n\t\t\t\tif(!self::isDevMode()) {\n\t\t\t\t\tob_start();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$all_routes_processed = false;\n\t\t\t\t$matched_route = null;\n\t\t\t\t$offset = -1;\n\t\t\t\t\n\t\t\t\t// start searching for matched route\n\t\t\t\twhile(!$all_routes_processed) {\n\t\t\t\t\t$matched_route = Router::getMatchedRoute(false, $offset + 1);\n\t\t\t\t\t\n\t\t\t\t\tif(!$matched_route) {\n\t\t\t\t\t\tApp::notFound();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// log the pattern\n\t\t\t\t\tLog::out(__METHOD__ . ' Matched route: \"' . $matched_route->name . '\", pattern: ' . \n\t\t\t\t\t\t\t$matched_route->getPatternRegex() . ', offset: ' . \n\t\t\t\t\t\t\t$matched_route->getOffset(), Log::LEVEL_DEBUG);\n\t\t\t\t\t\n\t\t\t\t\t// log route params\n\t\t\t\t\tLog::out(__METHOD__ . \" Route params: \\n\" . print_r($matched_route->getParams(), true), \n\t\t\t\t\t\t\tLog::LEVEL_DEBUG); \n\t\t\t\t\t\n\t\t\t\t\t$offset = $matched_route->getOffset();\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tLoader::invoke($matched_route);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(BakedCarrotPassException $e) {\n\t\t\t\t\t\t$all_routes_processed = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$all_routes_processed = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!self::isDevMode()) {\n\t\t\t\t\tob_end_flush();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception $e) {\n\t\t\t\tif(self::isDevMode()) {\n\t\t\t\t\twhile(@ob_end_clean());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$classes_to_test = array(get_class($e), get_parent_class($e), 'Exception');\n\t\t\t\t$executed = false;\n\t\t\t\t\n\t\t\t\tforeach($classes_to_test as $class) {\n\t\t\t\t\tif(isset(self::$exception_handlers[$class])) {\n\t\t\t\t\t\tLoader::invokeExceptionHandler($e, self::$exception_handlers[$class]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tLog::out(__METHOD__ . ' Exception handler \"' . self::$exception_handlers[$class] . '\" invoked for class \"' . \n\t\t\t\t\t\t\t\t$class . '\"', Log::LEVEL_INFO);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$executed = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$executed) {\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\tself::$instance->handleDefaultException($e);\n\t\t}\n\t}", "public function run(): void\n {\n\n Router::processAllRoutes();\n\n (new ControlResponseCode(ObjectInitializer::$response))->trackResponseStatus();\n\n $this->toolbarInit(ObjectInitializer::$frameworkConfiguration);\n\n }", "public function configure() {\r\n\t\r\n\t}", "public function setup_actions() {}", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function setupCommandFilter()\n {\n Event::listen(CommandStarting::class, function ($event) {\n (new CommandFilterService)->handle($event);\n });\n }", "public function declare_routes(){\n\n $this->routes = \\Chocolatine\\get_configuration( 'routes' );\n $view_manager = \\Chocolatine\\get_manager('view');\n\n /**\n * Declare all route\n */\n foreach ( $this->routes as $key => $current_route) {\n\n $this->router->map(['GET', 'POST'], $current_route['route'] ,function ($request, $response, $args) {\n\n $router = \\Chocolatine\\get_service( 'Router' );\n return $router->controller( $request, $response, $args );\n\n });\n\n }\n\n }", "public function configure()\n\t{\n\t\t$this->dispatcher->connect('context.load_factories', array($this, 'loadExtraFactories'));\n\t}", "public static function preRouter(){\n\t\t\n\t}", "public function run(): void\n {\n // missing routing\n // missing proper controller/model system\n // missing middleware framework\n // hacks incoming :)\n\n self::$config['httpMethod'] = $_SERVER['REQUEST_METHOD'];\n self::$config['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n echo $this->handleRequest(self::$config['uri'] === '/' ? '/site/index' : self::$config['uri']);\n }", "public function routeStartup()\n {\n //...\n }", "public function run()\n\t{\n\t\t// Fetch routes and URL path\n\t\t$routes = $this->config()->get('app.routes');\n\t\t$path = $this->request()->getPath();\n\n\t\t$match = false;\n\n\t\t// Loop through the routes to find a match\n\t\tforeach ($routes as $route => $action) {\n\t\t\tif ($path == $route) {\n\t\t\t\t// Check for exact match of route\n\t\t\t\t$match = array('route' => $route, 'action' => $action);\n\t\t\t} else {\n\t\t\t\t// Perform pattern matching of routes against path\n\t\t\t\t$routeMatches = array();\n\t\t\t\tpreg_match_all('/:(?P<params>[a-z]+)(\\/|\\z)/', $route, $routeMatches);\n\t\t\t\t\n\t\t\t\t// Create route regex\n\t\t\t\t$regexRoute = str_replace('/', '\\/', $route);\n\t\t\t\tforeach ($routeMatches['params'] as $param) {\n\t\t\t\t\t$regexRoute = str_replace(':' . $param, '(?P<values>[a-zA-Z0-9\\-_.]+)', $regexRoute);\n\t\t\t\t}\n\t\t\t\t$regexRoute = '/^' . $regexRoute . '$/';\n\t\t\t\t\n\t\t\t\t$regexPath = array();\n\t\t\t\t// Check for match\n\t\t\t\tif (preg_match_all($regexRoute, $path, $regexPath)) {\n\t\t\t\t\t$match = array('route' => $route, 'action' => $action, 'params' => array_combine($routeMatches['params'], $regexPath['values']));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($match !== false) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($match === false) {\n\t\t\tthrow new \\Exception(\"No matching route found.\");\n\t\t} else {\n\t\t\t$match['action']($match['params']);\n\t\t}\n\t}", "protected function _initLoadRouter(){\r\n\t}", "public function init()\n {\n $this->addAction('doStuff', 'performThingA');\n $this->addAction('doMoreStuff', 'performThingB');\n }", "public function configure();", "abstract protected function configure();", "abstract protected function configure();", "public function run()\n\t{\n\n\t\t$finded = false;\n\n\t\t$method = $this->request->getMethod();\n\n\t\tforeach((array)$this->reg[ $method ] as $route=>$opts)\n\t\t{\n\t\n\t\t\t$pattern = \"/^\" . str_replace(array(\"/\", \"*\", \"%any\", \"%part\", \"%num\"), array(\"\\/\", \".*\", \"(.*)\", \"([^\\/]*)\", \"([0-9]+)\"), $route) . \"\\/?$/\";\n\n\t\t\t// echo $this->request->path();\n\t\t\t\n\t\t\tif( preg_match($pattern, $this->request->path(), $m) )\n\t\t\t{ \n\n\t\t\t\tcall_user_func_array($opts['function'], array_slice($m, 1));\n\n\t\t\t\t// TODO: implementar execucao de middlewares\n\t\t\t\tif( array_key_exists('middleware', $opts) )\n\t\t\t\t{\n\n\t\t\t\t\tforeach($opts['middleware'] as $middle_name)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$refl = new \\ReflectionClass(\"\\Coupe\\Middleware\\\\\" . $middle_name);\n\n\t\t\t\t\t\t$inst = $refl->newInstanceArgs(array($this->request));\n\n\t\t\t\t\t\t$inst();\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$finded = true;\n\t\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// TODO: fazer redirect para pagina de erro 404\n\t\tif( ! $finded )\n\t\t{\n\t\t\tthrow new \\Exception(\"Caminho não encontrado.\", 1);\n\t\t}\n\n\t\tparent::run();\n\t\t\n\t\texit(0);\n\n\t}", "public function run ()\n\t\t{\n\t\t\t$uri = $this->getURI ();\n\t\t\t\n\t\t\tforeach ($this->routes as $uriPattern => $path) \n\t\t\t{\n\n\t\t\t\tif ( preg_match ( \"~$uriPattern~\", $uri) )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$internalRoute = preg_replace(\"~$uriPattern~\", $path, $uri);\n\n\t\t\t\t\t//Определяем контроллер, action(действие), параметры\n\t\t\t\t\t$segments = explode ( '/', $internalRoute );\n\n\t\t\t\t\t$controllerName = array_shift ( $segments ) . 'Controller';\n\t\t\t\t\t$controllerName = ucfirst ( $controllerName );\n\n\t\t\t\t\t$actionName = 'action' . ucfirst ( array_shift ( $segments ) );\n\n\t\t\t\t\t$parameters = $segments;\n\t\t\t\t\t\n\n\t\t\t\t\t$controllerFile = ROOT . '/controllers/' . \n\t\t\t\t\t\t$controllerName . '.php';\n\n\t\t\t\t\t\n\t\t\t\t\tif ( file_exists ( $controllerFile ) )\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once ( $controllerFile );\n\t\t\t\t\t}\n\n\t\t\t\t\t//Create new obj, that is call need method (that is action)\n\n\t\t\t\t\t$controllerObject = new $controllerName;\n\n\t\t\t\t\t// echo $controllerName.\" \".$actionName;\n\t\t\t\t\t/**\n\t\t\t\t\t * Calling need method ($actionName) a certain class ($contollerObject)\n\t\t\t\t\t * with given ($paramets) параметрами\n\t\t\t\t\t */\n\t\t\t\t\tif(method_exists($controllerObject, $actionName)) {\n\t\t\t\t\t\t$result = call_user_func_array (\n\t\t\t\t\t\t\t array ( $controllerObject, $actionName ), \n\t\t\t\t\t\t\t $parameters \n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trequire_once ROOT . '/views/error/error404.html';\n\t\t\t\t\t}\t\n\t\t\t\n\n\t\t\t\t\t//if method of controller is successeful, finish working router\n\t\t\t\t\tif ( $result != null )\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t} \n\n\t\t\t}\n\n\t\t}", "public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}", "private function run()\n {\n $dispatcher = $this->getDispatcher(self::getConfigSection('routes'));\n\n $routeInfo = $dispatcher->dispatch(self::getRequest('method'), self::getRequest('path'));\n\n switch ($routeInfo[0]) {\n case \\FastRoute\\Dispatcher::NOT_FOUND:\n $this->errorNotFound();\n break;\n case \\FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n $this->error405();\n break;\n case \\FastRoute\\Dispatcher::FOUND:\n $this->actionParams = $routeInfo[2];\n $handler = explode('.', $routeInfo[1]);\n $this->controllerName = 'app\\controllers\\\\' . ucfirst($handler[0]) . 'Controller';\n $controllerFile = ucfirst($handler[0]) . 'Controller.php';\n $this->actionName = 'action' . ucfirst($handler[1]);\n $this->actionSlug = $handler[0] . '.' . $handler[1];\n if (!file_exists(self::$request['root_path'] . '/app/controllers/' . $controllerFile) ||\n !method_exists($this->controllerName, $this->actionName)) {\n //there is not a controller file or action name == index\n if (App::getConfig('app.debug')) {\n echo 'There is not a controller file \"' . $controllerFile . '\" or action name == index';\n }\n $this->errorNotFound();\n }\n if (isset($handler[2])) {\n //part of hangler for checking permissions\n if ($handler[2] == 'auth') {\n //need login and not logged\n if (App::isGuest()) {\n $this->redirect(App::getConfig('app.login_url'));\n }\n } else {\n //check permission for $handler[2]\n $auth = self::getComponent('auth');\n $user = self::getUser();\n $checkUser = $user ? $auth->hasAccessTo($user->email, $handler[2]) : false;\n if (!$checkUser) {\n //user does not exists or user does not have a permission\n $this->error405();\n }\n }\n }\n break;\n }\n $this->startAction();\n }", "public static function run(){\n //App_Registry::instance();\n //App_Registry::set('Controller_Abstract', new Controller_Abstract());\n\n\t\t//Load Front controller to match url\n\n //echo self::getConfig()->is_installed;\n\n if(self::getConfig()->is_installed == '0'){\n\n echo \" Running Setup \";\n new Setup();\n //echo self::getConfig()->is_installed;\n }\n\n $front = new Controller_Front();\n $frontArray = Controller_Front::match();\n }", "public function start()\n {\n try {\n $this->registerProvider(Dependents::class);\n $route = Router::match();\n $response = $this->startAction($route);\n }\n catch (\\Throwable $e) {\n $response = $this->handleException($e);\n }\n catch (\\Exception $e) {\n $response = $this->handleException($e);\n }\n\n if ($response instanceof Response) {\n $this->accept($response);\n }\n }", "public static function init() {\n\t\tself::setup_actions();\n\t}", "public static function do($container, $lazyLoad = true)\n {\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/CommandBus.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/Middleware.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/Handler/CommandHandlerMiddleware.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/Handler/CommandNameExtractor/CommandNameExtractor.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/Handler/CommandNameExtractor/ClassNameExtractor.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/Handler/Locator/HandlerLocator.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician-container/src/ContainerLocator.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/Handler/MethodNameInflector/MethodNameInflector.php';\n include_once \\dirname(__DIR__, 6).'/league/tactician/src/Handler/MethodNameInflector/HandleInflector.php';\n\n return $container->services['tactician.commandbus.default'] = new \\League\\Tactician\\CommandBus([0 => new \\League\\Tactician\\Handler\\CommandHandlerMiddleware(new \\League\\Tactician\\Handler\\CommandNameExtractor\\ClassNameExtractor(), new \\League\\Tactician\\Container\\ContainerLocator(new \\Symfony\\Component\\DependencyInjection\\Argument\\ServiceLocator($container->getService, [\n 'phpDocumentor\\\\Guides\\\\Handlers\\\\LoadCacheHandler' => ['privates', 'phpDocumentor\\\\Guides\\\\Handlers\\\\LoadCacheHandler', 'getLoadCacheHandlerService', true],\n 'phpDocumentor\\\\Guides\\\\Handlers\\\\PersistCacheHandler' => ['privates', 'phpDocumentor\\\\Guides\\\\Handlers\\\\PersistCacheHandler', 'getPersistCacheHandlerService', true],\n 'phpDocumentor\\\\Guides\\\\Handlers\\\\RenderHandler' => ['privates', 'phpDocumentor\\\\Guides\\\\Handlers\\\\RenderHandler', 'getRenderHandlerService', true],\n 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseDirectoryHandler' => ['privates', 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseDirectoryHandler', 'getParseDirectoryHandlerService', true],\n 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseFileHandler' => ['privates', 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseFileHandler', 'getParseFileHandlerService', true],\n ], [\n 'phpDocumentor\\\\Guides\\\\Handlers\\\\LoadCacheHandler' => '?',\n 'phpDocumentor\\\\Guides\\\\Handlers\\\\PersistCacheHandler' => '?',\n 'phpDocumentor\\\\Guides\\\\Handlers\\\\RenderHandler' => '?',\n 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseDirectoryHandler' => '?',\n 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseFileHandler' => '?',\n ]), ['phpDocumentor\\\\Guides\\\\LoadCacheCommand' => 'phpDocumentor\\\\Guides\\\\Handlers\\\\LoadCacheHandler', 'phpDocumentor\\\\Guides\\\\PersistCacheCommand' => 'phpDocumentor\\\\Guides\\\\Handlers\\\\PersistCacheHandler', 'phpDocumentor\\\\Guides\\\\RenderCommand' => 'phpDocumentor\\\\Guides\\\\Handlers\\\\RenderHandler', 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\ParseDirectoryCommand' => 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseDirectoryHandler', 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\ParseFileCommand' => 'phpDocumentor\\\\Guides\\\\RestructuredText\\\\Handlers\\\\ParseFileHandler']), new \\League\\Tactician\\Handler\\MethodNameInflector\\HandleInflector())]);\n }", "public function run()\n {\n /**\n * set time zone for log and message queue message body\n * @author Mustafa Zeynel Dağlı\n */\n date_default_timezone_set($this->container['settings']['time.zone']);\n \n /**\n * if rest service entry logging conf. true, publish to message queue\n * @author Mustafa Zeynel Dağlı\n */\n if($this->container['settings']['restEntry.rabbitMQ'] == true) $this->publishMessage();\n \n set_error_handler(array('\\Slim\\Slim', 'handleErrors'));\n\n //Apply final outer middleware layers\n if ($this->config('debug') ) {\n //Apply pretty exceptions only in debug to avoid accidental information leakage in production\n $this->add(new \\Slim\\Middleware\\PrettyExceptions());\n }\n \n /**\n * zeynel dağlı\n */\n if($this->container['settings']['log.level'] <= \\Slim\\Log::ERROR) {\n //print_r('--slim run kontrolor--');\n $this->add(new \\Slim\\Middleware\\PrettyExceptions());\n }\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n //print_r('--slim run kontrolor2--');\n\n //Fetch status, header, and body\n list($status, $headers, $body) = $this->response->finalize();\n\n // Serialize cookies (with optional encryption)\n \\Slim\\Http\\Util::serializeCookies($headers, $this->response->cookies, $this->settings);\n\n //Send headers\n if (headers_sent() === false) {\n //Send status\n if (strpos(PHP_SAPI, 'cgi') === 0) {\n header(sprintf('Status: %s', \\Slim\\Http\\Response::getMessageForCode($status)));\n } else {\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n }\n\n //Send headers\n foreach ($headers as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", false);\n }\n }\n }\n\n //Send body, but only if it isn't a HEAD request\n if (!$this->request->isHead()) {\n echo $body;\n }\n\n $this->applyHook('slim.after');\n\n restore_error_handler();\n }", "public function run() \n\t{\n\t\tcall_user_func_array(array(new $this->controller, $this->action), $this->params);\t\t\n\t}", "abstract protected function bootstrap();", "public static function boot()\n {\n $hooks = config('hooks');\n $actions = $hooks['actions'];\n $filters = $hooks['filters'];\n\n foreach ($actions as $action) {\n add_action($action[0], $action[1]);\n }\n\n foreach ($filters as $event => $callback) {\n add_filter($event, $callback);\n }\n }", "function run($app) {\n //check routing\n\n $list=$this->segment->get_list();\n $path=\"\";\n //remove first array because it's router\n for($route=1;$route<count($list);$route++)\n {\n $path.=\"/\".$list[$route];\n }\n\n if(count($_GET)>1) {\n $path=strstr($path,\"?\",true);\n }\n \n $path=$this->remove_end_slash($path);\n\n //init for home\n if($path==\"\") $path=\"/\";\n\n //init the route\n $route=array();\n\n //check method\n if($this->io->method==\"GET\")\n {\n $route=$this->getRoute;\n }\n else if($this->io->method==\"POST\")\n {\n $route=$this->postRoute;\n }\n else if($this->io->method==\"PUT\")\n {\n $route=$this->putRoute;\n }\n else if($this->io->method==\"DELETE\")\n {\n $route=$this->deleteRoute;\n }\n\n if(isset($route[$path]))\n {\n \n //without param / , /username\n $function=$route[$path];\n //check it's array or not\n if (is_array($function))\n {\n foreach ($function as $fun) {\n $this->callFunction($app,$fun);\n }\n }\n else {\n $functions = explode(\",\", $function);\n foreach ($functions as $fun) {\n $this->callFunction($app,$fun);\n } \n }\n \n }\n else {\n //with param /:id , /:username\n if (count($route)) {\n $this->callFunctionWithParam($app,$route,$path);\n }\n else {\n $this->load->notfound_err(\"Need to config path in config/config.php. or Path \");\n }\n }\n \n }", "public function run()\n {\n $routes = new Routes($this->router);\n $routes->start();\n $this->router->start();\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function main()\n {\n $di = $this->getDI();\n\n if (self::$isCli) {\n global $argv;\n\n $arguments = array();\n foreach ($argv as $k => $arg) {\n if ($k == 1) {\n $arguments['task'] = $arg;\n } elseif ($k == 2) {\n $arguments['action'] = $arg;\n } elseif ($k >= 3) {\n $arguments['params'][] = $arg;\n }\n }\n\n // define global constants for the current task and action\n define('CURRENT_TASK', (isset($argv[1]) ? $argv[1] : null));\n define('CURRENT_ACTION', (isset($argv[2]) ? $argv[2] : null));\n\n $this->console->handle($arguments);\n\n } else {\n // Get the 'router' service\n $this->router->handle();\n\n\n // Pass the processed router parameters to the dispatcher\n $this->dispatcher->setNamespaceName($this->router->getNamespaceName());\n $this->dispatcher->setControllerName($this->router->getControllerName());\n $this->dispatcher->setActionName($this->router->getActionName());\n $this->dispatcher->setParams($this->router->getParams());\n\n // Dispatch the request\n $controller = $this->dispatcher->dispatch();\n\n // Find the name space added directory\n $namespaceExtension = explode('Controllers\\\\', $this->router->getNamespaceName());\n $namespaceDirectory = strtolower($namespaceExtension[count($namespaceExtension)-1]);\n\n if ($namespaceDirectory != '') {\n $namespaceDirectory .= '/';\n }\n\n // Start the view\n $view = $controller->view;\n $view->start();\n\n // Render the related views\n $view->render(\n $namespaceDirectory.$this->dispatcher->getControllerName(),\n $this->dispatcher->getActionName(),\n $this->dispatcher->getParams()\n );\n\n // Finish the view\n $view->finish();\n\n $response = $controller->response;\n\n // Pass the output of the view to the response\n $response->setContent($view->getContent());\n\n // Send the request headers\n $response->sendHeaders();\n\n // Print the response\n echo $response->getContent();\n\n }\n\n exit;\n\n\n }", "public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }", "public function __construct()\n {\n $this->beforeFilter('auth');\n\n $this->beforeFilter('connStoreDB');\n\n $this->afterFilter('disconnStoreDB');\n }", "public function loadConfiguration(): void\n {\n $config = $this->getConfig() + $this->defaults;\n $this->setConfig($config);\n\n $cb = $this->getContainerBuilder();\n\n $routingFilePath = $config['routingFile'];\n $neonRoutesLoader = $cb->addDefinition($this->prefix('neonRoutesLoader'));\n $neonRoutesLoader->setClass(NeonRoutesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters), $config['autoInternalIds']]);\n\n $neonLocalesLoader = $cb->addDefinition($this->prefix('neonLocalesLoader'));\n $neonLocalesLoader->setClass(NeonLocalesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters)]);\n\n $router = $cb->addDefinition($this->prefix('router'));\n $router->setClass(Router::class)\n ->addSetup('setAsSecured', [$config['isSecured']])\n ->addSetup('setFilesExtension', [$config['extension']]);\n }", "public function run()\n {\n $column = array_column($this->routes[GlobalHelper::method()], 'path');\n $url = $this->url;\n if (str_contains($url, '?')) {\n $this->query = explode(\"?\", $url);\n $url = $this->query[0];\n }\n $validPath = array_filter($column, function ($path) use ($url) {\n $regex = $this->compileRoute($path);\n $ok = preg_match($regex, $url, $match);\n return $ok === 1 ? $path : false;\n });\n if (!empty($validPath) || $url === \"\") {\n foreach ($this->routes[GlobalHelper::method()] as $route) {\n $regex = $this->compileRoute($route->path);\n if ($route->matches($this->url, $regex)) {\n $route->execute($this);\n }\n }\n } elseif (empty($validPath)) {\n print_r(call_user_func([new \\App\\Controllers\\Error404Controller(), \"index\"], $this));\n }\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 }", "public function run()\r\n\t{\r\n\t\t// function http_build_query ($query_data, $numeric_prefix = null, $arg_separator = null, $enc_type = PHP_QUERY_RFC1738);\r\n\t\t/**\r\n\t\t * @link http://php.net/manual/en/function.http-build-query.php\r\n\t\t */\r\n\t\t$url = '/' . ((isset($_GET['param'])) ? $_GET['param'] : '');\r\n\t\t$params = array();\r\n\r\n\t\tif (!empty($url) && $url != '/') {\r\n\r\n\t\t\t$url = explode('/', $url);\r\n\t\t\tarray_shift($url);\r\n\r\n\t\t\t$currentController = $url[0] . 'Controller';\r\n\t\t\tarray_shift($url);\r\n\r\n\t\t\tif (isset($url[0])) {\r\n\t\t\t\t$currentAction = $url[0];\r\n\t\t\t\tarray_shift($url);\r\n\t\t\t} else {\r\n\t\t\t\t$currentAction = 'index';\r\n\t\t\t}\r\n\r\n\t\t\tif (count($url) > 0) {\r\n\t\t\t\t$params = $url;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif (empty($url) || $url == '/') {\r\n\t\t\t$currentController = 'homeController';\r\n\t\t\t$currentAction = 'index';\r\n\t\t}\r\n\r\n\t\trequire_once __DIR__ . 'core/Controller.php';\r\n\r\n\t\t$instanceController = new $currentController();\r\n\r\n\t\t$arrayControllerAndAction = array($instanceController, $currentAction);\r\n\r\n\t\tcall_user_func_array($arrayControllerAndAction, $params);\r\n\t}", "public function run()\n {\n $this->buildPhpContainers();\n $this->buildNginxContainer();\n $this->buildDockerCompose();\n }", "public function initialize() {\n $this->setPaths(\n [\n 'namespace' => 'ReIndex\\Controller',\n 'controller' => 'footer'\n ]);\n\n $this->setHostname(Di::getDefault()['config']['application']['domainName']);\n\n $this->addGet('/tour/', ['action' => 'tour']);\n $this->addGet('/help/', ['action' => 'help']);\n $this->addGet('/legal/', ['action' => 'legal']);\n $this->addGet('/privacy/', ['action' => 'privacy']);\n $this->addGet('/careers/', ['action' => 'career']);\n $this->addGet('/advertising/', ['action' => 'advertising']);\n $this->addGet('/contacts/', ['action' => 'contact']);\n $this->addGet('/info/', ['action' => 'info']);\n }", "public function boot() {\n\n $this->handleConfigs();\n $this->handleViews();\n $this->handleRoutes();\n $this->handleRecources();\n }", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "public function run()\r\n\t{\r\n\t\t$this->loadModule();\r\n\t\r\n\t\t$this->loadController();\r\n\t\r\n\t\t// this can be overwritten by user in controller\r\n\t\t$this->loadDefaultView();\r\n\t}", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "public static function run(): void\n {\n global $containerBuilder, $errorHandler, $config, $server, $dbi, $request;\n global $lang, $cfg, $isConfigLoading, $auth_plugin, $route, $theme;\n global $urlParams, $isMinimumCommon, $sql_query, $token_mismatch;\n\n $request = ServerRequestFactory::createFromGlobals();\n\n $route = Routing::getCurrentRoute();\n\n if ($route === '/import-status') {\n $isMinimumCommon = true;\n }\n\n $containerBuilder = Core::getContainerBuilder();\n\n /** @var ErrorHandler $errorHandler */\n $errorHandler = $containerBuilder->get('error_handler');\n\n self::checkRequiredPhpExtensions();\n self::configurePhpSettings();\n self::cleanupPathInfo();\n\n /* parsing configuration file LABEL_parsing_config_file */\n\n /** @var bool $isConfigLoading Indication for the error handler */\n $isConfigLoading = false;\n\n register_shutdown_function([Config::class, 'fatalErrorHandler']);\n\n /**\n * Force reading of config file, because we removed sensitive values\n * in the previous iteration.\n *\n * @var Config $config\n */\n $config = $containerBuilder->get('config');\n\n /**\n * include session handling after the globals, to prevent overwriting\n */\n if (! defined('PMA_NO_SESSION')) {\n Session::setUp($config, $errorHandler);\n }\n\n $request = Core::populateRequestWithEncryptedQueryParams($request);\n\n /**\n * init some variables LABEL_variables_init\n */\n\n /**\n * holds parameters to be passed to next page\n *\n * @global array $urlParams\n */\n $urlParams = [];\n $containerBuilder->setParameter('url_params', $urlParams);\n\n self::setGotoAndBackGlobals($containerBuilder, $config);\n self::checkTokenRequestParam();\n self::setDatabaseAndTableFromRequest($containerBuilder, $request);\n\n /**\n * SQL query to be executed\n *\n * @global string $sql_query\n */\n $sql_query = '';\n if ($request->isPost()) {\n $sql_query = $request->getParsedBodyParam('sql_query', '');\n }\n\n $containerBuilder->setParameter('sql_query', $sql_query);\n\n //$_REQUEST['set_theme'] // checked later in this file LABEL_theme_setup\n //$_REQUEST['server']; // checked later in this file\n //$_REQUEST['lang']; // checked by LABEL_loading_language_file\n\n /* loading language file LABEL_loading_language_file */\n\n /**\n * lang detection is done here\n */\n $language = LanguageManager::getInstance()->selectLanguage();\n $language->activate();\n\n /**\n * check for errors occurred while loading configuration\n * this check is done here after loading language files to present errors in locale\n */\n $config->checkPermissions();\n $config->checkErrors();\n\n self::checkServerConfiguration();\n self::checkRequest();\n\n /* setup servers LABEL_setup_servers */\n\n $config->checkServers();\n\n /**\n * current server\n *\n * @global integer $server\n */\n $server = $config->selectServer();\n $urlParams['server'] = $server;\n $containerBuilder->setParameter('server', $server);\n $containerBuilder->setParameter('url_params', $urlParams);\n\n $cfg = $config->settings;\n\n /* setup themes LABEL_theme_setup */\n\n $theme = ThemeManager::initializeTheme();\n\n /** @var DatabaseInterface $dbi */\n $dbi = null;\n\n if (isset($isMinimumCommon)) {\n $config->loadUserPreferences();\n $containerBuilder->set('theme_manager', ThemeManager::getInstance());\n Tracker::enable();\n\n return;\n }\n\n /**\n * save some settings in cookies\n *\n * @todo should be done in PhpMyAdmin\\Config\n */\n $config->setCookie('pma_lang', (string) $lang);\n\n ThemeManager::getInstance()->setThemeCookie();\n\n $dbi = DatabaseInterface::load();\n $containerBuilder->set(DatabaseInterface::class, $dbi);\n $containerBuilder->setAlias('dbi', DatabaseInterface::class);\n\n if (! empty($cfg['Server'])) {\n $config->getLoginCookieValidityFromCache($server);\n\n $auth_plugin = Plugins::getAuthPlugin();\n $auth_plugin->authenticate();\n\n /* Enable LOAD DATA LOCAL INFILE for LDI plugin */\n if ($route === '/import' && ($_POST['format'] ?? '') === 'ldi') {\n // Switch this before the DB connection is done\n // phpcs:disable PSR1.Files.SideEffects\n define('PMA_ENABLE_LDI', 1);\n // phpcs:enable\n }\n\n self::connectToDatabaseServer($dbi, $auth_plugin);\n\n $auth_plugin->rememberCredentials();\n\n $auth_plugin->checkTwoFactor();\n\n /* Log success */\n Logging::logUser($cfg['Server']['user']);\n\n if ($dbi->getVersion() < $cfg['MysqlMinVersion']['internal']) {\n Core::fatalError(\n __('You should upgrade to %s %s or later.'),\n [\n 'MySQL',\n $cfg['MysqlMinVersion']['human'],\n ]\n );\n }\n\n // Sets the default delimiter (if specified).\n $sqlDelimiter = $request->getParam('sql_delimiter', '');\n if (strlen($sqlDelimiter) > 0) {\n // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps\n Lexer::$DEFAULT_DELIMITER = $sqlDelimiter;\n }\n\n // TODO: Set SQL modes too.\n } else { // end server connecting\n $response = ResponseRenderer::getInstance();\n $response->getHeader()->disableMenuAndConsole();\n $response->getFooter()->setMinimal();\n }\n\n $response = ResponseRenderer::getInstance();\n\n /**\n * There is no point in even attempting to process\n * an ajax request if there is a token mismatch\n */\n if ($response->isAjax() && $request->isPost() && $token_mismatch) {\n $response->setRequestStatus(false);\n $response->addJSON(\n 'message',\n Message::error(__('Error: Token mismatch'))\n );\n exit;\n }\n\n Profiling::check($dbi, $response);\n\n $containerBuilder->set('response', ResponseRenderer::getInstance());\n\n // load user preferences\n $config->loadUserPreferences();\n\n $containerBuilder->set('theme_manager', ThemeManager::getInstance());\n\n /* Tell tracker that it can actually work */\n Tracker::enable();\n\n if (empty($server) || ! isset($cfg['ZeroConf']) || $cfg['ZeroConf'] !== true) {\n return;\n }\n\n /** @var Relation $relation */\n $relation = $containerBuilder->get('relation');\n $dbi->postConnectControl($relation);\n }", "public static function run() {\n if(self::$_init) {\n $route = static::requestRoute();\n if($route && $controller = static::createController($route['controller'])) {\n /** session started */\n App::sessionStart();\n /** running application */\n try {\n /* @var Controller $controller */\n $controller->run($route['action']);\n } catch (\\Exception $e) {\n static::error500('', \"Exception: [{$e->getMessage()}] in {$e->getFile()} at #{$e->getLine()}.\");\n }\n /** on success */\n static::end();\n } else {\n static::error404('Requested invalid resource.');\n }\n } else {\n static::error500('Application was not set up.');\n }\n }", "public function execute() {\n\t\t$controller = $this->manager->get($this->getController());\n\t\t$reflection = new \\ReflectionClass($controller);\n\t\t$controller->run( $this->getAction($reflection) );\n\t}", "protected function initContainer(): void\n {\n // reserve some ids\n $this->reserveObject('config', $this->getConfig());\n $this->reserveObject('container', $this->delegator);\n\n // resolve all objects defined in di.services\n $this->autoResolve();\n\n // resolve all object referenced in the $config\n $tree = $this->getConfig()->getTree();\n $settings = &$tree->get('');\n $this->deReference($settings);\n }", "function Inject() {\n\t\t$CI =& get_instance();\n\t\tif (file_exists($file = 'application/controllers/' . $CI->router->class . '.php')) { // Found the controller\n\t\t\tforeach ($this->Scan($file, $CI->router->method) as $alias => $attribs)\n\t\t\t\t$this->Load($alias, $attribs);\n\t\t}\n\t}", "public function preExecute()\n {\n $this->getContext()->getConfiguration()->loadHelpers(array('Url', 'sfsCurrency'));\n \n if ($this->getActionName() == 'index') {\n $this->checkOrderStatus();\n }\n }", "function execute()\n\t{\t\n\t\t// Check for requested action\n\t\t$app_action = isset($_REQUEST['ax']) ? $_REQUEST['ax'] : 'startup_view';\n\t\t\n\t\tif(method_exists($this,$app_action))\n\t\t{\n\t\t\t// Call requested action\n\t\t\t$this->$app_action();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->default_action($app_action);\n\t\t}\n\t}", "protected function loadRoutesForConsoleKernel(): void\n {\n $consoleRoutes = $this->getCliRoutesFromContainers();\n\n foreach ($consoleRoutes as $route){\n require $route;\n }\n }", "public function start()\n {\n $this->registerDefaultServices();\n\n $this->handle($this->request->createFromGlobals());\n }", "public function initAndDispatch() {\n\t\treturn $this->initTypoScriptFrontendController()\n\t\t\t->initTypoScriptConfiguration()\n\t\t\t->initLanguage()\n\t\t\t->initCallArguments()\n\t\t\t->dispatch();\n\t}", "protected function configure()\n {\n\n \n }", "public function startup(): void\n {\n $this->handleOnBootListeners();\n $this->initialize();\n $this->handleOnRunListeners();\n }", "public function startup(): void\n {\n $this->handleOnBootListeners();\n $this->initialize();\n $this->handleOnRunListeners();\n }", "public function initialize()\n {\n $configs = \\Phpfox::get('router.provider')->loadConfigs();\n\n $this->phrases = $configs['phrases'];\n\n foreach ($configs['chains'] as $v) {\n\n if (!isset($v['chain'])) {\n throw new InvalidArgumentException(var_export($v, 1));\n }\n $key = $v['chain'];\n unset($v['chain']);\n if (!isset($this->routes[$key])) {\n $this->routes[$key] = new Routing($key, null);\n }\n $this->routes[$key]->chain($this->build($v));\n }\n\n foreach ($configs['routes'] as $key => $v) {\n if (strpos($key, '.')) {\n list($group) = explode('.', $key, 2);\n $this->routes[$group]->add(new Routing($key, $this->build($v)));\n } else {\n $this->routes[$key] = new Routing($key, $this->build($v));\n }\n }\n }", "function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}", "public function run() {\n //Matcher holen und request matchen\n $matcher = $this->routerContainer->getMatcher();\n $this->route = $matcher->match($this->request);\n\n //404 handler\n if (!$this->route) {\n return ControllerFactory::get(\"notfound\", $this->request)->render();\n }\n\n try {\n //home route\n if ($this->route->name == \"home\") {\n return ControllerFactory::get(\"index\", $this->request)->render();\n }\n\n if (isset($this->route->attributes[\"controller\"])) {\n $controller = ControllerFactory::get($this->route->attributes[\"controller\"], $this->request);\n } else {\n $controller = ControllerFactory::get($this->getControllerName($this->route->name), $this->request);\n }\n\n $controller->setMap($this->map);\n $controller->setRouter($this->route);\n $controller->init();\n\n switch ($this->route->name) {\n case 'ajax_default':\n $controller->ajax($this->route->attributes[\"action\"]);\n break;\n case 'get_default':\n $controller->get($this->route->attributes[\"action\"]);\n break;\n case 'post_default':\n $controller->post($this->route->attributes[\"action\"]);\n break;\n case 'controller_default_route':\n break;\n default:\n $method = $this->routes[$this->route->name][\"method\"];\n if (isset($this->routes[$this->route->name][\"action_param\"])) {\n $action = $this->route->attributes[$this->routes[$this->route->name][\"action_param\"]];\n //dynamically call the matching method\n $controller->$method($action);\n }\n }\n\n return $controller->render();\n } catch (FatalException $e) {\n /** @var Fatal $fatal_error */\n $fatal_error = ControllerFactory::get(\"fatal\", $this->request);\n $fatal_error->setException($e);\n return $fatal_error->render();\n }\n }", "protected function preReRouting()\n {\n\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->filter('before', 'orchestra::auth');\n\t\t\n\t\tEvent::fire('orchestra.started: backend');\n\t}", "public function init() {\n $config_array = $this->config->toArray();\n $prev_role = null;\n\n foreach ($config_array as $role => $permissions) {\n $prev_role = $this->addUserRole($role, $prev_role);\n \n if(empty($permissions) || !is_array($permissions)) {\n continue;\n }\n \n foreach($permissions as $controller => $actionList) {\n $controller = $this->addController($controller);\n $priviliges = $this->getPriviliges($actionList);\n \n $this->allow($role, $controller, $priviliges);\n } \n }\n }" ]
[ "0.61726075", "0.61593646", "0.6149375", "0.6096763", "0.5918048", "0.5865856", "0.5852307", "0.5843395", "0.58000326", "0.573982", "0.57176256", "0.56821084", "0.5680621", "0.5648291", "0.5616235", "0.5594341", "0.55915487", "0.55893785", "0.55826694", "0.5574651", "0.5570673", "0.5553221", "0.555315", "0.55455536", "0.5533256", "0.5514609", "0.5507391", "0.55059475", "0.55059475", "0.5504431", "0.54919446", "0.54783124", "0.54780954", "0.5475031", "0.5472874", "0.5469109", "0.54681253", "0.5458455", "0.545574", "0.5447564", "0.54466844", "0.5437019", "0.54200625", "0.54188484", "0.5417768", "0.5414534", "0.5408319", "0.5378237", "0.5376735", "0.5368911", "0.5367438", "0.53647095", "0.53647095", "0.5363556", "0.53612316", "0.5355623", "0.5354698", "0.53533995", "0.53417665", "0.5328409", "0.5326539", "0.53159034", "0.5311864", "0.5308111", "0.5305522", "0.5304472", "0.5298191", "0.52980655", "0.52970695", "0.52850425", "0.528191", "0.5281328", "0.5274474", "0.5273079", "0.52727354", "0.52714205", "0.52681655", "0.52599144", "0.52555543", "0.5255495", "0.5254945", "0.52443874", "0.52431035", "0.52386576", "0.5231692", "0.52135277", "0.521115", "0.52094585", "0.5207126", "0.520691", "0.51946956", "0.5192797", "0.5192431", "0.5192431", "0.5191377", "0.5189931", "0.51868004", "0.51867324", "0.51854587", "0.51831096" ]
0.6424706
0
Run the database seeds.
public function run() { $permiso = new Permission(); $permiso->name='Administer roles & permissions'; $permiso->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
Load the member list view
function index(){ $data['kategori'] = $this->m_berita->ambilDataKategori()->result(); $data['judul'] = "Kelola Berita"; $data['surname'] = "Berita"; $this->load->view('berita/index',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function members_list() {\n\t\tif (!in_array($this->type, $this->membership_types)) {\n\t\t\tredirect(base_url('members/list/active'));\n\t\t}\n\n\t\t$data['type'] = ($this->type === NULL)? 'active': $this->type;\n\t\t$data['user_mode'] = $this->session->userdata('mode');\n\t\t$data['members'] = $this->get_members($this->type);\n\t\t$data['api_ver_url'] = FINGERPRINT_API_URL . \"?action=verification&member_id=\";\n\t\t$data['total_count'] = count($this->get_members($this->type));\n\n\t\t$this->breadcrumbs->set([ucfirst($data['type']) => 'members/list/' . $data['type']]);\n\n\t\tif ($this->type === 'guest') {\n\t\t\t$data['guests'] = $this->get_guests();\n\t\t}\n\n\t\t$this->render('list', $data);\n\t}", "public function loadMembers() {\n if(!$this->id) return;\n\n $list = $this->getClient()->getDmMembers($this->id);\n\n if($list) $this->members = $list;\n }", "function index()\n {\n $data = $this->member->load_member();\n $container = array();\n $container ['data'] = $data;\n $this->load->view('admin_member',$container);\n }", "public function showMembers() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get all of the members from the db.\n $included_members = $memberModel->getAll();\n $data = array(\"included_members\" => $included_members);\n return $this->render(\"listMembers\", $data);\n }", "public function members(){\n\t\t\t$this->load->view(\"group_members\") ;\n\t\t}", "public function loadMembers()\n {\n /*\n * we assume the members-array is always filled\n */\n if (!empty($this->members) && !($this->members[0] instanceof User)) {\n $response = Helper::get('group/'.$this->unique_id);\n if (isset($response->body['result']['members'])) {\n $this->setMembers($response->body['result']['members']);\n }\n }\n }", "public function listMembers() {\n\t\t/*\n\t\t\tActions should be added to the array like so:\n\t\t\t\t[actions] =>\n\t\t\t\t\t\t[n]\n\t\t\t\t\t\t\t[title] => action title\n\t\t\t\t\t\t\t[controller] => action controller\n\t\t\t\t\t\t\t[action] => action name\n\t\t\t\t\t\t\t[params] => array of params\n\t\t*/\n\t\t$this->__paginateMemberList($this->Member->getMemberSummaryAll(true));\n\t}", "public function index()\n {\n return view('dashboard.members.index', [\n 'data' => Members::latest()->get(),\n 'memtypes' => MemberType::latest()->get()\n ]);\n }", "function admin_member_view() {\n\t\t$this->layout = 'admin';\n\t\t\n\t\t$this->set(\"parentClass\", \"selected\"); //set main navigation class\n\t\t\n\t\t\n\t\tif (isset($this->data)) {\n\t\t\t$this->Session->write('prntview.email', $this->data['Member']['email']);\n\t\t\t$this->Session->write('prntview.active', $this->data['Member']['active']);\n\t\t\t$this->Session->write('prntview.group_id', $this->data['Member']['group_id']);\n\t\t\t$this->Session->write('prntview.perpage', $this->data['Member']['perpage']);\n\t\t\t\n\t\t\t$this->data['Member']['email'] = $this->Session->read('prntview.email');\n\t\t\t$this->data['Member']['active'] = $this->Session->read('prntview.active');\n\t\t\t$this->data['Member']['group_id'] = $this->Session->read('prntview.group_id');\n\t\t\t$this->data['Member']['perpage'] = $this->Session->read('prntview.perpage');\n\t\t\t\n\t\t} else {\n\t\t\t$this->Session->delete('prntview');\n\t\t}\n\t\t\n\t\tif (strlen($this->Session->read('prntview.perpage')) > 0) {\n\t\t\t$this->data['Member']['perpage'] = $this->Session->read('prntview.perpage');\n\t\t} else {\n\t\t\t$this->data['Member']['perpage'] = 10;\n\t\t}\t\t\n\t\t\n\t\t/*echo '<pre>';\n\t\tprint_r($this->data);\n\t\tdie;*/\n\t\t\n\t\t\n\t\t\n\t\t$this->paginate['Member'] = array(\n\t\t\t'conditions' => array(\n\t\t\t\t'AND' => array(\n\t\t\t\t\t'Member.email LIKE' => \"%\" . $this->data['Member']['email'] . \"%\",\n\t\t\t\t\t'Member.active LIKE' => \"%\" . $this->data['Member']['active'] . \"%\",\n\t\t\t\t\t'Member.group_id LIKE' => \"%\" . $this->data['Member']['group_id'] . \"%\"\n\t\t\t\t)\n\t\t\t),\n\t\t\t'limit' => $this->data['Member']['perpage']\n\t\t);\n\t\t\n\t\t\n\t\t$alldata = $this->State->find('all'); //retireve all states\n\t\t$states = Set::combine($alldata, '{n}.State.state_code', '{n}.State.state_name');\n\t\t//$cities = Set::combine($alldata,'{n}.State.id','{n}.State.city');\n\t\t$this->set(\"states\", $states);\n\t\t//$this->set(\"cities\",$cities);\n\t\t\n\t\t\n\t\t/*$this->paginate = array(\n\t\t'limit' => 2\n\t\t);\n\t\t*/\n\t\t\n\t\t$members = $this->paginate('Member');\n\t\t\n\t\t$this->set('members', $members);\n\t\t//pr($members); die;\n\t\t\n\t\t\n\t\tif ($this->RequestHandler->isAjax()) {\n\t\t\t$this->layout = '';\n\t\t\tConfigure::write('debug', 0);\n\t\t\t$this->AutoRender = false;\n\t\t\t$this->viewPath = 'elements' . DS . 'adminElements' . DS . 'members';\n\t\t\t$this->render('members');\n\t\t}\n\t\t\n\t\t\n\t}", "function showMemberList()\r\n\t{\r\n\t\tglobal $skin;\r\n\t\tglobal $title;\r\n\t\tglobal $codex;\r\n\t\t$count=0;\r\n\t\t$start=\"users/\";\r\n\r\n\t\techo \"<div class='barre'>\";\r\n\t\techo \" <a class='barreLien' href='index.php' title='Index'>\". $title . \"</a> | \".$GLOBALS['l_menuMembers'];\r\n\t\techo \"</div>\";\r\n\r\n\t\techo \"<table border='0' cellpadding='0' cellspacing='0' width='100%'>\\n\";\r\n\t\techo \"<tr>\\n\";\r\n\t\techo \" <td class='col1tp' width='55%'>\".$GLOBALS['l_profUsername'].\"</td>\\n\";\r\n\t\techo \" <td class='col2tp' width='15%'>\".$GLOBALS['l_profLang'].\"</td>\\n\";\r\n\t\techo \" <td class='col3tp' width='15%'>\".$GLOBALS['l_profSkin'].\"</td>\\n\";\r\n\t\techo \" <td class='col4tp' width='15%'>\".$GLOBALS['l_getPosts'].\"</td>\\n\";\r\n\t\techo \"</tr>\\n\";\r\n\t\t$members=$codex->select_where(\"users\");\r\n\t\t\r\n\t\t\r\n\t\tforeach($members as $member)\r\n\t\t{\t\r\n\r\n\t\t\t\t\t\techo \"<tr>\\n <td class='filler' colspan='4'>\\n</td>\\n</tr>\\n\";\r\n\t\t\t\t\t\techo \"<tr valign='top'>\";\r\n\r\n\t\t\t\t\t\t// Username\r\n\t\t\t\t\t\techo \"<td class='col1bt'>\\n\";\r\n\t\t\t\t\t\techo \" <a class='topicLink' href='profile.php?action=view&amp;uname=\" .$member[\"username\"]. \"'>\" .$member[\"username\"]. \"</a>\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\t// Lang\r\n\t\t\t\t\t\techo \"<td class='col2bt'>\\n\";\r\n\t\t\t\t\t\techo $member[\"language\"].\"\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\t// Skin\r\n\t\t\t\t\t\techo \"<td class='col3bt'>\\n\";\r\n\t\t\t\t\t\techo $member[\"skin\"].\"\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\t// Num posts\r\n\t\t\t\t\t\techo \"<td class='col4bt'>\\n\";\r\n\t\t\t\t\t\tif (file_exists(\"users/\".$member[\"username\"].\".hits\")) echo getFile(\"users/\".$member[\"username\"].\".hits\") . \"\\n\";\r\n\t\t\t\t\t\telse echo \" -\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\techo \"</tr>\\n\";\r\n\t\t\t\t\t\techo \"<tr valign='top'>\\n\";\r\n\r\n\t\t\t\t\t\t// Statement\r\n\t\t\t\t\t\techo \"<td class='coltxt' colspan='4'>\\n\";\r\n\t\t\t\t\t\techo \" <em>\".$member[\"statement\"].\"&nbsp;</em>\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\t\t\t\t\t\t\r\n\t\t}\t\t\r\n\t\t\techo \"<tr>\\n <td class='filler' colspan='4'>\\n</td>\\n</tr>\\n\";\r\n\t\t\r\n\t\t\r\n\t\techo \"</table>\";\r\n\t}", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "public function display_all()\n {\n if ( ! file_exists(APPPATH.'views/pages/list.php'))\n {\n // Whoops, we don't have a page for that!\n show_404();\n }\n if (!isset($this->session->userdata['user_role']) || $this->session->userdata['user_role'] < 40)\n {\n $this->session->set_flashdata('message', 'Vous devez avoir les droits de superviseur');\n redirect($_SERVER['HTTP_REFERER']); \n } \n \n $data['title'] = 'Liste des Membres'; // Capitalize the first letter\n $data['membres'] = $this->member_model->get_member();\n\n // breadcrumb\n $data['breadcrumbs'] = $this->breadcrumbs('liste');\n \n $this->load->template('pages/list_members',$data);\n }", "public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}", "function index() { \n\t\t$this->set('members', $this->User->getProvinceMembers($this->user['User']['province'], $this->user['User']['province_number']));\n\t\t$this->set('user', $this->user);\n\t}", "public function index()\n {\n $data = Members::orderBy('member_positions')->get();\n return view('admin.members.index',['data'=>$data]);\n }", "public function index()\n {\n $member = Member::all()->toArray();die();\n return view('members.index',compact('member'));\n }", "function admin_member_view() {\n\t\t$this->layout = 'admin';\n\t\t\n\t\t$this->set(\"parentClass\", \"selected\"); //set main navigation class\n\t\t\n\t\t\n\t\tif (!$this->RequestHandler->isAjax() && !isset($this->data)) {\n\t\t\t$this->Session->delete('prntview');\n\t\t}\n\t\t\n\t\tif (isset($this->data)) {\n\t\t\t$this->Session->write('prntview.email', trim($this->data['Member']['email']));\n\t\t\t$this->Session->write('prntview.active', $this->data['Member']['active']);\n\t\t\t$this->Session->write('prntview.group_id', $this->data['Member']['group_id']);\n\t\t\t$this->Session->write('prntview.perpage', $this->data['Member']['perpage']);\n\t\t\t\n\t\t\t$this->data['Member']['email'] = $this->Session->read('prntview.email');\n\t\t\t$this->data['Member']['active'] = $this->Session->read('prntview.active');\n\t\t\t$this->data['Member']['group_id'] = $this->Session->read('prntview.group_id');\n\t\t\t$this->data['Member']['perpage'] = $this->Session->read('prntview.perpage');\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$this->data['Member']['email'] = $this->Session->read('prntview.email');\n\t\t\t$this->data['Member']['active'] = $this->Session->read('prntview.active');\n\t\t\t$this->data['Member']['group_id'] = $this->Session->read('prntview.group_id');\n\t\t\t$this->data['Member']['perpage'] = $this->Session->read('prntview.perpage');\n\n\t\t}\n\t\t\n\t\tif (strlen($this->Session->read('prntview.perpage')) > 0) {\n\t\t\t$this->data['Member']['perpage'] = $this->Session->read('prntview.perpage');\n\t\t} else {\n\t\t\t$this->data['Member']['perpage'] = 10;\n\t\t}\t\t\n\t\t\n\t\t\n\t\tif(!empty($this->data['Member']['email']) || !empty($this->data['Member']['active']) || !empty($this->data['Member']['group_id']) )\n\t\t{\n\t\t\t$this->paginate['Member'] = array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'AND' => array(\n\t\t\t\t\t\t'Member.email LIKE' => \"%\" . $this->data['Member']['email'] . \"%\",\n\t\t\t\t\t\t'Member.active LIKE' => \"%\" . $this->data['Member']['active'] . \"%\",\n\t\t\t\t\t\t'Member.group_id LIKE' => \"%\" . $this->data['Member']['group_id'] . \"%\"\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'limit' => $this->data['Member']['perpage']\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->paginate['Member'] = array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'AND' => array(\n\t\t\t\t\t\t'Member.active !=' => 0\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'limit' => $this->data['Member']['perpage']\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t$alldata = $this->State->find('all'); //retireve all states\n\t\t$states = Set::combine($alldata, '{n}.State.state_code', '{n}.State.state_name');\n\t\t//$cities = Set::combine($alldata,'{n}.State.id','{n}.State.city');\n\t\t$this->set(\"states\", $states);\n\t\n\t\t\n\t\t$members = $this->paginate('Member');\n\t\t\n\t\t$this->set('members', $members);\n\t\t//pr($members); die;\n\t\t\n\t\t\n\t\tif ($this->RequestHandler->isAjax()) {\n\t\t\t$this->layout = '';\n\t\t\tConfigure::write('debug', 0);\n\t\t\t$this->AutoRender = false;\n\t\t\t$this->viewPath = 'elements' . DS . 'adminElements' . DS . 'members';\n\t\t\t$this->render('members');\n\t\t}\n\t\t\n\t\t\n\t}", "function lihat_profil($id_member){\n $this->member->id_member = $id_member;\n $data = $this->member->load_member();\n $container = array();\n $container ['data'] = $data;\n $this->load->view('admin_lihat_profil',$container);\n }", "public function index()\n {\n $members = Member::all();\n\n\n return View('members/index')->with(compact('members'));\n\n }", "public function index()\n {\n $result['data']=member::all();\n return view('admin.memberlist',$result);\n }", "public function index()\n {\n $data['member'] = Member::all();\n return view('admin.member.index', $data);\n }", "public function index()\n {\n\n // $rs=DB::table('tb_members')->get();\n $rs=DB::table('tb_members')->orderBy('id','desc')->paginate(1);\n return view('pages.member.list-member',['rs'=>$rs]);\n \n }", "public function index()\n {\n //\n $members = Member::paginate(10);\n return view('member.master')->with('members', $members);\n }", "public function index()\n {\n $context = [\n 'members' => Member::all(),\n ];\n return view('member.index', $context);\n }", "public function index()\n {\n $members = Members::all();\n return view('members.index', ['members' => $members]);\n\n }", "function showData(){\n $members= Member::all();\n return view('Showpage', compact('members'));\n }", "public function show(members $members)\n {\n //\n }", "public function index()\n {\n return view('admin.membership', ['users' => User::with('membership')->has('membership')->orderBy('birth_date')->get()]);\n }", "public function index()\n {\n $members = Member::all();\n return view('member.index')->with('members', $members);\n }", "public function showMembersObject()\n\t{\n\t\tglobal $tree, $ilObjDataCache, $tpl, $ilTabs;\n\n\t\t$tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.forums_members_list.html', 'Modules/Forum');\n\n\t\t$ilTabs->setTabActive('settings');\n\t\t$this->settingsTabs();\n\t\t// instantiate the property form\n\t\tif(!$this->initNotificationSettingsForm())\n\t\t{\n\t\t\t// if the form was just created set the values fetched from database\n\t\t\t$this->notificationSettingsForm->setValuesByArray(array(\n\t\t\t\t'notification_type' => $this->objProperties->getNotificationType(),\n\t\t\t\t'adm_force' => (bool)$this->objProperties->isAdminForceNoti(),\n\t\t\t\t'usr_toggle' => (bool)$this->objProperties->isUserToggleNoti()\n\t\t\t));\n\t\t}\n\n\t\t// set form html into template\n\t\t$tpl->setVariable('NOTIFICATIONS_SETTINGS_FORM', $this->notificationSettingsForm->getHTML());\n\n\t\tinclude_once 'Modules/Forum/classes/class.ilForumNotification.php';\n\t\tinclude_once 'Modules/Forum/classes/class.ilObjForum.php';\n\n\t\t$frm_noti = new ilForumNotification($_GET['ref_id']);\n\n\t\t// check if there a parent-node is a grp or crs\n\t\t$grp_ref_id = $tree->checkForParentType((int)$_GET['ref_id'], 'grp');\n\t\t$crs_ref_id = $tree->checkForParentType((int)$_GET['ref_id'], 'crs');\n\n\t\t//if($parent_type == 'grp')\n\t\tif($grp_ref_id > 0)\n\t\t{\n\t\t\t$parent_obj = ilObjectFactory::getInstanceByRefId($grp_ref_id);\n\t\t\tinclude_once 'Modules/Group/classes/class.ilGroupParticipants.php';\n\t\t\t$oParticipants = ilGroupParticipants::_getInstanceByObjId(\n\t\t\t$parent_obj->getId());\n\t\t}\n\t\telse\n\t//\tif($parent_type == 'crs')\n\t\tif($crs_ref_id > 0)\n\t\t{\n\t\t\t$parent_obj = ilObjectFactory::getInstanceByRefId($crs_ref_id);\n\n\t\t\tinclude_once 'Modules/Course/classes/class.ilCourseParticipants.php';\n\t\t\t$oParticipants = ilCourseParticipants::_getInstanceByObjId(\n\t\t\t$parent_obj->getId());\n\t\t}\n\n\t\t$moderator_ids = $frm_noti->_getModerators($_GET['ref_id']);\n\n\t\t$admin_ids = $oParticipants->getAdmins();\n\t\t$member_ids = $oParticipants->getMembers();\n\t\t$tutor_ids = $oParticipants->getTutors();\n\n\t\t$moderators = array();\n\t\t$admins = array();\n\t\t$members = array();\n\t\t$tutors = array();\n\n\t\tif($this->objProperties->getNotificationType() == 'default')\n\t\t{\n\t\t\t// update forum_notification table\n\t\t\tinclude_once './Modules/Forum/classes/class.ilForumNotification.php';\n\t\t\t$forum_noti = new ilForumNotification($this->ref_id);\n\t\t\t$forum_noti->setAdminForce($this->objProperties->isAdminForceNoti());\n\t\t\t$forum_noti->setUserToggle($this->objProperties->isUserToggleNoti());\n\t\t\t$forum_noti->setForumId($this->objProperties->getObjId());\n\n\t\t\tif($_POST['notification_type'] == 'default')\n\t\t\t{\n\t\t\t\t// delete all notifications set by admin\n\t\t\t\t$forum_noti->deleteNotificationAllUsers();\n\t\t\t}\n\t\t}\n\t\telse if($this->objProperties->getNotificationType() == 'per_user')\n\t\t{\n\t\t\t$counter = 0;\n\t\t\tforeach($moderator_ids as $user_id)\n\t\t\t{\n\t\t\t\t$frm_noti->setUserId($user_id);\n\t\t\t\t$admin_force_noti = $frm_noti->isAdminForceNotification();\n\t\t\t\t$user_toggle_noti = $frm_noti->isUserToggleNotification();\n\t\t\t\t$icon_ok = $this->getIcon(!$user_toggle_noti);\n\n\t\t\t\t$moderators[$counter]['user_id'] = ilUtil::formCheckbox(0, 'user_id[]', $user_id);\n\t\t\t\t$moderators[$counter]['login'] = ilObjUser::_lookupLogin($user_id);\n\t\t\t\t$name = ilObjUser::_lookupName($user_id);\n\t\t\t\t$moderators[$counter]['firstname'] = $name['firstname'];\n\t\t\t\t$moderators[$counter]['lastname'] = $name['lastname'];\n\t\t\t\t$moderators[$counter]['user_toggle_noti'] = $icon_ok;\n\t\t\t\t$counter++;\n\t\t\t}\n\n\t\t\t$counter = 0;\n\t\t\tforeach($admin_ids as $user_id)\n\t\t\t{\n\t\t\t\t$frm_noti->setUserId($user_id);\n\t\t\t\t$admin_force_noti = $frm_noti->isAdminForceNotification();\n\t\t\t\t$user_toggle_noti = $frm_noti->isUserToggleNotification();\n\t\t\t\t$icon_ok = $this->getIcon(!$user_toggle_noti);\n\n\t\t\t\t$admins[$counter]['user_id'] = ilUtil::formCheckbox(0, 'user_id[]', $user_id);\n\t\t\t\t$admins[$counter]['login'] = ilObjUser::_lookupLogin($user_id);\n\t\t\t\t$name = ilObjUser::_lookupName($user_id);\n\t\t\t\t$admins[$counter]['firstname'] = $name['firstname'];\n\t\t\t\t$admins[$counter]['lastname'] = $name['lastname'];\n\t\t\t\t$admins[$counter]['user_toggle_noti'] = $icon_ok;\n\t\t\t\t$counter++;\n\t\t\t}\n\n\t\t\t$counter = 0;\n\t\t\tforeach($member_ids as $user_id)\n\t\t\t{\n\t\t\t\t$frm_noti->setUserId($user_id);\n\t\t\t\t$admin_force_noti = $frm_noti->isAdminForceNotification();\n\t\t\t\t$user_toggle_noti = $frm_noti->isUserToggleNotification();\n\t\t\t\t$icon_ok = $this->getIcon(!$user_toggle_noti);\n\n\t\t\t\t$members[$counter]['user_id'] = ilUtil::formCheckbox(0, 'user_id[]', $user_id);\n\t\t\t\t$members[$counter]['login'] = ilObjUser::_lookupLogin($user_id);\n\t\t\t\t$name = ilObjUser::_lookupName($user_id);\n\t\t\t\t$members[$counter]['firstname'] = $name['firstname'];\n\t\t\t\t$members[$counter]['lastname'] = $name['lastname'];\n\t\t\t\t$members[$counter]['user_toggle_noti'] = $icon_ok;\n\t\t\t\t$counter++;\n\t\t\t}\n\n\t\t\t$counter = 0;\n\t\t\tforeach($tutor_ids as $user_id)\n\t\t\t{\n\n\t\t\t\t$frm_noti->setUserId($user_id);\n\t\t\t\t$admin_force_noti = $frm_noti->isAdminForceNotification();\n\t\t\t\t$user_toggle_noti = $frm_noti->isUserToggleNotification();\n\t\t\t\t$icon_ok = $this->getIcon(!$user_toggle_noti);\n\n\t\t\t\t$tutors[$counter]['user_id'] = ilUtil::formCheckbox(0, 'user_id[]', $user_id);\n\t\t\t\t$tutors[$counter]['login'] = ilObjUser::_lookupLogin($user_id);\n\t\t\t\t$name = ilObjUser::_lookupName($user_id);\n\t\t\t\t$tutors[$counter]['firstname'] = $name['firstname'];\n\t\t\t\t$tutors[$counter]['lastname'] = $name['lastname'];\n\t\t\t\t$tutors[$counter]['user_toggle_noti'] = $icon_ok;\n\t\t\t\t$counter++;\n\t\t\t}\n\n\t\t\t$this->__showMembersTable($moderators, $admins, $members, $tutors);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$frm_noti = new ilForumNotification($_GET['ref_id']);\n\t\t\t$all_notis = $frm_noti->read();\n\n\t\t\tforeach($member_ids as $user_id)\n\t\t\t{\n\t\t\t\t$frm_noti->setUserId($user_id);\n\n\t\t\t\t$frm_noti->setAdminForce(1);\n\t\t\t\t$frm_noti->setUserToggle($this->objProperties->isUserToggleNoti());\n\n\t\t\t\tif(array_key_exists($user_id, $all_notis))\n\t\t\t\t{\n\t\t\t\t\t$res = $frm_noti->update();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$res = $frm_noti->insertAdminForce();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function showlist($famid){\n\t\tMisc::isfam_valid($famid,\"Show\");\n\n\t\t$members = Person::where('family_id','=',$famid)->get(['id','family_id','name','nickname','city','state','country','image','gender','deadoralive']);\t \t\n\t \t\n\t\t$sql = \"select A.id, B.relative_id, A.name , B.relation, C.name as relname \n\t\t\t from persons A, relations B, persons C\n\t\t\t where A.id = B.person_id \n\t\t\t and C.id = B.relative_id\n\t\t\t and (B.person_id = :id or B.relative_id = :id2) \" ;\n\n\t\tforeach ($members as $key => $member) {\n\t\t\tif($member->image != null) {\n\t\t \t\t$member->image = $member->id .\"f\".$member->family_id.\".\".$member->image ;\n\t\t \t} \n\t\t\t$member->name = $this->getfullname($member->id, $member->name, $member->nickname) ;\n\t \t\t$relatives = \\DB::select($sql, ['id' => $member->id, 'id2' => $member->id]) ; \t\t\n\t \t\t$member->relative = \"\";\n\t \t\t$member->relation = \"\" ;\n\t \t\tif($relatives[0]->id == $member->id){\n\t \t\t\t$member->relative = $relatives[0]->relname ;\n\t \t\t\t$member->relation = Misc::get_relation_in_mylang($relatives[0]->relation) ; \t\t\t\n\t \t\t} else{\n\t \t\t\t$member->relative = $relatives[0]->name ;\n\t \t\t\t$member->relation = Misc::get_revrelation_in_mylang($relatives[0]->relation,$member->gender); \t\t\t\n\t \t\t}\n\t\t\t\n\t\t}\n\t\treturn view('list', compact('members','famid'));\n\t}", "public function ListView()\n\t{\n\t\tif($this->GetCurrentUser())\n\t\t{\t\t\t\t\t\t\n\t\t\t//require 'translate/en.php';\n\t\t\t$lang=file_get_contents('libs/translate/en.php');\n\t\t\t$this->Assign(\"currentUser\", $this->GetCurrentUser());\n\t\t\t$this->Assign(\"lang\",$lang);\n\t\t\t$this->Render();\n\t\t}else{\t\t\t\n\t\t\t$this->Render('Login');\t\n\t\t}\n\t}", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "public function listview() {\n\n $photo_list = Doctrine::getTable('Photo')->findAll();\n $data['photo_list'] = $photo_list;\n\n $data['view_name'] = \"photo_list_view\";\n $this->load->view(\"admin/common/template\", $data);\n }", "public function index()\n {\n $members = Member::all();\n\n return view('member.index', compact('members'));\n }", "function Members_List_user_view($args)\n{\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n list($startnum, $sortby, $searchby) = pnVarCleanFromInput('startnum', 'sortby', 'searchby');\n\n // User functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\t\n\t// Set some defaults\n if (empty($sortby)) {\n $sortby = 'uname';\n }\n\n $letter = pnVarCleanFromInput('letter');\n if (empty($letter)) {\n $letter = _ALL;\n }\n\n if (empty($startnum)) {\n $startnum = 1;\n }\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Members_List');\n\n // get some permissions to use in the cache id and later to filter template output\n if ( pnSecAuthAction(0, 'Users::', '::', ACCESS_DELETE) ) {\n $edit=1; $delete=1;\n } elseif ( pnSecAuthAction(0, 'Users::', '::', ACCESS_EDIT) ) {\n $edit=1; $delete=0;\n } else {\n $edit=0; $delete=0;\n }\n\n\t// set the cache id\n\t$pnRender->cache_id = md5((int)$edit.(int)$delete.$startnum.$letter.$sortby);\n\t\n\t// check out if the contents are cached.\n\t// If this is the case, we do not need to make DB queries.\n\t// Note that we print out \"cached:\" in front of a chached output --\n\t// of course, this is here to illustrate caching and needs to be removed!\n\tif ($pnRender->is_cached('memberslist_user_view.htm')) {\n\t return $pnRender->fetch('memberslist_user_view.htm');\n\t}\n\n // get the number of users to show per page from the module vars\n $itemsperpage = pnModGetVar('Members_List', 'memberslistitemsperpage');\n\n // The API function is called. The arguments to the function are passed in\n // as their own arguments array\n $reguserscount = pnModAPIFunc('Members_List',\n 'user',\n 'countitems');\n $regusersonline = pnModAPIFunc('Members_List',\n 'user',\n 'getregisteredonline');\n $latestreguser = pnModAPIFunc('Members_List',\n 'user',\n 'getlatestuser');\n\n //output users online\n $pnRender->assign('memberslistreg', $reguserscount);\n\t$pnRender->assign('memberslistonline', $regusersonline);\n\t$pnRender->assign('memberslistnewest', pnUserGetVar('uname',$latestreguser));\n\n // get full list of user id's\n $users = pnModAPIFunc('Members_List',\n 'user',\n 'getall',\n array('letter' => $letter,\n 'sortby' => $sortby,\n 'searchby' => $searchby,\n 'startnum' => $startnum,\n 'numitems'=> $itemsperpage));\n\n $userscount = pnModAPIFunc('Members_List',\n 'user',\n 'countitems',\n\t array('letter' => $letter));\n\n // Is current user online\n\t$pnRender->assign('loggedin', pnUserLoggedIn());\n\n\t// check if we should show the extra admin column\n $pnRender->assign('adminedit', $edit);\n $pnRender->assign('admindelete', $delete);\n\n $pagedusers = array();\n foreach($users as $userid) {\n\n $user = pnUserGetVars($userid['uid']);\n $isonline = pnModAPIFunc('Members_List',\n 'user',\n 'isonline',\n array('userid' => $userid['uid']));\n\n // is this user online\n if ($isonline){\n $user['onlinestatus'] = 1;\n } else {\n $user['onlinestatus'] = 0;\n }\n\n // filter out any dummy url's\n if(!$user['url'] or $user['url']==\"http://\" or $user['url']==\"http:///\" ) {\n $user['url'] = '';\n }\n\n\t\t// add user to results array\n $pagedusers[] = $user;\n }\n $pnRender->assign('users', $pagedusers);\n\n // Assign the values for the smarty plugin to produce a pager in case of there\n // being many items to display.\n //\n // Note that this function includes another user API function. The\n // function returns a simple count of the total number of items in the item\n // table so that the pager function can do its job properly\n\t$pnRender->assign('pager', array('numitems' => pnModAPIFunc('Members_List', 'user', 'countitems', array('letter' => $letter)),\n\t 'itemsperpage' => pnModGetVar('Members_List', 'memberslistitemsperpage')));\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('memberslist_user_view.htm');\n\n}", "public function indexAction()\n {\n $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n $subject = Engine_Api::_()->core()->getSubject();\n\t$this->view->user = $user = $subject->getOwner();\n\tif (!$user)\n\t{\n\t\treturn $this->setNoRender();\n\t}\n\n // Get subject and check auth\n if( !$user->authorization()->isAllowed($viewer, 'view') ) {\n return $this->setNoRender();\n }\n\n // Member type\n $fieldsByAlias = Engine_Api::_()->fields()->getFieldsObjectsByAlias($user);\n\n if( !empty($fieldsByAlias['profile_type']) )\n {\n $optionId = $fieldsByAlias['profile_type']->getValue($user);\n if( $optionId ) {\n $optionObj = Engine_Api::_()->fields()\n ->getFieldsOptions($user)\n ->getRowMatching('option_id', $optionId->value);\n if( $optionObj ) {\n $this->view->memberType = $optionObj->label;\n }\n }\n }\n\n // Networks\n $select = Engine_Api::_()->getDbtable('membership', 'network')->getMembershipsOfSelect($user)\n ->where('hide = ?', 0);\n $this->view->networks = Engine_Api::_()->getDbtable('networks', 'network')->fetchAll($select);\n \n // Friend count\n $this->view->friendCount = $user->membership()->getMemberCount($user);\n }", "function action_listview() {\n\t\t$this->view = 'toplist';\n\t\t//$GLOBALS['log']->fatal('in controller');\n\t\t$this->bean = new REG_PatientListView();\n\t}", "public function index() {\r\n $data['data'] = $this->MemberModel->getData(3); //executes function from model returns rexcord set\r\n $this->load->view('MemberView', $data); //directs and passes data from the databse to the view\r\n }", "function list_view()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '优惠券列表';\n $this->global['pageName'] = 'coupon';\n $data['searchStatus'] = '0';\n\n $this->loadViews(\"coupon\", $this->global, $data, NULL);\n }\n }", "function list_view()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $data = '';\n $this->global['pageTitle'] = '轮播图列表';\n $this->global['pageName'] = 'carousel';\n\n $this->loadViews(\"carousel\", $this->global, $data, NULL);\n }\n }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "function members() {\n $results = null;\n pagination::init()->paginator('SELECT * FROM `users` ORDER BY `id` DESC', null, 20, 5, null);\n $results .= '<div class=\"members-header\">Members</div>';\n $results .= '<div class=\"members-content\">';\n if(pagination::init()->count() > 0):\n foreach(pagination::init()->result() as $user):\n $results .= '('.$user->id.') - '.sanitize($user->username).'<hr class=\"members-list-hr\"/>';\n endforeach;\n endif;\n $results .= '</div>';\n $results .= '<div class=\"members-content-pagination\">'.pagination::init()->links().'</div>';\n return $results;\n }", "public function index()\n {\n return MembersResource::collection(Member::latest()->get());\n }", "public function indexAction()\n {\n if (($this->target->type == 'NET') && isset($this->network) && $this->network->open && !(isset($this->network->nm_active) && $this->network->nm_active)) {\n $network_members = new network_models_members();\n \n $network_members->insert(array(\n 'network_id' => $this->target->id,\n 'member_profile_id' => $this->member->profile->id,\n 'status' => 't')\n );\n }\n \n $this->_autoredirect($this->target->pre . '/');\n }", "function show_list() {\n\t\tif(!has_permission(3)) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('global/dashboard');\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->output_head['function'] = __FUNCTION__;\n\n\t\t$this->output_head['style_extras'] = array(assets_url() . '/plugins/datatables/dataTables.bootstrap.css');\n\t\t$this->output_head['js_extras'] = array(assets_url() . '/plugins/datatables/jquery.dataTables.min.js',\n\t\t\t\t\t\t\t\t\t\t\t\tassets_url() . '/plugins/datatables/dataTables.bootstrap.min.js');\n\t\t$this->output_head['js_function'] = array();\n\t\t$this->load->model('user_model');\n\t\t\n\t\t$this->load->view('global/header', $this->output_head);\n\t\t\n\t\t$this->output_data['title'] = 'Users Manager';\n\t\t$this->load->view('users', $this->output_data);\n\t\t$this->load->view('global/footer');\n\t}", "public function getIndex()\n {\n return view('pages.members');\n }", "public function listView()\r\n {\r\n $data['roles'] = $this->AdminRoleModel->getAll();\r\n $firstRoleId = isset($data['roles'][0]['role_id']) ? $data['roles'][0]['role_id'] : '';\r\n $data['permissions'] = $this->AdminRoleModel->getPermissions($firstRoleId);\r\n echo $this->load->view('admin/roles/list', $data, TRUE);\r\n }", "public function selectMember() {\n $data['dormitories'] = $this->common->getAllData('dormitory');\n $this->load->view('temp/header');\n $this->load->view('selectMember', $data);\n $this->load->view('temp/footer');\n }", "public function index()\n {\n $users = User::orderBy('id', 'desc')->paginate(20);\n $cats = Cat::all();\n \n return view('admin.member', [\n 'users' => $users,\n 'cats' => $cats,\n ]);\n }", "public function viewMemberAction()\n {\n $users = $this->getDoctrine()\n ->getManager()\n ->getRepository('BlogBundle:Membres')\n ->findAll();\n\n return array('users' => $users);\n }", "function getMemberList() {\n return getAll(\"SELECT * FROM member \");\n}", "public function index()\n {\n //\n return view('member');\n }", "public function loadForView();", "public function index()\n {\n $roles = Role::all();\n $users = User::simplePaginate();\n\n return view('dashboard.members', compact('users', 'roles'));\n }", "public function index()\n {\n return view('superadmin.member.index');\n }", "public function display_all_supervisor()\n {\n \n if ( ! file_exists(APPPATH.'views/pages/list.php'))\n {\n // Whoops, we don't have a page for that!\n show_404();\n }\n if (!isset($this->session->userdata['user_role']) || $this->session->userdata['user_role'] < 50)\n {\n $this->session->set_flashdata('message', 'Vous devez avoir les droits d\\'administrateur');\n redirect($_SERVER['HTTP_REFERER']); \n } \n \n $data['title'] = 'Liste des superviseurs'; // Capitalize the first letter\n $data['membres'] = $this->member_model->get_by_type('name = \"Superviseur\"');\n \n // breadcrumb\n $data['breadcrumbs'] = $this->breadcrumbs('liste');\n \n $this->load->template('pages/list_members',$data);\n }", "public function membres()\n {\n $this->membres = $this->Member->list($_SESSION['guild_id']);\n }", "public function show(UserList $list)\n {\n \n }", "public function show(Member $member)\n {\n //\n }", "public function show(Member $member)\n {\n //\n }", "public function show(Member $member)\n {\n //\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "function culturefeed_pages_manage_members_list(CultureFeed_Cdb_Item_Page $page, CultureFeed_Pages_UserList $user_list, $cf_user = NULL) {\n\n // Get all the uid's in 1 time. Otherwise the theming layer will search it 1 by 1.\n culturefeed_get_uids_for_memberships($user_list->memberships);\n\n $header = array(\n t('Name'),\n t('Function'),\n t('Role'),\n t('Member since'),\n '',\n '',\n );\n\n // Count how many admins.\n $admins = array();\n foreach ($user_list->memberships as $member) {\n if ($member->role == CultureFeed_Pages_Membership::MEMBERSHIP_ROLE_ADMIN) {\n $admins[] = $member;\n }\n }\n $total_admins = count($admins);\n\n $rows = array();\n // Create row for every member.\n foreach ($user_list->memberships as $member) {\n\n $row = array();\n\n $name = '';\n $depiction = !empty($member->user->depiction) ? $member->user->depiction : 'http://media.uitid.be/fis/rest/download/ce126667652776f0e9e55160f12f5478/uiv/default.png';\n $name = '<span class=\"depiction\">' . theme('image', array('path' => $depiction . '?width=30&height=30&crop=auto')) . '</span>';\n $drupal_uid = culturefeed_get_uid_for_cf_uid($member->user->id, $member->user->nick);\n $name .= l($member->user->nick, 'user/' . $drupal_uid);\n\n $row['name'] = $name;\n\n // Show the user data.\n if (empty($cf_user) || $cf_user->id != $member->user->id) {\n\n $row['function'] = $member->relation;\n switch ($member->role) {\n case CultureFeed_Pages_Membership::MEMBERSHIP_ROLE_ADMIN:\n $role = t('administrator');\n break;\n case CultureFeed_Pages_Membership::MEMBERSHIP_ROLE_MEMBER:\n default:\n $role = t('member');\n break;\n }\n $row['role'] = $role;\n $row['member_since'] = date('d/m/Y H:i', $member->creationDate);\n $row['edit'] = l(t('Edit'), 'pages/' . $page->getId() . '/membership/' . $member->user->id . '/edit/nojs', array('attributes' => array('class' => 'use-ajax')));\n\n if ($total_admins == 1 && $member->role == CultureFeed_Pages_Membership::MEMBERSHIP_ROLE_ADMIN) {\n $row['delete'] = theme('culturefeed_pages_membership_delete_not_possible', array('page' => $page));\n }\n else {\n $delete_options = array(\n 'attributes' => array(\n 'role' => 'button',\n 'data-toggle' => 'modal',\n 'data-target' => '#page_confirm',\n 'data-remote' => url('pages/' . $page->getId() . '/membership/' . $member->user->id . '/delete/ajax'),\n ),\n );\n $row['delete'] = l(t('Remove as member'), 'pages/' . $page->getId() . '/membership/' . $member->user->id . '/delete/nojs', $delete_options);\n }\n }\n // Show the edit form.\n else {\n\n $form = drupal_get_form('culturefeed_pages_edit_membership_form', $page, $cf_user, $user_list);\n $row['function'] = array(\n 'data' => render($form),\n 'colspan' => 2,\n );\n $row['member_since'] = date('d/m/Y H:i', $member->creationDate);\n $row['cancel'] = array(\n 'data' => l(t('Cancel changes'), 'pages/' . $page->getId() . '/members/nojs', array('attributes' => array('class' => 'use-ajax'))),\n 'colspan' => 2,\n );\n\n }\n\n $rows[] = array('data' => $row, 'id' => 'member-' . $member->user->id);\n\n }\n\n return array(\n '#theme' => 'table',\n '#header' => $header,\n '#rows' => $rows,\n '#empty' => t('No content available.'),\n '#attached' => array('library' => array(array('system', 'drupal.ajax'))),\n '#prefix' => '<div id=\"manage-members\">',\n '#suffix' => '</div>',\n );\n\n}", "public function list ()\n {\n if (User::isLoggedIn() && User::getLoggedInUser()->is_admin === true) {\n\n // Alle User aus der DB laden\n $users = User::all();\n\n // Passenden View laden und User übergeben\n View::load('admin/users', [\n 'users' => $users\n ]);\n } else {\n \n // Wenn kein User eingeloggt ist, dann leider wir auf die Login Seite \n header(\"Location: login\");\n }\n }", "public function index() {\n\t\t$this->set('memberStatusInfo', $this->Member->Status->getStatusSummaryAll());\n\t\t$this->set('memberTotalCount', $this->Member->getCount());\n\n\t\t$this->Nav->add('Register Member', 'members', 'register');\n\t\t$this->Nav->add('E-mail all current members', 'members', 'emailMembersWithStatus', array( Status::CURRENT_MEMBER ) );\n $this->Nav->add('Upload CSV', 'bankTransactions', 'uploadCsv' );\n $this->Nav->add('Audit Members', 'auditMembers', 'audit');\n\t}", "public function index()\n {\n $members = Ahli::latest()->take(15)->get();\n\n return view('members.keahlian.index', compact('members'));\n }", "public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}", "protected function loadView()\n {\n }", "protected function loadView()\n {\n }", "public function listMembres() {\n\t\t$membreManager = $this->membreManager;\n\t\t$membres = $membreManager->listMembres();\n\t\t$success = ( isset( $_SESSION['success'] ) ? $_SESSION['success'] : null );\n\t\t$error = ( isset( $_SESSION['error'] ) ? $_SESSION['error'] : null );\n\t\t$myView = new View( 'listmembres' );\n\t\t$myView->renderView( array( 'membres' => $membres, 'success' => $success, 'error' => $error ) );\n\t}", "public function indexAction() {\r\n // members : getFrontProfiles\r\n $_SESSION['current'] = 'members';\r\n $this->members = $this->getMembers(); //give data to view\r\n $_SESSION['members'] = $this->members;\r\n }", "function list_view()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '订单管理';\n $this->global['pageName'] = 'order';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n $data['searchStatus'] = '0';\n $data['searchMethod'] = '0';\n\n $this->loadViews(\"order_manage/order\", $this->global, $data, NULL);\n }\n }", "public function index()\n {\n $memberSidebar = array(\n 'transaction_menu' => 'transaction-open',\n 'transaction_link' => 'transaction-active',\n 'contract_menu' => 'contract-open',\n 'contract_link' => 'contract-active',\n 'member_link' => 'member-open',\n );\n\n $members = Member::all();\n\n return view('member.index')\n ->with('members', $members)\n ->with($memberSidebar);\n\n }", "public function memberList($eid = 1) {\n $config = $this->config('simple_conreg.settings.'.$eid);\n $countryOptions = SimpleConregOptions::memberCountries($eid, $config);\n $types = SimpleConregOptions::badgeTypes($eid, $config);\n $digits = $config->get('member_no_digits');\n\n switch(isset($_GET['sort']) ? $_GET['sort'] : '') {\n case 'desc':\n $direction = 'DESC';\n break;\n default:\n $direction = 'ASC';\n break;\n }\n switch(isset($_GET['order']) ? $_GET['order'] : '') {\n case 'Name':\n $order = 'name';\n break;\n case 'Country':\n $order = 'country';\n break;\n case 'Type':\n $order = 'badge_type';\n break;\n default:\n $order = 'member_no';\n break;\n }\n\n $content = array();\n\n //$content['#markup'] = $this->t('Unpaid Members');\n\n $content['message'] = array(\n '#cache' => ['tags' => ['simple-conreg-member-list'], '#max-age' => 600],\n '#markup' => $this->t('Members\\' public details are listed below.'),\n );\n\n $rows = [];\n $headers = [\n 'member_no' => ['data' => t('Member No'), 'field' => 'm.member_no', 'sort' => 'asc'],\n 'member_name' => ['data' => t('Name'), 'field' => 'name'],\n 'badge_type' => ['data' => t('Type'), 'field' => 'm.badge_type', 'class' => [RESPONSIVE_PRIORITY_LOW]],\n 'member_country' => ['data' => t('Country'), 'field' => 'm.country', 'class' => [RESPONSIVE_PRIORITY_MEDIUM]],\n ];\n $total = 0;\n\n foreach ($entries = SimpleConregStorage::adminPublicListLoad($eid) as $entry) {\n // Sanitize each entry.\n $badge_type = trim($entry['badge_type']);\n $member_no = sprintf(\"%0\".$digits.\"d\", $entry['member_no']);\n $member = ['member_no' => $badge_type . $member_no];\n switch ($entry['display']) {\n case 'F':\n $fullname = trim(trim($entry['first_name']) . ' ' . trim($entry['last_name']));\n if ($fullname != trim($entry['badge_name']))\n $fullname .= ' (' . trim($entry['badge_name']) . ')';\n $member['name'] = $fullname;\n break;\n case 'B':\n $member['name'] = trim($entry['badge_name']);\n break;\n case 'N':\n $member['name'] = t('Name withheld');\n break;\n }\n $member['badge_type'] = trim(isset($types[$badge_type]) ? $types[$badge_type] : $badge_type);\n $member['country'] = trim(isset($countryOptions[$entry['country']]) ? $countryOptions[$entry['country']] : $entry['country']);\n\n // Set key to field to be sorted by.\n if ($order == 'member_no')\n $key = $member_no;\n else\n $key = $member[$order] . $member_no; // Append member number to ensure uniqueness.\n if (!empty($entry['display']) && $entry['display'] != 'N' && !empty($entry['country'])) {\n $rows[$key] = $member;\n }\n $total++;\n }\n\n // Sort array by key.\n if ($direction == 'DESC')\n krsort($rows);\n else\n ksort($rows);\n\n $content['table'] = array(\n '#type' => 'table',\n '#header' => $headers,\n //'#footer' => array(t(\"Total\")),\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n\n $content['summary_heading'] = [\n '#markup' => $this->t('Country Breakdown'),\n '#prefix' => '<h2>',\n '#suffix' => '</h2>',\n ];\n\n $rows = array();\n $headers = array(\n t('Country'),\n t('Number of members'),\n );\n $total = 0;\n foreach ($entries = SimpleConregStorage::adminMemberCountrySummaryLoad($eid) as $entry) {\n if (!empty($entry['country'])) {\n // Sanitize each entry.\n $entry['country'] = trim($countryOptions[$entry['country']]);\n $rows[] = $entry;\n $total += $entry['num'];\n }\n }\n //Add a row for the total.\n $rows[] = array(t(\"Total\"), $total);\n $content['summary'] = array(\n '#type' => 'table',\n '#header' => $headers,\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n // Don't cache this page.\n //$content['#cache']['max-age'] = 0;\n\n return $content;\n }", "function list()\n {\n if($this->checkAccess('permission.list') == 1)\n {\n $this->loadAccessRestricted();\n }\n else\n { \n \n $data['permissionRecords'] = $this->permission_model->permissionListing();\n \n $this->global['pageTitle'] = 'School : Permission Listing';\n \n $this->loadViews(\"permission/list\", $this->global, $data, NULL);\n }\n }", "public function loadFriendsList() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"Friends List\");\n\t\t$friends = $this -> user -> getContactManager() -> getFriends();\n\t\t$table = \"\";\n\t\t$online = array();\n\t\t$offline = array();\n\t\tforeach($friends as $friend) {\n\t\t\t$owner = User::getByName($friend);\n\t\t\tif (!$owner) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!$owner -> isOnline()) {\n\t\t\t\t$offline[$owner -> getUid()] = $owner;\n\t\t\t} else {\n\t\t\t\t$online[$owner -> getUid()] = $owner;\n\t\t\t}\n\t\t}\n\t\tforeach ($online as $owner) {\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\"> World \" . $owner -> getLastWorld() . \"</td></tr>\";\n\t\t}\n\t\tforeach ($offline as $owner) {\n\t\t\t$table .= \"<tr class=\\\"offline\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style='color: #9fabbf; '>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">Offline</td></tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t$table = \"You don't have any friends in your contact list. Add friends in-game for them to appear here.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"user\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}", "public function index() {\n $data['person_list'] = $this->person_db->get_people_by_admin_id($this->admin_lib->admin_id);\n $data['admin_id'] = $this->admin_lib->admin_id;\n $this->load->view(\"layout/header\", $data);\n $this->load->view(\"p_list/index\", $data);\n $this->load->view(\"layout/footer\");\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}", "function view_perm_users()\n\t{\n\t\t//-----------------------------------------\n\t\t// Check for a valid ID\n\t\t//-----------------------------------------\n\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $perms = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get all members using that ID then!\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Сведения о пользователе\" , \"50%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Действие\" , \"50%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= \"<script language='javascript' type='text/javascript'>\n\t\t\t\t\t\t <!--\n\t\t\t\t\t\t function pop_close_and_stop( id )\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \topener.location = \\\"{$this->ipsclass->base_url}&section=content&act=mem&code=doform&mid=\\\" + id;\n\t\t\t\t\t\t \tself.close();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t //-->\n\t\t\t\t\t\t </script>\";\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Используется пользователями: \" . $perms['perm_name'] );\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, email, posts, org_perm_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'members',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"(org_perm_id IS NOT NULL AND org_perm_id != '')\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'name' ) );\n\t\t$outer = $this->ipsclass->DB->simple_exec();\n\n\t\twhile( $r = $this->ipsclass->DB->fetch_row($outer) )\n\t\t{\n\t\t\t$exp_pid = explode( \",\", $r['org_perm_id'] );\n\n\t\t\tforeach( explode( \",\", $r['org_perm_id'] ) as $pid )\n\t\t\t{\n\t\t\t\tif ( $pid == $this->ipsclass->input['id'] )\n\t\t\t\t{\n\t\t\t\t\tif ( count($exp_pid) > 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$extra = \"<li>Также используются: <em style='color:red'>\";\n\n\t\t\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id IN (\".$this->ipsclass->clean_perm_string($r['org_perm_id']).\") AND perm_id <> {$this->ipsclass->input['id']}\" ) );\n\t\t\t\t\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t\t\t\t\twhile ( $mr = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extra .= $mr['perm_name'].\",\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$extra = preg_replace( \"/,$/\", \"\", $extra );\n\n\t\t\t\t\t\t$extra .= \"</em>\";\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$extra = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<div style='font-weight:bold;font-size:11px;padding-bottom:6px;margin-bottom:3px;border-bottom:1px solid #000'>{$r['name']}</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <li>Сообщений: {$r['posts']}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <li>Email: {$r['email']}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $extra\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"&#149;&nbsp;<a href='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=remove_mask&amp;id={$r['id']}&amp;pid=$pid' title='Удалить эту маску доступа у пользователя (без удаления других масок доступа)'>Удалить эту маску</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <br />&#149;&nbsp;<a href='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=remove_mask&amp;id={$r['id']}&amp;pid=all' title='Удалить все дополнительные маски'>Удалить все дополнительные маски</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <br /><br />&#149;&nbsp;<a href='javascript:pop_close_and_stop(\\\"{$r['id']}\\\");'>Изменить пользователя</a>\",\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}\n\t\t\t}\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->print_popup();\n\t}", "public function membershipIndex()\n {\n return view('membership');\n }", "public function listView(): void\n {\n $this->_data = $this->_entity->fetch();\n if (!$this->special) {\n $newData = $this->_builder->submitCreate();\n if ($newData) {\n array_push($this->_data, $newData);\n }\n }\n require VF . \"{$this->route}/list.php\";\n require VF . \"{$this->route}/create.php\";\n }", "public function memberlist() {\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Usermodel->countAll();\n\t\t$jTableResult['Records'] = $this->Usermodel->ListAll($this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}", "public function viewMembers()\n {\n\n //get approved members\n $members = Member::where('approved', '1')\n ->with('position', 'status')\n ->orderBy('created_at', 'desc')\n ->get();\n\n //get pending members\n $Pmembers = Member::where('approved', '0')\n ->orderBy('created_at', 'desc')\n ->with('position', 'status')\n ->get();\n //Calculate number of days to automatically set status value to alumni\n $today = Carbon::today();\n foreach($members as $member)\n {\n $joined = Carbon::parse($member->created_at);\n $difference = $joined->diffInMonths($today, false);\n\n //Check the difference\n if($difference >= 7 AND $member->status_id == '2')\n {\n $member->fill([\n 'status_id' => '4'\n ]);\n $member->save();\n\n $member->status_id;\n }elseif ($difference >= 7 AND $member->status_id == '1')\n {\n $member->fill([\n 'status_id' => '3'\n ]);\n $member->save();\n\n $member->status_id;\n }\n }\n\n //Return members view\n return view('members.viewMembers')\n ->with(['members' => $members, 'Pmembers' => $Pmembers]);\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Member manager';\n\t\t$view = 'admin/character/index';\n\t\t$data_level = Model_Level::get_level();\n\t\t$data = array(\n\t\t\t'data_level' => $data_level,\n\t\t);\n\t\t$this->template->content = View::forge($view, $data);\n\t}", "public function show_active_members()\n\t\t{\n\t\t\t$users = new User();\n\t\t\t$memberships = new Booking_membership();\n\t\t\t$data['memberships'] =$memberships->get();\n\t\t\t$data['results'] = $users->get();\n\t\t\t$data['current_page'] = 'booking_memberships';\n\t\t\t$data['current_child_page'] = 'booking_membership_orders';\n $this->load->view('backend/show_active_members',$data); \n\t\t}", "public function getMemberList() {\n\t\tif ( !is_object($this->memberList) ) {\n\t\t\t$this->memberList = t3lib_div::makeInstance('tx_passwordmgr_model_groupMemberList');\n\t\t\t$this->memberList->init($this['uid']);\n\t\t}\n\t\treturn($this->memberList);\n\t}", "public function index()\n {\n $users = (new User)->findAll();\n $title = 'Liste des membres';\n\n $data = compact('title', 'users');\n\n return $this->view('user/list', $data);\n\t}", "public function indexAction()\n \t{\n\t $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\n\t if( !Engine_Api::_()->core()->hasSubject() ) {\n\t return $this->setNoRender();\n\t }\n\t\n\t // Get subject and check auth\n\t $this->view->user = $subject = Engine_Api::_()->core()->getSubject('user');\n\t if( !$subject->authorization()->isAllowed($viewer, 'view') ) {\n\t return $this->setNoRender();\n\t }\n\t\n\t // Member type\n\t $subject = Engine_Api::_()->core()->getSubject();\n\t $fieldsByAlias = Engine_Api::_()->fields()->getFieldsObjectsByAlias($subject);\n\t\n\t if( !empty($fieldsByAlias['profile_type']) )\n\t {\n\t $optionId = $fieldsByAlias['profile_type']->getValue($subject);\n\t if( $optionId ) {\n\t $optionObj = Engine_Api::_()->fields()\n\t ->getFieldsOptions($subject)\n\t ->getRowMatching('option_id', $optionId->value);\n\t if( $optionObj ) {\n\t $this->view->memberType = $optionObj->label;\n\t }\n\t }\n\t }\n\t \n\t // Friend count\n\t $select = $subject->membership()->getMembersSelect();\n\t $paginator = Zend_Paginator::factory($select);\n\t $this->view->friendCount = $paginator -> getTotalItemCount();\n\t\t\n\t\t// Following count\n\t $select = $subject->membership()->getMembersOfSelect();\n\t\t$paginator = Zend_Paginator::factory($select);\n\t\t\n\t\t$memTable = Engine_Api::_() -> getDbTable('membership', 'advgroup');\n\t\t$select = $memTable -> select() -> from($memTable -> info (\"name\")) -> where('user_id = ?', $subject -> getIdentity()) -> where('active = 1');\n\t\t$clubs = Zend_Paginator::factory($select);\n\t\t\t\n\t\t$this -> view -> followingCount = $paginator -> getTotalItemCount() + $clubs -> getTotalItemCount();\n\t\t\n\t\t// Get professional user verified\n\t\t$slverifyTbl = Engine_Api::_()->getItemTable('slprofileverify_slprofileverify');\n\t $verifyRow = $slverifyTbl->getVerifyInfor($subject->getIdentity());\n\t if($verifyRow->approval == 'verified')\n\t {\n\t $settingsCore = Engine_Api::_()->getApi('settings', 'core');\n\t $photo_badge = $settingsCore->getSetting('sl_verify_badge', 0);\n\t $this->view->src_img = $src_img = Engine_Api::_()->slprofileverify()->getPhotoVerificaiton($photo_badge, null, 'pBadge');\n\t }\n\n\t\t// get preferred clubs\n\t\t$userGroupMappingTable = Engine_Api::_() -> getDbTable('groupmappings', 'user');\n\t\t$groupMappings = $userGroupMappingTable -> getGroupByUser($subject -> getIdentity(), 10);\n\t\t\n\t\t$groups = array();\n\t\tforeach($groupMappings as $groupMapping){\n\t\t\t\t$group_id = $groupMapping -> group_id;\n\t\t\t\t$group = Engine_Api::_() -> getItem('group', $group_id);\n\t\t\t\tif($group) {\n\t\t\t\t\t$groups[] = $group;\n\t\t\t\t}\n\t\t }\n\t\t$this -> view -> clubs = $groups;\n\t\t\n\t\t$this -> view -> sports = $subject->getSports();\n\t}", "public function addMember(){\n\t\t\t\n\t\t\t$this->load->view('addMember') ;\n\t\t}", "public function modload()\n\t{\n\t\tmodules::init_module( 'cs_list', self::MOD_VERSION, self::MOD_AUTHOR, 'chanserv', 'default' );\n\t\t// these are standard in module constructors\n\t\t\n\t\tchanserv::add_help( 'cs_list', 'help', &chanserv::$help->CS_HELP_LIST_1, true );\n\t\tchanserv::add_help( 'cs_list', 'help list', &chanserv::$help->CS_HELP_LIST_ALL, true );\n\t\t// add the help\n\t\t\n\t\tchanserv::add_command( 'list', 'cs_list', 'list_command' );\n\t\t// add the list command\n\t}", "public static function list() {\n $subscribers = Subscriber::findAll();\n\n // 2. Return/include de la view\n include( __DIR__ . '/../views/subscribers/list.php');\n}", "function Members_List_user_main()\n{\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing. \n if (!pnSecAuthAction(0, 'Members_List::', '::', ACCESS_READ)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Members_List');\n\n\t// since we're caching the view function based on a number of factors\n\t// we musn't cache the output here\n\t$pnRender->caching=false;\n\n // redirect to initial function\n $pnRender->assign('main', pnModFunc('Members_List', 'user', 'view'));\n\t\n // Return the output that has been generated by this function\n return $pnRender->fetch('memberslist_user_main.htm');\n}", "public function index()\n {\n return MemberResources::collection(Member::all());\n }", "function view() \n {\n $api = new Module_UserManagement_API();\n\n /* TODO: Check if administrator */\n $users = $api->getUsers();\n $view = Core_View::factory('users');\n\n $view->users = $users;\n echo $view->render();\n }", "public function index(){\n\t $this->data['page_title'] = 'Danh sách thông tin đã đăng ký cho từng sự kiện';\n\t\t$user = $this->ion_auth->user()->row();\n $this->data['temp_register'] = $temp_register = $this->temp_register_model->get_by_user_id($user->id);\n\t\t$this->render('member/overview/list_overview_view');\n\t}", "public function view($id) {\n\t\t$showAdminFeatures = false;\n\t\t$showFinances = false;\n\t\t$hasJoined = false;\n\t\t$showPersonalDetails = false;\n\t\t$canView = $this->__getViewPermissions($id, $showAdminFeatures, $showFinances, $hasJoined, $showPersonalDetails);\n\n\t\tif ($canView) {\n\t\t\t$rawMemberInfo = $this->Member->getMemberSummaryForMember($id, false);\n\n\t\t\tif ($rawMemberInfo) {\n\t\t\t\t$memberEmail = $this->Member->getEmailForMember($rawMemberInfo);\n\t\t\t\t$this->MailingList = $this->getMailingList();\n\t\t\t\t// Need a list of mailing-lists that the user can opt-in to\n\t\t\t\t$mailingLists = $this->MailingList->getListsAndSubscribeStatus($memberEmail);\n\t\t\t\t$this->set('mailingLists', $mailingLists);\n\n\t\t\t\t$sanitisedMemberInfo = $this->Member->sanitiseMemberInfo($rawMemberInfo, $showAdminFeatures, $showFinances, $hasJoined, true, true, $showPersonalDetails);\n\t\t\t\tif ($sanitisedMemberInfo) {\n\t\t\t\t\t$formattedInfo = $this->Member->formatMemberInfo($sanitisedMemberInfo, true);\n\t\t\t\t\tif ($formattedInfo) {\n\t\t\t\t\t\tif ($showAdminFeatures) {\n\t\t\t\t\t\t\t// Grab the data for the last e-mail\n\t\t\t\t\t\t\t$lastEmailRecord = $this->EmailRecord->getMostRecentEmailForMember($id);\n\t\t\t\t\t\t\tif ($lastEmailRecord != null) {\n\t\t\t\t\t\t\t\t$formattedInfo['lastEmail'] = $lastEmailRecord;\n\n\t\t\t\t\t\t\t\t$this->Nav->add('View Email History', 'emailRecords', 'view', array($id));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->set('member', $formattedInfo);\n\n\t\t\t\t\t\t$this->Nav->add('Edit', 'members', 'edit', array( $id ) );\n\t\t\t\t\t\t$this->Nav->add('Change Password', 'members', 'changePassword', array( $id ) );\n\n\t\t\t\t\t\tforeach ($this->__getActionsForMember($id) as $action) {\n\t\t\t\t\t\t\t$class = '';\n\t\t\t\t\t\t\tif (isset($action['class'])) {\n\t\t\t\t\t\t\t\t$class = $action['class'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->Nav->add($action['title'], $action['controller'], $action['action'], $action['params'], $class);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn; // Don't hit that redirect\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Nope, not allowed to view that\n\t\treturn $this->redirect($this->referer());\n\t}", "function member()\n\t{\n\t\t$this->consultant_form->insertM($_POST);\n\t\t$data['members']=$this->consultant_form->getmember($_POST['sr_no']);\n\t\t\n\t\t$data['sr_no']=$_POST['sr_no'];\n\t\t$this->load->view('consultant/consultant_member',$data);\n\t}", "public function show(MemberPub $memberPub)\n {\n //\n }", "function lists()\n {\n $data[\"data\"] = $this->RapatModel->get();\n $this->load->view('rapat/lists', $data);\n }", "public function index()\n {\n return view('memberships.index')->with('memberships', Membership::all())\n ->with('departments', Department::all())\n ->with('associations', Association::all());\n }" ]
[ "0.7219277", "0.7090991", "0.70758486", "0.7007153", "0.6925137", "0.6725471", "0.66804975", "0.662962", "0.6599075", "0.6508978", "0.65042484", "0.64932024", "0.6478977", "0.64785105", "0.646767", "0.6417706", "0.6409822", "0.6378312", "0.6366184", "0.63473356", "0.63311887", "0.632399", "0.631401", "0.6304268", "0.63018185", "0.6292678", "0.62729424", "0.6252358", "0.6233859", "0.61968887", "0.61869", "0.61666316", "0.6164032", "0.61626256", "0.61614555", "0.61534065", "0.6127143", "0.6119971", "0.61174524", "0.6111875", "0.6107685", "0.6107052", "0.60891986", "0.6079167", "0.60704035", "0.60699105", "0.6068094", "0.6067725", "0.6059945", "0.60559744", "0.60544854", "0.60461515", "0.60407823", "0.60404235", "0.6039429", "0.6036339", "0.6034792", "0.6028685", "0.6026641", "0.6007212", "0.6007212", "0.6007212", "0.60068005", "0.6000287", "0.59995043", "0.5988999", "0.5986503", "0.5985927", "0.598571", "0.598571", "0.5978282", "0.5974996", "0.5950979", "0.5946319", "0.594613", "0.5940613", "0.59355503", "0.5908936", "0.590691", "0.5905297", "0.58912086", "0.58899933", "0.58770263", "0.58739036", "0.58739007", "0.58670485", "0.58670443", "0.58654106", "0.5863688", "0.5862786", "0.5856755", "0.5854163", "0.5852402", "0.58496654", "0.5849606", "0.5846299", "0.58429146", "0.5838777", "0.583797", "0.5816488", "0.58058614" ]
0.0
-1
sends to site owner
public function sendFromContact(SendContactEmailRequest $request){ \Mail::send('emails.resume', array( 'name' => $request->get('name'), 'email' => $request->get('email'), 'user_message' => $request->get('message'), ), function($message) { $message->from('[email protected]', 'resume.thisdudecodes.com'); $message->to('[email protected]', 'resume.thisdudecode')->subject('Resume Contact!'); }); return response()->json(['success'=>true]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }", "public function messageOwnerAction() {\n\n //LOGGED IN USER CAN SEND THE MESSAGE\n if (!$this->_helper->requireUser()->isValid())\n $this->respondWithError('unauthorized');\n\n Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET EVENT ID AND OBJECT\n $wishlist_id = $this->_getParam(\"wishlist_id\");\n $wishlist = Engine_Api::_()->getItem('sitereview_wishlist', $wishlist_id);\n\n if (empty($wishlist))\n $this->respondWithError('no_record');\n\n $owner_id = $wishlist->owner_id;\n\n //OWNER CANT SEND A MESSAGE TO HIMSELF\n if ($viewer_id == $wishlist->owner_id) {\n $this->respondWithError('unauthorized');\n }\n\n //MAKE FORM\n if ($this->getRequest()->isGet()) {\n $response = Engine_Api::_()->getApi('Siteapi_Core', 'Sitereview')->getMessageOwnerForm();\n $this->respondWithSuccess($response, true);\n } else if ($this->getRequest()->isPost()) {\n $values = $this->_getAllParams();\n\n\n $db = Engine_Api::_()->getDbtable('messages', 'messages')->getAdapter();\n $db->beginTransaction();\n\n try {\n\n $is_error = 0;\n if (empty($values['title'])) {\n $this->respondWithValidationError('validation_fail', 'Subject field is required');\n }\n\n $recipients = preg_split('/[,. ]+/', $owner_id);\n\n //LIMIT RECIPIENTS\n $recipients = array_slice($recipients, 0, 1000);\n\n //CLEAN THE RECIPIENTS FOR REPEATING IDS\n $recipients = array_unique($recipients);\n\n //GET USER\n $user = Engine_Api::_()->getItem('user', $wishlist->owner_id);\n\n $wishlist_title = $wishlist->getTitle();\n $wishlist_title_with_link = '<a href = http://' . $_SERVER['HTTP_HOST'] . Zend_Controller_Front::getInstance()->getRouter()->assemble(array('wishlist_id' => $wishlist_id, 'slug' => $wishlist->getSlug()), \"sitereview_wishlist_view\") . \">$wishlist_title</a>\";\n\n $conversation = Engine_Api::_()->getItemTable('messages_conversation')->send($viewer, $recipients, $values['title'], $values['body'] . \"<br><br>\" . 'This message corresponds to the Wishlist: ' . $wishlist_title_with_link);\n\n try {\n Engine_Api::_()->getDbtable('notifications', 'activity')->addNotification($user, $viewer, $conversation, 'message_new');\n } catch (Exception $e) {\n //Blank Exception\n }\n //INCREMENT MESSAGE COUNTER\n Engine_Api::_()->getDbtable('statistics', 'core')->increment('messages.creations');\n\n $db->commit();\n $this->successResponseNoContent('no_content', true);\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }", "public function p_share() {\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 # 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('requests', $_POST);\n\n # send them to view list of active posts\n\n Router::redirect(\"/requests/index\");\n\n }", "public function messageOwnerAction() {\r\n\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET VIEWER DETAIL\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n\r\n //GET PAGE ID AND PAGE OBJECT\r\n $page_id = $this->_getParam(\"page_id\");\r\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\r\n\r\n //PAGE OWNER CAN'T SEND MESSAGE TO HIMSELF\r\n if ($viewer_id == $sitepage->owner_id) {\r\n return $this->_forwardCustom('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Messages_Form_Compose();\r\n $form->setTitle('Contact Page Owner');\r\n $form->setDescription('Create your message with the form given below. Your message will be sent to the admins of this Page.');\r\n $form->removeElement('to');\r\n\r\n //GET ADMINS ID FOR SENDING MESSAGE\r\n $manageAdminData = Engine_Api::_()->getDbtable('manageadmins', 'sitepage')->getManageAdmin($page_id);\r\n $manageAdminData = $manageAdminData->toArray();\r\n $ids = '';\r\n if (!empty($manageAdminData)) {\r\n foreach ($manageAdminData as $key => $user_ids) {\r\n $user_id = $user_ids['user_id'];\r\n if ($viewer_id != $user_id) {\r\n $ids = $ids . $user_id . ',';\r\n }\r\n }\r\n }\r\n $ids = trim($ids, ',');\r\n $form->toValues->setValue($ids);\r\n\r\n if (!$this->getRequest()->isPost()) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getDbtable('messages', 'messages')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n $values = $this->getRequest()->getPost();\r\n\r\n $form->populate($values);\r\n\r\n $is_error = 0;\r\n if (empty($values['title'])) {\r\n $is_error = 1;\r\n }\r\n\r\n //SENDING MESSAGE\r\n if ($is_error == 1) {\r\n $error = $this->view->translate('Subject is required field !');\r\n $error = Zend_Registry::get('Zend_Translate')->_($error);\r\n\r\n $form->getDecorator('errors')->setOption('escape', false);\r\n $form->addError($error);\r\n return;\r\n }\r\n\r\n $recipients = preg_split('/[,. ]+/', $values['toValues']);\r\n\r\n //LIMIT RECIPIENTS IF IT IS NOT A SPECIAL LIST OF MEMBERS\r\n $recipients = array_slice($recipients, 0, 1000);\r\n\r\n //CLEAN THE RECIPIENTS FOR REPEATING IDS\r\n //THIS CAN HAPPEN IF RECIPIENTS IS SELECTED AND THEN A FRIEND LIST IS SELECTED\r\n $recipients = array_unique($recipients);\r\n\r\n $recipientsUsers = Engine_Api::_()->getItemMulti('user', $recipients);\r\n\r\n $sitepage_title = $sitepage->title;\r\n $page_title_with_link = '<a href = http://' . $_SERVER['HTTP_HOST'] . Zend_Controller_Front::getInstance()->getRouter()->assemble(array('page_url' => Engine_Api::_()->sitepage()->getPageUrl($page_id)), 'sitepage_entry_view') . \">$sitepage_title</a>\";\r\n\r\n $conversation = Engine_Api::_()->getItemTable('messages_conversation')->send(\r\n $viewer, $recipients, $values['title'], $values['body'] . \"<br><br>\" . $this->view->translate(\"This message corresponds to the Page:\") . $page_title_with_link, null, $sitepage\r\n );\r\n\r\n// foreach ($recipientsUsers as $user) {\r\n// if ($user->getIdentity() == $viewer->getIdentity()) {\r\n// continue;\r\n// }\r\n// Engine_Api::_()->getDbtable('notifications', 'activity')->addNotification(\r\n// $user, $viewer, $conversation, 'message_new'\r\n// );\r\n// }\r\n\r\n //INCREMENT MESSAGES COUNTER\r\n Engine_Api::_()->getDbtable('statistics', 'core')->increment('messages.creations');\r\n\r\n $db->commit();\r\n\r\n return $this->_forwardCustom('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => false,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message has been sent successfully.'))\r\n ));\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function emailMeAction() {\r\n\r\n //DEFAULT LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //GET VIEWER DETAIL\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewr_id = $viewer->getIdentity();\r\n\r\n //GET PAGE ID AND PAGE OBJECT\r\n $this->view->page_id = $page_id = $this->_getParam('page_id', $this->_getParam('id', null));\r\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\r\n if (empty($sitepage))\r\n return $this->_forwardCustom('notfound', 'error', 'core');\r\n \r\n //AUTHORIZATION CHECK FOR TELL A FRIEND\r\n $isManageAdmin = Engine_Api::_()->sitepage()->isManageAdmin($sitepage, 'tfriend');\r\n if (empty($isManageAdmin)) {\r\n return $this->_forwardCustom('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitepage_Form_EmailMe();\r\n\r\n if (!empty($viewr_id)) {\r\n $value['sender_email'] = $viewer->email;\r\n $value['sender_name'] = $viewer->displayname;\r\n $form->populate($value);\r\n }\r\n\r\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\r\n\r\n $values = $form->getValues();\r\n\r\n //EDPLODES EMAIL IDS\r\n $reciver_ids = $sitepage->email; //explode(',', $values['sitepage_reciver_emails']);\r\n $values['sitepage_sender_email'] = $sitepage->email;\r\n if (!empty($values['sitepage_send_me'])) {\r\n $reciver_ids = $values['sitepage_sender_email'];\r\n }\r\n $sender_email = $values['sitepage_sender_email'];\r\n\r\n //CHECK VALID EMAIL ID FORMITE\r\n $validator = new Zend_Validate_EmailAddress();\r\n\r\n if (!$validator->isValid($sender_email)) {\r\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Invalid sender email address value'));\r\n return;\r\n }\r\n// foreach ($reciver_ids as $reciver_id) {\r\n// $reciver_id = trim($reciver_id, ' ');\r\n// if (!$validator->isValid($reciver_id)) {\r\n// $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter correct email address of the receiver(s).'));\r\n// return;\r\n// }\r\n// }\r\n $sender = $values['sitepage_sender_name'];\r\n $message = $values['sitepage_message'];\r\n $heading = ucfirst($sitepage->getTitle());\r\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($reciver_ids, 'SITEPAGE_EMAILME_EMAIL', array(\r\n 'host' => $_SERVER['HTTP_HOST'],\r\n 'sender_name' => $sender,\r\n 'page_title' => $heading,\r\n 'message' => '<div>' . $message . '</div>',\r\n 'object_link' => 'http://' . $_SERVER['HTTP_HOST'] . Engine_Api::_()->sitepage()->getHref($sitepage->page_id, $sitepage->owner_id, $sitepage->getSlug()),\r\n 'sender_email' => $sender_email,\r\n 'queue' => true\r\n ));\r\n\r\n $this->_forwardCustom('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => false,\r\n 'format' => 'smoothbox',\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message to page owner has been sent successfully.'))\r\n ));\r\n }\r\n }", "function view_added_site($url, $nickname) {\n include 'templates.inc';\n main_header(\"Confirmation\"); ?>\n <p><?php echo $url; ?> nicknamed to \n http://127.0.0.1/WEBD236/view_site.php?name=<?php echo $nickname ?>\n </p> <?php\n main_footer();\n}", "public function sendMarketing()\n {\n }", "public function send($id, $logged_in_user);", "function wpclients_func2() {\r\n global $current_user;\r\n\r\n $client_hub = get_user_meta( $current_user->ID, 'wpc_cl_hubpage_id', true );\r\n\r\n if( 0 < $client_hub ) {\r\n echo \"You will be redirected to the page in a few seconds, if it doesn't redirect , please click <a href='\" . wpc_client_get_slug( 'hub_page_id' ) . \"'>here</a>\";\r\n echo \"<script type='text/javascript'>document.location='\" . wpc_client_get_slug( 'hub_page_id' ) . \"';</script>\";\r\n }\r\n }", "public function send() {\n\n\t\t$current_time = time();\n\t\tif ( ! $this->should_send_tracking( $current_time ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$collector = $this->get_collector();\n\n\t\t$request = new WPSEO_Remote_Request( $this->endpoint );\n\t\t$request->set_body( $collector->get_as_json() );\n\t\t$request->send();\n\n\t\tupdate_option( $this->option_name, $current_time, 'yes' );\n\t}", "public function messageOwnerAction() {\r\n\r\n //LOGGED IN USER CAN SEND THE MESSAGE\r\n if (!$this->_helper->requireUser()->isValid())\r\n return;\r\n\r\n //GET VIEWER\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewer_id = $viewer->getIdentity();\r\n\r\n //GET PRODUCT ID AND OBJECT\r\n $wishlist_id = $this->_getParam(\"wishlist_id\");\r\n $wishlist = Engine_Api::_()->getItem('sitestoreproduct_wishlist', $wishlist_id);\r\n\r\n //OWNER CANT SEND A MESSAGE TO HIMSELF\r\n if ($viewer_id == $wishlist->owner_id) {\r\n return $this->_forward('requireauth', 'error', 'core');\r\n }\r\n\r\n //MAKE FORM\r\n $this->view->form = $form = new Messages_Form_Compose();\r\n $form->setDescription('Create your message with the form given below. (This message will be sent to the owner of this Wishlist.)');\r\n $form->removeElement('to');\r\n $form->toValues->setValue(\"$wishlist->owner_id\");\r\n \r\n \r\n if (!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\r\n $form->removeElement('toValues');\r\n }\r\n //CHECK METHOD/DATA\r\n if (!$this->getRequest()->isPost()) {\r\n return;\r\n }\r\n\r\n $db = Engine_Api::_()->getDbtable('messages', 'messages')->getAdapter();\r\n $db->beginTransaction();\r\n\r\n try {\r\n $values = $this->getRequest()->getPost();\r\n\r\n $form->populate($values);\r\n\r\n $is_error = 0;\r\n if (empty($values['title'])) {\r\n $is_error = 1;\r\n }\r\n\r\n //SENDING MESSAGE\r\n if ($is_error == 1) {\r\n $error = $this->view->translate('Subject is required field !');\r\n $error = Zend_Registry::get('Zend_Translate')->_($error);\r\n\r\n $form->getDecorator('errors')->setOption('escape', false);\r\n $form->addError($error);\r\n return;\r\n }\r\n\r\n $recipients = preg_split('/[,. ]+/', $values['toValues']);\r\n\r\n //LIMIT RECIPIENTS\r\n $recipients = array_slice($recipients, 0, 1000);\r\n\r\n //CLEAN THE RECIPIENTS FOR REPEATING IDS\r\n $recipients = array_unique($recipients);\r\n\r\n //GET USER\r\n $user = Engine_Api::_()->getItem('user', $wishlist->owner_id);\r\n\r\n $wishlist_title = $wishlist->getTitle();\r\n $wishlist_title_with_link = '<a href = http://' . $_SERVER['HTTP_HOST'] . Zend_Controller_Front::getInstance()->getRouter()->assemble(array('wishlist_id' => $wishlist_id, 'slug' => $wishlist->getSlug()), \"sitestoreproduct_wishlist_view\") . \">$wishlist_title</a>\";\r\n\r\n $conversation = Engine_Api::_()->getItemTable('messages_conversation')->send($viewer, $recipients, $values['title'], $values['body'] . \"<br><br>\" . $this->view->translate('This message corresponds to the Wishlist: ') . $wishlist_title_with_link);\r\n\r\n Engine_Api::_()->getDbtable('notifications', 'activity')->addNotification($user, $viewer, $conversation, 'message_new');\r\n\r\n //INCREMENT MESSAGE COUNTER\r\n Engine_Api::_()->getDbtable('statistics', 'core')->increment('messages.creations');\r\n\r\n $db->commit();\r\n\r\n return $this->_forward('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => true,\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message has been sent successfully.'))\r\n ));\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function sendShareNotification($sender,$url)\n {\n $this->notify(new ShareNotification($sender,$url));\n }", "function addCurrentUserAsRecipient(){\n // $this->AddRecipient( SessionUser::getProperty(\"firstname\").\" \".SessionUser::getProperty(\"lastname\").\" <\".SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN.\">\" );\n $this->AddRecipient( SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN );\n }", "public function sendPersonal() {\n return $this->_gtmHelper->sendPersonal();\n }", "private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }", "protected function send() {}", "function addsite()\r\n {\r\n $this->setRedirect('index.php?option=com_jfusionconnect&view=site&task=add', $msg, $msgType);\r\n }", "public function shareAction() {\t\n\t\t$this->view->addLayoutVar(\"onglet\", 1);\n\t\t$id_user = $this->_getParam('userId');\n\t\t\n\t\t$user = new Annuaire_Contact($id_user);\n\t\t$societe = new Annuaire_Societe($user->getSocieteId());\n\t\t$uid = Annuaire_User::getCurrentUserId();\n\t\t$share = new Annuaire_Share();\n\t\tif (!$share->allowContact($user->getId())) {\n\t\t\tthrow new Exception (t_('Not your contact'));\n\t\t}\n\n\t\t$this->view->nom = (($user->getNom() == \"\") ? t_(\"(None)\") : $user->getNom());\n\t\t$this->view->prenom = (($user->getPrenom() == \"\") ? t_(\"(None)\") : $user->getPrenom());\n\t\t$this->view->companyname = (($societe->getNom() == \"\") ? t_(\"(None)\") : $societe->getNom());\n\t\t$this->view->id = ($user->getId());\n\t\t$this->view->societeid = (($societe->getUserId() == $uid) ? $societe->getId() : 0);\n\t\t$this->view->admin = (($user->getUserId() == $uid) ? 1 : 0);\n\t\t$this->view->sharedwith = (t_(\"Shared with :\"));\n\t\t$this->view->addshare = (t_(\"Add a share\"));\n\t\t$this->view->sharecontact = (t_(\"Share a contact\"));\n\t\t$this->view->sharesociete = (t_(\"Share a company\"));\n\t\t$this->view->sureDeleteShare = (t_(\"Are you sure you want to delete this share ?\"));\n\t\t$this->view->delete = (t_(\"Delete\"));\n\t\t$this->view->modify = (t_(\"Allow to modify\"));\n\t\t$this->view->yes = (t_(\"Yes\"));\n\t\t$this->view->send = (t_(\"Send\"));\n\t\t$this->view->no = (t_(\"No\"));\n\t\t$this->view->cancel = (t_(\"Cancel\"));\n\t}", "function indexAction() {\n \t$server = implode('.', explode('.', $_SERVER['SERVER_ADDR'], -1));\n \t$remote = implode('.', explode('.', $_SERVER['REMOTE_ADDR'], -1));\n \t\n try {\n \t$this->authenticateAction('add');\n \tif ($this->auth->getIdentity()->role == 'bidder') {\n \t\t\t$this->_helper->layout->setlayout('bid');\n \t}\n } catch (Metis_Auth_Exception $e) {\n \t$e->failed();\n \treturn;\n }\n }", "private function checkOwner() {\r\n if (!$this->model->isOwner()) {\r\n $this->api->redirect('contact/home?message=Cannot Be Accessed');\r\n }\r\n }", "function _sf_send_user_publish_note($new_status, $old_status, $post) {\n\t\tif($post->post_type == 'spot') {\n\t\t\t\n\t\t\t$user = get_user_by('id', $post->post_author);\n\t\t\t\n\t\t\t//// IF THIS POST IS BEING PUBLISHED AND THE AUTHOR IS A SUBMITTER\n\t\t\tif($old_status != 'publish' && $new_status == 'publish' && isset($user->caps['submitter'])) {\n\t\t\t\t\n\t\t\t\t//// SENDS AN EMAIL SAYING HIS POST HAS BEEN SUBMITTED\n\t\t\t\t$message = sprintf2(__(\"Dear %user,\n\t\t\t\t\nThis is to inform you that your submission %title at %site_name has been approved and it is now published.\n\nYou can view it here at %link\n\nKind regards,\nthe %site_name team.\", 'btoa'), array(\n\t\t\t\n\t\t\t\t\t'user' => $user->display_name,\n\t\t\t\t\t'title' => $post->post_title,\n\t\t\t\t\t'site_name' => get_bloginfo('name'),\n\t\t\t\t\t'link' => get_permalink($post->ID),\n\t\t\t\t\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$subject = sprintf2(__('Submission approved at %site_name', 'btoa'), array('site_name' => get_bloginfo('name')));\n\t\t\t\t\n\t\t\t\t$headers = \"From: \".get_bloginfo('name').\" <\".get_option('admin_email').\">\";\n\t\t\t\t\n\t\t\t\twp_mail($user->user_email, $subject, $message, $headers);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t///// IF ITS A SPOT\n\t\t\tif($post->post_type == 'spot') {\n\t\t\t\t\n\t\t\t\tif(ddp('future_notification') == 'on' && $old_status != 'publish' && $new_status == 'publish') {\n\t\t\t\t\t\n\t\t\t\t\t//// ALSO CHECKS FOR USER NOTIFICATIONS FOR MATCHING CRITERIA\n\t\t\t\t\tif(function_exists('_sf_check_for_user_notifications_matching_spot')) { _sf_check_for_user_notifications_matching_spot($post->ID); }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('submission_days') != '' && ddp('submission_days') != '0') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO PENDING IN X AMOUNT OF DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date($post);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//// IF ITS BEING PUBLISHED AND WE HAVE AN EXPIRY DATE SET FOR OUR FEATURED SUBMISSION - AND ITS INDEED FEATURED\n\t\t\t\tif($old_status != 'publish' && $new_status == 'publish' && ddp('price_featured_days') != '' && ddp('price_featured_days') != '0' && get_post_meta($post->ID, 'featured', true) == 'on') {\n\t\t\t\t\t\n\t\t\t\t\t//// SETS UP OUR CRON JOB TO PUT IT BACK TO NORMAL SUBMISSION AFTER X DAYS\n\t\t\t\t\t_sf_set_spot_expiry_date_featured($post);\n\t\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\n\t\t\n\t}", "public function EnregistrerSite()\n {\n \n }", "public function postSend()\n {\n }", "public function website() {\n\t\t\n\t\t$name \t\t= Input::get('name');\n\t\t$mailFrom \t= Input::get('email');\n\t\t$phone \t\t= Input::get('phone');\n\t\t$comments \t= Input::get('comments');\n\t\t$emailTo \t= '[email protected]';\n\t\t\n\t\t$subject = 'Contato realizado a partir do site Pifou por: ' . $name . '.';\n\t\t$vars = array(\n\t\t\t'name'\t\t=>\t$name,\n\t\t\t'email'\t\t=>\t$mailFrom,\n\t\t\t'phone'\t\t=>\t$phone,\n\t\t\t'comments'\t=>\t$comments,\n\t\t);\n\t\t\n EmailTemplate::SendByKey('contact_mail_user', $vars, $emailTo, null, null, $mailFrom);\n\t\t\n\t\treturn \"<fieldset><div id='success_page'><h4 class='highlight'>Obrigado, <strong>$name</strong>! Sua mensagem foi enviada. Entraremos em contato o mais rápido possível.</h4></div></fieldset>\";\n }", "function getSendWelcomeMessageUrl() {\n return assemble_url('people_company_user_send_welcome_message', array(\n 'company_id' => $this->getCompanyId(),\n 'user_id' => $this->getId(),\n ));\n }", "function send_post()\n { \n $send = new send();\n\n $send->date_created = date('Y-m-d H:i:s');\n $send->createdbypk = $this->get_user()->user_id;\n $send->date_modified = date('Y-m-d H:i:s');\n $send->modifiedbypk = $this->get_user()->user_id;\n\n $this->response($this->_send_save($send, 'post'));\n }", "public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "private function send_system()\n\t{\n\t\t$to = $this->mail_to_name.' <'.$this->mail_to_email.'>';\n\n\t\t$headers = $this->getHeaders();\n\t\tmail($to, $this->mail_subject, $this->mail_message, $headers);\n\t}", "public function sendEmailWithApplyLink(){\n\t}", "public function server_social_wall(){\n echo $this->facebookTijdlijn();\n return 'Gelukt';\n }", "public function sendAction() {\n __mail::send('[email protected]', '[email protected]', 'title', 'me', 'hello world');\n\n return false;\n }", "function proitdev_publish_send_mail(){\n\tglobal $post;\n\t$author = $post->post_author; /* Post author ID */\n\t$name = get_the_author_meta('display_name',$author);\n\t$mail = get_the_author_meta('user_email',author);\n\t$title = $post->post_title;\n\t$permalink = get_permalink( $ID );\n\t$edit = get_edit_post_link($ID, '');\n\t$to[] = $sprintf('%s <%s>' , $name, $email);\n\t$subject = sprintf('Published: %s', $title);\n\t$message = sprintf('Congratulations, %s! Your article \"%s\" has been published.'. \"\\n\\n\", $name, $title);\n\t$message .= sprintf('View %s', $permalink);\n\t$header[] = '';\n\twp_mail($to, $subject, $messagge, $header);\n}", "function sendEmail_owner($details, $sitetitle) {\n\n\t\t\t $currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\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$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$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Order Information</b></h4>\";\n\t\t\t\t$message .= \"Date :\" . $date . \".<br>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//\t$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\tif(!empty($country)){\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice visit at: <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\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('New Booking Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "protected function doActionSendTracking()\n {\n \\XLite\\Core\\Mailer::sendOrderTrackingInformationCustomer($this->getOrder());\n\n \\XLite\\Core\\TopMessage::addInfo('Tracking information has been sent');\n }", "public function actionShare() {\n $postdata = file_get_contents(\"php://input\");\n $request = json_decode($postdata);\n\n if ($request) {\n\n $query = new Query;\n $query\n ->from('user')\n ->where(['id' => $request->to_user_id])\n ->select(\"email_id, admin_name\");\n\n $command = $query->createCommand();\n $user = $command->queryOne();\n\n\n $message = new Share;\n $message->to_user_id = $request->to_user_id;\n $message->sender_name = $request->sender_name;\n $message->sender_email = $request->sender_email;\n $message->message = $request->message;\n $message->sent_time = date(\"Y-m-d H:i:s\");\n\n $message->insert();\n\n $messageToSend = $request->sender_name . \" shared this...\\n\\n\" . $request->message;\n Yii::$app->view->params = Yii::$app->commoncomponent->getBrand(1);\n Yii::$app->mailer->compose()\n ->setFrom([$message->sender_email => $request->sender_name])\n ->setTo($request->to_email)\n ->setSubject($request->subject)\n ->setTextBody($messageToSend)\n ->send();\n\n\n $status = 1;\n $response = 'Your message has been sent.';\n } else {\n $status = 0;\n $response = 'No Email Sent';\n }\n\n $this->setHeader(200);\n echo json_encode(array('status' => $status, 'data' => $response), JSON_PRETTY_PRINT);\n }", "function newsdot_posted_by() {\n\t\tif ( get_theme_mod( 'newsdot_show_post_author', true ) ) :\n\t\t\t?>\n\t\t\t<span class=\"byline\">\n\t\t\t\t<i class=\"far fa-user-circle\"></i>\n\t\t\t\t<span class=\"author vcard\"><a class=\"url fn n\" href=\"<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>\"><?php echo esc_html( get_the_author() ); ?></a></span>\n\t\t\t</span>\n\t\t\t<?php\n\t\tendif;\n\t}", "public function propegate() : void\n {\n $this->event->sender->enabledForSite = in_array(\n $this->event->sender->siteId,\n $this->event->sender->getFieldValue('sites')\n );\n }", "function sendInformation($name,$company_name,$city,$email,$phone_no,$comments,$company_email)\n\t\t{\n\t\t\t//email will be sent to both the ad owners and admin\n\t\t\t//emaill of admin\n\t\t\t$email_admin = $this->manage_content->getValue('admin_profile','email_add');\n\t\t\t//get email from array $email_admin[0]['email_add']\n\t\t\t$sendMail_admin = $this->mail_function->contactToAdmin($name,$company_name,$city,$email,$phone_no,$comments,$email_admin[0]['email_add']);\n\t\t\t//send email to ad owner from company.php\n\t\t\t$sendMail_adOwner = $this->mail_function->contactToAdmin($name,$company_name,$city,$email,$phone_no,$comments,$company_email);\n\t\t}", "function add_form_send_to_friend() {\n do_action( 'add_form_send_to_friend' );\n}", "public function request() {\n //sent to poster \n }", "public function send_mail_to_accepted_user($username) {\n }", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "public function send()\n {\n }", "function siteorigin_share_activate() {\n}", "public function shareEmailAction()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$user = Application_Model_User::getAuth();\r\n\r\n\t\t\tif ($user == null)\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('You are not authorized to access this action');\r\n\t\t\t}\r\n\r\n\t\t\t$id = $this->_request->getPost('id');\r\n\r\n\t\t\tif (!v::intVal()->validate($id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID value: ' .\r\n\t\t\t\t\tvar_export($id, true));\r\n\t\t\t}\r\n\r\n\t\t\tif (!Application_Model_News::checkId($id, $post, ['join'=>false]))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect user ID: ' .\r\n\t\t\t\t\tvar_export($id, true));\r\n\t\t\t}\r\n\r\n\t\t\t$email = $this->_request->getPost('email');\r\n\r\n\t\t\tif (!v::email()->validate($email))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect email value: ' .\r\n\t\t\t\t\tvar_export($email, true));\r\n\t\t\t}\r\n\r\n\t\t\t$body = $this->_request->getPost('body');\r\n\r\n\t\t\tif (!v::stringType()->length(1, 65535)->validate($body))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect body value: ' .\r\n\t\t\t\t\tvar_export($body, true));\r\n\t\t\t}\r\n\r\n\t\t\tMy_Email::send($email, 'Interesting local news', [\r\n\t\t\t\t'template' => 'post-share',\r\n\t\t\t\t'assign' => [\r\n\t\t\t\t\t'user' => $user,\r\n\t\t\t\t\t'news' => $post,\r\n\t\t\t\t\t'message' => $body,\r\n\t\t\t\t]\r\n\t\t\t]);\r\n\r\n\t\t\t$response = ['status' => 1];\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\tMy_Log::exception($e);\r\n\t\t\t$response = [\r\n\t\t\t\t'status' => 0,\r\n\t\t\t\t'message' => $e instanceof RuntimeException ? $e->getMessage() :\r\n\t\t\t\t\t'Internal Server Error'\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\t$this->_helper->json($response);\r\n\t}", "function mailUser($email) {\n\t//echo \"mail user <br>\";\n\t$mail = getSocksMailer();\n\t$mail->Subject = \"Litesprite Survey Completed\";\n\t$mail->AddEmbeddedImage('../images/paw.png', 'paw');\n\t$mail->msgHTML(file_get_contents('../emails/postSurvey.html'), dirname(__FILE__));\n\t$mail->AddAddress($email);\n\tsendMail($mail);\n}", "function mentionMeXMLHTTP()\n{\n\tglobal $mybb;\n\n\t$ajaxFunction = \"mentionMeXMLHTTP{$mybb->input['mode']}\";\n\tif ($mybb->input['action'] != 'mentionme' ||\n\t\t!function_exists($ajaxFunction)) {\n\t\treturn;\n\t}\n\n\t$ajaxFunction();\n\treturn;\n}", "public function sendAction() {\n\t\t$this->certificateAction(TRUE);\n\t\t$this->groupAction(TRUE);\n\t\t$this->statAction(TRUE);\n\t}", "function setCurrentUserAsSender(){\n if( !SessionUser::isLoggedIn() ) return false;\n $this->From = SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN;\n $this->FromName = SessionUser::getProperty(\"firstname\").\" \".SessionUser::getProperty(\"lastname\").\" (\".SessionUser::getProperty(\"username\").\")\";\n }", "protected function getOwnerName() {\n $owner_name = 'site';\n return $owner_name;\n }", "public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }", "public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }", "function setSitePermission($service, $site, $email_address)\n{\n\t\n\t#echo \"ID: \".urldecode($site->id).\"<br>\";\n\t#echo \"Owners: \";\n\t#print_r($site->getOwners());\n\t$owners = $site->getOwners();\n\tarray_push($owners, $email_address);\n\t#print_r($site->owners);\n\t#echo \"<br>\";\n\t#array_push($site->owners, $email_address);\n\t#echo \"New Owners:\";\n\t#print_r($owners);\n\t$site->setOwners($owners);\n\t#echo \"<br>\";\n\t#echo \"Site:\";\n\t#print_r($site);\n\t#echo \"<br>\";\n\t\t\n\t#$newsite = new Google_Service_SiteVerification_SiteVerificationWebResourceResource($site);\n\t#$newsite->setId($site->id);\n\t#$newsite->setOwners($site->owners);\n\t\n\t#echo \"Newsite\";\n\t#print_r($newsite);\n\t#echo \"<br>\";\n\t\n\t\n\t/*\n\t$site = new Google_Service_SiteVerification_SiteVerificationWebResourceResourceSite();\n\t$site->setIdentifier($site->id);\n\t\n\t$request = new Google_Service_SiteVerification_SiteVerificationWebResourceResource();\n\t$request->setSite($site);\n\t\n\t$webResource = $service->webResource;\n\t#$result = $webResource->insert('FILE',$request);\n\t$result = $webResource->update($site->id,$request);\n\t\n\techo \"Result:\";\n\tprint_t($result);\n\techo \"<br>\";*/\n\t#echo \"Response:<br>\";\n\t\n\tif ($response = $service->webResource->update(urldecode($site->id), $site))\n\t{\n\t\techo \"<table>\";\n\t\techo \"<tr><th>Site</th><th>New owners</th></tr>\";\n\t\techo \"<tr><td>\";\n\t\techo urldecode($response->id);\n\t\techo \"</td><td>\";\n\t\tforeach ($response->owners as $responseOwners)\n\t\t{\n\t\t\techo \"$responseOwners<br>\";\n\t\t}\n\t\techo \"</td></tr>\";\n\t\techo \"</table>\";\n\t\t\n\t}\n\t\n\t/*$newsiteOwners = array(\"owners\"=>$site->owners);\n\techo \"Newsite Owners\";\n\tprint_r($newsiteOwners);\n\techo \"<br>\";\n\t\n\t$reponse = $service->webResource->update($site->id, $newsiteOwners);*/\n\t\n\t#print_r($reponse);\n\t\n\t#echo \"End response<br>\";\n\techo \"<br>\";\n\t\n\t#$site->setId($id);\n\t#$owners = $site->getOwners();\n\t\n\t#print_r($owners);\n\t\t\n/*\t$request = new Google_Service_SiteVerification_SiteVerificationWebResourceResource(array(\n 'site' => array(\n 'type' => 'INET_DOMAIN',\n 'identifier' => 'acme.com'\n )\n));\n\t$service->webResource->insert($verification_method, $request);\n */\n\t\n}", "function putAfficheSite(){\n\tglobal $translator;\n\t//$oSite = new Cms_site($_SESSION['idSite_travail']);\n\tprint(\"<br /><div class='arbo' align='left'>\".$translator->getTransByCode('sitedetravail').\": \".$_SESSION['site'].\"</div><br />\");\n}", "function setAuthorSite($site_url)\n\t{\n\t\t$this->add('author_site', strip_tags($site_url));\n\t}", "private function sendNotifyEmail(){\n $uS = Session::getInstance();\n $to = filter_var(trim($uS->referralFormEmail), FILTER_SANITIZE_EMAIL);\n\n try{\n if ($to !== FALSE && $to != '') {\n// $userData = $this->getUserData();\n $content = \"Hello,<br>\" . PHP_EOL . \"A new \" . $this->formTemplate->getTitle() . \" was submitted to \" . $uS->siteName . \". <br><br><a href='\" . $uS->resourceURL . \"house/register.php' target='_blank'>Click here to log into HHK and take action.</a><br>\" . PHP_EOL;\n\n $mail = prepareEmail();\n\n $mail->From = ($uS->NoReplyAddr ? $uS->NoReplyAddr : \"[email protected]\");\n $mail->FromName = htmlspecialchars_decode($uS->siteName, ENT_QUOTES);\n $mail->addAddress($to);\n\n $mail->isHTML(true);\n\n $mail->Subject = \"New \" . Labels::getString(\"Register\", \"onlineReferralTitle\", \"Referral\") . \" submitted\";\n $mail->msgHTML($content);\n\n if ($mail->send() === FALSE) {\n return false;\n }else{\n return true;\n }\n }\n }catch(\\Exception $e){\n return false;\n }\n return false;\n }", "function index() {\n ConfigOptions::setValueFor('fmn_last_visited', $this->logged_user, new DateTimeValue());\n\t \n // Popup\n if($this->request->isAsyncCall()) {\n $this->setView(array(\n 'template' => 'popup',\n 'controller' => 'frosso_mail_notify',\n 'module' => FROSSO_MAILN_MODULE,\n ));\n\t\t\n\t\t// $this->response->assign(array(\n // 'mail_updates' => time(),\n // ));\n\n\t } else {\n\t \t// $this->response->forbidden();\n } // if\n }", "public function thankYouAction(){\n\t}", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "public function send();", "function sendFaildVer(){\n\n}", "function offerEmail() {\n\t\t$this->set('title_for_layout', 'Advertiser Offer Email');\n\t\t$this->set('advertiserList',$this->common->getAdvertiserProfileAll());\n\t}", "function contactUs( $data ) {\n // Get the info as specified in the contact info section of the site\n // management porition\n $info = ContactInfo::getInstance();\n\n // For development purposes, currently return;\n\n // Send an email to the contacted persons\n}", "function sendGraphite($field, $value) {\n global $graphite_send, $graphite_prefix, $c_name, $fsock;\n\n $send = $graphite_prefix . $c_name . \".\" . $field . \" \" . $value . \" \" . time() . \"\\n\";\n\n if ($graphite_send) {\n fwrite($fsock, $send, strlen($send));\n }\n\n echo $send;\n}", "function change_sender() {\n\t\treturn \"[email protected]\";\n\n\t}", "function new_user_email_admin_notice()\n {\n }", "public function actionSend(): void\n {\n $prizes = UserPrize::find()->alias('user_prize')->JoinWith(['prize','user'])\n ->where([\n 'user_prize.status' => UserPrize::STATUS_RECEIVED,\n 'prize_type' => Prize::TYPE_MONEY,\n ])\n ->limit(self::DEFAULT_NUMBER)\n ->all();\n\n if ($prizes) {\n $this->stdout(\\Yii::t('app', 'Sending {prizes} prize(s)...' . PHP_EOL,\n ['prizes' => count($prizes)]), Console::FG_GREEN);\n } else {\n $this->stdout(\\Yii::t('app', 'Nothing to send!' . PHP_EOL), Console::FG_YELLOW);\n }\n\n foreach ($prizes as $prize) {\n\n $prize->status = UserPrize::STATUS_SENT;\n $prize->save(false);\n\n $this->stdout(\\Yii::t('app', 'Sending {money} money to user {user}...', [\n 'money' =>$prize->quantity,\n 'user' => $prize->user->email\n ]));\n\n\n $this->stdout(\\Yii::t('app', ' [SENT]' . PHP_EOL), Console::FG_GREEN);\n }\n }", "public function getNotifyAction() {\r\n $this->view->notification = $notification = $this->_getParam('notification', 0);\r\n $suggObj = Engine_Api::_()->getItem('suggestion', $notification->object_id);\r\n if (!empty($suggObj)) {\r\n\t\t\t$this->view->suggObj = $suggObj;\r\n\r\n if( strstr($suggObj->entity, \"sitereview\") ) {\r\n $getListingTypeId = Engine_Api::_()->getItem('sitereview_listing', $suggObj->entity_id)->listingtype_id;\r\n $getModId = Engine_Api::_()->suggestion()->getReviewModInfo($getListingTypeId);\r\n $modInfoArray = Engine_Api::_()->getApi('modInfo', 'suggestion')->getPluginDetailed(\"sitereview_\" . $getModId);\r\n $this->view->modInfoArray = $modInfoArray = $modInfoArray[\"sitereview_\" . $getModId];\r\n }else {\r\n $modInfoArray = Engine_Api::_()->getApi('modInfo', 'suggestion')->getPluginDetailed($suggObj->entity);\r\n $this->view->modInfoArray = $modInfoArray = $modInfoArray[$suggObj->entity];\r\n }\r\n \r\n if ($this->isModuleEnabled($modInfoArray['pluginName'])) {\r\n if ( $suggObj->entity == 'photo' ) {\r\n $modItemId = $suggObj->sender_id;\r\n } else {\r\n $modItemId = $suggObj->entity_id;\r\n }\r\n $modObj = Engine_Api::_()->getItem($modInfoArray['itemType'], $modItemId);\r\n\r\n\t// Check Sender exist on site or not.\r\n\t$isSenderExist= Engine_Api::_()->getItem('user', $suggObj->sender_id)->getIdentity();\r\n\tif( empty($isSenderExist) ) {\r\n\t Engine_Api::_()->getDbtable('suggestions', 'suggestion')->removeSuggestion($suggObj->entity, $suggObj->entity_id, $modInfoArray['notificationType']);\r\n\t $this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t $this->view->modObj = null;\r\n\t}\r\n\r\n\t// If Loggden user have \"Friend Suggestion\" Which already his friend then that friend suggestion should be delete.\r\n\tif( empty($modObj) || (( $suggObj->entity != 'photo' ) && ($modInfoArray['itemType'] == 'user') && !empty($modItemId)) ) {\r\n\t\t$is_user = Engine_Api::_()->getItem('user', $suggObj->entity_id)->getIdentity();\r\n\t\t$isFriend = Engine_Api::_()->getApi('coreFun', 'suggestion')->isMember($modItemId);\r\n\t\tif( empty($is_user) || !empty($isFriend) || empty($modObj) ) {\r\n\t\t Engine_Api::_()->getDbtable('suggestions', 'suggestion')->removeSuggestion($suggObj->entity, $suggObj->entity_id, $modInfoArray['notificationType']);\r\n\t\t $this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t $this->view->modObj = null;\r\n\t\t}\r\n\t}\r\n\r\n // It would be \"NULL\", If that entry already deleteed from the table.\r\n if (empty($modObj)) {\r\n Engine_Api::_()->getDbtable('suggestions', 'suggestion')->removeSuggestion($suggObj->entity, $suggObj->entity_id, $modInfoArray['notificationType']);\r\n $this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n $this->view->modObj = null;\r\n } else {\r\n\t\t\t\t\t$this->view->modObj = $modObj;\r\n $this->view->senderObj = $senderObj = Engine_Api::_()->getItem('user', $suggObj->sender_id);\r\n $this->view->sender_name = $this->view->htmlLink($senderObj->getHref(), $senderObj->displayname);\r\n }\r\n }else {\r\n\t$this->view->modNotEnable = true;\r\n }\r\n }else {\r\n\t\t\t// If suggestion are not available in \"Suggestion\" table but available in \"Notifications table\" then we are deleting from \"Notifications Table\".\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}\r\n }", "public function submit_form()\n\t{\n\t\tDisplay::message('user_profil_submit', ROOT . 'index.' . PHPEXT . '?p=profile&amp;module=contact', 'forum_profil');\n\t}", "function setUserInformation()\r\n{\r\n global $sender ;\r\n global $message ;\r\n global $chemin ;\r\n global $query ;\r\n if(filter_var(strtolower($message), FILTER_VALIDATE_EMAIL) || preg_match(\"#^(none)#i\", $message))\r\n {\r\n sendTextMessage(\"Thank you for your answer to my question.Your setting is correctly set\");\r\n displayAllService();\r\n $query->addUser($sender,strtolower($message));\r\n file_put_contents($chemin,\"\");\r\n }\r\n else\r\n {\r\n sendTextMessage(\"Please provide a valid email or type none if you don't get one 😕 .\");\r\n }\r\n}", "public function testUpdateSite()\n {\n }", "public function testUpdateSiteMembershipRequestForPerson()\n {\n }", "public function sendAction()\n {\n $_POST['email'] = Auth::getEmail();\n $chat = new Chat($_POST);\n $chat->send();;\n\n }", "private function notifyORS() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ORSNotification.php');\r\n\r\n $piDetails = $this->getPIDisplayDetails();\r\n $piName = $piDetails['firstName'] . \" \" . $piDetails['lastName'];\r\n\r\n $subject = sprintf('[TID-%s] Tracking form submitted online [%s]', $this->trackingFormId, $piName);\r\n $emailBody = sprintf('A tracking form was submitted online :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nPrincipal Investigator : %s\r\nDepartment : %s\r\n\r\n', $this->trackingFormId, $this->projectTitle, $piName, $piDetails['departmentName']);\r\n\r\n $ORSNotification = new ORSNotification($subject, $emailBody);\r\n try {\r\n $ORSNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to ORS : '. $e);\r\n }\r\n }", "function saveFeed()\n {\n // And subscribe the current user to the local profile\n $user = common_current_user();\n $local = $this->oprofile->localProfile();\n if ($user->isSubscribed($local)) {\n // TRANS: OStatus remote subscription dialog error.\n $this->showForm(_m('Already subscribed!'));\n } elseif (Subscription::start($user, $local)) {\n $this->success();\n } else {\n // TRANS: OStatus remote subscription dialog error.\n $this->showForm(_m('Remote subscription failed!'));\n }\n }", "public function afterUpdate()\n {\n // $this->getDI()\n // ->getMail()\n // ->send([\"[email protected]\" => \"Admin GamanAds\"],\"Update Adspace\", 'updateadspace',\n // [ 'emailBody'=> \"Update Adspace : <b>$this->ad_url</b> from Client Id : <b>$this->client_id</b> Client Name: <b>$this->client_name</b>\"]);\n }", "function TimeIt_user_formicula_send()\n{\n $ret = pnModFunc('formicula','user','send');\n\n // test against true because formicula uses pnRedirect() which returns true\n if($ret === true) {\n return pnRedirect(pnModURL('TimeIt','user','display', array('ot' => 'event',\n 'id' => FormUtil::getPassedValue('timeit_eid', null, 'GETPOST'),\n 'dheid' => FormUtil::getPassedValue('timeit_dheid', null, 'GETPOST'))));\n } else {\n return $ret;\n }\n}", "function send()\n\t{\n\t\t// $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t// $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\n\t\t// // Additional headers\n\t\t// $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . \"\\r\\n\";\n\t\t// $headers .= 'From: Birthday Reminder <[email protected]>' . \"\\r\\n\";\n\t\t// $headers .= 'Cc: [email protected]' . \"\\r\\n\";\n\t\t// $headers .= 'Bcc: [email protected]' . \"\\r\\n\";\n\n\t\t// // Mail it\n\t\t// mail($this->to, $subject, $message, $headers);\n\t}", "public function process()\n {\n Phpfox::isUser(true);\n /**\n * LOCK this feature\n *\n if($iId = $this->request()->get('id'))\n {\n $aInvite = Phpfox::getService('customprofiles')->getInviteAnonymousMessage($iId);\n if(isset($aInvite['invite_id']) && Phpfox::getUserId() == $aInvite['invite_user_id'])\n {\n if (Phpfox::isModule('notification'))\n {\n $type_id = 'customprofiles_anonymousconfirm';\n Phpfox::getService('customprofiles.process')->addNotification($type_id, $aInvite['feed_id'], $aInvite['invite_user_id'],$aInvite['user_id']); \n Phpfox::getService('customprofiles.process')->removeInviteAnonymousMessage($iId); \n }\n }\n } \n **/\n \n $this->url()->send('');\n }", "public function send() {\r\n\t\t\t$this->sent = true;\r\n\t\t}", "public function send() {\r\n\t\t$this->resource->send();\r\n\t}", "public function indexAction() {\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitecrowdfunding_admin_main', array(), 'sitecrowdfunding_admin_main_reminder_mails');\n $site_title = $_SERVER['HTTP_HOST'];\n $this->view->form = $form = new Sitecrowdfunding_Form_Admin_Email();\n\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n $values = $form->getValues();\n\n if ($values['sitecrowdfunding_reminder_demo'] != 1)\n $values['sitecrowdfunding_admin_mail'] = '';\n\n include APPLICATION_PATH . '/application/modules/Sitecrowdfunding/controllers/license/license2.php';\n if (empty($tempMailsend)) {\n return;\n }\n foreach ($values as $key => $value) {\n if (Engine_Api::_()->getApi('settings', 'core')->hasSetting($key)) {\n Engine_Api::_()->getApi('settings', 'core')->removeSetting($key);\n }\n if (is_null($value)) {\n $value = \"\";\n }\n Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);\n }\n $form->addNotice($this->view->translate('Your changes have been saved successfully.'));\n\n if ($values['sitecrowdfunding_reminder_demo'] == 1 && !empty($values['sitecrowdfunding_admin_mail'])) {\n $mailId = $values['sitecrowdfunding_admin_mail'];\n $user = Engine_Api::_()->getItemTable('user')->fetchRow(array(\n 'email = ?' => $mailId\n ));\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($user, \"SITECROWDFUNDING_REMINDER_TEST\", array(\n 'member_name' => $user->getTitle()\n ));\n $form->addNotice('Test email has been sent to the email id provided by you.');\n }\n }", "function goOnline($d){\n ///$d = email\n addOnline($d);\n }", "public function getSenderUrl()\n {\n if (count($this->sender()->first()) > 0)\n return URL::to('/profile/'.$this->sender()->first()->username);\n else\n return URL::to('#');\n }", "public function tellAFriendAction() {\r\n\r\n //DEFAULT LAYOUT\r\n $sitemobile = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemobile');\r\n if ($sitemobile && !Engine_Api::_()->sitemobile()->checkMode('mobile-mode'))\r\n\t\t\t$this->_helper->layout->setLayout('default-simple');\r\n\r\n //GET VIEWER DETAIL\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewr_id = $viewer->getIdentity();\r\n\r\n //GET PAGE ID AND PAGE OBJECT\r\n $page_id = $this->_getParam('page_id', $this->_getParam('id', null));\r\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\r\n if (empty($sitepage))\r\n return $this->_forwardCustom('notfound', 'error', 'core');\r\n //AUTHORIZATION CHECK FOR TELL A FRIEND\r\n $isManageAdmin = Engine_Api::_()->sitepage()->isManageAdmin($sitepage, 'tfriend');\r\n if (empty($isManageAdmin)) {\r\n return $this->_forwardCustom('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitepage_Form_TellAFriend();\r\n \r\n if (!empty($viewr_id)) {\r\n $value['sender_email'] = $viewer->email;\r\n $value['sender_name'] = $viewer->displayname;\r\n $form->populate($value);\r\n }\r\n \r\n //IF THE MODE IS APP MODE THEN\r\n if (Engine_Api::_()->seaocore()->isSitemobileApp()) {\r\n Zend_Registry::set('setFixedCreationForm', true);\r\n Zend_Registry::set('setFixedCreationFormBack', 'Back');\r\n Zend_Registry::set('setFixedCreationHeaderTitle', Zend_Registry::get('Zend_Translate')->_('Tell a friend'));\r\n Zend_Registry::set('setFixedCreationHeaderSubmit', Zend_Registry::get('Zend_Translate')->_('Send'));\r\n $this->view->form->setAttrib('id', 'tellAFriendFrom');\r\n Zend_Registry::set('setFixedCreationFormId', '#tellAFriendFrom');\r\n $this->view->form->removeElement('sitepage_send');\r\n $this->view->form->removeElement('sitepage_cancel');\r\n $form->setTitle('');\r\n }\r\n\r\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\r\n\r\n $values = $form->getValues();\r\n\r\n //EDPLODES EMAIL IDS\r\n $reciver_ids = explode(',', $values['sitepage_reciver_emails']);\r\n\r\n if (!empty($values['sitepage_send_me'])) {\r\n $reciver_ids[] = $values['sitepage_sender_email'];\r\n }\r\n $sender_email = $values['sitepage_sender_email'];\r\n\r\n //CHECK VALID EMAIL ID FORMITE\r\n $validator = new Zend_Validate_EmailAddress();\r\n\r\n if (!$validator->isValid($sender_email)) {\r\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Invalid sender email address value'));\r\n return;\r\n }\r\n foreach ($reciver_ids as $reciver_id) {\r\n $reciver_id = trim($reciver_id, ' ');\r\n if (!$validator->isValid($reciver_id)) {\r\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter correct email address of the receiver(s).'));\r\n return;\r\n }\r\n }\r\n $sender = $values['sitepage_sender_name'];\r\n $message = $values['sitepage_message'];\r\n $heading = ucfirst($sitepage->getTitle());\r\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($reciver_ids, 'SITEPAGE_TELLAFRIEND_EMAIL', array(\r\n 'host' => $_SERVER['HTTP_HOST'],\r\n 'sender_name' => $sender,\r\n 'page_title' => $heading,\r\n 'message' => '<div>' . $message . '</div>',\r\n 'object_link' => 'http://' . $_SERVER['HTTP_HOST'] . Engine_Api::_()->sitepage()->getHref($sitepage->page_id, $sitepage->owner_id, $sitepage->getSlug()),\r\n 'sender_email' => $sender_email,\r\n 'queue' => true\r\n ));\r\n\r\n if ($sitemobile && Engine_Api::_()->sitemobile()->checkMode('mobile-mode'))\r\n\t\t\t\t$this->_forwardCustom('success', 'utility', 'core', array( \r\n 'parentRedirect' => $sitepage->getHref(), \r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message to your friend has been sent successfully.'))\r\n ));\r\n\t\t else\t\r\n $this->_forwardCustom('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => false,\r\n 'format' => 'smoothbox',\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message to your friend has been sent successfully.'))\r\n ));\r\n }\r\n }", "function store_owner_dashboard()\n\t{\n\t\tlog_message('debug', 'Account/store_owner_dashboard');\n\t\t$data = filter_forwarded_data($this);\n\t\t$this->set_unread_count();\n\t\t$this->load->view('account/store_owner_dashboard', $data);\n\t}", "function mailSocks($mail) {\n\t\t//echo 'mail socks <br>';\n\t\t$mail = getSocksMailer();\n\t\t$mail->AddAddress(\"[email protected]\");\n\t\t$mail->Subject = \"Litesprite Survey Completed: \". $_SESSION['client_key'];\n\t\t$mail->Body = 'Tester: ' . $_SESSION['client_key'] . ' has completed the survey: #'.$_SESSION['survey_id'].\" .\";\n\t\t$mail->WordWrap = 80;\n\t\tsendMail($mail);\n}", "function generate_follow_link() {\n\t\treturn str_replace( 'swfw_username', $this->username, $this->url);\n\t}", "function post () {\n //OU SALVA NO\n header(\"location: /\");\n }", "public function mailopen() {\n $signingKey = $_GET['signingKey'];\n $request = Database::table(\"requests\")->where(\"signing_key\", $signingKey)->first();\n $actionTakenBy = escape($request->email);\n /*\n * Check, whether IP address register is allowed in .env\n * If yes, then capture the user's IP address\n */\n if (env('REGISTER_IP_ADDRESS_IN_HISTORY') == 'Enabled') {\n $actionTakenBy .= ' ['.getUserIpAddr().']';\n }\n $activity = '<span class=\"text-primary\">'.$actionTakenBy.'</span> opened signing invitation email of this document.';\n Signer::keephistory($request->document, $activity, \"default\");\n $notification = '<span class=\"text-primary\">'.escape($request->email).'</span> has opened the email signing requests sent for this <a href=\"'.url(\"Document@open\").$request->document.'\">document</a>.';\n Signer::notification($request->sender, $notification, \"accept\");\n exit();\n }", "public function send()\n {\n }" ]
[ "0.64414734", "0.6003556", "0.5921669", "0.5799669", "0.5791133", "0.5736323", "0.57148266", "0.571459", "0.57016355", "0.5699438", "0.56605375", "0.56580615", "0.5601739", "0.5595804", "0.5571576", "0.554252", "0.5533514", "0.5460197", "0.54461044", "0.54390305", "0.5438712", "0.5430153", "0.54267913", "0.5413186", "0.5400195", "0.53993845", "0.5392955", "0.53824687", "0.5380446", "0.53784245", "0.53758186", "0.5372772", "0.5366347", "0.53646463", "0.5356611", "0.53537774", "0.5342024", "0.53400254", "0.53396374", "0.53347397", "0.5314276", "0.5312123", "0.5283694", "0.528343", "0.5283131", "0.5272949", "0.52664465", "0.52649534", "0.5258737", "0.52544725", "0.52505803", "0.5247688", "0.5238882", "0.5236127", "0.5233531", "0.5230193", "0.522948", "0.5227246", "0.52191687", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.52151483", "0.5213738", "0.5213427", "0.52057606", "0.5195092", "0.519416", "0.5191249", "0.51890814", "0.5186431", "0.51862663", "0.518439", "0.5180401", "0.51768273", "0.5171687", "0.5163092", "0.51576734", "0.5142651", "0.5130488", "0.51206714", "0.51182014", "0.51181144", "0.5115995", "0.5110645", "0.51007223", "0.5100287", "0.50945985", "0.5091131", "0.509049", "0.50874907", "0.5086523", "0.50829166", "0.50805926" ]
0.0
-1
Render a view template.
public static function renderTemplate($file, $args = []) { if (!empty($file)) { self::setFile($file); extract($args, EXTR_SKIP); if (file_exists(self::$file)) { ob_start(); require_once self::$file; } else { throw new \Exception("Sorry, view file {$file} not exists", 404); } } else { throw new \Exception('Sorry, file much be provided', 404); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderTemplate();", "public function render()\n\t{\n\t $templateFile = $this->template;\n\t $templateContents = $this->getTemplateContents($templateFile);\n\n\t $layout = $this->getTemplateLayout($templateContents);\n $arguments = $this->getTemplateArguments($templateContents);\n\n\t return $this->renderLayout(\n \t\t$layout, \n \t\tfunction () use ($templateFile) {\n\t\t $template = new Template($templateFile);\n\t\t return $template->render();\n\t \t},\n \t\t$arguments\n \t);\n\t}", "public function render($template = 'index'){\n\t$template = $this->folder.\"\\\\templates\\\\$template\";\n\t$this->rendered_view = $this->view()->render($template);\n\treturn $this->rendered_view;\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "abstract protected function renderView();", "private function renderTemplate()\n {\n $this->html = view($this->template, [$this->contextAs => $this->viewData])->render();\n\n // We may try to minify the html before storing it in cache to save space.\n if (env('WIDGET_MINIFICATION', false)) {\n $this->minifyHtml();\n }\n\n // We add some comments to be able to easily identify the widget in browser's developer tool.\n if(env('WIDGET_IDENTIFIER',false)){\n $this->addIdentifierToHtml();\n }\n\n return $this->html;\n }", "public function renderView($template, array $arguments = [])\n {\n \textract($arguments);\n \tob_start();\n require($this->templatePath.\"layout/header.html.php\");\n \trequire($this->templatePath.\"layout/menu.html.php\");\n \trequire($this->templatePath.$template);\n require($this->templatePath.\"layout/footer.html.php\");\n \treturn ob_get_clean();\n }", "public function render() {\n\n\t\t$context = $this->options;\n\t\t$context = $this->load($context);\n\n\t\textract($context);\n\n\t\tinclude __DIR__ . '/../views/' . $this->template();\n\t}", "public static function renderTemplate()\n {\n echo self::$template;\n }", "public function template()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/template', [\n\t\t\t'templates_availables' => $this->templates_availables,\n\t\t]);\n\t}", "public function render()\n {\n $page = $this->twig->load($this->template);\n $this->prepareFlashMessages();\n $html = $page->render($this->vars);\n Router::sendResponse($html);\n }", "public function renderHTML() \n\t{\n\t\t$viewTemplate = file_get_contents('view_file.html');\n\t\techo $viewTemplate;\n\t}", "public function render()\n\t{\n\t\treturn $this->viewFactory->make($this->view)\n\t\t\t->with( 'presenter', $this )\n\t\t\t->render();\n\t}", "public function render()\n {\n return $this\n ->blade_instance\n ->view()\n ->make(static::TEMPLATE_NAME, $this->entity_data)\n ->render();\n }", "function render($template = 'layout') {\n\t\tinclude 'view/'.$template.'.phtml';\n\t}", "public function forTemplate()\n {\n if (!$this->canBeCached()) {\n HTTPCacheControlMiddleware::singleton()->disableCache();\n }\n\n $context = $this;\n $this->extend('onBeforeRender', $context);\n\n $return = $context->renderWith($context->getTemplates());\n\n // Now that we're rendered, clear message\n $context->clearMessage();\n\n return $return;\n }", "public function _render($view)\n {\n $this->data['admin'] = false;\n\n $data = $this->data;\n $data['css'] = $this->css;\n $data['js'] = $this->js;\n $data['bower_components'] = $this->bower_components;\n\n $data['title'] = $this->title;\n $data['description'] = $this->description;\n $data['keywords'] = $this->keywords;\n $data['author'] = $this->author;\n\n $data['head'] = $this->load->view('templates/head', $data, true);\n if (isset($data['user'])) {\n $data['nav'] = $this->load->view('templates/logged/nav', $data, true);\n } else {\n $data['nav'] = $this->load->view('templates/nav', $data, true);\n }\n $data['scripts'] = $this->load->view('templates/scripts', $data, true);\n $data['footer'] = $this->load->view('templates/footer', $data, true);\n\n $data['content'] = $this->load->view($view, $data, true);\n\n $this->load->view('templates/skeleton', $data);\n }", "public function render($view, array $parameters);", "protected function render()\n {\n $params = ['title' => $this->title, 'content' => $this->content];\n $html = $this->template('Views/v_main.php', $params);\n echo $html;\n }", "protected function render(){\n //render view\n \n }", "protected function render()\n {\n $file_path = ROOT . '/' . PATH_VIEWS . '/' . $this->view . '.php';\n\n if (is_file($file_path)) {\n $this->template = $this->getContentTemplate($file_path);\n echo $this->template;\n } else {\n throw new Exception(\"Error! Does not exist \" . $this->view);\n }\n }", "public function render()\n {\n $theme = Yii::app()->theme->name;\n $name = get_class($this);\n $templateName = \"themes/$theme/templates/$name.xhtml\";\n $content = $this->renderContent();\n if (!file_exists($templateName))\n {\n $templateName = \"themes/default/templates/$name.xhtml\";\n }\n if (file_exists($templateName))\n {\n $span = \"<span class=\\\"$name\\\" />\";\n $templateSource = file_get_contents($templateName);\n if (strpos($templateSource, $span))\n {\n $content = str_replace($span, $content, $templateSource);\n }\n $content = \"<!-- Start of $templateName -->$content<!-- End of $templateName -->\";\n }\n $classes = RuntimeUtil::getClassHierarchy(get_class($this), 'View');\n if ($this->isUniqueToAPage())\n {\n $id = \" id=\\\"$name\\\"\";\n unset($classes[0]);\n }\n else\n {\n $id = $this->getId();\n if ($id != null)\n {\n $id = \" id=\\\"$id\\\"\";\n }\n }\n $classes = join(' ', array_merge($this->getCssClasses(), $classes));\n if ($classes != '')\n {\n $classes = \" class=\\\"$classes\\\"\";\n }\n $calledClass = get_called_class();\n if (YII_DEBUG)\n {\n $reflection = new ReflectionClass( $calledClass );\n $classFile = $reflection->getFileName();\n return \"<!--Called in: $classFile--><div\" . $id . $classes . $this->getViewStyle() . \">$content</div>\";\n }\n else\n {\n return \"<div\" . $id . $classes . $this->getViewStyle() . \">$content</div>\";\n }\n }", "public function render()\n {\n // Pass messages by reference, as all messages are created after this function call\n $data = [ \"messages\" => &$this->messages ];\n $this->di->view->add($this->template, $data, $this->region);\n }", "private function renderView(){\n\t\trequire($this->ViewFile);\n\t}", "private function render_template() {\n\t\t$template = $this->template;\n\n\t\tif ( ! is_readable( $template ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinclude $template;\n\t}", "public function render (View $view, array $environment = array()) {\n extract($environment);\n ob_start();\n include $view->getTemplate();\n $contents = ob_get_clean();\n echo $contents;\n}", "function view(string $render, array $params = [], int $status = 200, array $headers = [])\n{\n $content = app(\"twig\")->render(\"renders\" . DS . $render, $params);\n response($content, $status, $headers);\n}", "public function render()\n {\n $config = $this->config();\n $location = $config['templates'] . \"/\" . $this->template . $config['extension'];\n\n if (file_exists($location) || $config['string_template']) {\n $prior = ob_start();\n extract($this->variables, EXTR_OVERWRITE, $config['string_template']);\n if (!$config['string_template']) {\n include $location;\n } else {\n echo $string;\n }\n $template = ob_get_clean();\n } else {\n throw new ViewException('Unable to locate the required template: ' . $location);\n }\n\n return $template;\n }", "public function renderPartialView($template, array $arguments = []) \n {\n extract($arguments);\n ob_start();\n require($this->templatePath.$template);\n return ob_get_clean();\n }", "private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}", "public function template()\n {\n\n include './views/template.php';\n\n }", "public function render ($view, $data = array())\r\n\t\t{\r\n\t\t\tlist ($path, $view) = explode ('::', $view);\r\n\r\n\t\t\t$path = PACKAGES_PATH.str_replace ('.', DS, strtolower ($path)).DS;\r\n\t\t\t$view = ! strstr ($view, '.tpl') ? $view.'.tpl' : $view;\r\n\r\n\t\t\t$this->view->setPath ($path);\r\n\t\t\t\r\n\t\t\tif (count ($data))\r\n\t\t\t{\r\n\t\t\t\t$this->view->bind ($data);\r\n\t\t\t}\r\n\r\n\t\t\treturn $this->view->display ($view);\r\n\t\t}", "public function render($view, $data_array = array())\n {\n $twig_loader = new Twig_Loader_Filesystem(PATH_VIEWS);\n $twig = new Twig_Environment($twig_loader);\n\n //rendre une vue en passant les données à rendre\n echo $twig->render($view . PATH_VIEW_FILE_TYPE, $data_array);\n }", "function render($view)\n\t{\n\t\t$data = $this->getData();\n\t\t\n\t\t\n\t\t//inclui funcoes auxiliares\n\t\trequire_once DIR . \"/Libs/functions.php\";\t\t\t\n\t\t\n\t\t//funcao que rendeniza as views\n\t\trequire_once DIR . \"/Views/layout/head.php\";\n\t\trequire_once DIR . \"/Views/layout/header.php\";\n\t\t//require_once DIR . \"/Views/layout/nav.php\";\n\t\t$this->menu($view);\n\t\t/*if(file_exists(DIR . \"/Views/\".$this->menu($view))){\n\t\t\trequire_once DIR . \"/Views/\".$this->menu($view);\n\t\t}*/\n\t\trequire_once DIR . \"/Views/layout/main.php\";\t\t\t\t\n\t\trequire_once DIR . \"/Views/\" . $view . \".php\";\t\t\n\t\trequire_once DIR . \"/Views/layout/footer.php\";\n\t}", "function stage_render_template($path, $data)\n{\n return view($path, view($path)->getData(), $data)->render();\n}", "protected function renderView() {\n try {\n $view = $this->response->getView();\n if ($view) {\n if ($this->log) {\n $this->log->logDebug('Rendering view', get_class($view), System::LOG_SOURCE);\n }\n\n if (!$view instanceof FileView) {\n $body = $view->render(true);\n\n $this->response->setBody($body);\n $this->response->setView(null);\n }\n\n if ($this->log) {\n $this->log->logDebug('Rendered view', get_class($view), System::LOG_SOURCE);\n }\n }\n } catch (Exception $exception) {\n $this->handleException($exception);\n }\n }", "public function getViewTemplate();", "public function render()\n\t{\n\t\t$template = $this->environment->loadTemplate(\\Adhoc\\Locale::file($this->representation));\n\t\treturn $template->render((array)$this->view);\n\t}", "public function renderView()\n {\n // Is valid record\n $result = $this->prepareRecord();\n if ($result instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($result);\n }\n if ($this->contentType == \"json\") {\n $record = $this->Model->toArray();\n // Hook Filter viewModifyRecord\n $record = $this->doFilter(\"viewModifyRecord\", $record);\n // Send Response\n $JsonResponse = new JsonResponse($record, 200);\n $JsonResponse->send();\n exit;\n }\n // Render View\n $parameters = array(\n \"Scaffolding\" => $this,\n );\n $content = view($this->template . \".view\", $parameters)->render();\n return $content;\n }", "public static function render_template($template, $data = array()) {\n return render(static::template($template, $data));\n }", "public function render($viewName, $data = array()) {\n\t\ttry {\n\t\t\treturn $this->twig->render($viewName, $data);\n\t\t}\n\t\tcatch (\\Twig_Error_Loader $e) {\n\t\t\tthrow new TemplateNotFoundError($e->getMessage());\n\t\t}\n\t\tcatch (\\Twig_Error_Syntax $e) {\n\t\t\tthrow new TemplateSyntaxError($e->getMessage(), 0, $e);\n\t\t}\n\t\tcatch (\\Twig_Error_Runtime $e) {\n\t\t\tthrow new TemplateEvaluationError($e->getMessage(), 0, $e);\n\t\t}\n\t}", "public function renderView(View $view)\n {\n $template = $view->template();\n\n // add extension if left off\n $len = strlen(self::EXTENSION);\n if (substr($template, -$len, $len) != self::EXTENSION) {\n $template .= self::EXTENSION;\n }\n\n $template = $this->viewsDir.'/'.$template;\n\n // assign global and view parameters\n $parameters = array_replace($this->getGlobalParameters(), $view->getParameters());\n\n // escape HTML special characters\n foreach ($parameters as &$value) {\n if (is_array($value) || is_object($value)) {\n continue;\n }\n\n $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n }\n\n return $this->render($parameters, $template);\n }", "public function render()\n {\n try {\n $this->build();\n } catch (\\Exception $e) {\n return Handler::renderException($e);\n }\n\n return view($this->view, $this->variables())->render();\n }", "public function render() {\n $args = func_get_args();\n if (isset($args[0]) && is_string($args[0])) {\n $tpl = array_shift($args);\n } else {\n $tpl = get_class($this);\n $paths = explode('\\\\', $tpl);\n array_shift($paths);\n $className = array_pop($paths);\n $actionSuffix = 'Action';\n if (substr($className, strrpos($className, $actionSuffix)) === $actionSuffix) {\n $basename = substr($className, 0, -strlen($actionSuffix));\n } else {\n $basename = $className;\n }\n array_push($paths, $basename);\n foreach ($paths as &$path) {\n $path = Toolkit::to_snake_case($path);\n }\n unset($path);\n $tpl = implode(DIRECTORY_SEPARATOR, $paths);\n }\n if (isset($args[0]) && is_array($args[0])) {\n $params = array_shift($args);\n } else {\n $params = [];\n }\n if (isset($args[0]) && is_string($args[0])) {\n $cacheId = array_shift($args);\n } else {\n $cacheId = '';\n }\n\n return $this->view->render($tpl, $params, $cacheId);\n }", "public function renderView(string $view, array $data = [])\n {\n return $this->templating->render($view, $data);\n }", "public function render() {\n $templates = func_get_args();\n $reserved = array('templates', 'template', 'this', 'key', 'value', 'reserved');\n \n // Give access to the set variables\n if (!empty($this->vars)) {\n foreach ($this->vars as $key => $value) {\n if (!in_array($key, $reserved)) {\n $$key = $value;\n }\n }\n }\n \n // Load the templates\n foreach ($templates as $template) {\n include $this->getThemedFile(\"{$template}.template.php\");\n }\n }", "public function render(){\n\n if($this->renderedTex){\n\n return $this->renderedTex;\n }\n\n if(!view()->exists($this->stubPath)){\n\n throw new ViewNotFoundException('View ' . $this->stubPath . ' not found.');\n }\n\n \t$this->renderedTex = view($this->stubPath, $this->data)->render();\n\n \treturn $this->renderedTex;\n }", "public function renderView($template, array $parameters = array())\n {\n $parameters['module'] = $this->module->createView();\n\n return $this->getContainer()->get('templating')->render($template, $parameters);\n }", "public function forTemplate()\n {\n return $this->renderWith($this->defaultTemplate());\n }", "protected function _render()\n {\n $renderer = $this->param('renderer');\n if ($renderer) {\n return call_user_func($renderer, $this);\n }\n\n ob_start();\n include $this->getTemplateFileName();\n return ob_get_clean();\n }", "function render_template($template_name, $layout = NULL) {\n\n # open template\n $factory = new Flexi_TemplateFactory($this->dispatcher->trails_root .\n '/views/');\n\n $template = $factory->open($template_name);\n\n # template requires setup ?\n switch (get_class($template)) {\n case 'Flexi_JsTemplate':\n $this->set_content_type('text/javascript');\n break;\n }\n\n $template->set_attributes($this->get_assigned_variables());\n\n if (isset($layout)) {\n $template->set_layout($layout);\n }\n\n $this->render_text($template->render());\n }", "public function render($subview = NULL){\n\t\t# Catch NULL Subview\n\t\tif(is_null($subview)){\n\t\t\tshow_error('Subbiew was not set.',500, $heading = 'An Error Was Encountered');\n\t\t}\n\t\t# Load View\n\t\t$this->data['subview'] = $subview;\n\t\t$this->load->view($this->view_template,$this->data);\n\t}", "public function renderEditView($template, array $arguments = [])\n {\n \textract($arguments);\n \tob_start();\n require($this->templatePath.\"layout/header.html.php\");\n require($this->templatePath.\"layout/edit/menu.html.php\");\n require($this->templatePath.$template);\n \treturn ob_get_clean();\n }", "public static function render($view)\n\t{\n\t\t$path = str_replace('.', DS, $view); // Handle 'pretty' paths\n\t\n\t\tob_start(); // Start the render buffer\n\t\t\n\t\t// Include the file, letting the contents render, but not print\n\t\tinclude( area('application') . 'views' . DS . $path . EXT );\n\t\t\n\t\treturn ob_get_clean(); // Return the contents of the view\n\t}", "function render ( $template, $data = array() ) {\r\n $template = $this->_twig->loadTemplate( $template );\r\n\r\n return $template->render( $data );\r\n }", "function render($view, $data)\n {\n\n $smarty = new Smarty();\n\n //Indicamos las carpetas a usar por SMARTY\n $smarty->template_dir = \"views\";\n $smarty->compile_dir = \"templates_c\";\n\n //Toda la data que se muestre la mando\n foreach ($data as $key => $value) {\n $smarty->assign($key, $value);\n\n }\n //mando la view a mostrar al layout, y hago que displayee el layout\n $smarty->assign(\"viewFile\", $view . \".tpl\");\n $smarty->display(\"layout.tpl\");\n }", "protected function render($template, $data=array()) {\n\n //Add extra data to the array\n $data['breadcrumb_array'] = $this->breadcrumb_array;\n $data['activity_link'] = false; //Need to create links to activity module\n\n //Metas & titles\n\n $data['meta_title'] = Config::get('modules.'.$this->module.'.title');\n\n $data['page_title'] = Config::get('modules.'.$this->module.'.title');\n\n $data['page_subtitle'] = $this->page_subtitle;\n if($data['page_subtitle']) $data['meta_title'] .= \" - \".$data['page_subtitle'];\n\n\n $data['page_shortcut'] = Auth::User()->hasAdminShortcut(\"/\".request()->path());\n\n return view($template, $data);\n }", "public function render($template, array & $params = array())\n {\n // Détermine le chemin des templates\n $config = $this->config;\n $view_path = $config['path']['views'];\n \n // Rend les variables disponibles au template\n extract($this->params);\n extract($params);\n \n // Place le contenu du template dans une variable\n ob_start();\n include($view_path.'/'.$template.'.php');\n $content = ob_get_clean();\n \n return $content;\n }", "public function render(string $view, array $parameters = []): Response;", "public static function render($view, $data = array()) {\n $filename = '../api/views/' . $view . '.php';\n\n if (!file_exists($filename)) {\n die('Unknown view! ' . $filename);\n }\n\n include_once($filename);\n }", "protected function createViewTemplate()\n {\n $overwrite_file = $this->hasOption('force') ? $this->option('force') : false;\n\n $path = $this->getViewTemplatePath();\n\n $contents = $this->getViewTemplateContents();\n\n (new FileGenerator($path, $contents))->withFileOverwrite($overwrite_file)->generate();\n }", "public function render ($template, $params = [])\n {\n $view = new View();\n $params['generator'] = $this;\n\n $path = $this->getTemplatePath() . '/' . $template;\n if (!file_exists($path)) {\n /// XXX quick solution, better redo\n $class = (new \\ReflectionClass($this))->getParentClass();\n $dir = dirname($class->getFileName()) . '/default';\n $path = $dir . '/' . $template;\n };\n return $view->renderFile($path, $params, $this);\n }", "public function render()\n {\n if (file_exists('../resources/views/' . $this->view_name . '.phtml')) {\n include_once '../resources/views/' . $this->view_name . '.phtml';\n include_once '../resources/views/layouts/' . $this->layout . '.phtml';\n } else {\n die(\"THERE IS NO VIEW\");\n }\n }", "public function view(string $template, array $data = []): string\n {\n\n return $this->twig->render($template, $data);\n }", "public function testRenderTemplate() {\n\t\t$this->View->set(['aVariable' => 123]);\n\t\t$result = $this->View->render('simple');\n\t\t$expected = \"The value of aVariable is: 123.\\n\";\n\n\t\t$this->assertSame($expected, $result, 'variables in Twig tags should be evaluated');\n\t}", "function render($view, $values = [])\n {\n // if view exists, render it\n if (file_exists(\"../views/{$view}\"))\n {\n // extract variables into local scope\n extract($values);\n\n // render view \n require(\"../views/{$view}\");\n exit;\n }\n\n // else error\n else\n {\n echo(\"Could not render\");\n }\n }", "public function renderView()\n {\n //$_SESSION[\"info\"] zobrazuje vysledek operaci, paklize se nejake udaly\n if((isset($_SESSION[\"info\"])) && (!empty($_SESSION[\"info\"]))){\n $this->view_data[\"info\"] = $_SESSION[\"info\"];\n $_SESSION[\"info\"] = null;\n } \n\n //generuje csrf token pro formulare\n if (!isset($_SESSION[\"csrf_token\"])) {\n $_SESSION[\"csrf_token\"] = rand(1, 1e9);\n }\n \n if ($this->view)\n {\n $this->view_data[\"view\"] = $this->view;\n extract($this->view_data);\n $main_template = (dirname(__FILE__) .'/../view/@layout.phtml');\n \n if(file_exists($main_template))\n require_once($main_template); \n }\n }", "function render ($template, ViewModelInterface $data = null);", "public function render($controller, $template, $data = array(), $render = true) {\r\n\t\t//load up the template.\r\n\t\t$template = $this->_twig_env->loadTemplate($controller.'/'.$template.'.twig');\r\n\t\treturn ($render)?$template->render($data):$template;\r\n }", "public static function make($viewname, array $data = [])\n {\n return static::singleton()->getTemplate()->render($viewname, $data);\n }", "public function render() {\n return $this->getRenderer()->render($this->getLayout() . $this->getContainer()->get('config')->get('template.extension'), $this->getData());\n }", "function render() \n {\n return View::factory($this->template_path . get_class($this))\n ->set('grid', $this)\n ->render();\n \n }", "public function render($template,$varArray=array()){\n\t$this->setByArray($varArray);\n\t$this->layoutVars['content'] = $this->CI->load->view($template, $this->vars, true);\n\n\tif (count($this->jsFiles) > 0)\n\t\t$this->layoutVars['globalJS'] = implode(\"\\n\\t\",$this->jsFiles);\n\telse\n\t\t$this->layoutVars['globalJS'] = \"\";\n\n\tif (count($this->cssFiles) > 0)\n\t\t$this->layoutVars['globalCSS'] = join(\"\\n\\t\",$this->cssFiles);\n\telse\n\t\t$this->layoutVars['globalCSS'] = \"\";\n\n\treturn $this->CI->load->view($this->layout, $this->layoutVars, false);\n}", "public function __call($view_name, $arguments) {\n $class_name = get_class($this);\n $view = View::factory($class_name, $view_name);\n try {\n $view->render();\n } catch (\\InvalidArgumentException $err) {\n // view template file does not exist\n Application::handleError(404);\n }\n }", "private function _template($data, $view)\n\t{\n\t\t$this->load->view('view/' . $view, $data);\n\t}", "public static function render($filePath, array $data = null) \n {\n //this try block is excecuted to enable throwing and catching of errors as appropriate\n try {\n\n //get the variables passed and make them available to the view\n if ( $data != null)\n {\n //loop through the array setting the respective variables\n foreach ($data as $key => $value) \n {\n $$key = $value;\n\n }\n\n }\n\n //get the parsed contents of the template file\n $contents = self::getContents($filePath);\n\n //start the output buffer\n ob_start();\n\n //evaluate the contents of this view file\n eval(\"?>\" . $contents . \"<?\");\n\n //get the evaluated contents\n $contents = ob_get_contents();\n\n //clean the output buffer\n ob_end_clean();\n\n //return the evaluated contents\n echo $contents;\n\n //stop further script execution\n exit();\n \n }\n\n catch(BaseException $e) {\n\n //echo $e->getMessage();\n $e->show();\n\n }\n\n catch(Exception $e) {\n\n echo $e->getMessage();\n \n }\n\n }", "public function render() {\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Executing all modules methods.\" );\n\t\tW2P::getInstance()->modules()->exec_all_functions();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Generating rendering of the view: {$this->view}\" );\n\t\t\n\t\tob_start ();\n\t\tinclude_once (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/views/' . $this->view . '.phtml');\n\t\t$this->content = ob_get_clean ();\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Content of the rendered view\" );\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Adding to the project layout\" );\n\t\t\n\t\tinclude (W2P_INCLUDE . W2P::getInstance()->configuration()->layout_path . '/' . $this->layout . '.phtml');\n\t\t\n\t\tW2P::getInstance()->debug()->_debug_add_content ( \"Layout successfully mastered\" );\n\t\t\n\t\tif (W2P::getInstance()->configuration()->debug)\n\t\t\tW2P::getInstance()->debug()->save_debug ( W2P::getInstance()->configuration()->debug_format );\n\t}", "public function render()\n {\n $template = $this->extractTemplate($this->presentation);\n\n if (null === $template)\n {\n return null;\n }\n\n $html = '';\n\n if (!empty($template))\n {\n $html .= $this->templatesService->render($template, $this->arguments);\n }\n\n return $html;\n }", "public function render($view, $values = array())\n {\n // Setup the template path\n $folder = $this->app->config('templates.path');\n $view = $folder . $view . '.php';\n\n // Check if the template exists\n if (!file_exists($view)) {\n throw new \\Exception('Template not found: ' . $view, 404);\n }\n\n // Extract values and include template\n extract($values);\n ob_start();\n include $view;\n $html = ob_get_contents();\n ob_end_clean();\n\n // Return rendered HTML\n return $html;\n }", "public function render( $view, $data = [] ) {\n\t\t$out = $this->getOutput();\n\t\t$this->setHeaders();\n\t\t$out->setProperty( 'unstyledContent', true );\n\t\t// disable visible page title\n\t\t$out->setPageTitle( $view->getTitle() );\n\t\t// add title of the actual view to html title-tag\n\t\t$out->setHTMLTitle( $view->getHTMLTitle() );\n\t\t$view->render( $out, $data );\n\t}", "public function render() {\n\t\t$this->rendered = false;\n\t\tob_start();\n\t\t\t//RENDERING VIEW HERE\n\t\t\trequire_once(\"pages/View/\" . $this->_view);\n\t\t\t$this->content = ob_get_contents();\n\t\tob_end_clean();\n\t\t$this->rendered = true;\n\t\treturn ($this->content);\n\t}", "protected function render($template, array $data = [])\n {\n $data = array_merge($data);\n return $this->view->render(\n $this->response,\n $template,\n $data\n );\n }", "public function view()\n {\n $this->processParametersForView();\n \n if ($this->view === 'main/base') { //Legacy and body\n extract($this->data);\n \n include(__DIR__ . '/../View/' . $this->view . '.php');\n \n return;\n }\n \n //Templates\n $this->latteView();\n }", "public function render()\n {\n $content = $this->__layoutContent();\n\n extract($this->getViewData());\n ob_start();\n include $content;\n ob_get_flush();\n }", "public function render()\n {\n if (is_archive()) {\n // Archive stuff\n } else {\n // Get Template vars\n $context = Timber::get_context();\n $post = new \\TimberPost();\n $context['post'] = $post;\n // Render Template\n Timber::render('pages/single-book.twig', $context);\n }\n }", "private static function view(): void\n {\n Debug::setBacklog();\n\n /**\n * Calls the methods to define and validate the template and view files.\n */\n self::viewCheckTemplateFile();\n self::viewDefineViewPath();\n self::viewCheckFileExists();\n\n /**\n * Calls the method that will import the template file to be returned to the request.\n */\n self::viewRequireTemplate(\n new ViewHelper(\n self::$routeController->getResultData(),\n self::$viewPath\n ),\n );\n }", "protected function render($view, $data){\n\n\t\tif(! $this->input->is_ajax_request()){\n\n\t\t\t$this->load->view($this->_header, $data);\n\t\t\t$this->load->view($this->_sidebar, $data);\n\t\t}\n\n\t\t$this->load->view($view, $data);\n\n\t\tif(! $this->input->is_ajax_request())\n\t\t\t$this->load->view($this->_footer, $data);\n\t}", "public function render_view($view, $data=[])\n\t{\n\t\tif(file_exists(\"app/view/\".$view.\".php\"))\n\t\t{\n\t\t\tif(!empty($data))\n\t\t\t{\n\t\t\t\textract($data);\n\t\t\t}\n\t\t\trequire_once(\"app/view/\".$view.\".php\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(\"Error view '\".$view.\"' does not exist\");\n\t\t}\n\t}", "protected function render($view, $data = null) {\n \n if (!is_null($data)) {\n extract($data);\n }\n\n include \"../views/$view.phtml\"; //$view: quer dizer o ficheiro que vier com .phtml ele processa.\n }", "public function render($template, DataInterface $data);", "public function render()\n {\n return view('bs-component::form.dynamic-template');\n }", "protected function render($view, $data = null)\n {\n if( is_null($data) ) $data = [];\n $data['slug'] = $this->slug;\n $data['title'] = $this->title;\n $data['columns'] = $this->obj->getColumns($view); \n\n return view($this->slug.\".\".$view, $data);\n }", "private function _template($data, $view)\n\t{\n\t\t$this->load->view('mahasiswa/views/' . $view, $data);\n\t}", "private function _template($data, $view)\n\t{\n\t\t$this->load->view('mahasiswa/views/' . $view, $data);\n\t}", "public function render()\n {\n parent::render();\n\n $oContent = $this->getContent();\n if ($oContent && !$this->_canShowContent($oContent->oxcontents__oxloadid->value)) {\n oxRegistry::getUtils()->redirect($this->getConfig()->getShopHomeURL() . 'cl=account');\n }\n\n $sTpl = false;\n if ($sTplName = $this->_getTplName()) {\n $this->_sThisTemplate = $sTpl = $sTplName;\n } elseif ($oContent) {\n $sTpl = $oContent->getId();\n }\n\n if (!$sTpl) {\n error_404_handler();\n }\n\n // sometimes you need to display plain templates (e.g. when showing popups)\n if ($this->showPlainTemplate()) {\n $this->_sThisTemplate = $this->_sThisPlainTemplate;\n }\n\n if ($oContent) {\n $this->getViewConfig()->setViewConfigParam('oxloadid', $oContent->getLoadId());\n }\n\n return $this->_sThisTemplate;\n }", "public function render() {\n\t\t$this->template->setFile(__DIR__ . '/templates/' . $this->templateName);\n\n\t\t$this->template->richTexts = $this->getRichTextNames();\n\t\t$this->template->config = $this->configuration;\n\n\t\t$this->template->render();\n\t}", "function render_view( $view, $args = array() ) {\n\t\textract( $args );\n\t\tinclude $this->plugin_dir_path . '/view/' . $view . '.php';\n\t}", "public static function view($template, $context = false)\n\t{\n\t\tif (is_null($template)) return;\n\n\t\tTimber::render($template, $context);\n\n\t\tif ( defined('TEMPLATE_DEBUG') && TEMPLATE_DEBUG ) {\n\n\t\t\techo '<div style=\"background-color:#18171B;padding:20px;margin-top:50px\">';\n\t\t\tdump('======= Dev only =======', $context, 'Current template: '.$template);\n\t\t\techo '</div>';\n\n\t\t}\n\n\t}" ]
[ "0.7697917", "0.75261205", "0.74491084", "0.736228", "0.7358392", "0.7358392", "0.7358392", "0.7207627", "0.7187606", "0.7157685", "0.70781314", "0.6991685", "0.69745624", "0.6946579", "0.68931115", "0.6877129", "0.6835607", "0.68138415", "0.68066424", "0.680365", "0.67896646", "0.6787528", "0.6784622", "0.6776996", "0.67399305", "0.6716961", "0.67131364", "0.6706662", "0.67060155", "0.669709", "0.6678074", "0.66730464", "0.66646844", "0.6644765", "0.66401815", "0.66332626", "0.66277915", "0.66227114", "0.65728414", "0.6571731", "0.65697557", "0.6563671", "0.6562554", "0.6556637", "0.6545499", "0.6529903", "0.6528304", "0.65244186", "0.65232235", "0.6522111", "0.6518724", "0.6503587", "0.6502651", "0.65009874", "0.649346", "0.6490492", "0.64866436", "0.64809006", "0.6471066", "0.64690995", "0.6462838", "0.6452279", "0.64507383", "0.64314896", "0.6426807", "0.6410579", "0.6402288", "0.6398227", "0.63814634", "0.6380891", "0.63766944", "0.6364925", "0.63596", "0.6357424", "0.6355181", "0.6354829", "0.6354508", "0.63537276", "0.6347329", "0.6346852", "0.6341135", "0.6340699", "0.6320099", "0.6317722", "0.63126796", "0.63088155", "0.6305716", "0.63052976", "0.629993", "0.62908936", "0.6289107", "0.6287508", "0.6284845", "0.62848043", "0.6282754", "0.6281096", "0.6281096", "0.6276395", "0.6271111", "0.62624615", "0.62616813" ]
0.0
-1
Command execute Generate the ISO19139 metadata XML and return it.
public function execute() { $data = $this->getParameters(); if(! isset($data['MDMetadata'])){ throw new GenerateISO19139XMLCommand_Exception("No data-object given"); } $MDMetadata = $data['MDMetadata']; if(! is_a($MDMetadata,'MDMetadata')){ throw new GenerateISO19139XMLCommand_Exception("data-object is not a MDMetadata"); } $requestXML = self::$templatename; $obj = new ViewableData(); $obj->customise($MDMetadata); $data = $obj->renderWith($requestXML); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_head()\n {\n $this->xml->openMemory();\n $this->xml->setIndent(true);\n $this->xml->startDocument(\"1.0\",\"UTF-8\");\n $this->xml->startElement(\"program\");\n $this->xml->writeAttribute(\"language\",\"IPPcode19\");\n }", "public function createXML() {}", "public function generateOutputCmd(): string;", "public function run()\n {\n \\Yii::$app->response->format = Response::FORMAT_XML;\n return $this->samlSsoComponent->getMetadata();\n }", "public function generate()\n {\n AnnotationRegistry::registerFile(\n __DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'\n );\n\n $driver = new AnnotationDriver(\n new CachedReader(new AnnotationReader(), new ArrayCache()),\n array(\n __DIR__ . '/../library/Xi/Filelib/Backend/Adapter/DoctrineOrm/Entity',\n )\n );\n\n $config = new Configuration();\n $config->setMetadataDriverImpl($driver);\n $config->setProxyDir(ROOT_TESTS . '/data/temp');\n $config->setProxyNamespace('Proxies');\n\n $em = EntityManager::create($this->connectionOptions, $config);\n\n $st = new SchemaTool($em);\n $metadata = $st->getCreateSchemaSql($em->getMetadataFactory()->getAllMetadata());\n\n return join(\";\\n\", $metadata) . \";\\n\";\n }", "public function testComDayCqDamCoreProcessExifToolExtractMetadataProcess()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.dam.core.process.ExifToolExtractMetadataProcess';\n\n $crawler = $client->request('POST', $path);\n }", "protected function _generate() {\n\t\t\n\t\t// recuperation de l'executable\n\t\t$cmd = $this->getExecutable();\n\t\t\n\t\t// gestion des paramètres\n\t\tforeach ($this->getParam() as $param => $value) {$cmd .= ' --' . (!is_numeric($param) ? $param . '=' : '') . $value;}\n\t\t\n\t\t// connexion\n\t\tforeach (array('u ' => 'username', 'p' => 'password', 'dbname') as $prefix => $key) {\n\t\t\tif ($value = array_find($key, $this->getConfig())) {$cmd .= ' ' . (!is_numeric($prefix) ? '-' . $prefix : '') . $value;}\n\t\t\telse { \n\t\t\t\trequire_once 'Zend/Exception.php';\n\t\t\t\tthrow new Zend_Exception('Erreur paramètre de connexion : ' . $key);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//construction de l'url du fichier\n\t\tif (!strlen($this->getFile())) { $this->setFile($this->getDirectory() . '/mysqldump_' . array_find('dbname', $this->getConfig()) . '_' . time() .'.sql' . ($this->getCompress() ? '.bz2' : '')); }\n\t\t\n\t\t// ajoute la fonction pour la compression\n\t\t$cmd .= $this->getCompress() ? ' | bzip2 --stdout --quiet --best ' : '';\n\t\t\n\t\t// inscirption de l'url\n\t\t$cmd .= ' > ' . $this->getFile();\n\n\t\treturn $cmd;\n\t}", "public function meta() {\t\t\t\t\t\t\n\t\t\t$this->output->layout = \"empty\";\n\t\t\t$this->output->set(\"actions\", results_array(\"SELECT * FROM actions ORDER BY title\"));\n\t\t\t$this->output->view(\"api/xml/meta.php\");\n\t\t\t$this->output->header(\"Content-Type: text/xml\");\n\t\t\t$this->output->cache($this->default_cache_timeout);\n\t\t}", "public function GetXML() {\n $xml = '<?xml version=\"1.0\" encoding=\"utf-8\"?><getAuthorization>';\n $xml .= \"<Version>$this->version</Version>\";\n $xml .= \"<Processor>$this->processor</Processor>\";\n $xml .= \"<MerchantID>$this->merchantID</MerchantID>\";\n if (!IsNullOrEmptyString($this->terminalID))\n $xml .= \"<TerminalID>$this->terminalID</TerminalID>\";\n $xml .= \"<TransType>$this->transType</TransType>\";\n $xml .= \"<TrAmount>$this->trAmount</TrAmount>\";\n if ($this->transType == '4' || $this->transType == 4)\n $xml .= \"<NewAmount>$this->newAmount</NewAmount>\";\n $xml .= \"<TrCurrency>$this->trCurrency</TrCurrency>\";\n $xml .= \"<DateAndTime>$this->dateAndTime</DateAndTime>\";\n if (!IsNullOrEmptyString($this->PAN))\n $xml .= \"<PAN>$this->PAN</PAN>\";\n if (!IsNullOrEmptyString($this->expDate))\n $xml .= \"<ExpDate>$this->expDate</ExpDate>\";\n if (!IsNullOrEmptyString($this->track1))\n $xml .= \"<Track1>$this->track1</Track1>\";\n if (!IsNullOrEmptyString($this->track2))\n $xml .= \"<Track2>$this->track2</Track2>\";\n $xml .= \"<RRN>$this->RRN</RRN>\";\n if (!IsNullOrEmptyString($this->authCode))\n $xml .= \"<AuthCode>$this->authCode</AuthCode>\";\n if (!IsNullOrEmptyString($this->CVC2))\n $xml .= \"<CVC2>$this->CVC2</CVC2>\";\n if (!IsNullOrEmptyString($this->securityLevelInd))\n $xml .= \"<SecurityLevelInd>$this->securityLevelInd</SecurityLevelInd>\";\n if (!IsNullOrEmptyString($this->UCAF))\n $xml .= \"<UCAF>$this->UCAF</UCAF>\";\n if (!IsNullOrEmptyString($this->CAVV))\n $xml .= \"<CAVV>$this->CAVV</CAVV>\";\n if (!IsNullOrEmptyString($this->XID))\n $xml .= \"<XID>$this->XID</XID>\";\n if (!IsNullOrEmptyString($this->merchantName))\n $xml .= \"<MerchantName>$this->merchantName</MerchantName>\";\n if (!IsNullOrEmptyString($this->merchantCity))\n $xml .= \"<MerchantCity>$this->merchantCity</MerchantCity>\";\n if (!IsNullOrEmptyString($this->merchantCountry))\n $xml .= \"<MerchantCountry>$this->merchantCountry</MerchantCountry>\";\n $xml .= \"</getAuthorization>\";\n return $xml;\n }", "public function run()\n {\n \n $metadata = Metadata::create([\n 'title' => '', \n 'author'=>'Sistema'\n ]);\n }", "public static function init(){\n\t\tself::$xml = xmlwriter_open_memory();\n\t\txmlwriter_set_indent(self::$xml, 1);\n\t\t$res = xmlwriter_set_indent_string(self::$xml, \" \");\n\t\txmlwriter_start_document(self::$xml, '1.0', 'UTF-8');\n\n\t\txmlwriter_start_element(self::$xml, 'program');\n\t\txmlwriter_start_attribute(self::$xml, 'language');\n\t\txmlwriter_text(self::$xml, 'IPPcode19');\n\t\txmlwriter_end_attribute(self::$xml);\n\t}", "function displayHelp($file){\n$xml = new XmlWriter();\n$xml->openMemory();\n//$xml->startDocument('1.0', 'UTF-8');\n$xml->startElement('doc');\n\n// CData output\n$xml->startElement('help');\n$xml->writeCData(\"$file\");\n$xml->endElement();\n\n// end the document and output\n$xml->endElement();\necho $xml->outputMemory(true);\n}", "private function createCoreXmlFile()\n {\n $createdDate = (new \\DateTime())->format(\\DateTime::W3C);\n $coreXmlFileContents = <<<EOD\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <dcterms:created xsi:type=\"dcterms:W3CDTF\">$createdDate</dcterms:created>\n <dcterms:modified xsi:type=\"dcterms:W3CDTF\">$createdDate</dcterms:modified>\n <cp:revision>0</cp:revision>\n</cp:coreProperties>\nEOD;\n\n $this->createFileWithContents($this->docPropsFolder, self::CORE_XML_FILE_NAME, $coreXmlFileContents);\n\n return $this;\n }", "public function doGenerateCommand()\n {\n $result = new ezcMvcResult();\n\n $videoFile = $this->VideoFile;\n\n $episodeFile = new TVEpisodeFile( $videoFile );\n $result->variables['status'] = 'ok';\n $commandGenerator = new MKVMergeCommandGenerator();\n\n // add audio + video in english, and disable existing subtitles\n foreach( $commandGenerator->addInputFile( new MKVMergeMediaInputFile( $episodeFile->path ) )\n as $track )\n {\n if ( $track instanceof MKVmergeCommandSubtitleTrack )\n {\n $track->enabled = false;\n }\n else\n {\n $track->language = 'eng';\n $track->default_track = true;\n }\n }\n // add subtitle file\n if ( $episodeFile->hasSubtitleFile )\n {\n foreach( $commandGenerator->addInputFile( new MKVMergeSubtitleInputFile( $episodeFile->subtitleFile, 'fre' ) )\n as $track )\n {\n $track->language = 'fre';\n $track->default_track = true;\n }\n }\n\n // determine best disk\n $bestFit = mmMkvManagerDiskHelper::BestTVEpisodeFit( $episodeFile->fullname, $episodeFile->fileSize );\n if ( isset( $bestFit['RecommendedDiskHasFreeSpace'] ) && $bestFit['RecommendedDiskHasFreeSpace'] === 'true' )\n $disk = $bestFit['RecommendedDisk'];\n else\n $disk = 'VIMES';\n\n $commandGenerator->setOutputFile( \"/media/storage/{$disk}/TV Shows/{$episodeFile->showName}/{$episodeFile->filename}\" );\n\n $commandObject = $commandGenerator->get();\n $commandObject->appendSymLink = true;\n\n $result->variables['command'] = $commandObject->asString();\n\n return $result;\n }", "public function build()\n {\n return $this->generateXml();\n }", "function autoMetadata(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $this->getProjects();\n\t\t $this->getPersons();\n\t\t $this->getProjectCreators();\n\t\t $this->saveMetadata(); //save the results\n\t }", "public function generate()\n\t{\n\t\t$extractor = $this->createExtractor($this->extractor);\n\t\t$factory = $this->createGeneratorFactory();\n\t\t$generator = $factory->createGenerator($this->directoryToSaveSitemap);\n\n\t\treturn $generator->generate($this->fileName, $extractor);\n\t}", "private function xml() {\n if( $this->format === 'text/hal+xml' ) {\n header('Content-Type: text/hal+xml; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\XmlWriter(true);\n \n return $writer->execute($hal_response);\n } else {\n header('Content-Type: text/xml; charset=utf-8', TRUE, $this->status);\n $xml_data = new \\SimpleXMLElement('<?xml version=\"1.0\"?><data></data>');\n static::array_to_xml($this->content,$xml_data);\n \n return $xml_data->asXML();\n }\n \n }", "public function infoAction() {\n\t\tob_clean();\n\t\tif(ini_get('zlib.output_compression')) {\n\t\t\theader(\"Content-encoding: gzip\");\t\t\n\t\t}\n\n\t\theader(\"Content-type: text/xml\");\t\t\n\t\techo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><info>';\n\t\techo self::toXmlTag('version', $this->getExtensionVersion());\n\t\t$access = $this->verifyAccess(true);\n\t\techo self::toXmlTag('access', $access ? 'true' : 'false');\n\t\techo self::toXmlTag('clientIp', self::getClientIp());\n\t\tif($access) {\n\t\t\t$attributes = Mage::getResourceModel('catalog/product_attribute_collection')->getItems();\n\t\t\techo '<product_attributes>';\n\t\t\tforeach ($attributes as $attribute){\n\t\t\t\techo '<attribute>';\n\t\t\t \techo self::toXmlTag('attribute_code', $attribute->getAttributeCode());\n\t\t\t \techo self::toXmlTag('attribute_name', $attribute->getFrontendLabel());\n\t\t\t echo '</attribute>';\n\t\t\t}\n\t\t\techo '</product_attributes>';\n\t\t} \n\n\t\techo '</info>';\n\t\texit;\n\t}", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function saveXML(){\n\t\t$path = \"/var/www/html/cap_12\";\n\t\t$xml = $this->gerarXMLCAP12();\n\t\n\t\t$siglacap = $this->instituicao->siglacap;\n\t\t$anoFolder = date('Y');\n\t\t$mesFolder = date('m');\n\t\t$diaFolder = date('d');\n\t\n\t\t$writer = new Writer();\n\t\t$writer->write($path . DIRECTORY_SEPARATOR)\n\t\t\t\t ->write($anoFolder . DIRECTORY_SEPARATOR)\n\t\t\t\t ->write($mesFolder . DIRECTORY_SEPARATOR)\n\t\t\t\t ->write($diaFolder . DIRECTORY_SEPARATOR)\n\t\t\t\t ->write($siglacap . DIRECTORY_SEPARATOR);\n\t\t\t\t\n\t\t$nomePasta = $writer->getString();\n\t\t$fileHelper = new FileHelper();\n\t\t$fileHelper->createDirectory($nomePasta, 755, true);\t\n\t\t\n\t\t$nomeArquivo = $nomePasta. $this->identifier.\".xml\";\n\t\ttry {\n\t\t\t$this->salvarArquivo($nomeArquivo, $xml);\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\tthrow new \\Exception(\"Erro ao tentar salvar o arquivo xml do cap\");\n\t\t}\n\t\treturn str_replace(\"/var/www/html/\", \"\", $nomeArquivo);\t\n\t}", "public function generateStandalone();", "public function generate()\n {\n $this->document = new \\DOMDocument('1.0', 'utf-8');\n $this->document->formatOutput = true;\n\n $rootEl = $this->document->createElementNS($this->nsUrl, 'gupdate');\n $rootEl->setAttribute('protocol', '2.0');\n $this->document->appendChild($rootEl);\n\n $appId = $this->idGenerator->getAppId();\n $appEl = $this->document->createElementNS($this->nsUrl, 'app');\n $appEl->setAttribute('appid', $appId);\n $rootEl->appendChild($appEl);\n\n $updateCheckEl = $this->document->createElementNS($this->nsUrl, 'updatecheck');\n $updateCheckEl->setAttribute('codebase', $this->packageUrl);\n $updateCheckEl->setAttribute('version', $this->package->getPackageVersion());\n $appEl->appendChild($updateCheckEl);\n }", "protected function workbookCoreXml() {\n\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n\t\t. '<cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">'\n\t\t// @ todo insert creators name - metata delegate\n\t\t. '<dc:creator>creator name</dc:creator>'\n\t\t. '<cp:lastModifiedBy>Name of last modified</cp:lastModifiedBy>'\n\t\t. '<dcterms:created xsi:type=\"dcterms:W3CDTF\">' . date('Y-m-d\\TH:i:s\\Z') . '</dcterms:created>'\n\t\t. '<dcterms:modified xsi:type=\"dcterms:W3CDTF\">' . date('Y-m-d\\TH:i:s\\Z') . '</dcterms:modified>'\n\t\t. '</cp:coreProperties>'\n\t\t\t;\n\t}", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "public function afficherXML(){\n echo\"<humidite>\";\n\n echo\"<moyenne>\".$this->moyenne.\"</moyenne>\";\n echo\"<max>\".$this->max.\"</max>\";\n echo\"<min>\".$this->min.\"</min>\";\n echo\"<nombreHumiditeReference>\".$this->nombreHumiditeReference.\"</nombreHumiditeReference>\";\n echo\"<date>\".$this->date.\"</date>\";\n\n echo\"</humidite>\";\n }", "private function generateThumbnailCmd(){\n\t}", "private function getXml()\n {\n try {\n $directory = __DIR__ . '/../../lib/Gocdb_Services/PI/';\n $em = \\Factory::getEntityManager();\n\n switch ($this->method) {\n case \"access_test\":\n require_once($directory . 'AccessTest.php');\n $this->authByIdentifier(true);\n $xml = (new AccessTest())->getRenderingOutput();\n break;\n case \"get_site\":\n require_once($directory . 'GetSite.php');\n $this->authByIdentifier();\n $getSite = new GetSite($em, $this->baseUrl, $this->baseApiUrl);\n $getSite->setDefaultPaging($this->defaultPaging);\n $getSite->setPageSize($this->defaultPageSize);\n $getSite->validateParameters($this->params);\n $getSite->createQuery();\n $getSite->executeQuery();\n $getSite->setSelectedRendering(\"GOCDB_XML\");\n $xml = $getSite->getRenderingOutput();\n break;\n case \"get_site_list\":\n require_once($directory . 'GetSite.php');\n $getSite = new GetSite($em);\n $getSite->validateParameters($this->params);\n $getSite->createQuery();\n $getSite->executeQuery();\n $getSite->setSelectedRendering(\"GOCDB_XML_LIST\");\n $xml = $getSite->getRenderingOutput();\n break;\n case \"get_site_contacts\":\n require_once($directory . 'GetSiteContacts.php');\n $this->authByIdentifier();\n $getSiteContacts = new GetSiteContacts($em, $this->baseApiUrl);\n $getSiteContacts->setDefaultPaging($this->defaultPaging);\n $getSiteContacts->setPageSize($this->defaultPageSize);\n $getSiteContacts->validateParameters($this->params);\n $getSiteContacts->createQuery();\n $getSiteContacts->executeQuery();\n $xml = $getSiteContacts->getRenderingOutput();\n break;\n case \"get_site_security_info\":\n require_once($directory . 'GetSiteSecurityInfo.php');\n $this->authByIdentifier();\n $getSiteSecurityInfo = new GetSiteSecurityInfo($em, $this->baseApiUrl);\n $getSiteSecurityInfo->setDefaultPaging($this->defaultPaging);\n $getSiteSecurityInfo->setPageSize($this->defaultPageSize);\n $getSiteSecurityInfo->validateParameters($this->params);\n $getSiteSecurityInfo->createQuery();\n $getSiteSecurityInfo->executeQuery();\n $xml = $getSiteSecurityInfo->getRenderingOutput();\n break;\n case \"get_roc_list\":\n require_once($directory . 'GetNGIList.php');\n $getNGIList = new GetNGIList($em);\n $getNGIList->validateParameters($this->params);\n $getNGIList->createQuery();\n $getNGIList->executeQuery();\n $xml = $getNGIList->getRenderingOutput();\n break;\n case \"get_subgrid_list\":\n require_once($directory . 'GetSubGridList.php');\n $getSubGrid = new GetSubGridList($em);\n $getSubGrid->validateParameters($this->params);\n $getSubGrid->createQuery();\n $getSubGrid->executeQuery();\n $xml = $getSubGrid->getRenderingOutput();\n break;\n case \"get_roc_contacts\":\n require_once($directory . 'GetNGIContacts.php');\n $this->authByIdentifier();\n $getNGIContacts = new GetNGIContacts($em, $this->baseUrl, $this->baseApiUrl);\n $getNGIContacts->setDefaultPaging($this->defaultPaging);\n $getNGIContacts->setPageSize($this->defaultPageSize);\n $getNGIContacts->validateParameters($this->params);\n $getNGIContacts->createQuery();\n $getNGIContacts->executeQuery();\n $xml = $getNGIContacts->getRenderingOutput();\n break;\n case \"get_service\":\n require_once($directory . 'GetService.php');\n $getSE = new GetService($em, $this->baseUrl, $this->baseApiUrl);\n $getSE->setDefaultPaging($this->defaultPaging);\n $getSE->setPageSize($this->defaultPageSize);\n $getSE->validateParameters($this->params);\n $getSE->createQuery();\n $getSE->executeQuery();\n $xml = $getSE->getRenderingOutput();\n break;\n case \"get_service_endpoint\":\n require_once($directory . 'GetService.php');\n $getSE = new GetService($em, $this->baseUrl, $this->baseApiUrl);\n $getSE->setDefaultPaging($this->defaultPaging);\n $getSE->setPageSize($this->defaultPageSize);\n $getSE->validateParameters($this->params);\n $getSE->createQuery();\n $getSE->executeQuery();\n $xml = $getSE->getRenderingOutput();\n break;\n case \"get_service_types\":\n require_once($directory . 'GetServiceTypes.php');\n $getST = new GetServiceTypes($em);\n $getST->validateParameters($this->params);\n $getST->createQuery();\n $getST->executeQuery();\n $xml = $getST->getRenderingOutput();\n break;\n case \"get_downtime_to_broadcast\":\n require_once($directory . 'GetDowntimesToBroadcast.php');\n $getDTTBroadcast = new GetDowntimeToBroadcast($em, $this->baseUrl, $this->baseApiUrl);\n $getDTTBroadcast->setDefaultPaging($this->defaultPaging);\n $getDTTBroadcast->setPageSize($this->defaultPageSize);\n $getDTTBroadcast->validateParameters($this->params);\n $getDTTBroadcast->createQuery();\n $getDTTBroadcast->executeQuery();\n $xml = $getDTTBroadcast->getRenderingOutput();\n break;\n case \"get_downtime\":\n //require_once($directory . 'GetDowntimeFallback.php');\n require_once($directory . 'GetDowntime.php');\n $getDowntime = new GetDowntime($em, false, $this->baseUrl, $this->baseApiUrl);\n $getDowntime->setDefaultPaging($this->defaultPaging);\n $getDowntime->setPageSize($this->defaultPageSize);\n $getDowntime->validateParameters($this->params);\n $getDowntime->createQuery();\n $getDowntime->executeQuery();\n $xml = $getDowntime->getRenderingOutput();\n break;\n case \"get_downtime_nested_services\":\n //require_once($directory . 'GetDowntimeFallback.php');\n require_once($directory . 'GetDowntime.php');\n $getDowntime = new GetDowntime($em, true, $this->baseUrl, $this->baseApiUrl);\n $getDowntime->setDefaultPaging($this->defaultPaging);\n $getDowntime->setPageSize($this->defaultPageSize);\n $getDowntime->validateParameters($this->params);\n $getDowntime->createQuery();\n $getDowntime->executeQuery();\n $xml = $getDowntime->getRenderingOutput();\n break;\n case \"get_user\":\n require_once($directory . 'GetUser.php');\n $this->authByIdentifier();\n $getUser = new GetUser(\n $em,\n \\Factory::getRoleActionAuthorisationService(),\n $this->baseUrl,\n $this->baseApiUrl\n );\n $getUser->setDefaultPaging($this->defaultPaging);\n $getUser->setPageSize($this->defaultPageSize);\n $getUser->validateParameters($this->params);\n $getUser->createQuery();\n $getUser->executeQuery();\n $xml = $getUser->getRenderingOutput();\n break;\n case \"get_project_contacts\":\n require_once($directory . 'GetProjectContacts.php');\n $this->authByIdentifier();\n $getProjCon = new GetProjectContacts($em, $this->baseApiUrl);\n $getProjCon->setDefaultPaging($this->defaultPaging);\n $getProjCon->setPageSize($this->defaultPageSize);\n $getProjCon->validateParameters($this->params);\n $getProjCon->createQuery();\n $getProjCon->executeQuery();\n $xml = $getProjCon->getRenderingOutput();\n break;\n case \"get_ngi\":\n require_once($directory . 'GetNGI.php');\n $this->authByIdentifier();\n $getNGI = new GetNGI($em, $this->baseApiUrl);\n $getNGI->setDefaultPaging($this->defaultPaging);\n $getNGI->setPageSize($this->defaultPageSize);\n $getNGI->validateParameters($this->params);\n $getNGI->createQuery();\n $getNGI->executeQuery();\n $xml = $getNGI->getRenderingOutput();\n break;\n case \"get_service_group\":\n require_once($directory . 'GetServiceGroup.php');\n $this->authByIdentifier();\n $getServiceGroup = new GetServiceGroup($em, $this->baseUrl, $this->baseApiUrl);\n $getServiceGroup->setDefaultPaging($this->defaultPaging);\n $getServiceGroup->setPageSize($this->defaultPageSize);\n $getServiceGroup->validateParameters($this->params);\n $getServiceGroup->createQuery();\n $getServiceGroup->executeQuery();\n $xml = $getServiceGroup->getRenderingOutput();\n break;\n case \"get_service_group_role\":\n require_once($directory . 'GetServiceGroupRole.php');\n $this->authByIdentifier();\n $getServiceGroupRole = new GetServiceGroupRole($em, $this->baseUrl, $this->baseApiUrl);\n $getServiceGroupRole->setDefaultPaging($this->defaultPaging);\n $getServiceGroupRole->setPageSize($this->defaultPageSize);\n $getServiceGroupRole->validateParameters($this->params);\n $getServiceGroupRole->createQuery();\n $getServiceGroupRole->executeQuery();\n $xml = $getServiceGroupRole->getRenderingOutput();\n break;\n case \"get_cert_status_date\":\n require_once($directory . 'GetCertStatusDate.php');\n $this->authByAnyIdentifier();\n $getCertStatusDate = new GetCertStatusDate($em, $this->baseApiUrl);\n $getCertStatusDate->setDefaultPaging($this->defaultPaging);\n $getCertStatusDate->setPageSize($this->defaultPageSize);\n $getCertStatusDate->validateParameters($this->params);\n $getCertStatusDate->createQuery();\n $getCertStatusDate->executeQuery();\n $xml = $getCertStatusDate->getRenderingOutput();\n break;\n case \"get_cert_status_changes\":\n require_once($directory . 'GetCertStatusChanges.php');\n $this->authByIdentifier();\n $getCertStatusChanges = new GetCertStatusChanges($em, $this->baseApiUrl);\n $getCertStatusChanges->setDefaultPaging($this->defaultPaging);\n $getCertStatusChanges->setPageSize($this->defaultPageSize);\n $getCertStatusChanges->validateParameters($this->params);\n $getCertStatusChanges->createQuery();\n $getCertStatusChanges->executeQuery();\n $xml = $getCertStatusChanges->getRenderingOutput();\n break;\n case \"get_site_count_per_country\":\n require_once($directory . 'GetSiteCountPerCountry.php');\n $getCountrySiteCount = new GetSiteCountPerCountry($em);\n $getCountrySiteCount->validateParameters($this->params);\n $getCountrySiteCount->createQuery();\n $getCountrySiteCount->executeQuery();\n $xml = $getCountrySiteCount->getRenderingOutput();\n break;\n //case \"get_role_action_mappings\":\n default:\n die(\"Unable to find method: {$this->method}\");\n break;\n }\n } catch (\\Exception $e) {\n die($e->getMessage());\n }\n return $xml;\n }", "public function getBookedXML()\n {\n $seg = $this->findSegment(static::SEG_ACCOUNT_INFORMATION);\n\n $parts = $this->splitSegment($seg);\n\n if (count($parts) > 3) {\n\n if ($parts[2] == HKCAZ::CAMT_FORMAT . '.xsd') {\n list($empty, $length, $xml) = explode('@', $parts[3], 3);\n if ($empty == '' && intval($length) == strlen($xml)) {\n return $xml;\n }\n\n throw new \\Exception('Fehler im XML Payload');\n\n } else {\n throw new \\Exception('Unerwartetes CAMT XML Format (' . $parts[2] . ')');\n }\n }\n\n return '';\n }", "public function execute(): void\n {\n $fileDirectoryPath = $this->filesystem->getDirectoryWrite(DirectoryList::PUB);\n $fileName = 'googleshopping.xml';\n try {\n $xmldata = $this->xmlFeed->getFeed();\n if (strlen($xmldata) > 500) {\n $fileDirectoryPath->writeFile($fileName, $xmldata);\n } else {\n $this->logger->error('Google Shopping XML Data not generated correctly');\n }\n } catch (\\Exception $exception) {\n $this->logger->error($exception->getMessage());\n }\n }", "private function create_xml_file(){\r\n global $CFG;\r\n \r\n $tmpfileid = time().rand(1,99999);\r\n $tmpfile = 'export_xml_'.$tmpfileid.'.pdf';\r\n $this->attachfile = $CFG->tempdir.'/'.$tmpfile;\r\n \r\n $dom = new DOMDocument('1.0', 'utf-8');\r\n $dom->preserveWhiteSpace = false;\r\n $dom->formatOutput = true;\r\n $dom->loadXML($this->xml_structure);\r\n $dom->save($this->attachfile);\r\n }", "function getPOXRequest() {\n return '<?xml version = \"1.0\" encoding = \"UTF-8\"?>\n<imsx_POXEnvelopeRequest xmlns = \"http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0\">\n <imsx_POXHeader>\n <imsx_POXRequestHeaderInfo>\n <imsx_version>V1.0</imsx_version>\n <imsx_messageIdentifier>MESSAGE</imsx_messageIdentifier>\n </imsx_POXRequestHeaderInfo>\n </imsx_POXHeader>\n <imsx_POXBody>\n <OPERATION>\n <resultRecord>\n <sourcedGUID>\n <sourcedId>SOURCEDID</sourcedId>\n </sourcedGUID>\n </resultRecord>\n </OPERATION>\n </imsx_POXBody>\n</imsx_POXEnvelopeRequest>';\n}", "function getMakeMetadata(){\n\t\t if(!$this->getSavedMetadata()){\n\t\t\t\t$this->tableID = false;\n\t\t\t\t$this->tableName = \"[Not titled]\";\n\t\t\t\t$this->tableDesciption = \"[Not described]\";\n\t\t\t\t$this->tableTags = false;\n\t\t\t\t$this->tableDOI = false;\n\t\t\t\t$this->tableARK = false;\n\t\t\t\t$this->published = false;\n\t\t\t\t$this->pubCreated = false;\n\t\t\t\t$this->pubUpdate = false;\n\t\t\t\t$this->license = $this->DBgetLicense();\n\t\t\t\t$this->getProjects();\n\t\t\t\t$this->getPersons();\n\t\t\t\t$this->getProjectCreators();\n\t\t\t\t$this->getGenerateTableID(); //create a table ID based in the metadata for the table\n\t\t\t\t$this->saveMetadata(); //save the results\n\t\t }\n\t\t else{\n\t\t\t\t$this->metadataParse(); //get saved metadata ready to use\n\t\t }\n\t\t $this->getTableSize(); //get the number of records in a table\n\t\t $this->getTableFields(); //get the fields in a table.\n\t\t $this->getSampleRecords(); //get the fields in a table.\n\t }", "function createMediaPackage() {\n $service_url = \"/ingest/createMediaPackage\";\n if($response = self::getXML($service_url)){\n return $response;\n } else return false;\n }", "protected function generate_instruction()\n {\n $this->xml->startElement(\"instruction\");\n $this->xml->writeAttribute(\"order\", $this->instrCount);\n $this->xml->writeAttribute(\"opcode\", $this->token);\n }", "function wm_write_metadata($image_id)\n{\n global $conf, $logger;\n \n $query = '\nSELECT\n img.name,\n img.comment,\n img.author,\n img.date_creation,\n GROUP_CONCAT(tags.name) AS tags,\n img.path,\n img.representative_ext\n FROM '.IMAGES_TABLE.' AS img\n LEFT OUTER JOIN '.IMAGE_TAG_TABLE.' AS img_tag ON img_tag.image_id = img.id\n LEFT OUTER JOIN '.TAGS_TABLE.' AS tags ON tags.id = img_tag.tag_id\n WHERE img.id = '.$image_id.'\n GROUP BY img.id, img.name, img.comment, img.author, img.path, img.representative_ext\n;';\n $result = pwg_query($query);\n $row = pwg_db_fetch_assoc($result);\n\n $name = wm_prepare_string($row['name'], 256);\n $description = wm_prepare_string($row['comment'], 2000);\n $author = wm_prepare_string($row['author'], 32);\n\n $command = isset($conf['exiftool_path']) ? $conf['exiftool_path'] : 'exiftool';\n $command.= ' -q';\n\n if (strlen($name) > 0)\n {\n # 2#105 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Headline=\"'.$name.'\"';\n\n # 2#005 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:ObjectName=\"'.wm_cutString($name, 64).'\"';\n }\n\n if (strlen($description) > 0)\n {\n # 2#120 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Caption-Abstract=\"'.$description.'\"';\n }\n\n if (strlen($author) > 0)\n {\n # 2#080 in iptcparse($imginfo['APP13'])\n $iptc_field = 'By-line';\n\n if (\n $conf['use_iptc']\n and isset($conf['use_iptc_mapping']['author'])\n and '2#122' == $conf['use_iptc_mapping']['author']\n )\n {\n # 2#122 in iptcparse($imginfo['APP13'])\n $iptc_field = 'Writer-Editor';\n }\n\n $command.= ' -IPTC:'.$iptc_field.'=\"'.$author.'\"';\n }\n \n if (strlen($row['tags']) > 0)\n {\n $tags = explode(',', $row['tags']);\n foreach ($tags as $tag)\n {\n $tag = wm_prepare_string($tag, 64);\n\n # 2#025 in iptcparse($imginfo['APP13'])\n $command.= ' -IPTC:Keywords=\"'.$tag.'\"';\n }\n }\n\n $command.= ' \"'.$row['path'].'\"';\n $command.= ' 2>&1';\n // echo $command;\n $logger->info(__FUNCTION__.' command = '.$command);\n\n $exec_return = exec($command, $output, $rc);\n // echo '$exec_return = '.$exec_return.'<br>';\n // echo '<pre>'; print_r($output); echo '</pre>';\n\n // as derivatives may contain metadata, they must be reset\n delete_element_derivatives($row);\n\n return array($rc, $output);\n}", "function createXmlFile()\r\n\t{\r\n\t\t/*\r\n\t\t<xml>\r\n\t\t\t<videofile src=\"eafade3f55760e4cdb44f82f2a4141f6ac439c5f\" thumbnail=\"e45829281e341081e43c4394544ddcee403ddc0b\" length=\"01:27\" text=\"Massmann 1\" />\r\n\t\t</xml>\r\n\t\t*/\r\n\t\t$output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><xml>';\r\n\t\r\n\t\t$videosQuery = $this->mc->database->query(\"SELECT * FROM \" . $this->mc->config['database_pref'] . \"concept_mediacenter AS A WHERE view_id = ?\", array(array($this->viewId, \"i\")), array(array(\"concept_mediacenter\", \"view_id\", \"video_name\")));\r\n\t\tforeach($videosQuery->rows as $currentVideo)\r\n\t\t{\r\n\t\t\t$output .= '<videofile src=\"' . $currentVideo->video_name . '\" thumbnail=\"' . $currentVideo->video_thumbnail . '\" length=\"' . $currentVideo->video_length . '\" text=\"' . $currentVideo->video_text . '\" />';\r\n\t\t}\r\n\t\t$output .= '</xml>';\r\n\t\t\r\n\t\t$outputFileSuffix = \"\";\r\n\t\t$outputFileHandle = fopen($this->mc->config['upload_dir'] . '/root/xml/'. $this->viewDetails->view_name . $outputFileSuffix . '.xml', 'wb');\r\n\t\tfwrite($outputFileHandle, $output);\r\n\t\tfclose($outputFileHandle);\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private function getXMLHeader() {\n\t\treturn '<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>' . \"\\n\";\n\t}", "private function _prepareCommand() {\n\t\t$args = array(\n\t\t\tself::PDF_DPI => $this->getDpi(),\n\t\t\tself::PDF_GRAYSCALE => $this->getIsGrayscale(),\n\t\t\tself::PDF_HEADER_LEFT => null,\n\t\t\tself::PDF_HEADER_RIGHT => null,\n\t\t\tself::PDF_LOWQUALITY => $this->getIsLowQuality(),\n\t\t\tself::PDF_ORIENTATION => $this->getPageOrientation(),\n\t\t\tself::PDF_PAGE_SIZE => $this->getPageSize()\n\t\t);\n\t\t$args = array_filter($args, create_function('$v', 'return !(false === $v);'));\n\t\t$args = array_filter($args, create_function('$v', 'return !is_null($v);'));\n\n\t\t$options = array_keys($args);\n\n\t\tarray_walk($options, create_function('&$v,$k', '$v = $v . \" %s\";'));\n\t\treturn vsprintf($this->_command . ' ' . implode(' ', $options) . ' - - ', array_values($args));\n\t}", "abstract public function getDataprotXML();", "function run()\n\t{\n\t\t$type=get_param('type','misc');\n\n\t\trequire_code('xml_storage');\n\t\trequire_lang('xml_storage');\n\n\t\t$GLOBALS['HELPER_PANEL_PIC']='pagepics/xml';\n\t\t$GLOBALS['HELPER_PANEL_TEXT']=comcode_lang_string('DOC_XML_DATA_MANAGEMENT');\n\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase 'misc':\n\t\t\t\treturn $this->ui();\n\n\t\t\tcase '_import':\n\t\t\t\treturn $this->_import();\n\n\t\t\tcase '_export':\n\t\t\t\treturn $this->_export();\n\t\t}\n\n\t\treturn new ocp_tempcode();\n\t}", "public function actionGenerate()\n {\n \\bariew\\yii2Tools\\tests\\FixtureManager::init();\n }", "function getXML() {\n $this->layout->addMenu(sprintf('<menu>%s</menu>'.LF, $this->menubar->getXML()));\n if (isset($this->params['cmd'])) {\n switch ($this->params['cmd']) {\n case 'edit_file':\n case 'file_tags':\n case 'file_versions':\n case 'file_derivations':\n case 'restore_version':\n case 'delete_version':\n case 'papaya_tag':\n $this->layout->addRight($this->getFilesToolbar());\n break;\n }\n }\n $this->addDialogXML();\n }", "function createMetaData()\n\t{\n\t\tparent::createMetaData();\n\t\t$this->saveAuthorToMetadata();\n\t}", "function generarOC(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_GENOC_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n $this->setParametro('fecha_oc','fecha_oc','date');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function getPOXResponse() {\n return '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<imsx_POXEnvelopeResponse xmlns=\"http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0\">\n <imsx_POXHeader>\n <imsx_POXResponseHeaderInfo>\n <imsx_version>V1.0</imsx_version>\n <imsx_messageIdentifier>%s</imsx_messageIdentifier>\n <imsx_statusInfo>\n <imsx_codeMajor>%s</imsx_codeMajor>\n <imsx_severity>status</imsx_severity>\n <imsx_description>%s</imsx_description>\n <imsx_messageRefIdentifier>%s</imsx_messageRefIdentifier>\n </imsx_statusInfo>\n </imsx_POXResponseHeaderInfo>\n </imsx_POXHeader>\n <imsx_POXBody>%s\n </imsx_POXBody>\n</imsx_POXEnvelopeResponse>';\n}", "public function image() {\n\t\t$image = new WkImage();\n\n\t\t$command = new Command($image->getImage()->getCommand() . ' --htmldoc');\n\n\t\tif ($command->execute()) {\n\t\t\techo $command->getOutput();\n\t\t} else {\n\t\t\techo $command->getError();\n\t\t}\n\t}", "private function packMeta()\n {\n $transport = $this->modx->fromJSON(file_get_contents(__DIR__ . '/../transport.json'));\n unset($transport['support']['db']);\n\n $this->builder->setPackageAttributes([\n 'changelog' => file_get_contents(__DIR__ . '/../meta/changelog.txt'),\n 'license' => file_get_contents(__DIR__ . '/../meta/license.txt'),\n 'readme' => file_get_contents(__DIR__ . '/../meta/readme.txt'),\n 'requires' => $transport['support']\n ]);\n }", "function make_xml($base, $structure)\r\t{\r\tglobal $CFG;\r\trequire_once($CFG->libdir.'/filelib.php');\r\r\tunset($r);\r\t$r = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\t<rss xmlns:itunes=\"http://www.itunes.com/DTDs/Podcast-1.0.dtd\" version=\"2.0\">\r\t<channel>\r\t<lastBuildDate>'.podcast_date_format().' '.date('O').'</lastBuildDate>\r\t<title>'.utf8_encode(stripslashes($base->name)).'</title>\r\t<itunes:author>'.utf8_encode(stripslashes($base->author)).'</itunes:author>\r\t<link>'.$base->image_url.'</link>\r\t<description>'.utf8_encode(stripslashes($base->intro)).'</description>\r\t<itunes:summary>'.utf8_encode(stripslashes($base->intro)).'</itunes:summary>\r\t<image>\r\t\t<url>'.$base->image_img.'</url>\r\t\t<title>'.utf8_encode(stripslashes($base->name)).'</title>\r\t\t<link>'.$base->image_url.'</link>\r\t</image>\r\t<language>'.$base->lang.'</language>\r\t<category>'.utf8_encode($base->category).'</category>\r\t<itunes:category text=\"'.utf8_encode(stripslashes($base->category)).'\"></itunes:category>\r\t<copyright>'.utf8_encode(stripslashes($base->copyright)).'</copyright>\r\t<itunes:owner>\r\t\t<itunes:name>'.utf8_encode(stripslashes($base->owner)).'</itunes:name>\r\t\t<itunes:email>'.$base->owner_email.'</itunes:email>\r\t</itunes:owner>\r\t<itunes:image href=\"'.$base->image_url.'\" />\r\t<itunes:explicit>clean</itunes:explicit>';\r\tforeach($structure as $item) {\r\t\t$r = $r.'<item>\r\t\t<title>'.utf8_encode(stripslashes($item->title)).'</title>\r\t\t<itunes:author>'.utf8_encode(stripslashes($base->author)).'</itunes:author>\r\t\t<link>'.$CFG->wwwroot.\"/mod/podcast/media/\".$base->course.\"/\".$base->id.\"/\".$item->lien.'</link>\r\t\t<description>'.utf8_encode(stripslashes($item->intro)).'</description>\r\t\t<guid>'.$CFG->wwwroot.\"/mod/podcast/media/\".$base->course.\"/\".$base->id.\"/\".$item->lien.'</guid>\r\t\t<pubDate>'.$item->pubdate.'</pubDate>\r\t\t<enclosure url=\"'.$CFG->wwwroot.\"/mod/podcast/media/\".$base->course.\"/\".$base->id.\"/\".$item->lien.'\" length=\"'.$item->length.'\" type=\"'.mimeinfo(\"type\",$item->lien).'\" />\r\t\t<itunes:duration>'.$item->duration.'</itunes:duration>\r\t\t<itunes:subtitle />\r\t\t<itunes:summary>'.utf8_encode(stripslashes($item->intro)).'</itunes:summary>\r\t\t</item>';\r\t}\r\t$r = $r.'</channel>\r\t</rss>';\r\r\treturn ($r);\r\t}", "function xmlbody(){\n\t\t$this->xm(\"<generalinfo>\");\n\t\t$this->p(\"name\",$_SERVER['SERVER_NAME']);\n\t\t$this->p(\"ip_addr\",$_SERVER['SERVER_ADDR'].\":\".$_SERVER['SERVER_PORT']);\n\t\t$this->p(\"host\", $_ENV['HOSTNAME']);\n\t\t$this->p(\"certauth\",$_SERVER['SSL_SERVER_S_DN_OU']);\n\t\t$this->p(\"referer\",$_SERVER ['HTTP_REFERER']);\n\t\t$this->p(\"time\",gmstrftime(\"%b %d %Y %H:%M:%S\").\" GMT\");\n\t\t$this->p(\"apache_admin\",$_SERVER['SERVER_ADMIN']);\n\t\t$this->xm(\"</generalinfo>\");\n\n\t\t// get medcommmons parameters about this instance of central\n\t\t$this->xm(\"<mcinfo>\");\n\t\t$this->p(\"sw_version\",$GLOBALS[\"SW_Version\"]);\n\t\t$this->p(\"sw_revision\",$GLOBALS[\"SW_Revision\"]);\n\t\t$this->p(\"db_connection\",$GLOBALS[\"DB_Connection\"]);\n\t\t$this->p(\"db_database\",$GLOBALS[\"DB_Database\"]);\n\t\t$this->p(\"default_repository\", $GLOBALS['Default_Repository']);\n\t\t$this->xm(\"</mcinfo>\");\n\n\t\t// get record counts from interesting tables\n\t\t$this->xm(\"<tableinfo>\");\n\t\t//\t\tz(\"hipaa\");\n\t\t//\tz(\"hipaa_trace\");\n\t\t$this->z(\"user\");\n\t\t// moved these tables to another database, really should reconnect to the other db to get them\n\n\t\t//\t\tz(\"faxstatus\");\n\t\t//\t\tz(\"ccstatus\");\n\t\t//\t\tz(\"emailstatus\");\n\n\t\t$this->xm(\"</tableinfo>\");\n\t\t$count++;\n\t\t//\n\t\t// return outputs\n\t\t//\n\t\t$this->xmfield(\"status\",\"ok\");\n\t}", "public function generate()\n\t{\n\t\treturn parent::generate();\n\t}", "private function compilar_metadatos_generales_basicos()\n\t{\n\t\t//-- Datos basicos --\n\t\t$this->manejador_interface->mensaje('Info basica', false);\n\t\t$nombre_clase = 'toba_mc_gene__basicos';\n\t\t$archivo = $this->get_dir_generales_compilados() . '/' . $nombre_clase . '.php';\n\t\t$clase = new toba_clase_datos( $nombre_clase );\n\t\t$datos = toba_proyecto_db::cargar_info_basica( $this->get_id() );\n\t\t$clase->agregar_metodo_datos('info_basica', $datos);\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//-- Fuentes --\n\t\tforeach( $this->get_indice_fuentes() as $fuente ) {\n\t\t\t$datos = toba_proyecto_db::get_info_fuente_datos( $this->get_id(), $fuente );\n\t\t\t//-- Se busca la relacion entre nombre_tabla y dt\n\t\t\t$mapeo = toba_proyecto_db::get_mapeo_tabla_dt($this->get_id(), $fuente);\n\t\t\t$datos['mapeo_tablas_dt'] = $mapeo;\n\t\t\t$clase->agregar_metodo_datos('info_fuente__'.$fuente, $datos );\n\t\t}\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//-- Permisos --\n\t\tforeach( $this->get_indice_permisos() as $permiso ) {\n\t\t\t$datos = toba_proyecto_db::get_descripcion_permiso( $this->get_id(), $permiso );\n\t\t\t$clase->agregar_metodo_datos('info_permiso__'.$permiso, $datos );\n\t\t}\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//-- Indice de componentes --\n\t\t$datos = toba_proyecto_db::get_mapeo_componentes_indice( $this->get_id() );\n\t\t$clase->agregar_metodo_datos('info_indices_componentes', $datos );\n\t\t$this->manejador_interface->progreso_avanzar();\n\t\t//Creo el archivo\n\t\t$clase->guardar( $archivo );\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "public function generate()\n {\n $this->xml = new DOMDocument( '1.0', 'utf-8' );\n $this->xml->formatOutput = 1;\n\n $rss = $this->xml->createElementNS( self::NAMESPACE_URI, 'feed' );\n $this->channel = $rss;\n $this->root = $this->xml->appendChild( $rss );\n\n $this->generateRequired();\n $this->generateAtLeastOne();\n $this->generateOptional();\n $this->generateFeedModules( $this->channel );\n $this->generateItems();\n\n return $this->xml->saveXML();\n }", "public function generate()\n {\n return parent::generate();\n }", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "public function generateCommands();", "public function main() {\n $nameArr = explode(\".\", $this->name);\n $name = $nameArr[0];\n $xml = SimpleXml_load_file(\"../domain/base/\".$name.\".xml\");\n\n $path = $xml->path[\"name\"];\n\n $template = file_get_contents(\"generateDomain/DomainObjectTemplate\");\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $template = $this->replaceTokens($vars, $template);\n\n// print_r($xml);\n if($xml->parentClass) {\n $template = $this->replaceToken(\"parent_class\", $xml->parentClass[\"name\"], $template);\n $template = $this->replaceToken(\"super_call\", file_get_contents(\"generateDomain/SuperCallTemplate\"), $template);\n $template = $this->replaceToken(\"register_new\", \"\", $template);\n } else {\n $template = $this->replaceToken(\"parent_class\", \"\\\\domain\\\\DomainObject\", $template);\n $template = $this->replaceToken(\"super_call\", \"\", $template);\n $template = $this->replaceToken(\"register_new\", file_get_contents(\"generateDomain/RegisterNewTemplate\"), $template);\n }\n\n $constantsPiece = \"\";\n $addAttributePiece = \"\";\n $gettersAndSettersPiece = \"\";\n foreach($xml->attributes->attribute as $attr) {\n // constants\n $constantsPiece.= 'const '. strtoupper($attr[\"name\"]). ' = \"'.$attr[\"name\"].'\";\n ' ;\n\n // AddAttributes method\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n\n $attrTemplate = file_get_contents(\"generateDomain/AddAttributesTemplate\");\n $addAttributePiece .= $this->replaceTokens($vars, $attrTemplate);\n\n // getters and setters\n $vars = array();\n $vars[\"class_name\"] = \"Base\".ucfirst($name);\n $vars[\"constant\"] = strtoupper($attr[\"name\"]);\n $vars[\"constant_name\"] = ucfirst($attr[\"name\"]);\n $vars[\"constant_normal_case\"] = $attr[\"name\"];\n\n $getterSetterTemplate = file_get_contents(\"generateDomain/GettersAndSettersTemplate\");\n $gettersAndSettersPiece .= $this->replaceTokens($vars, $getterSetterTemplate);\n }\n $template = $this->replaceToken(\"constants\", $constantsPiece, $template);\n $template = $this->replaceToken(\"attributes_to_add\", $addAttributePiece, $template);\n $template = $this->replaceToken(\"getters_and_setters\", $gettersAndSettersPiece, $template);\n\n\n if($xml->mapper) {\n $mapper = $xml->mapper[\"name\"];\n $klass = $xml->mapper[\"class\"];\n $table = $xml->mapper[\"table\"];\n $idField = $xml->mapper[\"idField\"];\n\n\n\n if($mapper !== null && $klass !== null && $table !== null && $idField !== null) {\n $t = file_get_contents(\"generateDomain/MapperTemplate\");\n $vars = array();\n $vars[\"class_name\"] = $klass;\n $vars[\"table_name\"] = $table;\n $vars[\"id_field\"] = $idField;\n echo \"MADE IT HERE!\";\n print_r($xml->mapper->joins);\n\n if($xml->mapper->joins) {\n echo \"Had Joins!\";\n $joinsTemplate = file_get_contents(\"generateDomain/MapperJoinTemplate\");\n $joinsPiece = \"\";\n foreach($xml->mapper->joins->join as $join) {\n\n $joinVars = array();\n $joinVars[\"join_name\"] = $join[\"name\"];\n $joinVars[\"join_table\"] = $join[\"table\"];\n $joinsPiece .= $this->replaceTokens($joinVars, $joinsTemplate);\n }\n $vars[\"joins\"] = $joinsPiece;\n } else {\n $vars[\"joins\"] = \"\";\n }\n\n\n $t = $this->replaceTokens($vars, $t);\n\n if(file_exists(\"../mapper/\".$mapper.\".php\")) {\n $mapperContent = file_get_contents(\"../mapper/\".$mapper.\".php\");\n if(preg_match('@(p)ublic function loadDataMap\\(\\) {[\\s\\S]*?(})@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1], ($matches[2][1] - $matches[1][1]) + 1);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n if(preg_match('@class\\s*'.$klass.'[\\s\\S]*(})[\\s\\S]*\\?>@i', $mapperContent, $matches, PREG_OFFSET_CAPTURE)) {\n $mapperContent = substr_replace($mapperContent, $t, $matches[1][1] - 1, 0);\n\n $fh = fopen(\"../mapper/\".$mapper.\".php\", \"w\");\n fwrite($fh, $mapperContent);\n fclose($fh);\n } else {\n throw new BuildException(\"Could not match regular expression in: \".$mapper);\n }\n }\n\n\n\n } else {\n throw new BuildException(\"Mapper file did not exist \". $mapper);\n }\n }\n }\n\n\n $fh = fopen(\"../domain/base/\".\"Base\".ucfirst($name).\".php\", \"w\");\n fwrite($fh, $template);\n fclose($fh);\n }", "private function getSetup()\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, \"http://\".WEMO_IP.\":\".WEMO_PORT.\"/setup.xml\");\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n return $this->parseXML($response);\r\n }", "public function getXml() {}", "private function execute()\n {\n if (isset($this->parsedOptions['h'])) {\n $this->printHelp();\n } else {\n\n try {\n $action = $this->getOption('a');\n $dbManger = null;\n $xmlProcessor = new XMLProcessor();\n\n if ($action !== 'generate-source-file') {\n if (!$this->config['db_host'] || !$this->config['db_name']\n || !$this->config['db_user']\n || !$this->config['db_password']\n || !$this->config['db_port']\n ) {\n throw new InvalidArgumentException('Please check parameters of db connection!!!');\n }\n\n $dbManger = new DatabaseManager($this->config['db_host'],\n $this->config['db_name'],\n $this->config['db_user'],\n $this->config['db_password'],\n $this->config['db_port']);\n\n if ($action !== 'init') {\n $userRepository = new UserRepository($dbManger->connect());\n $xmlProcessor->setUserRepository($userRepository);\n }\n }\n\n switch ($action) {\n case 'init':\n $dbManger->initDB();\n $this->println('DB and tables were created!!');\n break;\n case 'import':\n $xmlProcessor->setReader(new XMLReader(new ReaderFile(), new ChunkParser()));\n $xmlProcessor->setConverter(new UserDetailsConverter());\n $sourceFile = $this->getOption('s');\n\n $this->println($xmlProcessor->import($sourceFile) . ' - item(s) was imported');\n break;\n case 'filter':\n $targetFile = $this->getOption('t');\n $filterExpression = $this->getOption('filter-expression');\n\n $xmlProcessor->setWriter(new XmlWriter(new WriterFile()));\n $xmlProcessor->setConverter(new UserDetailsConverter());\n\n $this->println('Item(s) found - ' . $xmlProcessor->filter($filterExpression, $targetFile));\n break;\n case 'generate-source-file':\n $targetFile = $this->getOption('t');\n if (!$targetFile) {\n $this->println('Please specify target file');\n } else {\n DataGenerator::generateSourceFile($targetFile);\n $this->println('The source file was successfully generated!!');\n\n }\n break;\n case 'clean':\n $xmlProcessor->cleanCachedData();\n $this->println('The stored data was removed');\n break;\n default:\n $this->println('Undefined action', true);\n }\n } catch (PDOException $e) {\n $message = $e->getMessage();\n\n if (intval($e->getCode()) === 23000) {\n $message = 'Please clean the previously imported data';\n }\n\n $this->println($message, true);\n } catch (Exception $e) {\n $this->println($e->getMessage(), true);\n }\n }\n }", "public function execute()\n {\n $this->prepare();\n\n $this->generateModel();\n $this->generateResource();\n $this->generateCollection();\n $this->generateSearchResult();\n $this->generateCommandGet();\n $this->generateCommandSave();\n $this->generateCommandDelete();\n $this->generateCommandList();\n $this->generateRepository();\n $this->generateExtensionLoader();\n\n if ($this->tests) {\n $this->generateTestCaseWrapper();\n $this->generateRepositoryTest();\n }\n\n $outFilesNames = [];\n foreach ($this->outFiles as $outFile) {\n $outFilesNames[] = $outFile['file'];\n }\n\n if (!$this->overwrite) {\n $this->filesystem->assertNotExisting($outFilesNames);\n }\n\n foreach ($this->outFiles as $outFile) {\n $this->filesystem->writeFile($outFile['file'], $outFile['code']);\n }\n\n $this->injectDi();\n\n return $outFilesNames;\n }", "function genexml2($matricule,$nom,$prenom,$datenaissance,$lieunaissance,$telephone,$montantdu,$anneeacademique,$statut,$etablissement,$filiere,$nationalite, $type){\n\t$xml = new DOMDocument('1.0', 'utf-8');\n\t//$items = $xml->createElement('id_dataTable');\n\t\t$item = $xml->createElement('etudiant');\n\t\t$db_item=[\"matricule\"=>$matricule,\"nom\"=>$nom,\"prenom\"=>$prenom,\"telephone\"=>$telephone,\"anneeacademique\"=>$anneeacademique,\"etablissement\"=>$etablissement,\"anneeEtude\"=>$filiere,\"nationalite\"=>$nationalite,\"statut\"=>$statut,\"montant\"=>$montantdu,\"categorie\"=>$type,\"datePaiement\"=>\"\",\"reftransaction\"=>\"\",\"intermediairePaiement\"=>\"\"];\n\t\tforeach($db_item as $key => $value){\n\t\t\t$node = $xml->createElement($key,$value);\n\t\t\t$item->appendChild($node);\n\t\t}\n\t\t//$items->appendChild($item);\n\t$xml->appendChild($item);\n\t$date=date(\"Y-m-d\");\n\t$date=convertdatebanque($date);\n\t\n\treturn $xml->saveXML();\n}", "private function generateTranslations() {\n\n $this->doCommand('php artisan medkit:generate-translations');\n }", "public function getCreator($encoding = 'UTF-8') {}", "function generateXML($caller_profilecode,$callFlag,$callValid,$phoneNo,$callID,$errCode,$requestState,$quotaDate)\n{\n header('content-type: text/xml');\n $xmlStr =\"\";\n $xmlStr='<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>';\n $xmlStr.=\"\\n\\t<PROFILE>\\n\\t\\t\";\n\tif($callFlag =='I'){\n\t\t$xmlStr.=\"\\n\\t\\t<CALLVALID>$callValid</CALLVALID>\\n\\t\\t\";\n\t\t$xmlStr.=\"\\n\\t\\t<PHONENO>$phoneNo</PHONENO>\\n\\t\\t\";\n\t\t$xmlStr.=\"\\n\\t\\t<CALLID>$callID</CALLID>\\n\\t\\t\";\n\t\t$xmlStr.=\"\\n\\t\\t<ERRORMSG>$errCode</ERRORMSG>\\n\\t\\t\";\n\t\t$xmlStr.=\"\\n\\t\\t<QUOTADATE>$quotaDate</QUOTADATE>\\n\\t\\t\";\n\t}\n\telse\n\t\t$xmlStr.=\"\\n\\t\\t<STATUS>$requestState</STATUS>\\n\\t\\t\";\n $xmlStr.=\"\\n\\t</PROFILE>\";\n return $xmlStr;\n}", "function rawXMLPagegroupExport()\r\n\t{\r\n\t\tglobal $myPT;\r\n\t\tglobal $myDB;\r\n\r\n\t\t$xml ='<?xml version=\"1.0\" encoding=\"'.PT_CHARSET.'\" ?>\r\n<phenotype>\r\n\t<meta>\r\n\t\t<ptversion>'.$myPT->version.'</ptversion>\r\n\t\t<ptsubversion>'.$myPT->subversion.'</ptsubversion>\r\n\t</meta>\r\n\t<pagegroups>';\r\n\t\t$sql = \"SELECT * FROM pagegroup ORDER BY grp_id\";\r\n\t\t$rs = $myDB->query($sql);\r\n\t\twhile ($row=mysql_fetch_array($rs))\r\n\t\t{\r\n\t\t\t$xml .='\r\n\t\t<group>\r\n\t\t\t<grp_id>'.$row[\"grp_id\"].'</grp_id>\r\n\t\t\t<grp_bez>'.$myPT->codeX($row[\"grp_bez\"]).'</grp_bez>\r\n\t\t\t<grp_description>'.$myPT->codeX($row[\"grp_description\"]).'</grp_description>\r\n\t\t\t<grp_statistic>'.$myPT->codeX($row[\"grp_statistic\"]).'</grp_statistic>\r\n\t\t <grp_multilanguage>'.$myPT->codeX($row[\"grp_multilanguage\"]).'</grp_multilanguage>\r\n\t\t <grp_smarturl_schema>'.$myPT->codeX($row[\"grp_smarturl_schema\"]).'</grp_smarturl_schema>\r\n\t\t</group>';\r\n\t\t}\r\n\t\t$xml.='\r\n\t</pagegroups>\r\n</phenotype>';\r\n\t\treturn $xml;\r\n\t}", "public function run() {\n\t\t$user_data = $this->createContextFile('opennebula');\n\t\t$hex_user_data = bin2hex($user_data);\n\n\t\t/* This parameter is only needed for Xen */\n\t\t$bootloader_spec = '<BOOTLOADER>'.$this->os_bootloader.'</BOOTLOADER>';\n\t\tif (strcmp($this->virtualization_type, 'xen') != 0) {\n\t\t\t$bootloader_spec = '';\n\t\t}\n\n\t\t$response = $this->http_request('POST', '/compute',\n\t\t'<COMPUTE>'.\n\t\t\t'<NAME>conpaas</NAME>'.\n\t\t\t'<INSTANCE_TYPE>'. $this->instance_type .'</INSTANCE_TYPE>'.\n\t\t\t'<DISK>'.\n\t\t\t\t'<STORAGE href=\"'.$this->opennebula_url.'/storage/'.$this->image.'\" />'.\n\t\t\t\t'<TARGET>'.$this->disk_target.'</TARGET>'.\n\t\t\t'</DISK>'.\n\t\t\t'<NIC>'.\n\t\t\t\t'<NETWORK href=\"'.$this->opennebula_url.'/network/'.$this->network.'\" />'.\n\t\t\t'</NIC>'.\n\t\t\t'<CONTEXT>'.\n\t\t\t\t'<HOSTNAME>$NAME</HOSTNAME>'.\n\t\t\t\t'<IP_PUBLIC>$NIC[IP]</IP_PUBLIC>'.\n\t\t\t\t'<IP_GATEWAY>'.$this->gateway.'</IP_GATEWAY>'.\n\t\t\t\t'<NAMESERVER>'.$this->nameserver.'</NAMESERVER>'.\n\t\t\t\t'<USERDATA>'.$hex_user_data.'</USERDATA>'.\n\t\t\t\t'<TARGET>'.$this->context_target.'</TARGET>'.\n\t\t\t'</CONTEXT>'.\n\t\t '<OS>'.\n\t\t\t\t'<TYPE arch=\"'.$this->os_arch.'\" />'.\n\t\t\t\t$bootloader_spec.\n\t\t\t\t'<ROOT>'.$this->os_root.'</ROOT>'.\n\t\t\t'</OS>'.\n\t\t'</COMPUTE>');\n\t\tif ($response === false) {\n\t\t\tthrow new Exception('the OpenNebula instance was not created');\n\t\t}\n\n\t\t$obj = simplexml_load_string($response);\n\t\tif ($obj === false) {\n\t\t\tdlog('run(): Error response from OpenNebula: '.$response);\n\t\t\tthrow new Exception('run(): Invalid response from opennebula');\n\t\t}\n\t\t/* get the instance id */\n\t\treturn (string)$obj->ID;\n\t}", "function getOutput($option){\n\t\t$claseppal=$this->getMainNode();\n\t\t//imprimir la clase ppal\n\t\t$cant_clases=$this->cant_clases;\n\t\t$claseppaltext=\"<\".$claseppal.\">\\n\";\n\t\t$claseppaltextc=\"</\".$claseppal.\">\\n\";\n\n\t\t//Armar la escrutctura del XML\n\t\t$claseppal=$this->getMainNode();\n\t\t//imprimir la clase ppal\n\t\t$cant_clases=$this->cant_clases;\n\n\t\tforeach ($this->clases[$claseppal] as $llave=>$valor) {\n\t\t\t$this->estrucxml_arr[]=\"\\t<\".$valor.\">\\n\";\n\t\t\t\tforeach ($this->nodos[$valor] as $key=>$value) {\n\t\t\t\t\tif($this->perte[$key]==$valor){\n\t\t\t\t\t $this->estrucxml_arr[]=\"\\t\\t<\".$key.\">\".$value.\"</\".$key.\">\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t$this->estrucxml_arr[]=\"\\t</\".$valor.\">\\n\";\n\t\t}\n\t\t//Armar ARCHIVO XML externo file_put_contents (se ahorran 3 lineas de codigo jejeje)....\n\t\tif($this->primeravez!=0){\n\t\t\t$clase=$this->nmclass;\n\t\t\t$dirfile=$this->xmldir;\n\t\t\t$clasppal=$this->getMainNode();\n\t\t\t$contenido=$this->estrucxml_arr;\n\n\t\t\tif($contenido!='' && $dirfile!=''){\n\t\t\t\tif($option=='c'){\n\t\t\t\t\t$this->etiqcier='c';\n\t\t\t\t\tfile_put_contents($dirfile, $contenido, FILE_APPEND| LOCK_EX);\n\t\t\t\t\tfile_put_contents($dirfile, $claseppaltextc, FILE_APPEND| LOCK_EX);\n\t\t\t\t}\n\t\t\t\tif($option=='u'){\n\t\t\t\t\tfile_put_contents($dirfile, $contenido, FILE_APPEND| LOCK_EX);\n\t\t\t\t}\n\t\t\t\tif($option=='uf'){\n\t\t\t\t\t$this->etiqcier='uf';\n\t\t\t\t\tfile_put_contents($dirfile, $contenido, FILE_APPEND| LOCK_EX);\n\t\t\t\t\tfile_put_contents($dirfile, $claseppaltextc, FILE_APPEND| LOCK_EX);\n\t\t\t\t}\n\t\t\t\t$this->primeravez++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$contenido=$this->encodestat;\n\t\t\t//Armar ARCHIVO XML externo file_put_contents (se ahorran 3 lineas de codigo jejeje)....\n\t\t\t$clase=$this->nmclass;\n\t\t\t$dirfile=$this->xmldir;\n\t\t\t$clasppal=$this->getMainNode();\n\t\t\t$contenido=$this->estrucxml_arr;\n\t\t\t$enca=$this->encodestat;\n\t\t\tif($contenido!='' && $dirfile!=''){\n\t\t\t\tfile_put_contents($dirfile,\"<?xml version='1.0' encoding='utf-8'?>\\n\");\n\t\t\t\tfile_put_contents($dirfile, $claseppaltext, FILE_APPEND| LOCK_EX);\n\t\t\t\tfile_put_contents($dirfile, $contenido, FILE_APPEND| LOCK_EX);\n\t\t\t\t$this->primeravez++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t\t$this->vaciarXML();\n\t}", "private function getXmlFile() {\n if (!$this->xmlFileCreated) {\n $this->createXmlDataFile();\n }\n return DOKU_INC . $this->command->getConf(\"processingXmlFile\");\n }", "public function generateFeed() {\n\t\theader(\"Content-type: text/xml\");\n\t\techo $this->work();\n\t}", "public static function generate(): string\n {\n //Adds the homepage\n $url[] = self::parse('/');\n\n foreach (Plugin::all() as $plugin) {\n //Gets all methods from `Sitemap` class of the plugin\n $methods = self::getMethods($plugin);\n\n //Calls each method\n foreach ($methods as $method) {\n $url = array_merge($url, (array)call_user_func([$method['class'], $method['name']]));\n }\n }\n\n $xml = Xml::fromArray(['urlset' => [\n 'xmlns:' => 'http://www.sitemaps.org/schemas/sitemap/0.9',\n 'url' => $url,\n ]], ['pretty' => true]);\n\n return trim($xml->asXML());\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public function actionGenerateAndDownloadDatasetCreationFile() {\n $fileColumns[] = DatasetController::AGRONOMICAL_OBJECT_URI;\n $fileColumns[] = DatasetController::DATE;\n $variables = Yii::$app->request->post('variables');\n foreach ($variables as $variableAlias) {\n $fileColumns[] = $variableAlias;\n }\n\n $file = fopen('./documents/DatasetFiles/datasetTemplate.csv', 'w');\n fputcsv($file, $fileColumns, $delimiter = \";\"); \n fclose($file);\n }", "public function generate()\n {\n $soapClientOptions = $this->getSoapClientOptions();\n $config = $this->getGeneratorConfig($soapClientOptions);\n $generator = $this->getGenerator();\n $generator->generate($config);\n }", "public function output_xml()\n {\n $this->comment(sprintf(\"Estimated Execution Time Is: %s\"\n , (preg_replace(\n '/^0\\.(\\d+) (\\d+)$/', '\\2.\\1', microtime()) - START_TIME)\n ));\n\n $this->comments2xml($this->xmlw, $this->comments);\n $this->close_xml();\n $xml_out = $this->xmlw->outputMemory();\n $this->debug('---- Start XML Output ----');\n $this->debug(explode(\"\\n\", $xml_out));\n $this->debug('---- End XML Output ----');\n echo $xml_out;\n exit();\n }", "public function generujXML() {\n // nadawca\n $elementNadawca = $this->xml->createElement($this->ElementXmlNazwa());\n\n foreach ($this->regulyWalidacji() as $regula) {\n $atrybutNadawca = $this->xml->createAttribute($regula['pole']);\n $atrybutNadawca->value = $this->$regula['pole'];\n $elementNadawca->appendChild($atrybutNadawca);\n }\n\n return $this->xml->appendChild($elementNadawca);\n }", "function GenerateOdt($template)\n {\n require_once(\"generate_odt.php\");\n $engine = new XmlTemplateEngine($this->con);\n return $engine->processOdtTemplate($template);\n }", "public function create()\n {\n return $this->process($this->filename);\n }", "function compiler_xml_oasis($fichier, $contexte) {\n\n\t// separer nom, extension...\n\t$infos = pathinfo($fichier);\n\t$dir = $infos['dirname'] . '/';\n\t$ext = $infos['extension'];\n\t$nom = substr($infos['basename'], 0, -(strlen($ext)+1));\n\n\t// lire le content\n\tlire_fichier($fichier, $texte);\n\n\t// retablir les boucles\n\t$texte = preg_replace(\",&lt;([/]?B(.*))&gt;,U\",\"<\\\\1>\", $texte);\n\t\n\t// retablir les includes\n\t$texte = preg_replace(\",&lt;([/]?INCLU[RD]E(.*))&gt;,U\",\"<\\\\1>\", $texte);\n\t\n\t// falsifier l'en tete xml\n\t$texte = preg_replace(\",^<\".\"[?]xml,\",\"<@XML\", $texte);\n\n\t// ajouter les directives de cache/charset et mime-type\n\t$texte = \"#\".\"CACHE{0}\n\t#\".\"HTTP_HEADER{Content-type: text/xml; charset=UTF-8}\n\t$texte\";\n\n\n\t// ecrire le squelette et le fichier fonctions associe\n\tecrire_fichier(_DIR_TMP . $nom . \".html\", $texte);\n\tlire_fichier(_DIR_PLUGIN_SPIPODF . $nom . \"_fonctions.php\", $fonctions);\n\tecrire_fichier(_DIR_TMP . $nom . \"_fonctions.php\", $fonctions);\n\n\t// calculer le fond\n\tinclude_spip('inc/assembler');\n\t$texte = recuperer_fond(_DIR_TMP . $nom, $contexte);\n\t\n\t// nettoyer\n\t@unlink(_DIR_TMP.\"content_fonctions.php\");\n\t@unlink(_DIR_TMP.\"content.html\");\n\n\t$texte = preg_replace(\",^<@XML,\",\"<\".\"?xml\", $texte);\n\n\t// convertir les balises html ajoutees par propre en tags xml\n\t$texte = spip2odt_convertir($texte, $dir);\n\n\tecrire_fichier($fichier, $texte);\n\n}", "function getMAG($pid) {\n global $base_url;\n $path = drupal_get_path('module', 'fedora_repository');\n $thispath = drupal_get_path('module', 'islandora_mag');\n \n module_load_include('inc', 'fedora_repository', 'ConnectionHelper');\n\n $soapHelper = new ConnectionHelper();\n $client = $soapHelper->getSoapClient(variable_get('fedora_soap_url', 'http://localhost:8080/fedora/services/access?wsdl'));\n\n $dsId = 'MAG';\n $params = array(\n \t'pid' => \"$pid\",\n 'dsID' => \"$dsId\",\n 'asOfDateTime' => \"\"\n );\n try {\n $object = $client->__soapCAll('getDatastreamDissemination', array('parameters' => $params));\n }\n catch (Exception $e) {\n \tdrupal_set_message($e->getMessage(), 'error');\n return;\n }\n \n $xmlstr = $object->dissemination->stream;\n try {\n $proc = new XsltProcessor();\n }\n catch (Exception $e) {\n drupal_set_message($e->getMessage(), 'error');\n return;\n }\n\n $proc->setParameter('', 'baseUrl', $base_url);\n $proc->setParameter('', 'path', $base_url . '/' . $path);\n $input = NULL;\n $xsl = new DomDocument();\n try {\n $xsl->load($thispath . '/xsl/convertMAG.xsl');\n $input = new DomDocument();\n $input->loadXML(trim($xmlstr));\n }\n catch (exception $e) {\n watchdog(t(\"Fedora_Repository\"), t(\"Problem loading XSL file: !e\", array('!e' => $e)), NULL, WATCHDOG_ERROR);\n }\n \n $xsl = $proc->importStylesheet($xsl);\n $newdom = $proc->transformToDoc($input);\n $output = $newdom->saveXML();\n $baseUrl = base_path();\n \n if (user_access(ObjectHelper :: $EDIT_FEDORA_METADATA)) {\n $allow=TRUE;\n if (module_exists('fedora_fesl')) { \n\t\t\t\t$allow = fedora_fesl_check_roles($pid,'write');\n }\n if ($allow) {\n\t \t\t$output .= '<br /><a title = \"' . t('Edit Meta Data') . '\" href=\"' . $base_url . '/fedora/repository/editmetadata/' . $pid . '/' .\n\t \t$dsId . '\"><img src=\"' . $base_url . '/' . $path . '/images/edit.gif\" alt=\"' . t('Edit Meta Data') . '\" /></a>';\n }\n }\n return $output;\n }", "function XMLFile($version = \"1.0\", $encoding = \"UTF-8\")\n \n {\n\t\t$this->version = $version;\n\t\t$this->encoding = $encoding;\t\n $this->init();\n }", "function generer_alexa(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['alexa']['id'])\n\t\treturn '<meta name=\"alexaVerifyID\" content=\"' . $config['alexa']['id'] . '\"/>';\n}", "public function GetRawXml()\n\t\t{\n\t\t\t$xml = \"\";\n\n\t\t\tif (isset($this->InternalID))\n\t\t\t\t$xml .= \"<InternalID>$this->InternalID</InternalID>\";\n\n\t\t\tif (isset($this->Login))\n\t\t\t\t$xml .= \"<Login>$this->Login</Login>\";\n\n\t\t\tif (isset($this->Name))\n\t\t\t\t$xml .= \"<Name>$this->Name</Name>\";\n\n\t\t\tif (isset($this->CPF))\n\t\t\t\t$xml .= \"<CPF>$this->CPF</CPF>\";\n\n\t\t\tif (isset($this->RG))\n\t\t\t\t$xml .= \"<RG>$this->RG</RG>\"; \n\n\t\t\tif (isset($this->DateOfBirth))\n\t\t\t\t$xml .= \"<DateOfBirth>$this->DateOfBirth</DateOfBirth>\";\n\n\t\t\tif (isset($this->ClientSince))\n\t\t\t\t$xml .= \"<ClientSince>$this->ClientSince</ClientSince>\"; \n\n\t\t\tif (isset($this->LastUpdate))\n\t\t\t\t$xml .= \"<LastUpdate>$this->LastUpdate</LastUpdate>\";\n\t\t\n\t\t\tif (isset($this->Emails) && count($this->Emails) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Emails>\";\n\n\t\t\t\tforeach($this->Emails as $email)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Email>$email</Email>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Emails>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Phones) && count($this->Phones) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Phones>\";\n\n\t\t\t\tforeach($this->Phones as $tel)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Phone type=\\\"$tel->Type\\\">$tel->Number</Phone>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Phones>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Addresses) && count($this->Addresses) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Addresses>\";\n\n\t\t\t\tforeach($this->Addresses as $addr)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Address city=\\\"$addr->City\\\" state=\\\"$addr->State\\\" zip=\\\"$addr->ZipCode\\\" update=\\\"$addr->Update\\\"><![CDATA[$addr->Address]]></Address>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Addresses>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Orders) && count($this->Orders) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Orders>\";\n\n\t\t\t\tforeach($this->Orders as $o)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Order id=\\\"$o->Id\\\" date=\\\"$o->Date\\\" name=\\\"$o->Name\\\" value=\\\"$o->Value\\\" method=\\\"$o->Method\\\" loginMethod=\\\"$o->LoginMethod\\\" status=\\\"$o->Status\\\" />\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Orders>\";\n\t\t\t}\n\n\t\t\tif (isset($this->Resources) && count($this->Resources) > 0)\n\t\t\t{\n\t\t\t\t$xml .= \"<Resources>\";\n\n\t\t\t\tforeach($this->Resources as $r)\n\t\t\t\t{\n\t\t\t\t\t$xml .= \"<Resource name=\\\"$r->Name\\\" date=\\\"$r->Date\\\" description=\\\"$r->Description\\\" mimeType=\\\"$r->MimeType\\\"><![CDATA[$r->Data]]></Resource>\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"</Resources>\";\n\t\t\t}\n\n\t\t\t$validation = Security::IntegrityHash(IntegrationData::DataPushKey, $xml);\n\n\t\t\t$xml = \"<Data-Push Validation=\\\"$validation\\\"><Push>\" . $xml . \"</Push></Data-Push>\";\n\n\t\t\treturn $xml;\n\t\t}", "function xml($fichier, $meteocode, $date, $code)\n{\n $lines = file($fichier);\n $id = $meteocode;\n // Affiche toutes les lignes du tableau comme code HTML, avec les numéros de ligne\n foreach($lines as $line_num => $line)\n {\n\n $chaine = strpbrk(htmlspecialchars($line), 'T'); //commencer à partir de 'T'\n\n if(strstr($chaine, $id . '.' . $date['mm'] . '.' . $date['jj']))\n { // si la chaine contient le id.mm.jj\n $x = strpos($chaine, 'x', 0);\n $rest = substr($chaine, 0, $x + 3); // retourne \"abcde\"\n }\n }\n return($rest);\n}", "public function createXML() {\n\t\treturn \"<atom:entry xmlns:atom='http://www.w3.org/2005/Atom'\\n\" .\r\n\t\t\t\t\"xmlns:apps='http://schemas.google.com/apps/2006'>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"password\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> password) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"hashFunction\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> hashFunction) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"userEmail\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> userEmail) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"firstName\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> firstName) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"lastName\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> lastName) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"<apps:property name=\\\"isAdmin\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> isAdmin) . \"\\\"/>\\n\" .\n\t\t\t\t\"<apps:property name=\\\"isSuspended\\\" value=\\\"\" . ProvisioningApi::escapeXML_Attr($this -> isSuspended) . \"\\\"/>\\n\" .\r\n\t\t\t\t\"</atom:entry>\\n\";\n\t}", "public function run($args) {\n // args[1] = Target file\n try {\n // Open source file\n $fHandle = fopen($args[0], 'r');\n @unlink($args[1]);\n // Create XML\n $nativeXml = new DOMDocument(\"1.0\", \"UTF-8\");\n $root = $nativeXml->createElement('Cfds');\n $root = $nativeXml->appendChild($root);\n $invoiceNbr = 'XXX';\n $row = 1;\n while (($data = fgetcsv($fHandle, 0, ',')) !== FALSE) {\n // Skip first row\n if ($row != 1) {\n $data = self::normalizeDataRow($data);\n // Skip if colcount is not right\n if (count($data) != self::COL_COUNT)\n continue;\n if ($invoiceNbr != $data[self::INVOICE_NBR_COL]) {\n $invoiceNbr = $data[self::INVOICE_NBR_COL];\n // Find SAT certificate for vendor RFC\n $dt = self::getInvoiceDt($data[self::INVOICE_DATE_COL]);\n $certificate = SatCertificate::model()->validAsOf($dt)->find('rfc = :rfc', array(':rfc' => $data[self::VENDOR_RFC_COL]));\n if (!$certificate)\n throw new CException(yii::t('yanus', 'Cannot find a valid certifate for RFC \"{rfc}\"', array('{rfc}' => $data[self::VENDOR_RFC_COL])));\n $invoice = $root->appendChild($nativeXml->createElement('Cfd'));\n\n $invoice->setAttribute('folio', $data[self::INVOICE_NBR_COL]);\n $invoice->setAttribute('dttm', $dt->format(DateTime::ISO8601));\n $invoice->setAttribute('paymentType', 'PAGO EN UNA SOLA EXHIBICION');\n// $invoice->setAttribute('paymentTerm', $data[self::PAYMENT_TERM_COL]);\n// $invoice->setAttribute('currency', 'MXP');\n $invoice->setAttribute('voucherType', ($data[GamaHelper::DOCUMENT_TYPE_COL] == 0 ? 'ingreso' : 'egreso'));\n $invoice->setAttribute('paymentMethod', $data[self::PAYMENT_METHOD_COL]);\n if ($data[self::PAYMENT_METHOD_COL] != 'NO IDENTIFICADO')\n $invoice->setAttribute('paymentAcctNbr', $data[self::BANK_ACCT_COL]);\n\n\n // Parties\n// $cfdParties = $invoice->appendChild($nativeXml->createElement('CfdParties'));\n // Currency\n $currency = $invoice->appendChild($nativeXml->createElement('Currency'));\n $currency->setAttribute('code', 'MXP');\n\n $paymentTerm = $invoice->appendChild($nativeXml->createElement('PaymentTerm'));\n $paymentTerm->setAttribute('name', $data[self::PAYMENT_TERM_COL]);\n\n // Vendor\n $cfdParty = $invoice->appendChild($nativeXml->createElement('CfdParty'));\n $cfdParty->setAttribute('type', CfdPartyTypeBehavior::VENDOR);\n $party = $cfdParty->appendChild($nativeXml->createElement('Party'));\n $party->setAttribute('person', (strlen($data[self::VENDOR_RFC_COL]) == 13) ? 1 : 0);\n\n// $partyIdentifiers = $party->appendChild($nativeXml->createElement('PartyIdentifiers'));\n $partyIdentifier = $party->appendChild($nativeXml->createElement('PartyIdentifier'));\n $partyIdentifier->setAttribute('type', 'primary');\n $identifier = $partyIdentifier->appendChild($nativeXml->createElement('Identifier'));\n $identifier->setAttribute('type', IdentifierTypeBehavior::RFC);\n $identifier->setAttribute('value', $data[self::VENDOR_RFC_COL]);\n\n// $partyNames = $party->appendChild($nativeXml->createElement('PartyNames'));\n $partyName = $party->appendChild($nativeXml->createElement('PartyName'));\n $partyName->setAttribute('type', 'primary');\n $name = $partyName->appendChild($nativeXml->createElement('Name'));\n $name->setAttribute('name', $data[self::VENDOR_NAME_COL]);\n\n // Customer\n $cfdParty = $invoice->appendChild($nativeXml->createElement('CfdParty'));\n $cfdParty->setAttribute('type', CfdPartyTypeBehavior::CUSTOMER);\n $party = $cfdParty->appendChild($nativeXml->createElement('Party'));\n $party->setAttribute('person', (strlen($data[self::CUSTOMER_RFC_COL]) == 13) ? 1 : 0);\n\n// $partyIdentifiers = $party->appendChild($nativeXml->createElement('PartyIdentifiers'));\n $partyIdentifier = $party->appendChild($nativeXml->createElement('PartyIdentifier'));\n $partyIdentifier->setAttribute('type', 'primary');\n $identifier = $partyIdentifier->appendChild($nativeXml->createElement('Identifier'));\n $identifier->setAttribute('type', IdentifierTypeBehavior::RFC);\n $identifier->setAttribute('value', $data[self::CUSTOMER_RFC_COL]);\n\n// $partyNames = $party->appendChild($nativeXml->createElement('PartyNames'));\n $partyName = $party->appendChild($nativeXml->createElement('PartyName'));\n $partyName->setAttribute('type', 'primary');\n $name = $partyName->appendChild($nativeXml->createElement('Name'));\n $name->setAttribute('name', $data[self::CUSTOMER_NAME_COL]);\n\n // Address\n// $cfdAddresses = $invoice->appendChild($nativeXml->createElement('CfdAddresses'));\n//\n $cfdAddress = $invoice->appendChild($nativeXml->createElement('CfdAddress'));\n $cfdAddress->setAttribute('type', AddressTypeBehavior::PRIMARY);\n $cfdAddress->setAttribute('reference', $data[self::VENDOR_ADDRESS_REFERENCE_COL]);\n $address = $cfdAddress->appendChild($nativeXml->createElement('Address'));\n $address->setAttribute('street', $data[self::VENDOR_ADDRESS_STREET_COL]);\n $address->setAttribute('neighbourhood', $data[self::VENDOR_ADDRESS_COLONY_COL]);\n $address->setAttribute('city', $data[self::VENDOR_ADDRESS_CITY_COL]);\n $address->setAttribute('country', $data[self::VENDOR_ADDRESS_COUNTRY_COL]);\n $address->setAttribute('municipality', $data[self::VENDOR_ADDRESS_MUNICIPALITY_COL]);\n $address->setAttribute('state', $data[self::VENDOR_ADDRESS_STATE_COL]);\n $address->setAttribute('zipCode', substr('00000' . $data[self::VENDOR_ADDRESS_ZIPCODE_COL], -5));\n//\n $cfdAddress = $invoice->appendChild($nativeXml->createElement('CfdAddress'));\n $cfdAddress->setAttribute('type', AddressTypeBehavior::BILL_TO);\n $address = $cfdAddress->appendChild($nativeXml->createElement('Address'));\n $address->setAttribute('street', $data[self::CUSTOMER_ADDRESS_STREET_COL]);\n $address->setAttribute('neighbourhood', $data[self::CUSTOMER_ADDRESS_COLONY_COL]);\n $address->setAttribute('city', $data[self::CUSTOMER_ADDRESS_CITY_COL]);\n $address->setAttribute('country', $data[self::CUSTOMER_ADDRESS_COUNTRY_COL]);\n $address->setAttribute('municipality', $data[self::CUSTOMER_ADDRESS_MUNICIPALITY_COL]);\n $address->setAttribute('state', $data[self::CUSTOMER_ADDRESS_STATE_COL]);\n $address->setAttribute('zipCode', substr('00000' . $data[self::CUSTOMER_ADDRESS_ZIPCODE_COL], -5));\n//\n// $cfdTaxRegimes = $invoice->appendChild($nativeXml->createElement('CfdTaxRegimes'));\n $cfdTaxRegime = $invoice->appendChild($nativeXml->createElement('CfdTaxRegime'));\n $cfdTaxRegime->setAttribute('name', 'Régimen General de Ley Personas Morales');\n\n// $cfdTaxes = $invoice->appendChild($nativeXml->createElement('CfdTaxes'));\n $cfdTax = $invoice->appendChild($nativeXml->createElement('CfdTax'));\n $cfdTax->setAttribute('name', $data[self::TAX_NAME_COL]);\n $cfdTax->setAttribute('rate', $data[self::TAX_RATE_COL]);\n $cfdTax->setAttribute('amt', $data[self::TAX_AMOUNT_COL]);\n $invoice->setAttribute('tax', $data[self::TAX_AMOUNT_COL]);\n\n// $cfdItems = $invoice->appendChild($nativeXml->createElement('CfdItems'));\n $subTotal = 0;\n $total = $data[self::TAX_AMOUNT_COL];\n }\n // Process items\n $item = $invoice->appendChild($nativeXml->createElement('CfdItem'));\n $item->setAttribute('qty', $data[self::ITEM_QTY_COL]);\n $item->setAttribute('uom', 'EA');\n $item->setAttribute('description', $data[self::ITEM_DESCRIPTION_COL]);\n $item->setAttribute('unitPrice', $data[self::ITEM_UNIT_PRICE_COL]);\n $item->setAttribute('amt', $data[self::ITEM_AMOUNT_COL]);\n if ($data[self::CAR_COL])\n $item->setAttribute('vehicle', $data[self::CAR_COL]);\n if ($data[self::CAR_KM_COL])\n $item->setAttribute('km', $data[self::CAR_KM_COL]);\n if ($data[self::LICENSE_PLATE_COL])\n $item->setAttribute('licensePlate', $data[self::LICENSE_PLATE_COL]);\n if ($data[self::CAR_USERNAME_COL])\n $item->setAttribute('userName', $data[self::CAR_USERNAME_COL]);\n if ($data[self::CAR_ENGINE_NBR_COL])\n $item->setAttribute('engineNbr', $data[self::CAR_ENGINE_NBR_COL]);\n if ($data[self::CAR_SERIAL_NBR_COL])\n $item->setAttribute('serialNbr', $data[self::CAR_SERIAL_NBR_COL]);\n if ($data[self::CAR_INVENTORY_NBR_COL])\n $item->setAttribute('inventoryNbr', $data[self::CAR_INVENTORY_NBR_COL]);\n if ($data[self::AUTH_NBR_COL])\n $item->setAttribute('authNbr', $data[self::AUTH_NBR_COL]);\n\n $subTotal += $data[self::ITEM_AMOUNT_COL];\n $total += $data[self::ITEM_AMOUNT_COL];\n $invoice->setAttribute('subTotal', $subTotal);\n $invoice->setAttribute('total', $total);\n }\n $row++;\n }\n fclose($fHandle);\n $nativeXml->save($args[1]);\n } catch (Exception $e) {\n yii::trace($e->getMessage(), __METHOD__);\n }\n }", "function generateInfoXML($moduleInfo,$elem,$profile){\n\n\t\t// authorized fields\n\t\t$fields_array = $moduleInfo->getFieldsBySecurity('R');\n\n\t\t// fields asked for return in XML\n\t\tif (is_object($profile)){\n\t\t\t$profile_array = $profile->getIncludedFields();\n\t\t}else{\n\t\t\t$profile_array = false;\n\t\t}\n\t\t// user own contact fiche is completely readable to him, even if he's got very few rights\n\t\t$own_contact = ($moduleInfo->getName() == 'contact' && $elem['ID'] === OfficityUser::getID());\n\t\tif($own_contact){\n\t\t\t$fields_array = $moduleInfo->getFieldsBySecurity('0');\n\t\t}\n\n\t\tif($profile->getInfoMode() == 'read-only'){\n\n\t\t\t$infoXML = $this->generateInfoXMLReadOnly($moduleInfo,$elem,$fields_array,$profile_array,$profile->desc_output);\n\n\t\t}else{\n\n\t\t\t$infoGenerator = new NectilElementInfo($moduleInfo->getID(),$elem['ID'],$elem);\n\t\t\tif(is_object($profile)){\n\t\t\t\t$infoGenerator->setProfile($profile->getInfoProfile());\n\t\t\t}\n\t\t\t$infoGenerator->setSecurityProfile($fields_array);\n\n\t\t\t$infoXML = $infoGenerator->getXML();\n\t\t}\n\t\treturn $infoXML;\n\t}", "function getPackageMetaData() ;", "public function GenerateEntity() {\n return $this->entity->Generate();\n }", "private function outputXml()\n {\n $stringXML = $this->dom->saveXML();\n\n $stringXML = str_replace('<?xml version=\"999\"?>', '', $stringXML);\n\n //dd(trim($stringXML));\n\n return trim($stringXML);\n }", "function procMenuAdminMakeXmlFile()\n\t{\n\t\t// Check input value\n\t\t$menu_srl = Context::get('menu_srl');\n\t\t// Get information of the menu\n\t\t$oMenuAdminModel = getAdminModel('menu');\n\t\t$menu_info = $oMenuAdminModel->getMenu($menu_srl);\n\t\t$menu_title = $menu_info->title;\n\t\t// Re-generate the xml file\n\t\t$xml_file = $this->makeXmlFile($menu_srl);\n\t\t// Set return value\n\t\t$this->add('menu_title',$menu_title);\n\t\t$this->add('xml_file',$xml_file);\n\t}", "private function createCommandLineOptions()\n {\n $options = $this->options;\n\n $cmdOptions = [];\n\n // Metadata (all, exif, icc, xmp or none (default))\n // Comma-separated list of existing metadata to copy from input to output\n $cmdOptions[] = '-metadata ' . $options['metadata'];\n\n // preset. Appears first in the list as recommended in the docs\n if (!is_null($options['preset'])) {\n if ($options['preset'] != 'none') {\n $cmdOptions[] = '-preset ' . $options['preset'];\n }\n }\n\n // Size\n $addedSizeOption = false;\n if (!is_null($options['size-in-percentage'])) {\n $sizeSource = filesize($this->source);\n if ($sizeSource !== false) {\n $targetSize = floor($sizeSource * $options['size-in-percentage'] / 100);\n $cmdOptions[] = '-size ' . $targetSize;\n $addedSizeOption = true;\n }\n }\n\n // quality\n if (!$addedSizeOption) {\n $cmdOptions[] = '-q ' . $this->getCalculatedQuality();\n }\n\n // alpha-quality\n if ($this->options['alpha-quality'] !== 100) {\n $cmdOptions[] = '-alpha_q ' . escapeshellarg($this->options['alpha-quality']);\n }\n\n // Losless PNG conversion\n if ($options['encoding'] == 'lossless') {\n // No need to add -lossless when near-lossless is used\n if ($options['near-lossless'] === 100) {\n $cmdOptions[] = '-lossless';\n }\n }\n\n // Near-lossles\n if ($options['near-lossless'] !== 100) {\n // We only let near_lossless have effect when encoding is set to \"lossless\"\n // otherwise encoding=auto would not work as expected\n if ($options['encoding'] == 'lossless') {\n $cmdOptions[] ='-near_lossless ' . $options['near-lossless'];\n }\n }\n\n if ($options['auto-filter'] === true) {\n $cmdOptions[] = '-af';\n }\n\n // Built-in method option\n $cmdOptions[] = '-m ' . strval($options['method']);\n\n // Built-in low memory option\n if ($options['low-memory']) {\n $cmdOptions[] = '-low_memory';\n }\n\n // command-line-options\n if ($options['command-line-options']) {\n array_push(\n $cmdOptions,\n ...self::escapeShellArgOnCommandLineOptions($options['command-line-options'])\n );\n }\n\n // Source file\n $cmdOptions[] = escapeshellarg($this->source);\n\n // Output\n $cmdOptions[] = '-o ' . escapeshellarg($this->destination);\n\n // Redirect stderr to same place as stdout\n // https://www.brianstorti.com/understanding-shell-script-idiom-redirect/\n $cmdOptions[] = '2>&1';\n\n $commandOptions = implode(' ', $cmdOptions);\n $this->logLn('command line options:' . $commandOptions);\n\n return $commandOptions;\n }", "public function run()\n {\n //\n $extras_moto = [\n [\n 'description' => 'Puños de Gel'\n ],\n [\n 'description' => 'Asiento de Gel'\n ],\n [\n 'description' => 'Puños Termicos'\n ],\n [\n 'description' => 'Frenos ABS'\n ],\n [\n 'description' => 'Alarma'\n ],\n [\n 'description' => 'Luces Antiniebla'\n ],\n [\n 'description' => 'Record de Agencia'\n ],\n [\n 'description' => 'Control de Tracción'\n ],\n [\n 'description' => 'Control de Velocidad'\n ],\n\n ];\n\n foreach($extras_moto as $extra_moto){\n ExtraMoto::create($extra_moto);\n }\n }", "function webmap_compo_lib_xml_build()\r\n{\r\n\t$this->webmap_compo_lib_xml_base();\r\n}", "public function toXML()\n {\n $output = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . PHP_EOL;\n $output .= '<provisioning version=\"1.1\" productID=\"' . $this->getProductID() . '\">' . PHP_EOL;\n\n $output .= '<firmware>' . PHP_EOL;\n\n if ($this->getFirmware()) {\n $output .= '<file version=\"' . $this->getFirmware()->getVersion() . '\" url=\"' . $this->getFirmware()->getUrl() . '\"/>' . PHP_EOL;\n }\n\n $output .= '</firmware>' . PHP_EOL;\n\n if ($this->getDownloadWallpaper()) {\n $output .= '<custom>' . PHP_EOL;\n $output .= '<step type=\"DownloadWallpaper\" url=\"' . $this->getDownloadWallpaper() . '\"/>' . PHP_EOL;\n $output .= '</custom>' . PHP_EOL;\n }\n\n $output .= '<nvm>' . PHP_EOL;\n\n $iterator = new \\RecursiveIteratorIterator(new \\RecursiveArrayIterator($this->toArray()));\n foreach ($iterator as $leafValue) {\n $keys = [];\n foreach (range(0, $iterator->getDepth()) as $depth) {\n $keys[] = $iterator->getSubIterator($depth)->key();\n }\n\n // convert booleans to 0 or 1\n if (is_bool($leafValue)) {\n $leafValue = $leafValue ? '1' : '0';\n }\n\n $output .= '<param name=\"' . join('.', $keys) . '\" value=\"' . $leafValue . '\" />' . PHP_EOL;\n }\n $output .= '</nvm>' . PHP_EOL;\n\n $output .= '<custom></custom>' . PHP_EOL;\n $output .= '</provisioning>';\n\n return $output;\n }", "public function toXml ( $xml , $ast ) {\n\t\t$manufacturer = $xml->createElement ( 'manufacturer' ) ;\n\t\t$manufacturer->setAttribute ( 'id', $this->id ) ;\n\t\t$manufacturer->setAttribute ( 'name', $this->name ) ;\n\t\t$manufacturer->setAttribute ( 'website', $this->website) ;\n\t\t$manufacturer->setAttribute ( 'country', $this->country) ;\n\t\t$ast->appendchild ( $manufacturer ) ;\n\t}", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"\\r\\n\";\n echo \"<sitemapindex xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public static function xmlHeader(){\n\t\treturn '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>';\n\t}", "public function execute()\n {\n $args = $this->getRemainingArgs();\n if (!isset($args[1])) {\n throw new Exception('Missing template argument');\n }\n\n $template = $args[1];\n if ('@php_bin@' !== '@'.'php_bin@') {\n passthru(\n 'pear install docblox/DocBlox_Template_' . $template . ' '\n . $this->getVersion()\n );\n return;\n }\n\n if (!$this->getVersion()) {\n throw new Exception(\n 'Version number is required if DocBlox is not installed via PEAR'\n );\n }\n\n $source = 'http://pear.docblox-project.org/get/DocBlox_Template_'\n . $template . '-' . $this->getVersion() . '.tar';\n\n $tmp = tempnam(sys_get_temp_dir(), 'DBX').'.tar';\n file_put_contents($tmp, file_get_contents($source));\n $folder = realpath(dirname(__FILE__) . '/../../../../data/templates')\n . DIRECTORY_SEPARATOR . $template;\n\n echo 'Installing to: '.$folder.PHP_EOL;\n\n $tmp_folder = sys_get_temp_dir() . DIRECTORY_SEPARATOR\n . 'DBX_TEMPLATE_INSTALL' . $template . '-' . $this->getVersion();\n $phar = new PharData($tmp);\n $phar->extractTo($tmp_folder, null, true);\n unlink($tmp);\n\n $this->copyRecursive(\n $tmp_folder . DIRECTORY_SEPARATOR . 'DocBlox_Template_' . $template\n . '-' . $this->getVersion(),\n $folder\n );\n\n echo 'Completed installation'.PHP_EOL;\n }", "public function run()\n {\n $args = $this->getArguments();\n\n // Validate argument was passed\n if (empty($args)) {\n throw new Exception(self::signature . ' requires an argument.');\n }\n\n $this->arg = new MakeCmdArgument($args[0]);\n\n $this->createSubDirectories();\n $this->createCommandFile();\n }" ]
[ "0.51424557", "0.50474995", "0.49079108", "0.48542053", "0.48455122", "0.4840253", "0.48006558", "0.47983032", "0.47948125", "0.47890016", "0.47443396", "0.4742791", "0.4722852", "0.46845752", "0.4643586", "0.46386895", "0.45956045", "0.45919335", "0.45914263", "0.45735836", "0.45610264", "0.4529947", "0.45228907", "0.45133674", "0.45027843", "0.45006827", "0.4493511", "0.4488571", "0.44872472", "0.44730958", "0.4466895", "0.44632763", "0.44611672", "0.44517294", "0.44504467", "0.44489804", "0.44369587", "0.44268605", "0.44243196", "0.44151184", "0.44148788", "0.4406001", "0.44005165", "0.4387531", "0.43789312", "0.43714792", "0.43521821", "0.43518215", "0.43406197", "0.43329394", "0.43289822", "0.4319189", "0.43163148", "0.43094295", "0.43064535", "0.43062624", "0.4303399", "0.42906114", "0.42874968", "0.42763758", "0.4273791", "0.4272215", "0.42699525", "0.42689198", "0.42668605", "0.42637414", "0.42627606", "0.42590365", "0.42552227", "0.42437047", "0.42221832", "0.42213517", "0.42181593", "0.421718", "0.42165595", "0.42144242", "0.4213164", "0.4198958", "0.41969532", "0.4192774", "0.41783628", "0.41761014", "0.41743967", "0.41731328", "0.41675848", "0.4159622", "0.41577297", "0.41541708", "0.4153627", "0.4146991", "0.41445988", "0.41421357", "0.41393626", "0.41382548", "0.41376427", "0.41373605", "0.41343835", "0.41288105", "0.41275716", "0.41261798" ]
0.6808798
0
Print list of tool parameters
function printGetParameters() { $this->printDebugMessage('printGetParameters', 'Begin', 1); $paramList = $this->getParameters(); print "<ul>\n"; foreach($paramList as $paramName) { print '<li>' . $paramName . "</li>\n"; } print "</ul>\n"; $this->printDebugMessage('printGetParameters', 'End', 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paramDump() {\n $spec = Terminus::getRunner()->getConfigurator()->getSpec();\n $this->output()->outputDump($spec);\n }", "private function print() {\n\t\tvar_dump($this->getParams());\n\t}", "public function help_parameters(&$details) {\n\t\t// @todo Add in which environment to use.\n\t}", "function printOptions()\n {\n $lines = $this->outputOptions();\n echo join( \"\\n\" , $lines );\n }", "function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}", "public function describe_debug_options() {\n echo '<p>The following options control logging of the plugin actions for debugging purposes.</p>';\n }", "public static function var_dumpp()\n {\n echo \"<pre>\";\n if(func_num_args()>0)\n foreach(func_get_args() as $argv)\n {\n var_dump($argv);\n }\n echo \"</pre>\";\n\n }", "public function help()\n\t{\n\t\t$this\n\t\t\t->output\n\t\t\t->addOverview(\n\t\t\t\t'Store shared configuration variables used by the command line tool.\n\t\t\t\tThese will, for example, be used to fill in docblock stubs when\n\t\t\t\tusing the scaffolding command.'\n\t\t\t)\n\t\t\t->addTasks($this)\n\t\t\t->addArgument(\n\t\t\t\t'--{keyName}',\n\t\t\t\t'Sets the variable keyName to the given value.',\n\t\t\t\t'Example: --name=\"John Doe\"'\n\t\t\t);\n\t}", "function printParambers($params){\n $parLength = count($params); // Number of parameters\n \n // No parameters and should be closed \n if($parLength == 0){\n echo \")\";\n }\n else{\n for($parCounter = 0; $parCounter < $parLength - 1; $parCounter++){\n $par = $params[$parCounter];\n echo $par->__get(\"type\") . \" \" . $par->__get(\"name\") . \",\";\n }\n $par = $params[$parLength - 1];\n echo $par->__get(\"type\") . \" \" . $par->__get(\"name\") . \")\";\n }\n }", "function print_help()\n{\n\techo \"skript lze spustit s nasledujicimi parametry:\n\\\t--format=filename \\tparametr urcujici formatovaci soubor, volitelny\n\\\t--input=filename \\tparametr urcujici vstupni soubor, volitelny\n\\\t\\t\\t\\tpokud neni zadan vstup ocekavan na stdin\n\\\t--output=filename \\tparametr urcujici vystupni soubor, volitelny\n\\\t\\t\\t\\tpokud neni zadan vystup na stdout\n\\\t--br \\t\\t\\tpridani <br /> na konec kazdeho radku, volitelny\\n\";\n\texit (0);\n}", "public function debugDumpParams()\n {\n }", "private function printListOfCommands()\n {\n /**\n * @var Padding\n */\n $padding = $this->cli->padding(50)->char(' ');\n $padding->label(' <bold><blue>show dbs:</blue></bold>')->result('show database names');\n $padding->label(' <bold><blue>show collection:</blue></bold>')->result('show collections in current database');\n $padding->label(' <bold><blue>use:</blue></bold>')->result('set current database');\n }", "public function debugDumpParams() {\n }", "public function printHelp();", "public function ovpnDisplayConfigSet()\n {\n foreach ($this as $key=>$value) {\n echo \"$key = $value<br />\\n\";\n }\n }", "public function getParams($print = false){\n if($print == true){\n echo '<pre>' . htmlspecialchars( print_r($this->params, true) ) . '</pre>';\n }else{\n return $this->params;\n }\n }", "public static function DEBUG_PRINT()\n {\n $self = new self;\n $debug = [\n 'Service_Endpoint' => $self->getServiceEndpoint(),\n 'App_key' => $self->getAppKey(),\n 'App_Secret' => $self->getSecretKey(),\n 'Server_URL' => $self->SERVER_URL\n ];\n\n echo \"<h1> Print our all configuration </h1>\";\n echo \"<br>\";\n\n foreach ($debug as $key => $value) {\n echo \"My \" . $key . ' is ' . $value . \"<br>\";\n }\n }", "public static function getToolSettings();", "public function getHelp()\n\t{\n\t return '<info>Console Tool</info>';\n\t}", "function getParameters();", "function getParameters();", "private function printToolHead() {\n\t\t\t$this->page->openBlock('div', 'iw-content');\n\t\t\t$this->page->addInline('p', 'This tool generates reports about wikilinks in one article:');\n\t\t\t$this->page->openBlock('ul');\n\t\t\t$this->page->addInline('li', 'Links from given article which have no backlinks from target article');\n\t\t\t$this->page->addInline('li', 'Backlinks from other articles which have no links from given article');\n\t\t\t$this->page->addInline('li', 'Links from given article with backlinks from other articles');\n\t\t\t$this->page->closeBlock();\n\t\t\t$this->page->addInline('h2', 'Options');\n\t\t\t\n\t\t\t// options\n\t\t\t$optionForm = new HtmlForm('index.php', 'GET');\n\t\t\t$optionForm->addHTML('<table class=\"iw-nostyle\">');\n\t\t\t\n\t\t\t// lang/project\n\t\t\t$optionForm->addHTML('<tr><td>');\n\t\t\t$optionForm->addLabel('lang', 'Project');\n\t\t\t$optionForm->addHTML('</td><td>');\n\t\t\t$optionForm->addInput('lang', $this->par['lang'], '', 7, true);\n\t\t\t$optionForm->addHTML('&nbsp;.&nbsp;');\n\t\t\t$optionForm->addInput('project', $this->par['project'], '', 20, true);\n\t\t\t$optionForm->addHTML('&nbsp;.org</td></tr>');\n\t\t\t\n\t\t\t// page\n\t\t\t$optionForm->addHTML('<tr><td>');\n\t\t\t$optionForm->addLabel('page', 'Page title');\n\t\t\t$optionForm->addHTML('</td><td>');\n\t\t\t$optionForm->addInput('page', $this->par['page'], 'A page title in the main namespace (0)', 0, true);\n\t\t\t$optionForm->addHTML('</td></tr>');\n\t\t\t\n\t\t\t// submit button\n\t\t\t$optionForm->addHTML('<tr><td colspan=\"2\">');\n\t\t\t$optionForm->addButton('submit', 'View page conjunction');\n\t\t\t$optionForm->addHTML('</td></tr>');\n\t\t\t\n\t\t\t$optionForm->addHTML('</table>');\n\t\t\t$optionForm->output();\n\t\t\t\n\t\t\t$this->page->closeBlock();\n\t\t}", "function printvalues(){\n\t\tprint_r([$this->bedroom,$this->bathroom,$this->kitchen, $this->livingroom]);\n\t}", "public function printApplicationDetails()\n {\n $this->output->writeln($this->console->getName());\n\n if (!is_null($this->console->getVersion())) {\n $this->output->writeln('version '.$this->console->getVersion());\n }\n\n // New line padding\n $this->output->writeln('');\n }", "public function actionMyOptions()\n {\n echo \"option1 - $this->option1\\n\\roption2 - $this->option2\\n\\rcolor - $this->color\\n\\r\";\n }", "public function printCommandList(): void\n {\n $commandList = $this->getCommandList();\n $this->writeData('Available commands:');\n array_map(function ($command) {\n $this->writeData('-------------------------');\n $this->writeData('-name: '.$command->getName());\n $this->writeData('-description: '.$command->getDescription());\n $this->writeData('-------------------------');\n }, $commandList);\n }", "static function plInfo()\n {\n return array(\n \"plShortName\" => _(\"Argonaut Mirror settings\"),\n \"plDescription\" => _(\"Argonaut Mirror settings\").\" (\"._(\"Services\").\")\",\n \"plIcon\" => \"plugins/argonaut/images/iconMiniMirrorConfig.png\",\n\n \"plProvidedAcls\" => parent::generatePlProvidedAcls(self::getAttributesInfo())\n );\n }", "function getToolSettings() {\n /*reserved for future use*/\n }", "function help()\n {\n return\n \"\\n -------------------------------------------------------------------------\\n\".\n \" ---- ~ BidVest Data : Assessment Commands ~ -------\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" All comamnds begin with '\\e[1m\\033[92mphp run.php\\033[0m'\\e[0m\\n\".\n \" Then append of the folling options: \\n\".\n \" -------------------------------------------------------------------------\\n\".\n \"\\n\\n\".\n \" 1. \\e[1m --action=\\033[34madd \\033[0m \\e[0m : \\e[3mThis allows you to add a record.\\e[0m \\n\\n\".\n \" 2. \\e[1m --action=\\033[33medit \\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mEdit a student record.\\e[0m \\n\\n\".\n \" (leave filed blank to keep previous value)\\n\\n\".\n \" 3. \\e[1m --action=\\033[91mdelete\\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mDelete a student record (remove file only).\\e[0m \\n\\n\".\n \" 4. \\e[1m --action=\\033[36msearch \\033[0m \\e[0m : \\e[3mSearch for a student record. \\e[0m \\n\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" Where \\e[1m<valid_id>\\e[0m must be an 8-digit number.\\n\\n\".\n \" -------------------------------------------------------------------------\\n\";\n }", "function getParameters()\r\n {\r\n }", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }", "function dump() {\n\t\t$vars = get_object_vars( $this );\n\t\techo '<pre style=\"text-align:left\">';\n\t\tforeach( $vars as $name => $value ) {\n\t\t\techo $name.': '.$value.\"\\n\";\n\t\t}\n\t\techo '</pre>';\n\t}", "public function help()\n {\n echo PHP_EOL;\n $output = new Output;\n $output->write('Available Commands', [\n 'color' => 'red',\n 'bold' => true,\n 'underline' => true,\n ]);\n echo PHP_EOL;\n\n $maxlen = 0;\n foreach ($this->supportedArgs as $key => $description) {\n $len = strlen($key);\n if ($len > $maxlen) {\n $maxlen = $len;\n }\n\n }\n\n foreach ($this->supportedArgs as $key => $description) {\n $len = strlen($key);\n $output->write(' ')\n ->write($key, ['color' => 'yellow'])\n ->write(str_repeat(' ', $maxlen - $len))\n ->write(' - ')\n ->write($description);\n\n echo PHP_EOL;\n }\n\n echo PHP_EOL;\n\n }", "public function getHelmertParameters(){\n\n\t\t\treturn $this->_helmertPatameters;\n\t\t}", "function print_help($err_code = 0)\n{\n\tprintf(\"\n\tHelp:\\n\n\t--help - this help will be printed\n\t--input=FILE_NAME - input xml file (if not provided stdin is used)\n\t--output=FILE_NAME - output file\n\t--header='HEADER' - this header will be written to the beginning of the output file\n\t--etc=N - max number of columns generated from same named sub elements\n\t-a - columns from attributes in imputed xml will not be generated\n\t-b - if element will have more sub elements of same name, only one will be generated\n\t - cannot be combined with --etc option\\n\\n\");\n\texit($err_code);\n}", "function printGetParameterDetails($parameterId) {\n $this->printDebugMessage('printGetParameterDetails', 'Begin', 1);\n $paramDetail = $this->getParameterDetails($parameterId);\n print <<<EOF\n<h3>$paramDetail->name</h3>\n\n<p>$paramDetail->description</p>\nEOF\n ;\n if(isset($paramDetail->values)) {\n print \"<table border=\\\"1\\\">\\n\";\n print \"<tr><th>Label</th><th>Value</th><th>Default</th></tr>\\n\";\n foreach($paramDetail->values->value as $val) {\n\tprint \"<tr><td>$val->label</td><td>$val->value</td><td>\";\n\tif($val->defaultValue && $val->defaultValue == 'true') print 'default';\n\telse print '&nbsp;';\n\tprint \"</td></tr>\\n\";\n }\n print \"</table>\\n\";\n }\n $this->printDebugMessage('printGetParameterDetails', 'Begin', 1);\n }", "protected function help()\n\t{\n\t\t$this->out('Getsocialdata ' . self::VERSION);\n\t\t$this->out();\n\t\t$this->out('Usage: php -f bin/getdata.php -- [switches]');\n\t\t$this->out();\n\t\t$this->out('Switches: -h | --help Prints this usage information.');\n\t\t$this->out();\n\t\t$this->out();\n\t}", "protected function getConfigParameterOptions(): string\n {\n $options = '';\n foreach ($this->configParameters as $name => $value) {\n $options .= ' -c ' . escapeshellarg($name . '=' . $value);\n }\n return $options;\n }", "public function to_string() {\n\n\t\treturn print_r( $this->parameters, true );\n\t}", "public function getParameters() {}", "private function PrintHelp(){\n\t\t\techo \"Script parser.php\\n\";\n echo \"Launch: php7.4 parse.php <file.src >out.xml\\n\";\n\t\t\techo \"Only supported argument is --help\\n\";\n exit;\n\t\t}", "function scaffold_dump() {\n\t$args = func_get_args();\n\tforeach ($args as $arg) {\n\t\tprintf(\"<pre>\\n%s\\n</pre>\\n\", print_r($arg, true));\n\t}\n}", "public function ovpnDisplayConfig()\n {\n $readArr = unserialize(file_get_contents(\"./vpn/ovpn.array.config\"));\n foreach ($readArr as $key=>$value) {\n echo \"$key = $value<br />\\n\";\n }\n }", "public function getHelp() {\n $help = parent::getHelp();\n $global_options = $this->getGlobalOptions();\n if (!empty($global_options)) {\n $help .= PHP_EOL . 'Global options:';\n foreach ($global_options as $name => $value) {\n $help .= PHP_EOL . ' [' . $name . '=' . $value . ']';\n }\n }\n return $help;\n }", "public static function debug()\n {\n if (func_num_args() === 0) {\n return;\n }\n\n // Get params\n $params = func_get_args();\n $output = array();\n\n foreach ($params as $var) {\n $output[] = '<pre>('.gettype($var).') '.html::specialchars(print_r($var, true)).'</pre>';\n }\n\n return implode(\"\\n\", $output);\n }", "function opcion__info()\n\t{\n\t\t$p = $this->get_proyecto();\n\t\t$param = $this->get_parametros();\n\t\t$this->consola->titulo( \"Informacion sobre el PROYECTO '\" . $p->get_id() . \"' en la INSTANCIA '\" . $p->get_instancia()->get_id() . \"'\");\n\t\t$this->consola->mensaje(\"Version de la aplicación: \".$p->get_version_proyecto().\"\\n\");\n\t\tif ( isset( $param['-c'] ) ) {\n\t\t\t// COMPONENTES\n\t\t\t$this->consola->subtitulo('Listado de COMPONENTES');\n\t\t\t$this->consola->tabla( $p->get_resumen_componentes_utilizados() , array( 'Tipo', 'Cantidad') );\n\t\t} elseif ( isset( $param['-g'] ) ) {\n\t\t\t// GRUPOS de ACCESO\n\t\t\t$this->consola->subtitulo('Listado de GRUPOS de ACCESO');\n\t\t\t$this->consola->tabla( $p->get_lista_grupos_acceso() , array( 'ID', 'Nombre') );\n\t\t} else {\n\t\t\t$this->consola->subtitulo('Reportes');\n\t\t\t$subopciones = array( \t'-c' => 'Listado de COMPONENTES',\n\t\t\t\t\t\t\t\t\t'-g' => 'Listado de GRUPOS de ACCESO' ) ;\n\t\t\t$this->consola->coleccion( $subopciones );\n\t\t}\n\t}", "function printToolAdmin() {\r\n $criteria = array('status' => Appeal::$STATUS_AWAITING_ADMIN);\r\n return printAppealList($criteria);\r\n}", "function get_list_params()\n\t{\n\t\treturn '';\n\t}", "public static function p()\r\n\t{\r\n\t\t$consolePrint = false;\r\n\r\n\t\tif (!isset($_SERVER['HTTP_HOST']) || $_SERVER['HTTP_HOST'] == null) {\r\n\t\t\t$consolePrint = true;\r\n\t\t}\r\n\r\n\t\tif (!$consolePrint) {\r\n\t\t\techo '<pre>';\r\n\t\t}\r\n\t\t$args = func_get_args();\r\n\r\n\t\tforeach ($args as $var)\r\n\t\t{\r\n\t\t\tif ($var == null || $var == '') {\r\n\t\t\t\tvar_dump($var);\r\n\t\t\t} elseif (is_array($var) || is_object($var)) {\r\n\t\t\t\tprint_r($var);\r\n\t\t\t} else {\r\n\t\t\t\techo $var;\r\n\t\t\t}\r\n\t\t\tif (!$consolePrint) {\r\n\t\t\t\techo '<br>';\r\n\t\t\t} else {\r\n\t\t\t\techo \"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!$consolePrint) {\r\n\t\t\techo '</pre>';\r\n\t\t}\r\n\t}", "public function printConfiguration () {\n echo static::substituteTemplateVariables($this->template);\n }", "public function getDescriptions()\n {\n return [\n 'debug applications' => 'Show all loaded applications'\n ];\n }", "protected function getOpModeParamsList()\n {\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT rt.KINST, rt.KINDAT, ri.PARAMETER_ID \" ;\n\t$query .= \"FROM tbl_record_type rt, tbl_record_info ri, \" ;\n\t$query .= \"tbl_parameter_code pc \" ;\n\t$query .= \"WHERE rt.RECORD_TYPE_ID=ri.RECORD_TYPE_ID \" ;\n\t$query .= \"AND pc.PARAMETER_ID=ri.PARAMETER_ID \" ;\n\t$query .= \"AND NOT (pc.LONG_NAME='UNDEFINED')\" ;\n\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }", "public function dump() {\n print_r($this->getConfig());\n }", "public function getPrintOptions() {\r\n\t\treturn $this->options->getPrint();\r\n\t}", "function showHelp()\n{\n $myName = basename(__FILE__);\n echo \"Usage:\\n\";\n echo sprintf(\" %s \\033[32m{tool name}\\033[0m\\n\", $myName);\n echo PHP_EOL;\n echo \" Tool names:\\n\";\n echo PHP_EOL;\n echo sprintf(\" * %s\\n\", 'Convert SASS/SCSS to CSS:');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sass2css');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scss2css');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sasstocss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scsstocss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sass');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'css');\n echo PHP_EOL;\n echo sprintf(\" * %s\\n\", 'Dump autoload classes map:');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'dumpautoload');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'dump');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoload');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'classmap');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoloadmap');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoloadclassmap');\n exit(0);\n}", "function PrintSiteDescription()\n\t{\n\t\t$description = GetTitle('parameters/preferences', 3);\n\t\techo $description;\n\t}", "static function plInfo()\n {\n return (array(\n \"plShortName\" => _(\"Service\"),\n \"plDescription\" => _(\"Terminal service\"),\n \"plSelfModify\" => FALSE,\n \"plDepends\" => array(),\n \"plPriority\" => 3,\n \"plSection\" => array(\"administration\"),\n \"plCategory\" => array(\"terminal\"),\n\n \"plProvidedAcls\"=> array(\n\n \"gotoXMonitor\" => _(\"Monitor\"),\n \"gotoXMethod\" => _(\"Method\"),\n \"gotoXdmcpServer\" => _(\"Remote desktop\"),\n \"gotoXDriver\" => _(\"Graphic driver\"),\n \"gotoXResolution\" => _(\"Graphic resolution\"),\n \"gotoXColordepth\" => _(\"Graphic color depth\"),\n \"gotoXHsync\" => _(\"Horizontal synchronization\"),\n \"gotoXVsync\" => _(\"Vertical synchronization\"),\n \"AutoSync\" => _(\"Auto-Sync\"),\n \"gotoScannerEnable\" => _(\"Scanner enabled\"),\n \"gotoLpdEnable\" => _(\"Printer enabled\"),\n \"gotoXKbModel\" => _(\"Keyboard model\"),\n \"gotoXKbLayout\" => _(\"Keyboard layout\"),\n \"gotoXKbVariant\" => _(\"Keyboard variant\"),\n \"gotoXMouseType\" => _(\"Mouse type\"),\n \"gotoXMouseport\" => _(\"Mouse port\"),\n \"gotoLpdEnable\" => _(\"Printer enabled\"),\n \"goFonHardware\" => _(\"Telephone hardware\"))\n ));\n }", "public function help(){\n\t\t$list = array();foreach($this->getEncryptionKeys() as $k=>$v){$list[]=$k;}\n\t\treturn \"Supported Encryped sections: \". rtrim(implode(',', $list), ',');\n\t}", "function get_tools()\n {\n }", "public function debug() {\n\t\tvar_dump(array(\n\t\t\t'config' => $this->config,\n\t\t\t'prices' => $this->prices\n\t\t));\n\t}", "function print_additional_settings_section_info() {\n }", "public function params() {\n\t\treturn nl2br($this -> params);\n\t}", "public function print_section_info()\n {\n print 'Enter your settings below:';\n }", "public function print_section_info()\n {\n print 'Enter your settings below:';\n }", "public function print_section_info()\n {\n print 'Enter your settings below:';\n }", "public function print_section_info() {\n // print 'Enter your settings below:';\n }", "public function getParameters()\n\t{\n\n\t}", "public function getParameters()\n\t{\n\n\t}", "public static function print_section_info()\n {\n print 'Enter your settings below:';\n }", "public function print_settings_section_info()\n {\n }", "function printHelp(){\n\t\techo \"Executes SQL-like SELECT query on XML file.\\n\";\n\t\techo \"Arguments:\\n\";\n\t\techo \" --help - prints this message\\n\";\n\t\techo \" --input=<file> - specifies input XML file\\n\";\n\t\techo \" --output=<file> - specifies output file\\n\";\n\t\techo \" --query='query' - query to be perfomed, cannot be used with --qf\\n\";\n\t\techo \" --qf=<file> - specifies file containing query, cannot be used with --query\\n\";\n\t\techo \" -n - XML header is not generated in the output\\n\";\n\t\techo ' --root=\"string\" - specifies name of the root element in the output'.\"\\n\";\n\t}", "protected function getParamList()\n {\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT PARAMETER_ID, LONG_NAME, SHORT_NAME, MADRIGAL_NAME FROM tbl_parameter_code\" ;\n\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }", "public function getParametersList(){\n return $this->_get(2);\n }", "function prg() \r\n{\r\n\tprintarr($_GET, '$_GET:');\r\n}", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function help()\n\t\t{\n\t\t\t//On défini les commandes dispo\n\t\t\t$commands = array(\n\t\t\t\t'generateObjectFromTable' => array(\n\t\t\t\t\t'description' => 'Cette commande permet de générer un objet correspondant à la table fournie en argument.',\n\t\t\t\t\t'requireds' => array(\n\t\t\t\t\t\t'-t' => 'Nom de la table pour laquelle on veux générer un objet',\n\t\t\t\t\t),\n\t\t\t\t\t'optionals' => array(),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$message = \"Vous êtes ici dans l'aide de la console.\\n\";\n\t\t\t$message .= \"Voici la liste des commandes disponibles : \\n\";\n\n\t\t\t//On écrit les texte pour la liste des commandes dispos\n\t\t\tforeach ($commands as $name => $value)\n\t\t\t{\n\t\t\t\t$requireds = isset($value['requireds']) ? $value['requireds'] : array();\n\t\t\t\t$optionals = isset($value['optionals']) ? $value['optionals'] : array();\n\n\t\t\t\t$message .= '\t' . $name . ' : ' . $value['description'] . \"\\n\";\n\t\t\t\t$message .= \"\t\tArguments obligatoires : \\n\";\n\t\t\t\tif (!count($requireds))\n\t\t\t\t{\n\t\t\t\t\t$message .= \"\t\t\tPas d'arguments\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach ($requireds as $argument => $desc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= '\t\t\t\t- ' . $argument . ' : ' . $desc . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$message .= \"\t\tArguments optionels : \\n\";\n\t\t\t\t\n\t\t\t\tif (!count($optionals))\n\t\t\t\t{\n\t\t\t\t\t$message .= \"\t\t\tPas d'arguments\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach ($optionals as $argument => $desc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= '\t\t\t\t- ' . $argument . ' : ' . $desc . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo $message;\n\t\t}", "protected function getDebugUrl()\n\t{\n\t\treturn implode( ' ', \\Sifo\\CLBootstrap::$command_line_params );\n\t}", "function info()\n\t{\n\t\t$info=array();\n\t\t$info['author']='Chris Graham';\n\t\t$info['organisation']='ocProducts';\n\t\t$info['hacked_by']=NULL;\n\t\t$info['hack_version']=NULL;\n\t\t$info['version']=2;\n\t\t$info['locked']=false;\n\t\t$info['parameters']=array('root','sort','search','max','param','select','template_set','display_type');\n\t\treturn $info;\n\t}", "private function getArguments()\n {\n $opts = getopt(\n \"\",\n array(\n 'help',\n 'debug',\n 'host:',\n 'port:',\n 'virtualport:',\n 'timeout:',\n 'warning-packetloss:',\n 'critical-packetloss:',\n 'warning-ping:',\n 'critical-ping:',\n 'minimal-uptime:',\n 'warning-clients:',\n 'critical-clients:',\n 'ignore-reserved-slots',\n 'ignore-virtualserverstatus',\n )\n );\n\n // show usage help when help isset or no (valid) parameters given\n if (count($opts) == 0 || isset($opts['help'])) {\n $this->echoExit(\n 99,\n PHP_EOL .\n \"Icinga Teamspeak3 performance/health check\" . PHP_EOL . PHP_EOL .\n \"* all checks are optional, they will be executed when a warning and or critical limit has been given\" . PHP_EOL .\n \"* when virtualport is not set, uptime & clients check will be done globally, other checks do require the virtualport to be set\" . PHP_EOL . PHP_EOL .\n 'Usage:' . PHP_EOL .\n '--host <localhost> --port <10011> [--virtualport <portnr>] ' . PHP_EOL .\n '[--warning-packetloss <percentage>] [--critical-packetloss <percentage>] ' . PHP_EOL .\n '[--warning-ping <ms>] [--critical-ping <ms>] ' . PHP_EOL .\n '[--warning-clients <percent>] [--critical-clients <percentage>]' . PHP_EOL .\n '[--minimal-uptime <seconds>] ' . PHP_EOL .\n '[--ignore-reserved-slots] - a reserved slot will be counted as free slot' . PHP_EOL .\n '[--ignore-virtualserverstatus] - go to UNKNOWN state when virtual server is offline' . PHP_EOL .\n '[--timeout <10>] [--debug]' . PHP_EOL\n );\n }\n\n $this->host = isset($opts['host']) ? $opts['host'] : 'localhost';\n $this->telnetport = isset($opts['port']) ? intval($opts['port']) : 10011;\n $this->virtualport = isset($opts['virtualport']) ? intval($opts['virtualport']) : 0;\n $this->debug = isset($opts['debug']) ? true : false;\n $this->timeout = isset($opts['timeout']) ? intval($opts['timeout']) : 10;\n $this->warningPacketLoss = isset($opts['warning-packetloss']) ? floatval($opts['warning-packetloss']) : 0;\n $this->criticalPacketLoss = isset($opts['critical-packetloss']) ? floatval($opts['critical-packetloss']) : 0;\n $this->warningPing = isset($opts['warning-ping']) ? intval($opts['warning-ping']) : 0;\n $this->criticalPing = isset($opts['critical-ping']) ? intval($opts['critical-ping']) : 0;\n $this->minimalUptime = isset($opts['minimal-uptime']) ? intval($opts['minimal-uptime']) : 0;\n $this->warningClientPercent = isset($opts['warning-clients']) ? intval($opts['warning-clients']) : 0;\n $this->criticalClientPercent = isset($opts['critical-clients']) ? intval($opts['critical-clients']) : 0;\n $this->ignoreReservedSlots = isset($opts['ignore-reserved-slots']) ? true : false;\n $this->ignoreVirtualstatus = isset($opts['ignore-virtualserverstatus']) ? true : false;\n\n if ($this->virtualport == 0) {\n if ($this->warningPacketLoss != 0 || $this->criticalPacketLoss) {\n $this->echoExit(self::STATE_UNKNOWN, \"cannot check packetloss without port of virtual server set\");\n }\n if ($this->warningPing != 0 || $this->criticalPing) {\n $this->echoExit(self::STATE_UNKNOWN, \"cannot check ping without port of virtual server set\");\n }\n }\n }", "function print_help(){\necho \"Napoveda pre skript na analyzu funkcii v hlavickovych suboroch jazyka C. \\n\";\necho \"Skript je mozne spustit s nasledovnymi parametrami: \\n\";\necho \"--help: zobrazi napovedu \\n\";\necho \"--input=NIECO: kde nieco reprezentuje subor alebo adresar\\n\";\necho \"--output=subor: kde subor je vystupny subor pre zapis. Implicitne stdout\\n\";\necho \"--pretty-xml=k: odsadi vystup o k medzier, implicitne o 4\\n\";\necho \"--no-inline: preskakuje funkcie so specifikatorom inline\\n\";\necho \"--max-par=n: nevypise funkcie s n a viac parametrami\\n\";\necho \"--no-duplicates: v pripade definicie aj deklaracie funkcie vypise funkciu len jedenkrat\\n\";\necho \"--no-whitespaces: odstrani prebytocne biele znaky vo funkciach\"; \nexit (0); \n}", "function dumpInfo() {\n $op = '';\n foreach ($this->sectionList as $sectionName=>$sec) {\n $op .= $sec->dumpInfo();\n }\n return $op;\n }", "public function usageHelp()\n {\n return <<<USAGE\nUsage:\n php -f export.php [--attr1 val1 --attr2 val2] [--images|--skus]\n --skus Export sku,name csv (could be used in Import to delete products)\n --images Export images\nThe script export sku,name (if --sku) or images (if --media) for products with attr1 = val1 AND attr2 = val2; If you want to use LIKE condition, put % in val\n\nExample\n To get a list with images:\n php exportskus.php --name 'My%' --images | sort -u \n To get a csv with sku,name:\n php exportskus.php --name 'My%' --skus > skutodelete.csv\n\n\nUSAGE;\n }", "public function parameters();", "public function parameters();", "function display_help ($version = 0) {\n\tprint \"Cacti ISP Billing Script, Copyright 2006-2009 - The Cacti Group\\nVersion: \" . $version . \"\\n\";\n\tprint \"usage: -config=[file] -track=[file] [-check] [-build=[file] [-filter=[id]]] [-process] [-list] \\n\";\n\tprint \" [-email=[email]] [-email_no_html] [-html_no_csv] [-start_date=[date]] \\n\";\n print \" [-current_time=[date]] [-tech] [-d] [--debug] [-h] [--help] [-v] [--version]\\n\\n\";\n\tprint \"-config=[file] - Billing configuration file\\n\";\n\tprint \"-track=[file] - Date tracking file\\n\";\n\tprint \"-track_no_write - Do not update the date tracking file\\n\";\n\tprint \"-track_clear_cache - Clear threshold tracking cache from track file\\n\";\n\tprint \"-check - Check billing configuration file\\n\";\n\tprint \"-build=[file] - Build example configuration file from system, supplying filename is \\n\";\n\tprint \" optional, default example.xml\\n\";\n\tprint \"-filter=[id] - Only used by the build command to limit configuration build to the supplied\\n\";\n\tprint \" graph ids, comma delimited\\n\";\n\tprint \"-info - Display information on the billing configuration file\\n\";\n\tprint \"-list - Display list of graphs and titles that are billable\\n\";\n\tprint \"-email=[email] - Override configuration email addresses, all customer reports will be\\n\";\n\tprint \" emailed to the supplied email\\n\";\n\tprint \"-email_no_html - Only used when email override enabled, globally set no html emails \\n\";\n\tprint \"-email_no_csv - Only used when email override enabled, globally set no csv attachments\\n\";\n\tprint \"-start_date=[date] - Used to override track date and start date for testing and reruns\\n\";\n\tprint \"-current_time=[date] - Used to override current time for testing and reruns\\n\";\n\tprint \"-tech - Writes out technical support file\\n\";\n\tprint \"-d --debug - Display verbose output during execution\\n\";\n\tprint \"-v --version - Display this help message\\n\";\n\tprint \"-h --help - Display this help message\\n\\n\";\n}", "public function usageHelp()\n {\n return <<<USAGE\nUsage: php factfinder.php -- [options]\n\n --exportAll Export products for every store\n --exportStore <storeId> Export Product CSV for store\n --exportStorePrice <storeId> Export Price CSV for store\n --exportStoreStock <storeId> Export Stock CSV for store\n --exportAllTypesForStore <storeId> Export Stock, Price and Products for store\n --exportAllTypesForAllStores Export Stock, Price and Products for all stores\n --exportCmsForStore <storeId> Export CMS Sites for store\n exportall Export Product CSV for all stores\n help Show this help message\n\n <storeId> Id of the store you want to export\n\nUSAGE;\n }", "function displayProperties ()\n {\n foreach ($this as $key => $property)\n {\n echo $key . ':' . $property . '<br>';\n }\n }", "public static function dump(){\n self::_print(\"enabled : \". (int)self::$enabled .\"\\n\");\n self::_print(\"disabled : \". (int)self::$disabled .\"\\n\");\n self::_print_r(self::$list);\n }", "public function print_section_info()\r\n {\r\n print 'Additional options of your sites are available in Tapatalk Admin CP.';\r\n }", "function getParamInfo() {\n\t\treturn FALSE;\n\t}", "public function getParams();" ]
[ "0.72988623", "0.66153634", "0.65034276", "0.64514416", "0.6319169", "0.60153574", "0.59266806", "0.5855921", "0.5850814", "0.58468", "0.5817109", "0.5810008", "0.58091986", "0.5789715", "0.57840925", "0.57542574", "0.57394177", "0.5704294", "0.5630645", "0.560848", "0.560848", "0.55988634", "0.5572262", "0.55719304", "0.55706143", "0.55653256", "0.5563027", "0.5555417", "0.5546603", "0.55439764", "0.55310565", "0.55310565", "0.55310565", "0.55310565", "0.55310565", "0.55310565", "0.55310565", "0.55310565", "0.5526137", "0.55211", "0.55186486", "0.55140287", "0.55075634", "0.5505084", "0.55027354", "0.5501903", "0.549458", "0.5491993", "0.5475741", "0.54683656", "0.5466371", "0.5465992", "0.5465368", "0.54598963", "0.54475325", "0.5441024", "0.5434478", "0.54266196", "0.54137367", "0.54026926", "0.5396098", "0.5387829", "0.53850234", "0.5384527", "0.53839725", "0.53775895", "0.5374343", "0.53621936", "0.53619605", "0.5356588", "0.5350369", "0.5350369", "0.5350369", "0.5334818", "0.5334258", "0.5334258", "0.5328756", "0.5326395", "0.53241086", "0.5319573", "0.5307631", "0.5305213", "0.52916604", "0.52916604", "0.5270681", "0.5267417", "0.52646047", "0.5260985", "0.5259795", "0.52592486", "0.5248423", "0.5237863", "0.5237863", "0.5233354", "0.5232667", "0.5226973", "0.52240247", "0.5221429", "0.521127", "0.52110624" ]
0.6712034
1
Print details of a parameter
function printGetParameterDetails($parameterId) { $this->printDebugMessage('printGetParameterDetails', 'Begin', 1); $paramDetail = $this->getParameterDetails($parameterId); print <<<EOF <h3>$paramDetail->name</h3> <p>$paramDetail->description</p> EOF ; if(isset($paramDetail->values)) { print "<table border=\"1\">\n"; print "<tr><th>Label</th><th>Value</th><th>Default</th></tr>\n"; foreach($paramDetail->values->value as $val) { print "<tr><td>$val->label</td><td>$val->value</td><td>"; if($val->defaultValue && $val->defaultValue == 'true') print 'default'; else print '&nbsp;'; print "</td></tr>\n"; } print "</table>\n"; } $this->printDebugMessage('printGetParameterDetails', 'Begin', 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paramDump() {\n $spec = Terminus::getRunner()->getConfigurator()->getSpec();\n $this->output()->outputDump($spec);\n }", "private function print() {\n\t\tvar_dump($this->getParams());\n\t}", "function printGetParameters() {\n $this->printDebugMessage('printGetParameters', 'Begin', 1);\n $paramList = $this->getParameters();\n print \"<ul>\\n\";\n foreach($paramList as $paramName) {\n print '<li>' . $paramName . \"</li>\\n\";\n }\n print \"</ul>\\n\";\n $this->printDebugMessage('printGetParameters', 'End', 1);\n }", "public function help_parameters(&$details) {\n\t\t// @todo Add in which environment to use.\n\t}", "function renderParameterDetail($parameter) {\n\n if (!isset($parameter[0]))\n $parameter = array($parameter);\n\n $this->tpl->setCurrentBlock(\"functiondetails_parameter_loop\");\n \n reset($parameter);\n while (list($k, $param) = each($parameter)) {\n\n $this->tpl->setVariable(\"NAME\", $param[\"name\"]);\n $this->tpl->setVariable(\"DESCRIPTION\", $this->encode($param[\"value\"]));\n\n if (isset($param[\"type\"]))\n $this->tpl->setVariable(\"TYPE\", $param[\"type\"]);\n\n if (isset($param[\"default\"]))\n $this->tpl->setVariable(\"DEFAULT\", \"= >>\".htmlentities($param[\"default\"]).\"<<\");\n\n if (\"true\" == $param[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock(); \n }\n\n }", "function printparam($name) {\n echo getparam($name);\n}", "public function debugDumpParams()\n {\n }", "function printParambers($params){\n $parLength = count($params); // Number of parameters\n \n // No parameters and should be closed \n if($parLength == 0){\n echo \")\";\n }\n else{\n for($parCounter = 0; $parCounter < $parLength - 1; $parCounter++){\n $par = $params[$parCounter];\n echo $par->__get(\"type\") . \" \" . $par->__get(\"name\") . \",\";\n }\n $par = $params[$parLength - 1];\n echo $par->__get(\"type\") . \" \" . $par->__get(\"name\") . \")\";\n }\n }", "public function debugDumpParams() {\n }", "public static function getParam() {\n\n\t}", "function show_debug_params(PDOStatement $stmt)\n{\n echo '<div class=\"info\">';\n echo $stmt->debugDumpParams();\n echo '</div>';\n}", "function getParamInfo() {\n\t\treturn FALSE;\n\t}", "public function getParameter();", "public function getParameter();", "public function to_string() {\n\n\t\treturn print_r( $this->parameters, true );\n\t}", "public function p() {\n $args = func_get_args();\n print htmlspecialchars(call_user_func_array(array($this, 'get'), $args));\n }", "public function toStringReturnsStringRepresentationWithClassNameOfReflectedMethodAndParameter()\n {\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\test_function(): Argument param] {\\n}\\n\",\n (string) $this->refParamFunction\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper::paramTest(): Argument param] {\\n}\\n\",\n (string) $this->refParamMethod1\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper2::paramTest(): Argument param] {\\n}\\n\",\n (string) $this->refParamMethod2\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper2::paramTest2(): Argument param2] {\\n}\\n\",\n (string) $this->refParamMethod3\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper2::paramTest3(): Argument param2] {\\n}\\n\",\n (string) $this->refParamMethod4\n );\n }", "function dd($params) {\n echo \"<pre>\";\n print_r($params);\n exit();\n}", "protected function infoOfOne(ReflectionParameter $param)\n {\n $class = $param->getClass();\n $hasDefault = $param->isDefaultValueAvailable();\n\n if ($class) return $class->name;\n\n if ($hasDefault) return $param->getDefaultValue();\n\n return '$'.$param->getName();\n }", "public abstract function printValue($value);", "public static function debug()\n {\n if (func_num_args() === 0) {\n return;\n }\n\n // Get params\n $params = func_get_args();\n $output = array();\n\n foreach ($params as $var) {\n $output[] = '<pre>('.gettype($var).') '.html::specialchars(print_r($var, true)).'</pre>';\n }\n\n return implode(\"\\n\", $output);\n }", "function getParameters();", "function getParameters();", "private function get_rujukan_detail($parameter) {\n\n }", "function getParameters()\r\n {\r\n }", "public function render()\n {\n return sprintf(\n ':param %s %s: %s',\n $this->renderType(),\n $this->getName(),\n $this->getDesc()\n );\n }", "public function show($parameter)\n\t{\n\t\t$parameter->load('module');\n\t\treturn $parameter;\n\t}", "public static function p()\r\n\t{\r\n\t\t$consolePrint = false;\r\n\r\n\t\tif (!isset($_SERVER['HTTP_HOST']) || $_SERVER['HTTP_HOST'] == null) {\r\n\t\t\t$consolePrint = true;\r\n\t\t}\r\n\r\n\t\tif (!$consolePrint) {\r\n\t\t\techo '<pre>';\r\n\t\t}\r\n\t\t$args = func_get_args();\r\n\r\n\t\tforeach ($args as $var)\r\n\t\t{\r\n\t\t\tif ($var == null || $var == '') {\r\n\t\t\t\tvar_dump($var);\r\n\t\t\t} elseif (is_array($var) || is_object($var)) {\r\n\t\t\t\tprint_r($var);\r\n\t\t\t} else {\r\n\t\t\t\techo $var;\r\n\t\t\t}\r\n\t\t\tif (!$consolePrint) {\r\n\t\t\t\techo '<br>';\r\n\t\t\t} else {\r\n\t\t\t\techo \"\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!$consolePrint) {\r\n\t\t\techo '</pre>';\r\n\t\t}\r\n\t}", "public function getParameters()\n\t{\n\n\t}", "public function getParameters()\n\t{\n\n\t}", "public function getParameter()\n\t{\n\t\treturn $this->parameter;\n\t}", "public function getParameters() {}", "public function debugprint($variable,$desc=\"\",$exit=0) {\n\t}", "public function pr($var) \n\t{\n\t\techo '<pre>';\n\t\tprint_r($var);\n\t\techo '</pre>';\n\t}", "function paramDetailToLabelStr($parameterId, $paramDetail) {\n $this->printDebugMessage('paramDetailToLabelStr', 'Begin', 1);\n $helpUrl = '?paramDetail=' . $parameterId;\n $retStr = '<a href=\"' . $helpUrl . '\">' . $paramDetail->name .'</a>: ';\n $this->printDebugMessage('paramDetailToLabelStr', 'End', 1);\n return $retStr;\n }", "public function show(Parametre $parametre)\n {\n //\n }", "public static function var_dumpp()\n {\n echo \"<pre>\";\n if(func_num_args()>0)\n foreach(func_get_args() as $argv)\n {\n var_dump($argv);\n }\n echo \"</pre>\";\n\n }", "public function getTesterParameter();", "public function getParams($print = false){\n if($print == true){\n echo '<pre>' . htmlspecialchars( print_r($this->params, true) ) . '</pre>';\n }else{\n return $this->params;\n }\n }", "public function getParam($param);", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "function inspect()\n{\n\t$args=func_get_args();\n\n\t_inspect($args,false);\n}", "public function parameters();", "public function parameters();", "function p($p) {\n\tif ( $GLOBALS['debug'] === true ) {\n\t\techo $p.\"\\t<br>\\n\";\n\t}\n}", "private function debug($var = null) {\n if( $var ) {\n echo '<pre>';\n print_r( $var );\n echo '</pre>';\n }\n }", "public function getParam()\n {\n return $this->param;\n }", "public function getParam()\n {\n return $this->param;\n }", "protected function formatParam(\\ReflectionParameter $param)\n {\n $ret = $this->formatParamName($param->name);\n\n if ($param->isOptional()) {\n $ret .= ' = ';\n\n if (version_compare(PHP_VERSION, '5.4.3', '>=') && $param->isDefaultValueConstant()) {\n $name = $param->getDefaultValueConstantName();\n $ret .= '<const>' . $name . '</const>';\n } elseif ($param->isDefaultValueAvailable()) {\n $ret .= $this->manager->presentRef($param->getDefaultValue());\n } else {\n $ret .= '<urgent>?</urgent>';\n }\n }\n\n return $ret;\n }", "protected function getParametrContentWithExample($parameter)\n {\n return sprintf(\n '+ %s:%s (%s, %s) - %s',\n $parameter->identifier,\n $parameter->example ? \" `{$parameter->example}`\" : '',\n $parameter->members ? sprintf('enum[%s]', $parameter->type) : $parameter->type,\n $parameter->required ? 'required' : 'optional',\n $parameter->description\n );\n }", "function param(string $name, string $value, string $type = 'ref', string $attributes = ''): string\n {\n return '<param name=\"' . $name\n . '\" type=\"' . $type\n . '\" value=\"' . $value\n . '\" ' . $attributes . _solidus() . '>';\n }", "public function print($params) {\n\t\treturn $this->getData($params)->get();\n\t}", "public function print($params) {\n\t\treturn $this->getData($params)->get();\n\t}", "function dump($arg){\r\n echo \"<pre>\";\r\n print_r($arg);\r\n echo \"</pre>\";\r\n}", "public static function details($name,$phone){\n\t\t\techo \"Name is:\".self::$Name=$name.\"<br>\";\n\t\t\techo \"Phone is:\".self::$Phone=$phone.\"<br>\";\n\t\t}", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function getParameterName();", "function debug($var) {\n echo '<pre>'. print_r($var, 1) .'</pre>';\n}", "function pr($var) {\n\t\t\t\n\t\t\tob_start();\n\t\t\tprint_r($var);\n\t\t\t$content = ob_get_contents();\n\t\t\tob_clean();\n\t\t\t\n\t\t\techo \"<pre>\";\n\t\t\techo htmlentities($content);\n\t\t\techo \"</pre>\";\n\t}", "function debug($variable)\n{\n echo \"<pre>\" . print_r($variable, true) . \"</pre>\";\n}", "function debug( $var ) {\n print \"<pre>\";\n var_dump( $var );\n print \"</pre>\";\n }", "public function show(Parameter $parameter)\r\n {\r\n return view('parameters.show')->with([\r\n 'parameter' => $parameter,\r\n ]);\r\n }", "public function params() {\n\t\treturn nl2br($this -> params);\n\t}", "public function title (\\stdClass $param);", "abstract public function getParameters();", "function debug($var) {\n\techo '<pre>',print_r($var,1),'</pre>';\n}", "function dump() {\n\t\t$vars = get_object_vars( $this );\n\t\techo '<pre style=\"text-align:left\">';\n\t\tforeach( $vars as $name => $value ) {\n\t\t\techo $name.': '.$value.\"\\n\";\n\t\t}\n\t\techo '</pre>';\n\t}", "public function getParam($name);", "function Info($param, $data)\n {\n // Times 12\n $this->SetFont('Times','',14);\n // Output justified text\n $this->MultiCell(0,7,utf8_decode(\"$param : $data\"));\n // Line break\n $this->Ln();\n }", "function pr($a) {\n\techo '<pre>', gettype($a), ' - ', print_r($a, true), '</pre>';\n}", "public function getParameter($name);", "public function getParameter($name);", "public function getParameter($name);", "public function getVariable($param)\n {\n return \"Method {Attribute::getVariable()} has been called and received: {$param}\";\n }", "public function details() {\n return \"My name is {$this->name} and I am {$this->age} years old.\";\n }", "public function printCardInfo() {\n\t\tprint $this->strRepresentation();\n\t}", "public static function debug($var) \n\t{\n\t\techo '<pre>'; var_dump($var); exit;\n\t}", "function printUserInfo() {\n return $this->Name.' '.$this->Surname;\n }", "function pr($obj, $label = '')\n{\n echo \"<hr>\" . $label . \":<br>\";\n echo \"<pre>\";\n print_r($obj);\n echo \"</pre><hr>\";\n}", "public function printValue($value)\n {\n print $value;\n }", "function debug($v) {\n\tprint_r($v);\n}", "function debug($variable)\n{\n\techo '<pre>';\n\tprint_r($variable);\n\techo '</pre>';\n}", "public function debugDumpParams()\r\n\t{\r\n\t\tif(!is_resource($this->resource))\r\n\t\t{\r\n\t\t\tthrow new LikePDOException(\"There is no active statement\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$parameters = array();\r\n\t\t\t\r\n\t\t\tif(count($this->parametersBound) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($this->parametersBound as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!isset($this->parameters[$key]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$parameters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"key\" => is_string($key) == true ? \"Name: [\".strlen($key).\"] \".$key : \"Position #\".$key,\r\n\t\t\t\t\t\t\t\"paramno\" => is_string($key) == true ? -1 : $key,\r\n\t\t\t\t\t\t\t\"name\" => is_string($key) == true ? \"[\".strlen($key).\"] \\\"\".$key.\"\\\"\" : \"[0] \\\"\\\"\",\r\n\t\t\t\t\t\t\t\"is_param\" => 1,\r\n\t\t\t\t\t\t\t\"param_type\" => $param['data_type']\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}\r\n\t\t\t\r\n\t\t\tif(count($this->parameters) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($this->parameters as $key => $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!isset($this->parametersBound[$key]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$parameters[] = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\"key\" => is_string($key) == true ? \"Name: [\".strlen($key).\"] \".$key : \"Position #\".$key.\":\",\r\n\t\t\t\t\t\t\t\"paramno\" => is_string($key) == true ? -1 : $key,\r\n\t\t\t\t\t\t\t\"name\" => is_string($key) == true ? \"[\".strlen($key).\"] \\\"\".$key.\"\\\"\" : \"[0] \\\"\\\"\",\r\n\t\t\t\t\t\t\t\"is_param\" => 1,\r\n\t\t\t\t\t\t\t\"param_type\" => $param['data_type']\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}\r\n\t\t\t\r\n\t\t\tprintf(\"SQL: [%d] %s\".PHP_EOL.\"Params: %d\".PHP_EOL.PHP_EOL, strlen($this->queryString), $this->queryString, count($parameters));\r\n\t\t\t\r\n\t\t\tif(count($parameters) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach($parameters as $param)\r\n\t\t\t\t{\r\n\t\t\t\t\tprintf(\"Key: %s\".PHP_EOL, $param['key']);\r\n\t\t\t\t\tprintf(\"paramno=%d\".PHP_EOL, $param['paramno']);\r\n\t\t\t\t\tprintf(\"name=%s\".PHP_EOL, $param['name']);\r\n\t\t\t\t\tprintf(\"is_param=%d\".PHP_EOL, $param['is_param']);\r\n\t\t\t\t\tprintf(\"param_type=%d\".PHP_EOL, $param['param_type']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "function ibase_param_info($query, $param_number)\n{\n}", "function paramDetailToStr($parameterId, $multi=FALSE) {\n $this->printDebugMessage('paramDetailToStr', 'Begin', 1);\n $paramDetail = $this->getParameterDetails($parameterId);\n $retStr = $this->paramDetailToLabelStr($parameterId, $paramDetail);\n if(isset($paramDetail->values)) {\n if($multi) {\n\t// Multi-select menu\n\t$retStr .= '<select name=\"' . $parameterId .'[]\" multiple=\"1\">';\n }\n else {\n\t// Drop-down list\n\t$retStr .= '<select name=\"' . $parameterId .'\">';\n }\n $retStr .= $this->paramDetailToOptionStr($paramDetail);\n $retStr .= '</select>';\n }\n else {\n // Input box\n $retStr .= '<input type=\"text\" name=\"' . $parameterId . '\" />';\n }\n $this->printDebugMessage('paramDetailToStr', 'End', 1);\n return $retStr;\n }", "function print_debug($var)\n {\n //display if null\n if ($var == NULL)\n print(\"$var is NULL\");\n\n\t\t//iterate through results and display\n\t\tforeach($var as $obj) {\n\t\t\tprint_r($obj);;\n\t\t}\n\t}", "function dev_debug_display( $thing ) {\n\techo '<pre>';\n\tprint_r( $thing );\n\techo '</pre>';\n}", "function dd( $param ) {\r\n var_dump( $param );\r\n die();\r\n}", "function describe() {\n print(\"\\nI am \" . $this->getName() . \" - \" . $this->getCode() . \" price: \" . $this->price);\n }", "function var_show($var)\n{\n echo '<pre>';\n var_dump($var);\n echo '</pre>';\n}", "public static function debug()\r\n {\r\n if (func_num_args() === 0)\r\n return;\r\n\r\n // Get all passed variables\r\n $variables = func_get_args();\r\n\r\n $output = array();\r\n foreach ($variables as $var)\r\n {\r\n $output[] = Core::_dump($var, 1024);\r\n }\r\n\r\n echo '<pre class=\"debug\">'.implode(\"\\n\", $output).'</pre>';\r\n }", "function pr($var)\n{\n $var_name = return_var_name($var);\n echo \"<pre> \\n\";\n echo '==============================';\n echo \"\\nBEGIN print_r of \\\"\\${$var_name}\\\"\";\n echo \"\\n------------------------------\\n\";\n print_r($var);\n echo \"\\n------------------------------\\n\";\n echo \"END print_r of \\\"\\${$var_name}\\\"\\n\";\n echo \"==============================\\n\";\n echo '</pre>' . PHP_EOL . PHP_EOL;\n}" ]
[ "0.74285173", "0.7018132", "0.70011", "0.66356", "0.65831774", "0.6540464", "0.65067065", "0.64498675", "0.6415727", "0.63735104", "0.6319392", "0.62674975", "0.6203969", "0.6203969", "0.6152487", "0.6121072", "0.6115414", "0.61054", "0.60192686", "0.6011297", "0.5966349", "0.594709", "0.594709", "0.5920568", "0.58906573", "0.5889688", "0.5885036", "0.587019", "0.58389026", "0.58389026", "0.58307016", "0.58286774", "0.5825988", "0.5812056", "0.5791758", "0.57866096", "0.5770039", "0.5760434", "0.5741182", "0.57366437", "0.5727058", "0.5727058", "0.5727058", "0.5727058", "0.5727058", "0.5727058", "0.5727058", "0.5727058", "0.572355", "0.5722292", "0.5722292", "0.570576", "0.5682787", "0.5681208", "0.5681208", "0.56665516", "0.56642807", "0.5642175", "0.5621309", "0.5621309", "0.5612564", "0.5599185", "0.559431", "0.559431", "0.5593167", "0.5567819", "0.55641955", "0.5559168", "0.5555741", "0.5554606", "0.55507475", "0.5549193", "0.55464536", "0.5539363", "0.553444", "0.5522168", "0.5522127", "0.552114", "0.552034", "0.552034", "0.552034", "0.5501026", "0.5498749", "0.54964477", "0.54896253", "0.5487838", "0.5487769", "0.5484756", "0.54797643", "0.5469828", "0.54651666", "0.54593927", "0.54559547", "0.5453977", "0.5452374", "0.54424816", "0.54352653", "0.5434681", "0.54280955", "0.5415825" ]
0.7184769
1
Label for an option, generated from the parameter details.
function paramDetailToLabelStr($parameterId, $paramDetail) { $this->printDebugMessage('paramDetailToLabelStr', 'Begin', 1); $helpUrl = '?paramDetail=' . $parameterId; $retStr = '<a href="' . $helpUrl . '">' . $paramDetail->name .'</a>: '; $this->printDebugMessage('paramDetailToLabelStr', 'End', 1); return $retStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_option_name()\n {\n }", "public function getOptionName()\n {\n return $this->optionName;\n }", "public function get_option_label_html(){\n\t\t$html = \"\";\n\t\t$classes = $this->get_label_html_classes();\n\t\t$required = $this->required ? \"*\" : \"\";\n\t\t$html .= \"<{$this->element} class='$classes' for='{$this->id}'>{$this->label}{$required}</{$this->element}>\";\n\t\treturn $html;\n\t}", "function label() {\n return \"<label>\".$this->label.\": </label>\";\n }", "public function getLabelForOption($option)\n {\n if ( ! array_key_exists($option, $this->options)) {\n return null;\n }\n\n return $this->options[$option];\n }", "public function label()\n\t{\n\t\treturn \"$this->merk $this->jenis\";\n\t}", "public function CustomConfigureLabel()\n {\n if ($this->HasProductQuestions()) {\n if ($this->owner->ConfigureLabel) {\n return $this->owner->ConfigureLabel;\n } else {\n return _t(\"ProductQuestion.CONFIGURE\", \"Configure\");\n }\n }\n }", "public function getName()\n {\n return $this->options['name'];\n }", "public function getLabel(){\n return \"$this->penulis, $this->penerbit\"; // $penulis adalah variable baru karena didalam method getLable. Untuk mengambil isi dari properti yg ada didalam class, kita menggunakan $this. $this->penulis. Penulis akan mengacu ke property penulis diatas.\n // kita menggunakan $this karena untuk mengambil isi dari property yg ada didalam class yg bersangkutan ketika dibuat instancenya.\n }", "protected function absenceLabel($option)\n {\n return $this->absenceLabelList[$option];\n }", "public function getLabel()\n {\n return $this->label ?: $this->getName();\n }", "public function getName()\n\t{\n\t\treturn 'Trinity_OPT';\n\t}", "public function getOptionsName()\n {\n return 'options' . ucfirst($this->getName());\n }", "public function get_option_name() {\n\t\t$name = $this->get_input_name();\n\n\t\treturn $name . '[]';\n\t}", "public function label(){\n\t\treturn '<label class=\"control-label\" for=\"'.$this->name.'\">'.$this->label.'</label>';\n\t}", "function fieldLabel($field, $option = [])\n{\n if (!empty($option['label'])) {\n return $option['label'];\n }\n\n return ucfirst($field);\n}", "public function getLabel(): string\n {\n return $this->name;\n }", "public function getOptionTitle()\n {\n return $this->optionTitle;\n }", "public function label()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->oxselectlist__oxtitle->value;\n }", "public static function label()\n {\n return 'Bukeri';\n }", "function getLabel()\n\t{\n\t\treturn '';\n\t}", "public function get_label();", "public function get_label();", "public function get_name() {\r\n\t\treturn $this->options['name'];\r\n\t}", "public function getLabel()\n {\n return Translation::get(($this->label ? : $this->name));\n }", "public function getProgressParameterOptionName()\n\t{\n\t\treturn self::SETTING_ID;\n\t}", "public function getLabel() {}", "public function getLabel() {}", "public function get_label(){ return $this->label; }", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel(): string\n {\n return $this->label;\n }", "public function getLabel()\n\t{\n\t\treturn $this->get('label');\n\t}", "public static function label()\n {\n return __('Attributes');\n }", "public function getLabel(): string {\n return $this->label;\n }", "function render_label() {\n return xFormTemplate::apply($this->template_label, $this->options);\n }", "public function getLabel(): string;", "public function getLabel(): string;", "public function getLabel(): \\Magento\\Framework\\Phrase;", "public function name() {\n\t\treturn __( 'Option Container', 'thrive-cb' );\n\t}", "public function getLabel() {\n return $this->label;\n }", "public function getLabel() {\n return $this->label;\n }", "public function getLabel() {\n\t\treturn \\Extension\\Templavoila\\Utility\\GeneralUtility::getLanguageService()->sL($this->label);\n\t}", "public function getLabel()\n\t{\n\t\t$label = parent::getLabel();\n\t\t$label->for = $this->getId();\n\t\treturn $label;\n\t}", "protected function getLabel()\n\t{\n\t\treturn str_replace($this->id, $this->id . '_id', parent::getLabel());\n\t}", "public function get_label() {\n\t\treturn $this->label;\n\t}", "public function getLabel() {\n\t}", "public function getProgressParameterOptionName()\n {\n $controller = $this->getController();\n return $controller::SETTING_ID;\n }", "function getLabel(): string;", "public function set_label($param)\n\t{\n\t\t$this->params->label = $param; return $this;\n\t}", "function label_table_options($options, $labelOption = null)\n{\n if ($labelOption === null) {\n $labelOption = __('Select Below ');\n }\n return array('' => $labelOption) + $options;\n}", "public function generateLabel()\n\t{\n\t\tif ($this->strLabel == '')\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\treturn sprintf('<label for=\"ctrl_%s\" class=\"mandatory%s\"><span class=\"invisible\">%s </span>%s<span class=\"mandatory\">*</span><span class=\"invisible\"> %s</span></label>',\n\t\t\t\t\t\t$this->strId,\n\t\t\t\t\t\t(($this->strClass != '') ? ' ' . $this->strClass : ''),\n\t\t\t\t\t\t$GLOBALS['TL_LANG']['MSC']['mandatory'],\n\t\t\t\t\t\t$this->strLabel,\n\t\t\t\t\t\t$this->getQuestion());\n\t}", "public function label() {\n return $this->getPluginId();\n }", "public function getLabel(): string\n {\n return $this->_label;\n }", "function getLabel(){\r\n\t\treturn $this->label;\r\n\t}", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\n }", "public function getLabel()\n {\n return $this->label;\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 label()\n {\n return $this->label ?? class_basename($this);\n }", "public static function label()\n {\n return 'Settings';\n }", "protected function getProgressParameterOptionName()\n\t{\n\t\treturn $this->module. '_cloud_export';\n\t}", "public function getLabel() {\n\t\treturn $this->label;\n\t}", "public function getLabel() {\n\t\treturn $this->label;\n\t}", "public function getLabel() {\n\t\treturn $this->label;\n\t}", "public function getLabel() {\n\t\treturn $this->label;\n\t}", "public static function label()\n {\n return 'Ārsti';\n }", "public function getLabel()\n {\n return $this->getData(self::LABEL);\n }", "public function getLabel() {\n return $this->label;\n }", "public function getLabel() {\n return $this->label;\n }", "function get_wpcli_label() {\n\tglobal $argv;\n\n\t$label = '';\n\n\tforeach ($argv as $arg) {\n\t\t$arg = explode('=', $arg, 2);\n\t\tif (count($arg) === 2 && $arg[0] === '--label') {\n\t\t\t$label = $arg[1];\n\t\t}\n\t}\n\n\treturn $label;\n}", "public static function label()\n {\n return __('Templates');\n }", "public function menu_label()\n\t{\n\t\t$label = $this->p('menu_label')->text();\n\t\t$label = $this->render($label);\n\n\t\tif ( ! $label && $p = $this->p('title') ) {\n\t\t\t$label = $p->text();\n\t\t}\n\n\t\tif ( ! $label && $p = $this->p('name') ) {\n\t\t\t$label = $p->text();\n\t\t}\n\n\t\treturn $label;\n\t}", "public function get_label() {\n return $this->_label;\n }" ]
[ "0.703395", "0.67761666", "0.67441285", "0.6512557", "0.64861625", "0.646095", "0.6460804", "0.6427965", "0.6400693", "0.63969684", "0.6389162", "0.6360357", "0.63524157", "0.635024", "0.63331175", "0.6328731", "0.6328136", "0.63186675", "0.63053167", "0.62846076", "0.6282387", "0.6256507", "0.6253663", "0.6253663", "0.6219788", "0.6214833", "0.6192611", "0.61747175", "0.61747175", "0.6165246", "0.6155367", "0.6155367", "0.6155367", "0.6155367", "0.61450624", "0.6116561", "0.6111099", "0.6104924", "0.6101081", "0.6101081", "0.60995096", "0.6077107", "0.6076306", "0.6076306", "0.60757554", "0.6069623", "0.60680616", "0.60642916", "0.6059667", "0.60460037", "0.60403305", "0.60358995", "0.60310334", "0.6030679", "0.6028902", "0.60274345", "0.6006761", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.5998515", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59853876", "0.59808004", "0.59801304", "0.59798485", "0.5976006", "0.5976006", "0.5976006", "0.5976006", "0.59665215", "0.5966062", "0.5964722", "0.5964722", "0.5948358", "0.5942227", "0.59417796", "0.59375834" ]
0.0
-1
Generate HTML option tags for a parameter detail.
function paramDetailToOptionStr($paramDetail) { $this->printDebugMessage('paramDetailToOptionStr', 'Begin', 1); $retStr = ''; if(isset($paramDetail->values)) { foreach($paramDetail->values->value as $val) { if($val->defaultValue && $val->defaultValue == 'true') { $retStr .= "<option selected=\"1\" value=\"$val->value\">$val->label</option>\n"; } else { $retStr .= "<option value=\"$val->value\">$val->label</option>\n"; } } } $this->printDebugMessage('paramDetailToOptionStr', 'End', 1); return $retStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _toHtml()\n {\n $productId = $this->getRequest()->getParam('id', null);\n $product = Mage::getModel('catalog/product')->setStoreId(Mage::app()->getStore()->getId());\n\n if ($productId) {\n $product->load($productId);\n }\n\n if ($product->getId()) {\n Mage::register('product', $product);\n $type = $product->getTypeId();\n if (isset($this->_renderers[$type])) {\n $renderer = $this->getLayout()->createBlock($this->_renderers[$type]);\n if ($renderer) {\n return $renderer->getProductOptionsXml($product);\n }\n }\n }\n return '<?xml version=\"1.0\" encoding=\"UTF-8\"?><options/>';\n }", "function paramDetailToStr($parameterId, $multi=FALSE) {\n $this->printDebugMessage('paramDetailToStr', 'Begin', 1);\n $paramDetail = $this->getParameterDetails($parameterId);\n $retStr = $this->paramDetailToLabelStr($parameterId, $paramDetail);\n if(isset($paramDetail->values)) {\n if($multi) {\n\t// Multi-select menu\n\t$retStr .= '<select name=\"' . $parameterId .'[]\" multiple=\"1\">';\n }\n else {\n\t// Drop-down list\n\t$retStr .= '<select name=\"' . $parameterId .'\">';\n }\n $retStr .= $this->paramDetailToOptionStr($paramDetail);\n $retStr .= '</select>';\n }\n else {\n // Input box\n $retStr .= '<input type=\"text\" name=\"' . $parameterId . '\" />';\n }\n $this->printDebugMessage('paramDetailToStr', 'End', 1);\n return $retStr;\n }", "private function renderOptions(): string\n {\n $str = '';\n if ($this->defaultText !== false) {\n $option = new OptionElement();\n $option->text = $this->defaultText;\n $option->value = $this->defaultValue;\n $str .= $option->render();\n }\n foreach ($this->arrOption as $option) {\n $this->setAutoOptionTitle($option);\n $str .= $option->render();\n }\n\n return $str;\n }", "function HTMLSelect ($params, $options) {\n if (!isset($params['name'])) {\n $params['name'] = $params['id'];\n }\n $str = '';\n foreach ($params as $k=>$v) {\n $str .= \" {$k}=\\\"{$v}\\\"\";\n }\n $prm = '';\n if (isset($options['params'])) {\n foreach ($options['params'] as $k=>$v) {\n $prm .= \" {$k}=\\\"{$v}\\\"\";\n }\n }\n $opn = '';\n foreach ($options['list'] as $k=>$v) {\n $selected = '';\n if (isset($options['default'])&&!is_null($options['default'])&&$options['default']!='') {\n if ($k == $options['default']) {\n $selected = \"selected=\\\"selected\\\"\";\n }\n }\n $opn.= \"<option value='{$k}' {$prm} {$selected}>{$v}</option>\";\n }\n return \"<select {$str} >{$opn}</select>\";\n }", "function tag_options($options)\n{\n $html = \"\";\n foreach ($options as $key => $value) {\n if ($key and $value) {\n $html .= \" \".htmlspecialchars($key).\"=\\\"\".\n htmlspecialchars($value).\"\\\"\";\n }\n }\n return $html;\n}", "protected function getConfigParameterOptions(): string\n {\n $options = '';\n foreach ($this->configParameters as $name => $value) {\n $options .= ' -c ' . escapeshellarg($name . '=' . $value);\n }\n return $options;\n }", "function renderParameterDetail($parameter) {\n\n if (!isset($parameter[0]))\n $parameter = array($parameter);\n\n $this->tpl->setCurrentBlock(\"functiondetails_parameter_loop\");\n \n reset($parameter);\n while (list($k, $param) = each($parameter)) {\n\n $this->tpl->setVariable(\"NAME\", $param[\"name\"]);\n $this->tpl->setVariable(\"DESCRIPTION\", $this->encode($param[\"value\"]));\n\n if (isset($param[\"type\"]))\n $this->tpl->setVariable(\"TYPE\", $param[\"type\"]);\n\n if (isset($param[\"default\"]))\n $this->tpl->setVariable(\"DEFAULT\", \"= >>\".htmlentities($param[\"default\"]).\"<<\");\n\n if (\"true\" == $param[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock(); \n }\n\n }", "function options_html($key, $field)\n\t{\n\t\t// vars\n\t\t$options = $field->options;\n\t\t$options['save_format'] = isset($options['save_format']) ? $options['save_format'] : 'url';\n\t\t\n\t\t?>\n\t\t<tr class=\"field_option field_option_file\">\n\t\t\t<td class=\"label\">\n\t\t\t\t<label><?php _e(\"Return Value\",'acf'); ?></label>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\t\t$temp_field = new stdClass();\t\n\t\t\t\t\t$temp_field->type = 'select';\n\t\t\t\t\t$temp_field->input_name = 'acf[fields]['.$key.'][options][save_format]';\n\t\t\t\t\t$temp_field->input_class = '';\n\t\t\t\t\t$temp_field->value = $options['save_format'];\n\t\t\t\t\t$temp_field->options = array('choices' => array(\n\t\t\t\t\t\t'url'\t=>\t'File URL',\n\t\t\t\t\t\t'id'\t=>\t'Attachment ID'\n\t\t\t\t\t));\n\t\t\t\t\t$this->parent->create_field($temp_field);\n\t\t\t\t?>\n\t\t\t</td>\n\t\t</tr>\n\n\t\t<?php\n\t}", "public function render(){\n\t\t$this->clearAttribute(\"value\");\n\t\t$inner = \"\\n\";\n\t\tforeach($this->options as $value => $option){\n\t\t\tif(in_array($value, $this->selected)){\n\t\t\t\t$option->addAttribute(\"selected\", \"selected\");\n\t\t\t}\n\t\t\t$inner .= \"\\t\" . $option->render() . \"\\n\";\n\t\t}\n\t\t$this->setInnerText($inner);\n\t\treturn parent::render();\n\t}", "function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}", "public function optionAction() \n {\n $result = array();\n \n $productIdOrSku = $this->getRequest()->getParam('product');\n $attributeOptionId = $this->getRequest()->getParam('id');\n\n try {\n \n $model = $this->getModel();\n $model->loadOptions($productIdOrSku, $attributeOptionId);\n $options = $model->getApiOptions(); \n \n $result = $options;\n \n \n } catch (Exception $e) {\n \n $result['error'] = true;\n $result['data'] = $e->getMessage();\n } \n \n $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true)->setBody(Mage::helper('core')->jsonEncode($result));\n \n }", "public function option_definition() {\n $options = parent::option_definition();\n $options['render_link'] = array('default' => FALSE);\n return $options;\n }", "public function option_description_string() {\n return '';\n }", "function option($name)\n{\n $name = apply_filters(\"display_option_$name\", get_option($name));\n $name = html_escape($name);\n return $name;\n}", "public function help_parameters(&$details) {\n\t\t// @todo Add in which environment to use.\n\t}", "public function option_definition() {\n $options = parent::option_definition();\n $options['multi_type'] = array(\n 'default' => 'ol'\n );\n $options['list_class'] = array(\n 'default' => ''\n );\n $options['display_as_link'] = array(\n 'default' => FALSE\n );\n return $options;\n }", "private function build_factory_meta_option_field($_meta, $_ptype = \"wccpf\") {\r\n \t$name = ($_meta[\"type\"] == \"radio\") ? 'name=\"options-'. $_meta[\"param\"] .'\"' : '';\r\n \t$html = '<ul class=\"wcff-field-layout-' . $_meta[\"layout\"] . '\">';\r\n \tforeach ($_meta[\"options\"] as $option) {\r\n \t\t$checked = '';\r\n \t\tif ($this->fields_values && isset($this->fields_values[$_meta[\"param\"]])) {\r\n \t\t\tif ($_meta[\"type\"] == \"checkbox\") {\r\n \t\t\t\t/* We have an array situation here */\r\n \t\t\t\tif (in_array($option[\"value\"], $this->fields_values[$_meta[\"param\"]])) {\r\n \t\t\t\t\t$checked = 'checked';\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\t/* Straight forward comparision */\r\n \t\t\t\tif ($option[\"value\"] == $this->fields_values[$_meta[\"param\"]]) {\r\n \t\t\t\t\t$checked = 'checked';\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t} else {\r\n \t\t\tif (isset($option[\"selected\"]) && $option[\"selected\"]) {\r\n \t\t\t\t$checked = 'checked';\r\n \t\t\t}\r\n \t\t}\r\n \t\t$html .= '<li><label><input '. $name .' type=\"' . $_meta[\"type\"] . '\" class=\"wcff-field-type-meta-' . $_meta[\"param\"] . '\" value=\"' . $option[\"value\"] . '\" ' . $checked . ' /> ' . $option[\"label\"] . '</label></li>';\r\n \t}\r\n \t$html .= '</ul>';\r\n \treturn $html;\r\n }", "function toHtml(){\n global $PAGE;\n\n // Enhance the select with javascript.\n $this->_generateId();\n $id = $this->getAttribute('id');\n\n if (!$this->isFrozen()) {\n $PAGE->requires->js_call_amd('core/form-autocomplete', 'enhance', $params = array('#' . $id, $this->tags, $this->ajax,\n $this->placeholder, $this->casesensitive, $this->showsuggestions, $this->noselectionstring));\n }\n\n $html = parent::toHTML();\n\n // Hacky bodge to add in the HTML code to the option tag. There is a nicer\n // version of this code in the new template version (see export_for_template).\n if ($this->valuehtmlcallback) {\n $html = preg_replace_callback('~value=\"([^\"]+)\"~', function($matches) {\n $value = html_entity_decode($matches[1]);\n $htmlvalue = call_user_func($this->valuehtmlcallback, $value);\n if ($htmlvalue !== false) {\n return $matches[0] . ' data-html=\"' . s($htmlvalue) . '\"';\n } else {\n return $matches[0];\n }\n }, $html);\n }\n\n return $html;\n }", "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}", "public static function generate_options ()\n\t{\n\t\t// Location options\n\t\tadd_option(\"wustache_base_folder\", 'templates');\n\t}", "public function actionMyOptions()\n {\n echo \"option1 - $this->option1\\n\\roption2 - $this->option2\\n\\rcolor - $this->color\\n\\r\";\n }", "function render_attribute($key, $contents, $selected)\r\n\t{\r\n\t\techo '<option value=\"';\r\n\t\techo htmlspecialchars($key, ENT_QUOTES);\r\n\t\techo '\"';\r\n\t\tif ($selected)\r\n\t\t{\r\n\t\t\techo \" selected\";\r\n\t\t} \r\n\t\techo '>';\r\n\t\tif (empty($contents))\r\n\t\t{\r\n\t\t\techo htmlspecialchars($key, ENT_QUOTES);\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\techo $contents;\r\n\t\t} \r\n\t\techo '</option>';\r\n\t}", "public function __toString(): string\n {\n $options = \\http_build_query(Values::of($this->options), '', ' ');\n return '[Twilio.Api.V2010.CreatePaymentOptions ' . $options . ']';\n }", "protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('format', '%isd% %mobile%');\n }", "public function render_advanced_options( $post )\n {\n }", "function virtual_product_type_options() {\n\t?>\n\t<div id=\"virtual_product_options\">\n\t\t<?php\n\t\t\t_e('Virtual products have no specific options.', 'jigoshop');\n\t\t?>\n\t</div>\n\t<?php\n}", "public function getView()\n {\n $view = '';\n\n /** @var Param $param */\n foreach ($this->params as $param) {\n $view .= $param->getLabel().' \"<i>'.$param->getValue().'</i>\" ';\n }\n\n return $view;\n }", "function selectHtml($idPlato, $name, $condicion, $parametros, $valorSeleccionado = \"\", $blanco = true, $orderby = \"1\") {\r\n $select = \"<select name='$name' id='$idPlato'>\";\r\n if ($blanco) {\r\n $select.= \"<option value='' />&nbsp $ </option>\";\r\n }\r\n $lista = $this->getList($condicion, $parametros, $orderby);\r\n foreach ($lista as $objeto) {\r\n $selected = \"\";\r\n if ($objeto->getIdPlato() == $valorSeleccionado) {\r\n $selected = \"selected\";\r\n }\r\n\r\n $select = \"<option $selected value='\" . $objeto->getIdPlato() . \"' >\" . $objeto->getNombre() . \",\" . $objeto->getDescripcion() .\r\n $objeto->getPrecio() . \"</option>\";\r\n }\r\n\r\n $select.=\"</select>\";\r\n return $select;\r\n }", "public function getElementHtml()\n\t{\n\t\treturn $this->_blockFactory->createBlock('\\ThinkIdeas\\TipsOfExperts\\Block\\Adminhtml\\Options')->toHtml();\n\t}", "function bb_print_mystique_option( $option ) {\r\n\techo bb_get_mystique_option( $option );\r\n}", "public function getOpt($option) {}", "function option_dropdown($label, $name, $value, $keys, $comment='') {\r\n\t\techo \"<tr valign='top'><th scope='row'>\" . $label . \"</th>\";\r\n\t\techo \"<td><select name='$name'>\";\r\n\r\n\t\tforeach ((array)$keys as $key => $description) {\r\n\t\t\tif ($key == $value)\r\n\t\t\t\t$selected = \"selected\";\r\n\t\t\telse\r\n\t\t\t\t$selected = \"\";\r\n\r\n\t\t\techo \"<option value='\" . htmlentities($key, ENT_QUOTES, 'UTF-8') . \"' $selected>$description</option>\";\r\n\t\t}\r\n\t\techo \"</select>\";\r\n\t\techo \" $comment</td></tr>\";\r\n\t}", "public function optionsAction()\n\t{\n\t\treturn '';\n\t}", "function _echo_esc_attr( $option_key ) {\n\t\techo esc_attr( bf_get_option( $option_key, $this->option_panel_id ) );\n\t}", "public function render($echo = true)\n {\n //if it is not an array , search the backend for the select options\n if (!is_array($this->_field['options'])) {\n $this->load_select_options($this->_field['options']);\n }\n\n $option = '<select class=\"font-select\">';\n\n if (isset($this->_field['blank'])) {\n $option .= '<option value=\"\">' . $this->_field['blank'] . '</option>';\n }\n\n $option .= $this->create_select_options($this->_field['options'], $this->_value);\n\n $option .= '</select>';\n\n // add hidden option that stores all the field\n $option .= '<input type=\"hidden\"' . $this->create_attributes() . ' />';\n $option .= '<div class=\"oxy-checkbox-list\"></div>';\n $option .= '<div class=\"oxy-checkbox-list\"></div>';\n\n if ($echo) {\n echo $option;\n } else {\n return $option;\n }\n }", "function renderOption($option, $conf) {\n\t\t$rc = $this->invokeCObject($this->field, $conf, $option, $option[$this->config['table.']['valueField']]);\n\t\t$needles = array(\n\t\t\t'%%%IDOPT%%%',\n\t\t);\n\t\t$values = array(\n\t\t\t'%%%IDVAR%%%_'.$option[$this->config['table.']['valueField']],\n\t\t);\n\t\t$rc = str_replace($needles, $values, $rc);\n\t\treturn $rc;\n\t}", "function printGetParameterDetails($parameterId) {\n $this->printDebugMessage('printGetParameterDetails', 'Begin', 1);\n $paramDetail = $this->getParameterDetails($parameterId);\n print <<<EOF\n<h3>$paramDetail->name</h3>\n\n<p>$paramDetail->description</p>\nEOF\n ;\n if(isset($paramDetail->values)) {\n print \"<table border=\\\"1\\\">\\n\";\n print \"<tr><th>Label</th><th>Value</th><th>Default</th></tr>\\n\";\n foreach($paramDetail->values->value as $val) {\n\tprint \"<tr><td>$val->label</td><td>$val->value</td><td>\";\n\tif($val->defaultValue && $val->defaultValue == 'true') print 'default';\n\telse print '&nbsp;';\n\tprint \"</td></tr>\\n\";\n }\n print \"</table>\\n\";\n }\n $this->printDebugMessage('printGetParameterDetails', 'Begin', 1);\n }", "private function selectCustomField(): string\n {\n $value = $this->getValue($this->index);\n foreach($this->options as &$option) {\n if($option['key'] == $value) {\n $option['selected'] = true;\n break;\n }\n }\n\n return Template::build($this->getTemplatePath('select.html'), [\n 'id' => uniqid(\"{$this->id}-\", true),\n 'name' => $this->id,\n 'label' => $this->label,\n 'options' => $this->options,\n 'index' => isset($this->index) ? $this->index : false\n ]);\n }", "public function parameterFormat() {\n $params = array(\n 'object_type' => array(\n 'help' => _txt('pl.garbagecollectorjob.arg.object_type'),\n 'type' => 'select',\n 'required' => false,\n 'choices' => array('Co')\n ),\n );\n\n return $params;\n }", "public function getOptionPoste(){\n $ge = new GestionEmploye();\n $postes = $ge->getAllPoste();\n $html = \"\";\n\n if (!is_array($postes)){\n $html .= \"Aucun resultat trouvé.\";\n }\n else{\n for ($i = 0; $i < sizeof($postes); $i++){\n $html .= \"\n <option value=\\\"\".$postes[$i]->getId().\"\\\">\".$postes[$i]->getNom().\"</option>\";\n }\n }\n\n return $html;\n }", "public function display_option_generator() {\n\n\t\t$desc = __( 'If our plugin\\'s shortcode generator causes any unwanted clutter or doesn\\'t fully jive with your WordPress setup, you can disable it here.', 'theme-blvd-shortcodes' );\n\t\t$this->display_yes_no( 'themeblvd_shortcode_generator', $desc, 'yes' );\n\n\t}", "function initialize () {\n $this->set_openingtag(\"<OPTION[attributes]>\");\n\t$this->set_closingtag(\"</OPTION>\");\n }", "function print_custom($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title.'<br/><br/><br/>';\n\t\t\n\t\t$field_ids=array();\n\t\t$field_names=array();\n\t\t$is_textarea=array();\n\t\t\n\t\tforeach($value['fields'] as $field){\n\t\t\techo '<div class=\"custom-option\"><span class=\"custom-heading\">'.$field['name'].'</span>';\n\t\t\tswitch($field['type']){\n\t\t\t\tcase 'text':\n\t\t\t\t\t//print a standart text field\n\t\t\t\t\techo '<input type=\"text\" id=\"'.$field['id'].'\" name=\"'.$field['id'].'\"/>';\n\t\t\t\t\t$is_textarea[]=\"false\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'upload':\n\t\t\t\t\t//print a field with an upload button\n\t\t\t\t\techo '<input class=\"option-input upload\" name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" type=\"text\" />';\n\t\t\t\t\techo '<div id=\"'.$field['id'].'_button\" class=\"upload-button upload-logo\" ><a class=\"hana-button alignright\"><span>Upload</span></a></div><br/>';\n\t\t\t\t\techo '<script type=\"text/javascript\">jQuery(document).ready(function($){\n\t\t\t\t\t\t\t\thanaOptions.loadUploader(jQuery(\"div#'.$field['id'].'_button\"));\n\t\t\t\t\t\t});</script>';\n\t\t\t\t\t$preview=$field['id'];\n\t\t\t\t\t$is_textarea[]=\"false\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'textarea':\n\t\t\t\t\t//print a textarea\n\t\t\t\t\techo '<textarea id=\"'.$field['id'].'\" name=\"'.$field['id'].'\"></textarea>';\n\t\t\t\t\t$is_textarea[]=\"true\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'imageselect':\n\t\t\t\t\t//print a textarea\n\t\t\t\t\techo '<div class=\"styles-holder images-select-holder\" id=\"'.$field['id'].'_container\">';\n\t\t\t\t\techo '<input name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" type=\"hidden\" /><ul>';\n\t\t\t\t\n\t\t\t\t\t$counter=0;\n\t\t\t\t\tforeach ($field['options'] as $key=>$option) {\n\t\t\t\t\t\t//$style='background-image:url('.$option.');';\n\t\t\t\t\t\techo '<li><a class=\"style-box\" title=\"'.$option.'\" href=\"\"><img src=\"'.$option.'\" /></a>'.$key.'</li>';\n\t\t\t\t\t} \n\t\t\t\t\techo '</ul></div>';\n\t\t\t\t\t$is_textarea[]=\"false\";\n\t\t\t\t\tbreak;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$saved_value=$this->get_field_value( $field['id'].'s');\n\t\t\t\n\t\t\t\n\t\t\t$saved_value=stripslashes($saved_value);\n\t\t\t//echo '<input type=\"hidden\" name=\"'.$field['id'].'s\" id=\"'.$field['id'].'s\" value=\"'.$saved_value.'\" /></div>';\n\t\t\techo '<textarea style=\"display:none;\" name=\"'.$field['id'].'s\" id=\"'.$field['id'].'s\">'.$saved_value.'</textarea></div>';\n\t\t\t$field_ids[]=$field['id'];\n\t\t\t$field_names[]=$field['name'];\n\t\t}\n\t\t\n\t\t//print the add button\n\t\techo '<a class=\"hana-button custom-option-button\" id=\"'.$value['id'].'_button\"><span>'.$value['button_text'].'</span></a>';\n\t\t\n\t\t//print the list that will contain the added items\n\t\techo '<ul id=\"'.$value['id'].'_list\" class=\"sortable\"></ul>';\n\t\t\n\t\t$idsString=implode('\",\"', $field_ids);\n\t\t$namesString=implode('\",\"', $field_names);\n\t\t$textareaString=implode(',', $is_textarea);\n\t\t\n\t\t//call the script that enables the functionality for adding custom fields\n\t\techo '<script type=\"text/javascript\">\n\t\t\tjQuery(document).ready(function($){\n\t\t\t\thanaOptions.setCustomFieldsFunc(\"'.$value['id'].'\", [\"'.$idsString.'\"], [\"'.$namesString.'\"], ['.$textareaString.'] , \"'.((isset($value['preview']))?$value['preview']:'').'\", \"'.HANA_TIMTHUMB_URL.'\");\n\t\t\t});\n\t\t</script>';\n\t\t\n\t\t$this->close_option($value);\n\t}", "function setHTMLoption($fieldname, $innername, $value)\n\t{\n\t\t$this->setFieldInnerParam($fieldname, \"html\", $innername, $value);\n\t}", "function uds_pricing_render_product_options_property($name, $type, $product)\n{\n\t$out = \"<div>\";\n\t$out .= \"<label>$name</label>\";\n\t$html_name = sanitize_title_with_dashes($name);\n\tswitch($type) {\n\t\tcase 'checkbox':\n\t\t\t$checked = $product['properties'][$name] == 'on' ? \"checked='checked'\" : \"\" ;\n\t\t\t$out .= \"<input type='checkbox' name='{$html_name}[]' $checked />\";\n\t\t\tbreak;\n\t\tcase 'text':\n\t\tdefault:\n\t\t\t$out .= \"<input type='text' name='{$html_name}[]' value='{$product['properties'][$name]}' class='text' />\";\n\t}\n\t$out .= \"<div class='clear'></div>\";\n\t$out .= \"</div>\";\n\t\n\treturn $out;\n}", "public function optionList()\n {\n return array(\n 'file:', // The template file to be rendered\n );\n }", "protected function toHtml()\n\t{\n\t\t// parameter is hexadecimal number\n\t\treturn \"&#x{$this->parameter};\";\n\t}", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->parameters([\n 'dom' => 'Bfrtip',\n 'order' => [1, 'asc'],\n 'select' => [\n 'style' => 'os',\n 'selector' => 'td:first-child',\n ],\n 'buttons' => [\n /*['extend' => 'create', 'editor' => 'editor'],\n ['extend' => 'edit', 'editor' => 'editor'],\n ['extend' => 'remove', 'editor' => 'editor'],*/\n ]\n ]);\n }", "function get_string() {\n\t$_strReturn = '';\n\t\t$attribs = $this->get_attribs();\n\t\t$_strReturn = \"\\n<select$attribs>\\n\";\n\t\t$_strReturn .= $this->get_options();\n\t\t$_strReturn .= \"</select>\\n\";\n\treturn $_strReturn;\n\t}", "function _echo( $option_key ) {\n\t\tbf_echo_option( $option_key, $this->option_panel_id );\n\t}", "public function xhtml() {\n\t global $container;\n $tag = new xo_codetag(xo_basename(__FILE__),__LINE__,get_class(),__FUNCTION__);\n $hid = $this->id;\n\t\t$class = $this->class;\n\t\t\n\t\t$multiple = ( $this->multiple && is_numeric($this->multiple))? \" multiple size=\\\"$this->multiple\\\" \": \"\";\n\t\t\n\t\t$html = '<select '.$multiple . ' title=\"'.$this->title . '\" style=\"' . $this->xml['style'] . '\" class=\"'. $class . '\" name=\"' . $hid . '\" id=\"'. $hid .'\">';\n\t\t\n\t\t// add default option\n $c = $container->userstring(\"choose\");\n\t\t$html .= '<option value=\"\">'.$c.'</option>';\n\t\t\n\t\tforeach ( $this->nv_pairs as $id => $name ) {\n if ( $container->debug) echo \"$tag->event_format: setting pair for $id => $name<br>\\r\\n\";\n\t\t $selected = $this->default == $id ? 'selected=\"selected\"' : '';\n\t\t\t// set optional class for multiple values\n // set optional class for multiple values\n if ( preg_match('/\\,/',$id)) {\n $vals = explode(',',$id);\n $class = ' class=\"alt-'.$vals[1].'\" ';\n }\n\n $html .= '<option ' . $selected . ' value=\"' . $id . '\">' . $name . '</option>';\n\n\n\n }\n $html .= '</select>';\n\n return $html;\n\t}", "function printOptions()\n {\n $lines = $this->outputOptions();\n echo join( \"\\n\" , $lines );\n }", "function option_attr(string $option_id, array $field): string\n{\n $attributes = [\n 'value' => $option_id,\n ];\n\n $option = $field['options'][$option_id];\n if ($field['value'] == $option_id) $attributes['selected'] = true;\n if (is_array($option)) $attributes += $option['attr'];\n\n return html_attr($attributes);\n}", "function settings_html() {\n $this->render_setting( 'label_any' );\n $this->render_setting( 'modifiers' );\n $this->render_setting( 'orderby' );\n $this->render_setting( 'count' );\n }", "function dropdown($array,$param=NULL) {\n\t\t$name = $param['name'];\n\t\tif (!$param['id']) $param['id'] = $name;\n\t\techo '<select name=\"' . $name . '\" id=\"' . $param['id'] . '\"' . '\" class=\"' . $param['class'] . '\"';\n\t\tif ($param['onchange']) echo ' onchange=\"' . $param['onchange'] . '\"';\n\t\tif ($param['class']) echo ' class=\"' . $param['class'] . '\"';\n\t\techo '>' . \"\\n\";\n\t\tif ( $param['null_option'] !== false ) echo \"\\t\" . '<option value=\"\">' . $param['null_option'] . '</option>';\n\t\tforeach ($array as $value => $option) {\n\t\t\techo \"\\t\" . '<option value=\"' . $value . '\"';\n\t\t\tif ($param['selected_value'] && $param['selected_value'] == $value) echo ' selected ';\n\t\t\techo '>' . $option . '</option>' . \"\\n\";\n\t\t}//foreach\n\t\techo \"</select>\\n\";\n\t\n\t}", "private function d(string $option): string\n {\n return '<bold:blue>' . $option . '</bold:blue>';\n }", "function wpbs_echo_option()\n {\n include wpbs_advs_plugin_dir . 'admin/view/adminLayout.php';\n }", "public function option(string $option);", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "public function start_el(&$output, $item, $depth=0, $args=array(), $id = 0){\n $item->title = str_repeat(\"&#45; \", $depth ) . $item->title;\n parent::start_el($output, $item, $depth, $args);\n\n $output = str_replace( '<a', '<option', $output );\n $output = str_replace( 'href=', 'value=', $output );\n\n }", "public function site_admin_option_hook($params) {\n echo '<li><a href=\"'.$this->getPluginPath().'/\">Admin delegation</a></li>';\n }", "public function get_option_label_html(){\n\t\t$html = \"\";\n\t\t$classes = $this->get_label_html_classes();\n\t\t$required = $this->required ? \"*\" : \"\";\n\t\t$html .= \"<{$this->element} class='$classes' for='{$this->id}'>{$this->label}{$required}</{$this->element}>\";\n\t\treturn $html;\n\t}", "function Field() {\n\t\t$size = '';\n\t\t$multiple = '';\n\t\t\n\t\tif($this->size) $size = \"size=\\\"$this->size\\\"\";\n\t\t\n\t\tif($this->multiple) {\n\t\t\t$multiple = \"multiple=\\\"multiple\\\"\";\n\t\t\t$this->name .= '[]';\n\t\t}\n\t\t\n\t\t$options = \"\";\n\t\t\n\t\t// We have an array of values\n\t\tif(is_array($this->value)){\n\t\t\t// Loop through and figure out which values were selected.\n\t\t\t\t\t\n\t\t\tforeach($this->getSource() as $value => $title) {\n\t\t\t\t// Loop through the array of values to find out if this value is selected.\n\t\t\t\t$selected = \"\";\n\t\t\t\tforeach($this->value as $v){\n\t\t\t\t\tif($value == $v) {\n\t\t\t\t\t\t$selected = \" selected=\\\"selected\\\"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$options .= \"<option$selected value=\\\"$value\\\">$title</option>\\n\";\n\t\t\t}\n\t\t}else{\n\t\t\t// Listbox was based a singlular value, so treat it like a dropdown.\n\t\t\tforeach($this->getSource() as $value => $title) {\n\t\t\t\t$selected = $value == $this->value ? \" selected=\\\"selected\\\"\" : \"\"; \n\t\t\t\t$options .= \"<option$selected value=\\\"$value\\\">$title</option>\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$id = $this->id();\n\t\treturn \"<select $size $multiple name=\\\"$this->name\\\" id=\\\"$id\\\">$options</select>\";\n\t}", "public function makeElement()\r\n\t{\r\n\t\t$selected = $this->value;\r\n\t\tif (empty($selected)) {\r\n\t\t\t$selected = $this->default;\r\n\t\t}\r\n\t\t$id = (isset($this->attributes['id'])) ? $this->attributes['id'] : $this->name;\r\n\t\t$class = (isset($this->attributes['class'])) ? $this->attributes['class'] : 'selectbox';\r\n\t\t$out = \"<select name='{$this->name}' id='{$id}' class='{$class}'\";\r\n\t\t$out .= $this->renderAttributes() . \">\\n\";\r\n\t\tforeach ($this->options as $value => $option) {\r\n\t\t\t$out .= \"\\t<option value='$value'\";\r\n\t\t\t// Triple equals required here. 0 == 'some string' evaluates to true in PHP.\r\n\t\t\tif ($value === $selected) {\r\n\t\t\t\t$out .= \" selected='selected'\";\r\n\t\t\t}\r\n\t\t\t$out .= \">$option</option>\\n\";\r\n\t\t}\r\n\t\t$out .= \"</select>\\n\";\r\n\r\n\t\treturn $out;\r\n\t}", "private function o(string $option): string\n {\n return '<bold:bgLightYellow>' . $option . '</bold:bgLightYellow>';\n }", "protected function get_option_name()\n {\n }", "function makeSelectElement($list, $pre_selected='', $fullinfo=false, $extra=array())\n{\n $select_elem = '';\n foreach ( $list as $item ) {\n if ( $item->getId() == $pre_selected ) {\n $selected = ' selected';\n } else {\n $selected = '';\n }\n $name = htmlspecialchars($item->getFullName());\n $id = htmlspecialchars($item->getId());\n if ( $fullinfo ) {\n $id = \"{$name} ({$id})\";\n $name = $id;\n }\n $select_elem .= <<<HTML\n <option value=\"{$id}\"{$selected}>{$name}</option>\n\nHTML;\n }\n if ( !empty($extra) ) {\n $select_elem .= <<<HTML\n <option value=\"{$extra['id']}\">{$extra['name']}</option>\nHTML;\n\n }\n return $select_elem;\n}", "public function getValuesHtml()\n {\n $product = $this->getProduct();\n\n\n $selectHtml = '<div class=\"options-list nested\" id=\"options-shipment-' . $product->getId() . '-list\">';\n\n $options = explode(',', $product->getMdlShipments());\n $i = 0;\n foreach ($options as $option) {\n $optionInfo = $optionLabel = $this->shipmentRepository\n ->getByCode($option, $this->_storeManager->getStore()->getId());\n $optionLabel = $optionInfo->getName();\n $selectHtml .= '<div class=\"field choice admin__field admin__field-option required\">' .\n '<input type=\"radio\" id=\"shipment_' .\n $product->getId() . '_' . $i .\n '\" class=\"'\n\n . 'radio admin__control-radio required product-custom-option\" name=\"shipment_' .\n $product->getId()\n .\n '\" data-selector=\"shipment_' . $product->getId() . '\"' .\n ' value=\"' \n . $optionLabel \n . '--'\n . $option \n . '--'\n . $optionInfo->getBillingAddressTopLabel()\n . '--'\n . $optionInfo->getShippingAddressTopLabel()\n . '--'\n . $optionInfo->getIsSameAsBilling()\n . '\" /><label class=\"label admin__field-label\" for=\"shipment_' .\n $product->getId() . '_' . $i .\n '\">\n '\n . $optionLabel . '</span></label></div>';\n\n $i++;\n }\n $selectHtml .= '</div>';\n return $selectHtml;\n\n }", "protected function get_options()\n\t{}", "public function __toString(): string\n {\n $options = \\http_build_query(Values::of($this->options), '', ' ');\n return '[Twilio.Api.V2010.UpdatePaymentOptions ' . $options . ']';\n }", "public function options();", "public function options();", "public function options();", "public function options();", "public function options();", "public function getOptDoc($optname) {}", "function uds_pricing_render_product_options($product = null, $properties = array())\n{\n\tglobal $uds_pricing_column_options;\n\n\tforeach($uds_pricing_column_options as $key => $option) {\n\t\t$default = $product == null ? $option['default'] : $product[$key];\n\t\techo call_user_func('uds_pricing_render_product_options_'.$option['type'], $key, $default);\n\t}\n\t\n\tif(!empty($properties)) {\n\t\techo \"<div class='properties-separator'><h3>Properties</h3></div>\";\n\t\tforeach($properties as $name => $type) {\n\t\t\techo uds_pricing_render_product_options_property($name, $type, $product);\n\t\t}\n\t}\n}", "public function view_option_page() {\n\t\tinclude_once plugin_dir_path( __FILE__ ) . 'options.php';\n\t}", "function edit_component_tool_inputs_param_options_filter(&$form) {\n // use current time as form_key to enable webform component clone.\n $form['form_key']['#default_value'] = 'form_key_' . time();\n\n unset($form['validation']);\n unset($form['display']);\n\n $form = array_merge($form, get_edit_component_base_form_elements($form, 'filter'));\n\n // form field to edit attributes, available attributes for command includes:\n $form['extra']['attributes']['type'] = [\n '#type' => 'select',\n '#title' => t('Type'),\n '#description' => t('These values are defined in the module ' .\n l('/lib/galaxy/tools/parameters/dynamic_options.py', 'https://github.com/galaxyproject/galaxy/blob/master/lib/galaxy/tools/parameters/dynamic_options.py') .\n ' in the filter_types dictionary'),\n '#options' => drupal_map_assoc([\n 'data_meta',\n 'param_value',\n 'static_value',\n 'unique_value',\n 'multiple_splitter',\n 'attribute_value_splitter',\n 'add_value',\n 'remove_value',\n 'sort_by',\n ]),\n '#required' => TRUE,\n ];\n $form['extra']['attributes']['column'] = [\n '#type' => 'textfield',\n '#title' => t('Column'),\n '#description' => t('Column targeted by this filter - this attribute is \n unused and invalid if <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span> or \n <span style=\"color: #FF5666\">remove_value</span>. \n This can be a column index or a column name.'),\n ];\n $form['extra']['attributes']['name'] = [\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#description' => t('Name displayed for value to add (only used with \n <span style=\"color: #FF5666;\">type</span> of <span style=\"color: #FF5666\">add_value</span>).'),\n ];\n $form['extra']['attributes']['ref'] = [\n '#type' => 'textfield',\n '#title' => t('Reference file'),\n '#description' => t('The attribute name of the reference file (tool data) or \n input dataset. Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span> (required), \n <span style=\"color: #FF5666\">param_value</span> (required), or \n <span style=\"color: #FF5666\">remove_value</span> (optional).')\n ];\n $form['extra']['attributes']['key'] = [\n '#type' => 'textfield',\n '#title' => t('Key'),\n '#description' => t('When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span>, \n <span style=\"color: #FF5666\">param_value</span>, or \n <span style=\"color: #FF5666\">remove_value</span> - this is the name of \n the metadata key to filter by.'),\n ];\n $form['extra']['attributes']['multiple'] = [\n '#type' => 'radios',\n '#title' => t('Multiple'),\n '#description' => t('For types <span style=\"color: #FF5666\">data_meta</span> and \n <span style=\"color: #FF5666\">remove_value</span>, whether option values are multiple. \n Columns will be split by separator. Defaults to <span style=\"color: #FF5666\">false</span>.'),\n '#options' => drupal_map_assoc([\n 'true',\n 'false',\n ])\n ];\n $form['extra']['attributes']['separator'] = [\n '#type' => 'textfield',\n '#title' => t('Separator'),\n '#description' => t('When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span>, \n <span style=\"color: #FF5666\">multiple_splitter</span>, or \n <span style=\"color: #FF5666\">remove_value</span> - this is used to split \n one value into multiple parts. When <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">data_meta</span> or \n <span style=\"color: #FF5666\">remove_value</span> this is only used if \n <span style=\"color: #FF5666\">multiple</span> is set to \n <span style=\"color: #FF5666\">true</span>.')\n ];\n $form['extra']['attributes']['keep'] = [\n '#type' => 'radios',\n '#title' => t('Keep'),\n '#description' => t('If <span style=\"color: #FF5666\">true</span>, keep columns \n matching the value, if <span style=\"color: #FF5666\">false</span> discard \n columns matching the value. Used when <span style=\"color: #FF5666\">type</span> \n is either <span style=\"color: #FF5666\">static_value</span> or \n <span style=\"color: #FF5666\">param_value</span>.'),\n '#options' => drupal_map_assoc([\n 'true',\n 'false',\n ]),\n '#default_value' => 'true',\n ];\n $form['extra']['attributes']['value'] = [\n '#type' => 'textfield',\n '#title' => t('Value'),\n '#description' => t('Target value of the operations - has slightly different \n meanings depending on type. For instance when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span> it is the value to add to the list \n and when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">static_value</span> it is the value compared against.')\n ];\n $form['extra']['attributes']['ref_attribute'] = [\n '#type' => 'textfield',\n '#title' => t('Reference attribute'),\n '#description' => t('Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">param_value</span>. Period (<span style=\"color: #FF5666\">.</span>) \n separated attribute chain of input (<span style=\"color: #FF5666\">ref</span>) \n attributes to use as value for filter.'),\n ];\n $form['extra']['attributes']['index'] = [\n '#type' => 'textfield',\n '#title' => t('Index'),\n '#description' => t('Used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">add_value</span>, it is the index into the \n list to add the option to. If not set, the option will be added to \n the end of the list.'),\n ];\n $form['extra']['attributes']['meta_ref'] = [\n '#type' => 'textfield',\n '#title' => t('Meta reference'),\n '#description' => t('Only used when <span style=\"color: #FF5666\">type</span> is \n <span style=\"color: #FF5666\">remove_value</span>. Dataset to look for the \n value of metadata <span style=\"color: #FF5666\">key</span> to remove from the list.')\n ];\n // grab populated data from 'extra' column from webform_component table and\n // fill it as default values for edit component form fields.\n edit_component_form_fields_default_value($form);\n}", "public static function option($texte,$valeur=null,$defaut=null){\n $selected = '';\n \n if(is_null($valeur)){\n $valeur = $texte;\n }\n \n if(!is_null($defaut)){\n if($valeur == $defaut){\n $selected = 'selected';\n }\n }\n \n ?>\n <option value=\"<?php echo $valeur;?>\" <?php echo $selected;?> ><?php echo $texte;?></option>\n <?php \n }", "function convertOptionToHTML($option_value, $option_label, $selected = false) {\n\tif ($selected) {\n\t\t$selected_html = 'selected=\"selected\"';\n\t} else {\n\t\t$selected_html = '';\n\t}\n\treturn <<<EOD\n<option value=\"$option_value\" $selected_html>$option_label</option>\nEOD;\n}", "public function getHtml(){\n $options = $this->getOptions();\n if ($this->getColumn()->getWithEmpty()) {\n array_unshift($options, array(\n 'value' => '',\n 'label' => ''\n ));\n }\n $html = sprintf('<select name=\"%s\" id=\"%s\" class=\"no-changes\">', $this->_getHtmlName(), $this->_getHtmlId())\n . $this->_drawOptions($options)\n . '</select>';\n return $html;\n }", "function options_markup(SplDoublyLinkedList $_list, $select_target = NULL)\n\t{\n\t\t$result\t\t= NULL;\n\t\t$current \t= NULL;\n\n\t\tif(is_object($_list) === TRUE)\n\t\t{ \n\t\t\t// Generate table row for each item in list.\n\t\t\tfor($_list->rewind(); $_list->valid(); $_list->next())\n\t\t\t{\t \n\t\t\t\t$current = $_list->current();\n\n\t\t\t\t$value \t\t= $current->get_id();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$label\t\t= $current->get_name_l().', '.$current->get_name_f();\n\t\t\t\t$selected \t= NULL;\n\n\t\t\t\tif($value == $select_target)\n\t\t\t\t{\n\t\t\t\t\t$selected = ' selected ';\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t$result .= '<option value=\"'.$value.'\"'.$selected.'>'.$label.'</option>'; \n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "protected function viewSettingElement($element) {\n $output = '';\n\n if (is_array($element['option'])) {\n $value = '';\n foreach ($element['option'] as $sub_element) {\n $value .= $this->viewSettingElement($sub_element);\n }\n }\n else {\n $value = $this->getOption($element['option']);\n $value = nl2br(check_plain(print_r($value, TRUE)));\n }\n $output .= '<dt><em>' . check_plain($element['label']) . '</em></dt>' . \"\\n\";\n $output .= '<dd>' . $value . '</dd>' . \"\\n\";\n\n return \"<dl>\\n{$output}</dl>\";\n }", "function setHTMLoptions($fieldname, $value)\n\t{\n\t\t$this->setFieldParam($fieldname, \"html\", $value);\n\t}", "abstract function options();", "function print_option($value){\n\t\tstatic $i=0;\n\t\tswitch ( $value['type'] ) {\n\t\t\tcase 'open':\n\t\t\t\t$this->print_subnavigation($value, $i);\n\t\t\t\tbreak;\n\t\t\tcase 'subtitle':\n\t\t\t\t$this->print_subtitle($value, $i);\n\t\t\t\tbreak;\n\t\t\tcase 'close':\n\t\t\t\t$this->print_close();\n\t\t\t\tbreak;\n\t\t\tcase 'block':\n\t\t\t\t$this->print_block($value);\n\t\t\t\tbreak;\n\t\t\tcase 'blockclose':\n\t\t\t\t$this->print_blockclose();\n\t\t\t\tbreak;\n\t\t\tcase 'div':\n\t\t\t\t$this->print_div($value);\n\t\t\t\tbreak;\n\t\t\tcase 'title':\n\t\t\t\t$i++;\n\t\t\t\tbreak;\n\t\t\tcase 'text':\n\t\t\t\t$this->print_text_field($value);\n\t\t\t\tbreak;\t\n\t\t\tcase 'textarea':\n\t\t\t\t$this->print_textarea($value);\n\t\t\t\tbreak;\n\t\t\tcase 'select':\n\t\t\t\t$this->print_select($value);\n\t\t\t\tbreak;\n\t\t\tcase 'multicheck':\n\t\t\t\t$this->print_multicheck($value);\n\t\t\t\tbreak;\n\t\t\tcase 'color':\n\t\t\t\t$this->print_color($value);\n\t\t\t\tbreak;\n\t\t\tcase 'upload':\n\t\t\t\t$this->print_upload($value);\n\t\t\t\tbreak;\n\t\t\tcase 'checkbox':\n\t\t\t\t$this->print_checkbox($value);\n\t\t\t\tbreak;\n\t\t\tcase 'custom':\n\t\t\t\t$this->print_custom($value);\n\t\t\t\tbreak;\n\t\t\tcase 'pattern':\n\t\t\t\t$this->print_stylebox($value, 'pattern');\n\t\t\t\tbreak;\n\t\t\tcase 'stylecolor':\n\t\t\t\t$this->print_stylebox($value, 'color');\n\t\t\t\tbreak;\n\t\t\tcase 'documentation':\n\t\t\t\t$this->print_text($value);\t\n\t\t\t\tbreak;\n\t\t}\n\t}", "function opt_2_html($arr) {\n\t$r = array();\n\tforeach($arr AS $key=>$value) {\n\t\t$r[] = sechoe('%s=\"%s\"',$key,$value);\n\t}\n\treturn join(' ', $r);\n}", "function close_option($value){\n\t\tif(!isset($value['desc'])) $value['desc']='';\n\t\tif (isset($value['std']) && $value['std']!='' && in_array($value['type'],array('text','color','upload')))\n\t\t\t$value['desc'] .= ' (default: '.$value['std'].')';\n\t\tif($value['desc'])\n\t\t\techo '<a href=\"\" class=\"help-button\"><div class=\"help-dialog\" title=\"'.$value['name'].'\"><p>'.$value['desc'].'</p></div></a>';\n\t\techo $this->after_option;\n\t}", "public function render() {\n $this->checkValue();\n $html = NULL;\n\n $html .= '<select id=\"'.$this->id.'\" name=\"'.$this->name.'\"';\n $html .= (bool)$this->multiple ? ' multiple' : NULL;\n $html .= (bool)$this->size ? ' size=\"'.$this->size.'\"' : NULL;\n $html .= \">\\n\";\n\n foreach($this->options as $option) {\n $html .= '<option value=\"'.$option['optionValue'].'\"';\n\n if($this->form->isSubmitted()) {\n $html .= ($_REQUEST[$this->name] == $option['optionValue']) ? ' selected' : NULL;\n } else {\n $html .= (isset($option['selected']) && (bool)$option['selected']) ? ' selected' : NULL;\n }\n\n $html .= '>'.$option['optionTitle'].\"</option>\\n\";\n }\n\n if($this->required\n && $this->form->isSubmitted()\n && !$this->checkValue()) {\n $this->error = TRUE;\n }\n\n $html .= '</select>';\n $this->html = $this->wrap($html);\n }", "public static function print_editor_option_markup($robot_info, $ability_info){\n // Require the function file\n $this_option_markup = '';\n require(MMRPG_CONFIG_ROOTDIR.'data/classes/ability_editor-option-markup.php');\n // Return the generated option markup\n return $this_option_markup;\n }", "private function getSpec() {\n\t\t$html = '<div id=\"tal_ecoles\">';\n\t\t$html .= '<select id=\"tal_listEcoles\" onchange=\"tal_display(this)\">';\n\t\t$html .= '<option value=\"0\" selected=\"\" disabled=\"\">Choose...</option>';\n\t\tforeach ($this->_xml->ecole as $branch) {\n\t\t\t$html .= '<option value=\"'.$branch['id'].'\">'.$branch['name'].'</option>';\n\t\t}\n\t\t$html .= '</select>';\n\t\t$html .= '</div>';\n\n\t\treturn $html;\n\t}", "public function options()\n {\n $options = apply_filters(\n $this->id . '_option_fields',\n [\n 'id' => $this->id, // upstream_milestones\n 'title' => $this->title,\n 'menu_title' => $this->menu_title,\n 'desc' => $this->description,\n 'show_on' => ['key' => 'options-page', 'value' => [$this->id],],\n 'show_names' => true,\n 'fields' => [\n [\n 'name' => upstream_milestone_label_plural(),\n 'id' => 'milestone_title',\n 'type' => 'title',\n ],\n [\n 'name' => 'Milestone Categories',\n 'id' => 'enable_milestone_categories',\n 'type' => 'radio',\n 'description' => '',\n 'options' => [\n '1' => __('Enabled', 'upstream'),\n '0' => __('Disabled', 'upstream'),\n ],\n 'default' => '0',\n ],\n ],\n ]\n );\n\n return $options;\n }", "public function privacySelectOptions(): string {\n\n $privateSelected = ($this->privacy == 1) ? \"selected='selected'\" : \"\";\n $publicSelected = ($this->privacy == 2) ? \"selected='selected'\" : \"\";\n\n return \"<option value='1' {$privateSelected}>Private</option>\n <option value='2' {$publicSelected}>Public</option>\";\n }", "public function __toString()\n {\n $options = array();\n foreach ($this->options as $key => $value) {\n if ($value != Values::NONE) {\n $options[] = \"$key=$value\";\n }\n }\n return '[Oneyun.Api.CreateIvrCallOptions ' . implode(' ', $options) . ']';\n }", "function param(string $name, string $value, string $type = 'ref', string $attributes = ''): string\n {\n return '<param name=\"' . $name\n . '\" type=\"' . $type\n . '\" value=\"' . $value\n . '\" ' . $attributes . _solidus() . '>';\n }", "function print_select($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\t\t\n\t\techo '<select class=\"option-select'.((isset($value['conditional']) && $value['conditional'])?' option-conditional':'').'\" name=\"'.$value['id'].'\" id=\"'.$value['id'].'\">';\n\t\t\n\t\tforeach ($value['options'] as $option) {\n\t\t\t$attr='';\t\n\t\t\t if ( get_option( $value['id'] ) == $option['id']) {\n\t\t\t\t$attr = ' selected=\"selected\"';\n\t\t\t }\n\t\t \t if ( $option['id'] == 'disabled') {\n\t\t\t\t$attr.= ' disabled=\"disabled\"';\n\t\t\t }\n\t\t\t if($option['class']){\n\t\t\t\t$attr.=' class=\"'.$option['class'].'\"';\t\t\t \t\n\t\t\t }\n\t\t\techo '<option '.$attr.' value=\"'.$option['id'].'\">'.$option['name'].'</option>'; \n\t\t} \n\t\n\t\techo '</select>';\n\t\t$this->close_option($value);\n\t}", "protected function buildOptionsList() {\n }", "abstract function fields_options();" ]
[ "0.6297293", "0.58801293", "0.587356", "0.57426906", "0.5708701", "0.56722516", "0.56327105", "0.56052715", "0.5542332", "0.5520321", "0.54288703", "0.53827727", "0.5377769", "0.5377766", "0.5375306", "0.5369502", "0.53631186", "0.5341538", "0.5331674", "0.5331674", "0.53290385", "0.5319063", "0.5315006", "0.531205", "0.53036875", "0.52845305", "0.5283166", "0.52810127", "0.5279005", "0.5277496", "0.5276296", "0.52713275", "0.52630454", "0.5247962", "0.5247935", "0.5247909", "0.5247087", "0.5246099", "0.5242625", "0.52409995", "0.5226044", "0.5222665", "0.5212667", "0.5204776", "0.5198682", "0.5197154", "0.51962", "0.51922536", "0.5190373", "0.51849216", "0.5164629", "0.515569", "0.5152537", "0.51453483", "0.5143964", "0.5143311", "0.51424146", "0.514145", "0.5132861", "0.51262474", "0.51242477", "0.51232994", "0.5116313", "0.5110489", "0.51027626", "0.5099134", "0.5098646", "0.50983316", "0.5098076", "0.5089947", "0.50868523", "0.5083234", "0.5083234", "0.5083234", "0.5083234", "0.5083234", "0.5081346", "0.5079726", "0.50796765", "0.5079265", "0.5076951", "0.5073203", "0.50604165", "0.50527644", "0.50413984", "0.5035477", "0.5034992", "0.5033122", "0.5033085", "0.50300425", "0.502511", "0.502412", "0.5019955", "0.50196826", "0.500991", "0.50015116", "0.49974182", "0.49913645", "0.49909717", "0.49905437" ]
0.7178049
0
Generate HTML tags for a parameter detail. menu or text input.
function paramDetailToStr($parameterId, $multi=FALSE) { $this->printDebugMessage('paramDetailToStr', 'Begin', 1); $paramDetail = $this->getParameterDetails($parameterId); $retStr = $this->paramDetailToLabelStr($parameterId, $paramDetail); if(isset($paramDetail->values)) { if($multi) { // Multi-select menu $retStr .= '<select name="' . $parameterId .'[]" multiple="1">'; } else { // Drop-down list $retStr .= '<select name="' . $parameterId .'">'; } $retStr .= $this->paramDetailToOptionStr($paramDetail); $retStr .= '</select>'; } else { // Input box $retStr .= '<input type="text" name="' . $parameterId . '" />'; } $this->printDebugMessage('paramDetailToStr', 'End', 1); return $retStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderParameterDetail($parameter) {\n\n if (!isset($parameter[0]))\n $parameter = array($parameter);\n\n $this->tpl->setCurrentBlock(\"functiondetails_parameter_loop\");\n \n reset($parameter);\n while (list($k, $param) = each($parameter)) {\n\n $this->tpl->setVariable(\"NAME\", $param[\"name\"]);\n $this->tpl->setVariable(\"DESCRIPTION\", $this->encode($param[\"value\"]));\n\n if (isset($param[\"type\"]))\n $this->tpl->setVariable(\"TYPE\", $param[\"type\"]);\n\n if (isset($param[\"default\"]))\n $this->tpl->setVariable(\"DEFAULT\", \"= >>\".htmlentities($param[\"default\"]).\"<<\");\n\n if (\"true\" == $param[\"undoc\"])\n $this->tpl->setVariable(\"UNDOC\", $this->undocumented);\n\n $this->tpl->parseCurrentBlock(); \n }\n\n }", "function editor_element($params)\n {\n $heading = \"\";\n $template = $this->update_template(\"heading\", \" - <strong>{{heading}}</strong>\");\n if(!empty($params['args']['heading'])) $heading = \"- <strong>\".$params['args']['heading'].\"</strong>\";\n\n $params['innerHtml'] = \"<img src='\".$this->config['icon'].\"' title='\".$this->config['name'].\"' />\";\n $params['innerHtml'].= \"<div class='avia-element-label'>\".$this->config['name'].\"</div>\";\n $params['innerHtml'].= \"<div class='avia-element-label' {$template}>\".$heading.\"</div>\";\n\n return $params;\n }", "function EchoHTMLHiddens ($params) {\n if (is_array($params)) {\n foreach ($params as $key=>$val) {\n if (!is_array($val)) {\n echo SimpleCartFunctions::HTMLInput(array('type'=>'hidden', 'id'=>$key, 'value'=>$val));\n }\n else {\n foreach ($val as $k=>$v) {\n $kname = $key . '[' . $k . ']';\n echo SimpleCartFunctions::HTMLInput(array('type'=>'hidden', 'id'=>$key.'_'.$k, 'id'=>$kname, 'value'=>$v));\n }\n }\n }\n }\n }", "function printGetParameterDetails($parameterId) {\n $this->printDebugMessage('printGetParameterDetails', 'Begin', 1);\n $paramDetail = $this->getParameterDetails($parameterId);\n print <<<EOF\n<h3>$paramDetail->name</h3>\n\n<p>$paramDetail->description</p>\nEOF\n ;\n if(isset($paramDetail->values)) {\n print \"<table border=\\\"1\\\">\\n\";\n print \"<tr><th>Label</th><th>Value</th><th>Default</th></tr>\\n\";\n foreach($paramDetail->values->value as $val) {\n\tprint \"<tr><td>$val->label</td><td>$val->value</td><td>\";\n\tif($val->defaultValue && $val->defaultValue == 'true') print 'default';\n\telse print '&nbsp;';\n\tprint \"</td></tr>\\n\";\n }\n print \"</table>\\n\";\n }\n $this->printDebugMessage('printGetParameterDetails', 'Begin', 1);\n }", "function training_menu_arguments_display($arg) {\n return '<div>' . $arg . '</div>';\n}", "public function getView()\n {\n $view = '';\n\n /** @var Param $param */\n foreach ($this->params as $param) {\n $view .= $param->getLabel().' \"<i>'.$param->getValue().'</i>\" ';\n }\n\n return $view;\n }", "public function singleParamHtmlHolder( $param, $value ) {\n\n\t\t$output = '';\n\n\t\t$param_name = isset( $param['param_name'] ) ? $param['param_name'] : '';\n\t\t$type = isset( $param['type'] ) ? $param['type'] : '';\n\t\t$class = isset( $param['class'] ) ? $param['class'] : '';\n\n\t\tif ( 'attach_image' === $param['type'] && 'image' === $param_name ) {\n\t\t\t$output .= '<input type=\"hidden\" class=\"wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '\" name=\"' . $param_name . '\" value=\"' . $value . '\" />';\n\t\t\t$element_icon = $this->settings( 'icon' );\n\t\t\t$img = wpb_getImageBySize( array(\n\t\t\t\t'attach_id' => (int) preg_replace( '/[^\\d]/', '', $value ),\n\t\t\t\t'thumb_size' => 'thumbnail',\n\t\t\t\t'class' => 'attachment-thumbnail vc_general vc_element-icon tm-element-icon-none',\n\t\t\t) );\n\t\t\t$this->setSettings( 'logo',\n\t\t\t\t( $img ? $img['thumbnail'] : '<img width=\"150\" height=\"150\" src=\"' . vc_asset_url( 'vc/blank.gif' ) . '\" class=\"attachment-thumbnail vc_general vc_element-icon amely-element-icon-banner\" data-name=\"' . $param_name . '\" alt=\"\" title=\"\" style=\"display: none;\" />' ) . '<span class=\"no_image_image vc_element-icon' . ( ! empty( $element_icon ) ? ' ' . $element_icon : '' ) . ( $img && ! empty( $img['p_img_large'][0] ) ? ' image-exists' : '' ) . '\" /><a href=\"#\" class=\"column_edit_trigger' . ( $img && ! empty( $img['p_img_large'][0] ) ? ' image-exists' : '' ) . '\">' . esc_html__( 'Add image',\n\t\t\t\t\t'amely' ) . '</a>' );\n\t\t\t$output .= $this->outputCustomTitle( $this->settings['name'] );\n\t\t} elseif ( ! empty( $param['holder'] ) ) {\n\t\t\tif ( 'input' === $param['holder'] ) {\n\t\t\t\t$output .= '<' . $param['holder'] . ' readonly=\"true\" class=\"wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '\" name=\"' . $param_name . '\" value=\"' . $value . '\">';\n\t\t\t} elseif ( in_array( $param['holder'],\n\t\t\t\tarray(\n\t\t\t\t\t'img',\n\t\t\t\t\t'iframe',\n\t\t\t\t) ) ) {\n\t\t\t\t$output .= '<' . $param['holder'] . ' class=\"wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '\" name=\"' . $param_name . '\" src=\"' . $value . '\">';\n\t\t\t} elseif ( 'hidden' !== $param['holder'] ) {\n\t\t\t\t$output .= '<' . $param['holder'] . ' class=\"wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '\" name=\"' . $param_name . '\">' . $value . '</' . $param['holder'] . '>';\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $param['admin_label'] ) && true === $param['admin_label'] ) {\n\t\t\t$output .= '<span class=\"vc_admin_label admin_label_' . $param['param_name'] . ( empty( $value ) ? ' hidden-label' : '' ) . '\"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';\n\t\t}\n\n\t\treturn $output;\n\t}", "function printTextInput($isPro,$options, $label, $id, $description, $type = 'text', $url='', $showSave = false) {\r\n if (empty($options[$id])) {\r\n $options[$id] = '';\r\n }\r\n \r\n $offset = '';\r\n if (ai_startsWith($label, 'i-')) {\r\n $offset = 'class=\"'.substr($label,0, 5).'\" ';\r\n $label = substr($label, 5);\r\n }\r\n if (!isset($options['demo']) || $options['demo'] == 'false') {\r\n $isPro = false;\r\n }\r\n $pro_class = $isPro ? ' class=\"ai-pro\"':'';\r\n\r\n if ($isPro) {\r\n $label = '<span alt=\"Pro feature\" title=\"Pro feature\">'.$label.'</span>';\r\n }\r\n\r\n echo '\r\n <tr'.$pro_class.'>\r\n <th scope=\"row\" '.$offset.'>' . $label . renderExampleIcon($url) . renderExternalWorkaroundIcon($showSave). '</th>\r\n <td><span class=\"hide-print\">\r\n <input name=\"' . $id . '\" type=\"' . $type . '\" id=\"' . $id . '\" value=\"' . esc_attr($options[$id]) . '\" /><br></span>\r\n <p class=\"description\">' . $description . '</p></td>\r\n </tr>\r\n ';\r\n}", "public function getTemplateExample()\n\t{\n\t\t// start form\n\t\t$value = \"\\n\";\n\t\t$value .= '{form:' . $this->getName() . \"}\\n\";\n\n\t\t/**\n\t\t * At first all the hidden fields need to be added to this form, since\n\t\t * they're not shown and are best to be put right beneath the start of the form tag.\n\t\t */\n\t\tforeach($this->getFields() as $object)\n\t\t{\n\t\t\t// is a hidden field\n\t\t\tif(($object instanceof SpoonFormHidden) && $object->getName() != 'form')\n\t\t\t{\n\t\t\t\t$value .= \"\\t\" . '{$hid' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . \"}\\n\";\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Add all the objects that are NOT hidden fields. Based on the existance of some methods\n\t\t * errors will or will not be shown.\n\t\t */\n\t\tforeach($this->getFields() as $object)\n\t\t{\n\t\t\t// NOT a hidden field\n\t\t\tif(!($object instanceof SpoonFormHidden))\n\t\t\t{\n\t\t\t\t// buttons\n\t\t\t\tif($object instanceof SpoonFormButton)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$btn' . SpoonFilter::toCamelCase($object->getName()) . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// single checkboxes\n\t\t\t\telseif($object instanceof SpoonFormCheckbox)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$chk' . SpoonFilter::toCamelCase($object->getName()) . '} {$chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// multi checkboxes\n\t\t\t\telseif($object instanceof SpoonFormMultiCheckbox)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<div{option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<p class=\"label\">' . SpoonFilter::toCamelCase($object->getName()) . '</p>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$chk' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<ul class=\"inputList\">' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\\t\" . '<li><label for=\"{$' . $object->getName() . '.id}\">{$' . $object->getName() . '.chk' . SpoonFilter::toCamelCase($object->getName()) . '} {$' . $object->getName() . '.label}</label></li>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{/iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '</ul>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</div>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// dropdowns\n\t\t\t\telseif($object instanceof SpoonFormDropdown)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . 'Error} class=\"errorArea\"{/option:ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . '} {$ddm' . str_replace('[]', '', SpoonFilter::toCamelCase($object->getName())) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// imagefields\n\t\t\t\telseif($object instanceof SpoonFormImage)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$file' . SpoonFilter::toCamelCase($object->getName()) . '} <span class=\"helpTxt\">{$msgHelpImageField}</span> {$file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// filefields\n\t\t\t\telseif($object instanceof SpoonFormFile)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$file' . SpoonFilter::toCamelCase($object->getName()) . '} {$file' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// radiobuttons\n\t\t\t\telseif($object instanceof SpoonFormRadiobutton)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<div{option:rbt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:rbt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<p class=\"label\">' . SpoonFilter::toCamelCase($object->getName()) . '</p>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$rbt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<ul class=\"inputList\">' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\\t\" . '<li><label for=\"{$' . $object->getName() . '.id}\">{$' . $object->getName() . '.rbt' . SpoonFilter::toCamelCase($object->getName()) . '} {$' . $object->getName() . '.label}</label></li>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\\t\" . '{/iteration:' . $object->getName() . '}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '</ul>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</div>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// datefields\n\t\t\t\telseif($object instanceof SpoonFormDate)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$txt' . SpoonFilter::toCamelCase($object->getName()) . '} <span class=\"helpTxt\">{$msgHelpDateField}</span> {$txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// timefields\n\t\t\t\telseif($object instanceof SpoonFormTime)\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$txt' . SpoonFilter::toCamelCase($object->getName()) . '} <span class=\"helpTxt\">{$msgHelpTimeField}</span> {$txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\n\t\t\t\t// textfields\n\t\t\t\telseif(($object instanceof SpoonFormPassword) || ($object instanceof SpoonFormTextarea) || ($object instanceof SpoonFormText))\n\t\t\t\t{\n\t\t\t\t\t$value .= \"\\t\" . '<p{option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error} class=\"errorArea\"{/option:txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '<label for=\"' . $object->getAttribute('id') . '\">' . SpoonFilter::toCamelCase($object->getName()) . '</label>' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\\t\" . '{$txt' . SpoonFilter::toCamelCase($object->getName()) . '} {$txt' . SpoonFilter::toCamelCase($object->getName()) . 'Error}' . \"\\n\";\n\t\t\t\t\t$value .= \"\\t\" . '</p>' . \"\\n\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $value . '{/form:' . $this->getName() . '}';\n\t}", "public function get_input_template() {\n\t\t$options = $this->build_options();\n\n\t\treturn '<ul %s>' . $options . '</ul>';\n\t}", "function HTMLText ($params) {\n if (!isset($params['name'])) {\n if (isset($params['id'])) {\n $params['name'] = $params['id'];\n }\n }\n $val = $params['value'];\n unset($params['value']);\n $str = '';\n foreach ($params as $k=>$v) {\n $str .= \" {$k}=\\\"{$v}\\\"\";\n }\n return \"<textarea {$str} >{$val}</textarea>\";\n }", "function editor_element($params)\n\t\t{\n\t\t\t$params['innerHtml'] = \"<img src='\".$this->config['icon'].\"' title='\".$this->config['name'].\"' />\";\n\t\t\t$params['innerHtml'].= \"<div class='avia-element-label'>\".$this->config['name'].\"</div>\";\n\t\t\t$params['content'] \t = NULL; //remove to allow content elements\n\t\t\treturn $params;\n\t\t}", "protected function generateTag() {\n $this->callFormFactoryFunction('open',[$this->formTemplate['parameters']['id']],$this->formTemplate['methods']);\n\n parent::generateTag();\n\n }", "function param(string $name, string $value, string $type = 'ref', string $attributes = ''): string\n {\n return '<param name=\"' . $name\n . '\" type=\"' . $type\n . '\" value=\"' . $value\n . '\" ' . $attributes . _solidus() . '>';\n }", "public function generate()\n\t{\n\t\t$strValues = '';\n\t\t$arrValues = array();\n\n\t\tif (!empty($this->varValue)) // Can be an array\n\t\t{\n\t\t\t$strValues = implode(',', array_map('intval', (array)$this->varValue));\n\t\t\t$objPages = $this->Database->execute(\"SELECT id, title, alias, type, hide, protected, published, start, stop FROM tl_page WHERE id IN($strValues) ORDER BY \" . $this->Database->findInSet('id', $strValues));\n\n\t\t\twhile ($objPages->next())\n\t\t\t{\n\t\t\t\t$arrValues[] = $this->generateImage($this->getPageStatusIcon($objPages)) . ' ' . $objPages->title . ' (' . $objPages->alias . $GLOBALS['TL_CONFIG']['urlSuffix'] . ')';\n\t\t\t}\n\t\t}\n\n\t\treturn '<input type=\"hidden\" name=\"'.$this->strName.'\" id=\"ctrl_'.$this->strId.'\" value=\"'.$strValues.'\">\n <div class=\"selector_container\" id=\"target_'.$this->strId.'\">\n <ul><li>' . implode('</li><li>', $arrValues) . '</li></ul>\n <p><a href=\"contao/page.php?table='.$this->strTable.'&amp;field='.$this->strField.'&amp;id='.\\Input::get('id').'&amp;value='.$strValues.'\" class=\"tl_submit\" onclick=\"Backend.getScrollOffset();Backend.openModalSelector({\\'width\\':765,\\'title\\':\\''.$GLOBALS['TL_LANG']['MOD']['page'][0].'\\',\\'url\\':this.href,\\'id\\':\\''.$this->strId.'\\'});return false\">'.$GLOBALS['TL_LANG']['MSC']['changeSelection'].'</a></p>\n </div>';\n\t}", "function editor_element($params)\n {\n $params['innerHtml'] = \"<img src='\".$this->config['icon'].\"' title='\".$this->config['name'].\"' />\";\n $params['innerHtml'].= \"<div class='avia-element-label'>\".$this->config['name'].\"</div>\";\n $params['content'] \t = NULL; //remove to allow content elements\n\n return $params;\n }", "public function help_parameters(&$details) {\n\t\t// @todo Add in which environment to use.\n\t}", "public function render()\n {\n return sprintf(\n ':param %s %s: %s',\n $this->renderType(),\n $this->getName(),\n $this->getDesc()\n );\n }", "static function vox_html($utterance, $params){\n\n\t\textract(self::vox_prep_args($params) );\n\n\t\t$tag = (!isset($tag)) ? 'pre' : $tag;\n\t\t$label = (!isset($label)) ? '' : $label;\n\n\t\t$articulation = sprintf('<%s class=\"vox\">%s%s</%s><!-- /.vox -->', $tag, $label, $utterance, $tag);\n\n\t\treturn $articulation;\n\n\t}", "protected function toHtml()\n\t{\n\t\t// parameter is hexadecimal number\n\t\treturn \"&#x{$this->parameter};\";\n\t}", "function get_tag()\n {\n\t $id = 'id=\"'.$this->OP_[id]->get().'\"';\n\t $name='name=\"'.$this->OP_[name]->get().'\"';\n\t $value='value=\"'.$this->OP_[value]->get().'\"';\n\t $type='type=\"hidden\"';\n\t $my_value = \"<input $id $name $type $value>\";\n\t return $my_value;\n }", "function get_page_parameter($parameter, $ziel = 'dump')\n{\n $page_parameter = '<form action=\"' . $ziel . '.php\" method=\"POST\" name=\"' . $ziel . '\">' . \"\\n\";\n foreach ($parameter as $key => $val) {\n if (is_array($val)) {\n foreach ($val as $key2 => $val2) {\n $page_parameter .= '<input type=\"hidden\" name=\"' . $key . '[' . $key2 . ']' . '\" value=\"' . $val2 . '\">'\n . \"\\n\";\n }\n } else {\n $page_parameter .= '<input type=\"hidden\" name=\"' . $key . '\" value=\"' . $val . '\">' . \"\\n\";\n }\n }\n $page_parameter .= '</form>';\n\n return $page_parameter;\n}", "function display($tag , $value) {\n echo $tag . $value ;\n }", "protected static function generateHtml($name, $tags, $type) {\n $paramList = self::ParamList();\n $paramList = $paramList[$type];\n $structureList = self::StructureList();\n $structureList = $structureList[$type];\n $eventList = self::EventList();\n $eventList = $eventList[$type];\n\n $params = '';\n foreach ($tags as $key => $value) {\n echo \"'\".addslashes($value).\"'\".\"<br /><br />\";\n if (in_array($key, $paramList) || in_array($key, $eventList)) {\n $params .= htmlspecialchars($key).\"='\".addslashes($value).\"' \";\n } else {\n trigger_error(\"No such attribute - $key - for this HTML element\", E_USER_WARNING);\n }\n }\n $html = str_replace(\"###\", $params, $structureList);\n $html = str_replace(\"$$$\", $name, $html);\n return $html;\n }", "protected function _toHtml()\n{\n// use arguments like $this->getMyParam1() , $this->getAnotherParam()\n \nreturn $html;\n}", "public function generateFormProperites(){\r\n\t\t$formProperties = $this->formProperties;\r\n\t\t$formTags = '<form ';\r\n\t\tif(sizeof($formProperties) > 0) {\r\n\t\t\tforeach($formProperties as $key=>$params){\r\n\t\t\t\t$formTags .= $key.'=\"'.$params.'\" ';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$formTags\t\t.= '>';\r\n\t\treturn $formTags;\r\n\t}", "function paramDetailToOptionStr($paramDetail) {\n $this->printDebugMessage('paramDetailToOptionStr', 'Begin', 1);\n $retStr = '';\n if(isset($paramDetail->values)) {\n foreach($paramDetail->values->value as $val) {\n\tif($val->defaultValue && $val->defaultValue == 'true') {\n\t $retStr .= \"<option selected=\\\"1\\\" value=\\\"$val->value\\\">$val->label</option>\\n\";\n\t}\n\telse {\n\t $retStr .= \"<option value=\\\"$val->value\\\">$val->label</option>\\n\";\n\t}\n }\n }\n $this->printDebugMessage('paramDetailToOptionStr', 'End', 1);\n return $retStr;\n }", "public function getHTML() {\t\n\t\t$html = '';\n\t\tif ($this->type != 'title') $html.= '<p>'.\"\\n\";\n\t\tif ($this->type != 'info' && $this->type != 'system' && $this->type != 'title') \n\t\t\t{\t\t\t\n\t\t\t$html.= '<label id=\"label_for_'. $this->name . '\" name=\"label_for_'. $this->name . '\" for=\"'. $this->name . '\">';\n\t\t\t// special check for files item\n\t\t\tif ($this->type == 'file')\n\t\t\t\t{\n\t\t\t\tif (file_exists($_SERVER['DOCUMENT_ROOT'].'/uploads/' . $this->name))\n\t\t\t\t\t{\n\t\t\t\t\t$html.= '<a href = \"/uploads/'. $this->name .'\">'.$this->label.'</a> \n\t\t\t\t\t\t(<a href=\"javascript:void Messi.ask(\\''.DELETE.' ' .$this->name.' ?\\', \n\t\t\t\t\t\tfunction(val) { if(val==\\'Y\\') formSubmit(\\'delete\\',\\'' . $this->name . '\\');});\">'.DELETE.'</a>)';\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t$html.= $this->label.' ('.NONE.')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t$html.= $this->label;\n\t\t\t\t}\n\t\t\t$html.= '</label>'.\"\\n\";\n\t\t\t}\n\t\t// add dependence of the item for js managing in user interface\n\t\tif ($this->depend != 'none' or $this->depend != '') {\n\t\t\t$html.= '<input type=\"hidden\" id=\"dependance_for_'. $this->name . '\" value=\"'. $this->depend . '\" />'.\"\\n\";\n\t\t}\t\n\t\t$html.= '<input type=\"hidden\" id=\"title_for_'. $this->name . '\" value=\"'. $this->title . '\" />'.\"\\n\";\n\t\tswitch ($this->type)\n\t\t\t{\n\t\t\tcase 'text' : \n\t\t\t\t$html.= '<input id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'password' : \n\t\t\t\t$html.= '<input type=\"password\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'checkbox' : \n\t\t\t\t$html.= '<input type=\"checkbox\" id=\"'. $this->name . '\" name=\"'. $this->name . '\"' . ( ($this->value == 'on') ? \" \n\t\t\t\t\tchecked \" : \"\") . ' onchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'file' : \n\t\t\t\t$html.= '<input type=\"file\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'select' :\n\t\t\t\t$html.= '<select id=\"'. $this->name . '\" name=\"'. $this->name . '\" onchange=\"display_dependance();\" >'.\"\\n\";\n\t\t\t\t$valuesPossible = explode(',',$this->values);\n\t\t\t\tforeach ($valuesPossible as $valuePossible){\n\t\t\t\t\t$html.= '<option value=\"'. $valuePossible . '\" ' . (($valuePossible == $this->value) ? \" selected \" : \"\") . '>'.\n\t\t\t\t\t(($valuePossible == \"none\") ? NONE : $valuePossible) . '</option>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t$html.= '</select><div style=\"clear:both\"></div>'.\"\\n\";\n\t\t\t\tbreak; \n\n\t\t\tcase 'title' : \n\t\t\t\t$html.= \"\\n\". '<h2>'.$this->label.'</h2><hr />'.\"\\n\\n\";\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t// system action items\n\t\t\tcase 'system' : \n\t\t\t\t// a system item will render a button that submit the form with the configured action name in the config-map.php\n\t\t\t\t$html.= '<label></label><input class=\"button\" type=\"button\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'.$this->label.'\" \n\t\t\t\tonclick=\"new Messi(\\''.addslashes($this->help).'\\', {\n\t\t\t\t\ttitle: \\''.addslashes($this->label).'?\\', \n\t\t\t\t\tmodal: true, buttons: [{id: 0, label: \\''.YES.'\\', val: \\'Y\\'}, {id: 1, label: \\''.NO.'\\', val: \\'N\\'}], \n\t\t\t\t\tcallback: function(val) { if(val==\\'Y\\') {openTerminal();formSubmit(\\''.$this->values.'\\');}}});\" />';\n\t\t\t\tbreak;\n\n\t\t\tcase 'html' : \n\t\t\t\t// this is only arbitrary html code to display\n\t\t\t\t$html.= $this->value;\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * HERE YOU CAN ADD THE TYPE RENDERER YOU NEED\n\t\t\t *\n\t\t\t * case 'YOUR_TYPE' : \n\t\t\t *\t$html.= 'ANY_HTML_CODE_TO_RENDER';\n\t\t\t *\tbreak;\n\t\t\t */\n\n\t\t\tdefault : \n\t\t\t\t$html.= '<b>'.NO_METHOD_TO_RENDER_THIS_ITEM .'</b><br />Item : '.$this->name. '<br />Type : '.$this->type. '<br />'.\"\\n\"; \n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\tif ($this->type != 'title') $html.= '</p>'.\"\\n\"; \t\t\n\t\treturn $html;\n\t}", "function paramDetailToLabelStr($parameterId, $paramDetail) {\n $this->printDebugMessage('paramDetailToLabelStr', 'Begin', 1);\n $helpUrl = '?paramDetail=' . $parameterId;\n $retStr = '<a href=\"' . $helpUrl . '\">' . $paramDetail->name .'</a>: ';\n $this->printDebugMessage('paramDetailToLabelStr', 'End', 1);\n return $retStr;\n }", "protected function input()\n {\n return '<input type=\"' . $this->property->input_type . '\" placeholder=\"Значение\" ' .\n 'name=\"property[' . $this->property->id . ']\" class=\"form-control\">';\n }", "public static function get_params() {\n\t\t\t$params = array(\n\t\t\t\t// General\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading',\n\t\t\t\t\t'value' => 'Sample Heading',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textarea_html',\n\t\t\t\t\t'holder' => 'div',\n\t\t\t\t\t'heading' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content',\n\t\t\t\t\t'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed faucibus feugiat convallis. Integer nec eros et risus condimentum tristique vel vitae arcu.',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Element ID', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'unique_id',\n\t\t\t\t\t'admin_label' => true,\n\t\t\t\t\t'description' => vcex_shortcode_param_description( 'unique_id' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Extra class name', 'total-theme-core' ),\n\t\t\t\t\t'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'classes',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_visibility',\n\t\t\t\t\t'heading' => esc_html__( 'Visibility', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'visibility',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_hover_animations',\n\t\t\t\t\t'heading' => esc_html__( 'Hover Animation', 'total-theme-core'),\n\t\t\t\t\t'param_name' => 'hover_animation',\n\t\t\t\t),\n\t\t\t\tvcex_vc_map_add_css_animation(),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Animation Duration', 'total'),\n\t\t\t\t\t'param_name' => 'animation_duration',\n\t\t\t\t\t'description' => esc_html__( 'Enter your custom time in seconds (decimals allowed).', 'total'),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Animation Delay', 'total'),\n\t\t\t\t\t'param_name' => 'animation_delay',\n\t\t\t\t\t'description' => esc_html__( 'Enter your custom time in seconds (decimals allowed).', 'total'),\n\t\t\t\t),\n\t\t\t\t// Style\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'style',\n\t\t\t\t\t'value' => array(\n\t\t\t\t\t\tesc_html__( 'Default', 'total-theme-core' ) => '',\n\t\t\t\t\t\tesc_html__( 'Plain', 'total-theme-core' ) => 'one',\n\t\t\t\t\t\tesc_html__( 'Boxed Rounded', 'total-theme-core' ) => 'two',\n\t\t\t\t\t\tesc_html__( 'Boxed Square', 'total-theme-core' ) => 'three',\n\t\t\t\t\t\tesc_html__( 'Outline', 'total-theme-core' ) => 'four',\n\t\t\t\t\t),\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Bottom Margin', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'bottom_margin',\n\t\t\t\t\t'value' => vcex_margin_choices(),\n\t\t\t\t\t'admin_label' => true,\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Shadow', 'total' ),\n\t\t\t\t\t'param_name' => 'shadow',\n\t\t\t\t\t'value' => vcex_shadow_choices(),\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_text_alignments',\n\t\t\t\t\t'heading' => esc_html__( 'Text Align', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'text_align',\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_trbl',\n\t\t\t\t\t'heading' => esc_html__( 'Padding', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'padding',\n\t\t\t\t\t'dependency' => array( 'element' => 'style', 'value' => array( 'two', 'three' ) ),\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_colorpicker',\n\t\t\t\t\t'heading' => esc_html__( 'Background Color', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'background',\n\t\t\t\t\t'dependency' => array( 'element' => 'style', 'value' => array( 'two', 'three' ) ),\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_colorpicker',\n\t\t\t\t\t'heading' => esc_html__( 'Border Color', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'border_color',\n\t\t\t\t\t'dependency' => array( 'element' => 'style', 'value' => array( 'four' ) ),\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Border Radius', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'border_radius',\n\t\t\t\t\t'dependency' => array( 'element' => 'style', 'value' => array( 'two', 'three', 'four' ) ),\n\t\t\t\t\t'group' => esc_html__( 'Style', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\t// Heading\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_colorpicker',\n\t\t\t\t\t'heading' => esc_html__( 'Color', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_color',\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_select_buttons',\n\t\t\t\t\t'heading' => esc_html__( 'Tag', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_type',\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t\t'std' => 'h2',\n\t\t\t\t\t'choices' => 'html_tag',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_font_family_select',\n\t\t\t\t\t'heading' => esc_html__( 'Font Family', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_font_family',\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_font_weight',\n\t\t\t\t\t'heading' => esc_html__( 'Font Weight', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_weight',\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_text_transforms',\n\t\t\t\t\t'heading' => esc_html__( 'Text Transform', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_transform',\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_responsive_sizes',\n\t\t\t\t\t'target' => 'font-size',\n\t\t\t\t\t'heading' => esc_html__( 'Font Size', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_size',\n\t\t\t\t\t'description' => vcex_shortcode_param_description( 'font_size' ),\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_trbl',\n\t\t\t\t\t'heading' => esc_html__( 'Margin', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_margin',\n\t\t\t\t\t'description' => vcex_shortcode_param_description( 'margin' ),\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Letter Spacing', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'heading_letter_spacing',\n\t\t\t\t\t'description' => vcex_shortcode_param_description( 'letter_spacing' ),\n\t\t\t\t\t'group' => esc_html__( 'Heading', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\t// Content\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Top Spacing', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content_top_margin',\n\t\t\t\t\t'value' => vcex_margin_choices(),\n\t\t\t\t\t'group' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_colorpicker',\n\t\t\t\t\t'heading' => esc_html__( 'Background', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content_background',\n\t\t\t\t\t'group' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_colorpicker',\n\t\t\t\t\t'heading' => esc_html__( 'Color', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content_color',\n\t\t\t\t\t'group' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_trbl',\n\t\t\t\t\t'heading' => esc_html__( 'Margin', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content_margin',\n\t\t\t\t\t'description' => vcex_shortcode_param_description( 'margin' ),\n\t\t\t\t\t'group' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_trbl',\n\t\t\t\t\t'heading' => esc_html__( 'Padding', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content_padding',\n\t\t\t\t\t'description' => vcex_shortcode_param_description( 'padding' ),\n\t\t\t\t\t'group' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_responsive_sizes',\n\t\t\t\t\t'target' => 'font-size',\n\t\t\t\t\t'heading' => esc_html__( 'Font Size', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content_font_size',\n\t\t\t\t\t'description' => vcex_shortcode_param_description( 'font_size' ),\n\t\t\t\t\t'group' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_font_weight',\n\t\t\t\t\t'heading' => esc_html__( 'Font Weight', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'content_font_weight',\n\t\t\t\t\t'group' => esc_html__( 'Content', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\t// Media\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Source', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'image_source',\n\t\t\t\t\t'std' => 'media_library',\n\t\t\t\t\t'value' => array(\n\t\t\t\t\t\tesc_html__( 'Media Library', 'total-theme-core' ) => 'media_library',\n\t\t\t\t\t\tesc_html__( 'External', 'total-theme-core' ) => 'external',\n\t\t\t\t\t),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'attach_image',\n\t\t\t\t\t'heading' => esc_html__( 'Image', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'image',\n\t\t\t\t\t'dependency' => array( 'element' => 'image_source', 'value' => 'media_library' ),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'External Image URL', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'external_image',\n\t\t\t\t\t'dependency' => array( 'element' => 'image_source', 'value' => 'external' ),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Image Alt', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'image_alt',\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t\t'dependency' => array( 'element' => 'image', 'not_empty' => true ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Video link', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'video',\n\t\t\t\t\t'description' => esc_html__( 'Enter in a video URL that is compatible with WordPress\\'s built-in oEmbed feature.', 'total-theme-core' ),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_select_buttons',\n\t\t\t\t\t'heading' => esc_html__( 'Image Style', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_style',\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'choices' => array(\n\t\t\t\t\t\t'' => esc_html__( 'Auto', 'total-theme-core' ),\n\t\t\t\t\t\t'stretch' => esc_html__( 'Stretch', 'total-theme-core' ),\n\t\t\t\t\t),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_text_alignments',\n\t\t\t\t\t'heading' => esc_html__( 'Align', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_align',\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Border Radius', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_border_radius',\n\t\t\t\t\t'value' => vcex_border_radius_choices(),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Bottom Margin', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_bottom_margin',\n\t\t\t\t\t'value' => vcex_margin_choices(),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_image_sizes',\n\t\t\t\t\t'heading' => esc_html__( 'Image Size', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_size',\n\t\t\t\t\t'std' => 'wpex_custom',\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t\t'dependency' => array( 'element' => 'image_source', 'value' => 'media_library' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_image_crop_locations',\n\t\t\t\t\t'heading' => esc_html__( 'Image Crop Location', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_crop',\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t\t'dependency' => array( 'element' => 'img_size', 'value' => 'wpex_custom' ),\n\t\t\t\t\t'dependency' => array( 'element' => 'image_source', 'value' => 'media_library' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Image Crop Width', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_width',\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t\t'dependency' => array( 'element' => 'img_size', 'value' => 'wpex_custom' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Image Crop Height', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_height',\n\t\t\t\t\t'description' => esc_html__( 'Leave empty to disable vertical cropping and keep image proportions.', 'total-theme-core' ),\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t\t'dependency' => array( 'element' => 'img_size', 'value' => 'wpex_custom' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_image_filters',\n\t\t\t\t\t'heading' => esc_html__( 'Image Filter', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_filter',\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_image_hovers',\n\t\t\t\t\t'heading' => esc_html__( 'CSS3 Image Hover', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'img_hover_style',\n\t\t\t\t\t'group' => esc_html__( 'Media', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\t// Link\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vc_link',\n\t\t\t\t\t'heading' => esc_html__( 'URL', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'url',\n\t\t\t\t\t'group' => esc_html__( 'Link', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'vcex_ofswitch',\n\t\t\t\t\t'heading' => esc_html__( 'Local Scroll', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'url_local_scroll',\n\t\t\t\t\t'group' => esc_html__( 'Link', 'total-theme-core' ),\n\t\t\t\t\t'std' => 'false',\n\t\t\t\t),\n\t\t\t\t// CSS\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'css_editor',\n\t\t\t\t\t'heading' => esc_html__( 'CSS box', 'total-theme-core' ),\n\t\t\t\t\t'param_name' => 'css',\n\t\t\t\t\t'group' => esc_html__( 'CSS', 'total-theme-core' ),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn apply_filters( 'vcex_shortcode_params', $params, 'vcex_teaser' );\n\n\t\t}", "public function html(){\n\n $all = [];\n $all['id'] = $this->id;\n $all['item'] = $this;\n $all['fields'] = $this->getFields();\n\n foreach ($this->getParams() as $key => $value) {\n $all['p_' . $key] = $value;\n }\n\n return view('components.' . $this->component->name . '.print' , $all)->render();\n }", "function cp_print_button($type,$value,$name){\r\n return '<span class=\"btn-wrapper\"><input type=\"'.$type.'\" class=\"btn\" value=\"'.$value.'\" name=\"'.$name.'\"></span>';\r\n}", "function wp_idolondemand_get_parametric_values($args) {\n\textract($args);\n\techo $before_widget;\n\techo $before_title;?>get_parametric_values<?php echo $after_title;\n\tdisplay_wp_idolondemand_get_parametric_values();\n\techo $after_widget;\n}", "function _get_details_comcode_tags()\n{\n\t$tag_list=array(\n\t\t'list'=>array('param'),\n\t\t'indent'=>array('param'),\n\t\t'ins'=>array('cite','datetime'),\n\t\t'del'=>array('cite','datetime'),\n\t\t'b'=>array(),\n\t\t'u'=>array(),\n\t\t'i'=>array(),\n\t\t's'=>array(),\n\t\t'sup'=>array(),\n\t\t'sub'=>array(),\n\t\t'size'=>array('param'),\n\t\t'color'=>array('param'),\n\t\t'highlight'=>array(),\n\t\t'font'=>array('param','color','size'),\n\t\t'align'=>array('param'),\n\t\t'left'=>array(),\n\t\t'center'=>array(),\n\t\t'right'=>array(),\n\t\t'abbr'=>array('param'),\n\t\t'box'=>array('float','dimensions','type','options','param'),\n\t\t'quote'=>array('param','saidless','cite'),\n\t\t'cite'=>array(),\n\t\t'samp'=>array(),\n\t\t'q'=>array(),\n\t\t'var'=>array(),\n\t\t'dfn'=>array(),\n\t\t'address'=>array(),\n\t\t'title'=>array('param','sub','number','base'),\n\t\t'contents'=>array('files','zone','levels','base'),\n\t\t'include'=>array('param'),\n\t\t'concepts'=>array('x_key','x_value'),\n\t\t'concept'=>array('param'),\n\t\t'staff_note'=>array(),\n\t\t'menu'=>array('param','type'),\n\t\t'surround'=>array('param'),\n\t\t'php'=>array('scroll','numbers'),\n\t\t'codebox'=>array('param','numbers'),\n\t\t'sql'=>array('scroll','numbers'),\n\t\t'code'=>array('param','scroll','numbers'),\n\t\t'tt'=>array(),\n\t\t'no_parse'=>array(),\n\t\t'semihtml'=>array(),\n\t\t'html'=>array(),\n\t\t'overlay'=>array('param','x','y','width','height','timein','timeout'),\n\t\t'random'=>array('string','X'),\n\t\t'pulse'=>array('param','min','max'),\n\t\t'ticker'=>array('param','speed'),\n\t\t'shocker'=>array('left','right','min','max'),\n\t\t'jumping'=>array('string'),\n\t\t'sections'=>array('default','name'),\n\t\t/*'section_controller'=>array(),*/\n\t\t'big_tabs'=>array('default','switch_time','name'),\n\t\t/*'big_tab_controller'=>array(),*/\n\t\t/*'tab'=>array('param'),*/\n\t\t'tabs'=>array('default','name'),\n\t\t'carousel'=>array('param'),\n\t\t'hide'=>array('param'),\n\t\t'tooltip'=>array('param'),\n\t\t/*'block'=>array(),*/\n\t\t'if_in_group'=>array('param','type'),\n\t\t'flash'=>array('param'),\n\t\t'img'=>array('align','float','param','title','rollover','refresh_time'),\n\t\t'upload'=>array('type','param'),\n\t\t'exp_thumb'=>array('float'),\n\t\t'exp_ref'=>array('param'),\n\t\t'thumb'=>array('align','param','caption','float'),\n\t\t'url'=>array('param','title','target'),\n\t\t'email'=>array('param','title','subject','body'),\n\t\t'reference'=>array('type','param'),\n\t\t'page'=>array('param'),\n\t\t'snapback'=>array('param','forum'),\n\t\t'post'=>array('param','forum'),\n\t\t'topic'=>array('param','forum'),\n\t\t'attachment'=>array('description','filename','type','thumb','float','align','width','height','thumb_url'),\n\t);\n\n\t//'attachment_safe'=>array('description','filename','type','width','height','align','float','thumb_url'),\tMerged into attachment in UI\n\n\tif (addon_installed('ecommerce'))\n\t{\n\t\t$tag_list['currency']=array('param','bracket');\n\t}\n\n\tksort($tag_list);\n\n\t/* // Helps find missing tags\n\tunset($VALID_COMCODE_TAGS['section']);\n\tunset($VALID_COMCODE_TAGS['section_controller']);\n\tunset($VALID_COMCODE_TAGS['tab']);\n\tunset($VALID_COMCODE_TAGS['big_tab']);\n\tunset($VALID_COMCODE_TAGS['big_tab_cntroller']);\n\tunset($VALID_COMCODE_TAGS['acronym']);\n\tunset($VALID_COMCODE_TAGS['internal_table']);\n\tunset($VALID_COMCODE_TAGS['external_table']);\n\tunset($VALID_COMCODE_TAGS['acronym']);\n\tunset($VALID_COMCODE_TAGS['block']);\n\tunset($VALID_COMCODE_TAGS['attachment']);\n\tunset($VALID_COMCODE_TAGS['attachment2']);\n\tunset($VALID_COMCODE_TAGS['attachment_safe']);\n\tunset($VALID_COMCODE_TAGS['thread']);\n\tforeach (array_keys($tag_list) as $tag)\n\t{\n\t\tglobal $VALID_COMCODE_TAGS;\n\t\tunset($VALID_COMCODE_TAGS[$tag]);\n\t}\n\t@var_dump($VALID_COMCODE_TAGS);exit();*/\n\t$custom_tag_list=array();\n\n\tglobal $DANGEROUS_TAGS,$TEXTUAL_TAGS;\n\n\tif ((get_forum_type()=='ocf') && (addon_installed('custom_comcode')))\n\t{\n\t\t$custom_tags=$GLOBALS['FORUM_DB']->query_select('custom_comcode',array('tag_title','tag_description','tag_example','tag_parameters','tag_replace','tag_tag','tag_dangerous_tag','tag_block_tag','tag_textual_tag'),array('tag_enabled'=>1));\n\t\tforeach ($custom_tags as $tag)\n\t\t{\n\t\t\t$custom_tag_list[$tag['tag_tag']]=$tag;\n\t\t\tif ($tag['tag_textual_tag']==1) $TEXTUAL_TAGS[$tag['tag_tag']]=1;\n\t\t\tif ($tag['tag_dangerous_tag']==1) $DANGEROUS_TAGS[$tag['tag_tag']]=1;\n\t\t}\n\t\tif ((isset($GLOBALS['FORUM_DB'])) && ($GLOBALS['SITE_DB']->connection_write!=$GLOBALS['FORUM_DB']->connection_write))\n\t\t{\n\t\t\t$custom_tags=$GLOBALS['SITE_DB']->query_select('custom_comcode',array('tag_title','tag_description','tag_example','tag_parameters','tag_replace','tag_tag','tag_dangerous_tag','tag_block_tag','tag_textual_tag'),array('tag_enabled'=>1));\n\t\t\tforeach ($custom_tags as $tag)\n\t\t\t{\n\t\t\t\t$custom_tag_list[$tag['tag_tag']]=$tag;\n\t\t\t\tif ($tag['tag_textual_tag']==1) $TEXTUAL_TAGS[$tag['tag_tag']]=1;\n\t\t\t\tif ($tag['tag_dangerous_tag']==1) $DANGEROUS_TAGS[$tag['tag_tag']]=1;\n\t\t\t}\n\t\t}\n\t}\n\n\t// From Comcode hooks\n\t$hooks=find_all_hooks('systems','comcode');\n\tforeach (array_keys($hooks) as $hook)\n\t{\n\t\trequire_code('hooks/systems/comcode/'.filter_naughty_harsh($hook));\n\t\t$object=object_factory('Hook_comcode_'.filter_naughty_harsh($hook),true);\n\n\t\t$tag=$object->get_tag();\n\t\t$custom_tag_list[$tag['tag_tag']]=$tag;\n\n\t\tif ($tag['tag_textual_tag']==1) $TEXTUAL_TAGS[$tag['tag_tag']]=1;\n\t\tif ($tag['tag_dangerous_tag']==1) $DANGEROUS_TAGS[$tag['tag_tag']]=1;\n\t}\n\n\treturn array($tag_list,$custom_tag_list);\n}", "function showDetailsPair($tag, $value) {\n\t/**\n\t* 2016-03-16 INFO: AHH\n\t* Don't use <p> to space because the style sheet changes the color on a p\n\t*/\n\techo \"<div style=\\\"padding-top:20px;\\\">$tag<br />$value</div>\";\n}", "function print_custom($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title.'<br/><br/><br/>';\n\t\t\n\t\t$field_ids=array();\n\t\t$field_names=array();\n\t\t$is_textarea=array();\n\t\t\n\t\tforeach($value['fields'] as $field){\n\t\t\techo '<div class=\"custom-option\"><span class=\"custom-heading\">'.$field['name'].'</span>';\n\t\t\tswitch($field['type']){\n\t\t\t\tcase 'text':\n\t\t\t\t\t//print a standart text field\n\t\t\t\t\techo '<input type=\"text\" id=\"'.$field['id'].'\" name=\"'.$field['id'].'\"/>';\n\t\t\t\t\t$is_textarea[]=\"false\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'upload':\n\t\t\t\t\t//print a field with an upload button\n\t\t\t\t\techo '<input class=\"option-input upload\" name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" type=\"text\" />';\n\t\t\t\t\techo '<div id=\"'.$field['id'].'_button\" class=\"upload-button upload-logo\" ><a class=\"hana-button alignright\"><span>Upload</span></a></div><br/>';\n\t\t\t\t\techo '<script type=\"text/javascript\">jQuery(document).ready(function($){\n\t\t\t\t\t\t\t\thanaOptions.loadUploader(jQuery(\"div#'.$field['id'].'_button\"));\n\t\t\t\t\t\t});</script>';\n\t\t\t\t\t$preview=$field['id'];\n\t\t\t\t\t$is_textarea[]=\"false\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'textarea':\n\t\t\t\t\t//print a textarea\n\t\t\t\t\techo '<textarea id=\"'.$field['id'].'\" name=\"'.$field['id'].'\"></textarea>';\n\t\t\t\t\t$is_textarea[]=\"true\";\n\t\t\t\tbreak;\n\t\t\t\tcase 'imageselect':\n\t\t\t\t\t//print a textarea\n\t\t\t\t\techo '<div class=\"styles-holder images-select-holder\" id=\"'.$field['id'].'_container\">';\n\t\t\t\t\techo '<input name=\"'.$field['id'].'\" id=\"'.$field['id'].'\" type=\"hidden\" /><ul>';\n\t\t\t\t\n\t\t\t\t\t$counter=0;\n\t\t\t\t\tforeach ($field['options'] as $key=>$option) {\n\t\t\t\t\t\t//$style='background-image:url('.$option.');';\n\t\t\t\t\t\techo '<li><a class=\"style-box\" title=\"'.$option.'\" href=\"\"><img src=\"'.$option.'\" /></a>'.$key.'</li>';\n\t\t\t\t\t} \n\t\t\t\t\techo '</ul></div>';\n\t\t\t\t\t$is_textarea[]=\"false\";\n\t\t\t\t\tbreak;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$saved_value=$this->get_field_value( $field['id'].'s');\n\t\t\t\n\t\t\t\n\t\t\t$saved_value=stripslashes($saved_value);\n\t\t\t//echo '<input type=\"hidden\" name=\"'.$field['id'].'s\" id=\"'.$field['id'].'s\" value=\"'.$saved_value.'\" /></div>';\n\t\t\techo '<textarea style=\"display:none;\" name=\"'.$field['id'].'s\" id=\"'.$field['id'].'s\">'.$saved_value.'</textarea></div>';\n\t\t\t$field_ids[]=$field['id'];\n\t\t\t$field_names[]=$field['name'];\n\t\t}\n\t\t\n\t\t//print the add button\n\t\techo '<a class=\"hana-button custom-option-button\" id=\"'.$value['id'].'_button\"><span>'.$value['button_text'].'</span></a>';\n\t\t\n\t\t//print the list that will contain the added items\n\t\techo '<ul id=\"'.$value['id'].'_list\" class=\"sortable\"></ul>';\n\t\t\n\t\t$idsString=implode('\",\"', $field_ids);\n\t\t$namesString=implode('\",\"', $field_names);\n\t\t$textareaString=implode(',', $is_textarea);\n\t\t\n\t\t//call the script that enables the functionality for adding custom fields\n\t\techo '<script type=\"text/javascript\">\n\t\t\tjQuery(document).ready(function($){\n\t\t\t\thanaOptions.setCustomFieldsFunc(\"'.$value['id'].'\", [\"'.$idsString.'\"], [\"'.$namesString.'\"], ['.$textareaString.'] , \"'.((isset($value['preview']))?$value['preview']:'').'\", \"'.HANA_TIMTHUMB_URL.'\");\n\t\t\t});\n\t\t</script>';\n\t\t\n\t\t$this->close_option($value);\n\t}", "public function modelTag($name = NULL, $Model = NULL, $value = NULL, $parameter = NULL, $options = NULL)\n {\n /*\n * Define the root. We can set parent start as perametre so that it can start form any parent\n */\n $inputType = isset($parameter['inputType']) ? $parameter['inputType'] : \"selectTag\";\n $condition = isset($parameter['condition']) ? $parameter['condition'] : \"1=1\";\n $name = ($inputType == \"checkboxTag\") ? $name . \"[checkbox][]\" : $name;\n $parameter['key'] = isset($parameter['key']) ? $parameter['key'] : \"id\";\n $parameter['val'] = isset($parameter['val']) ? $parameter['val'] : \"id\";\n\n /*\n * Requesting for data\n */\n $tmp = App::Model($Model)->findAll($condition);\n\n /*\n * Generate a 1D array for dropdown list\n */\n\n $data_arr = App::Load(\"Helper/Utility\")->get_1d_arr($tmp['data'], $parameter['key'], $parameter['val']);\n\n /*\n * Return the HTML Deopdown list\n */\n return App::Load(\"Helper/Html\")->$inputType($name, $data_arr, $value, $options, $parameter);\n }", "public function renderParamJs() {\n $script = '<script type=\"text/javascript\"> if(typeof TAMI.pagedata ==\"undefined\"){TAMI.pagedata={}; } ';\n\n foreach ($this->paramjs as $key => $val) {\n $script = $script . ' TAMI.pagedata.' . $key . '=' . json_encode($val) . '; ';\n }\n\n $script = $script . ' </script>';\n\n return $script;\n }", "public function p() {\n $args = func_get_args();\n print htmlspecialchars(call_user_func_array(array($this, 'get'), $args));\n }", "function HTMLLink ($params) {\n $val = $params['value'];\n unset($params['value']);\n $str = '';\n foreach ($params as $k=>$v) {\n $str .= \" {$k}=\\\"{$v}\\\"\";\n }\n return \"<a {$str} >{$val}</a>\";\n }", "function editor_sub_element($params)\n {\n $template = $this->update_template(\"title\", \"{{title}}\");\n\t\t\t\t //$imgThumb = $this->update_template(\"src\", \"<img width='50px' src='{{src}}'>\");\n\t\t\t\t $imgThumb = $this->update_template(\"img_fakeArg\", \"{{img_fakeArg}}\");\n\t\t\t\t if(is_numeric($params['args']['src'])) {\n\t\t\t\t \t$thumb = isset($params['args']['src']) ? wp_get_attachment_image($params['args']['src']) : \"\";\n\t\t\t\t } else {\n\t\t\t\t \t$thumb = \"<img width='50px' src='\". $params['args']['imgsrc'] .\"'>\";\n\t\t\t\t }\n $params['innerHtml'] = \"\";\n //$params['innerHtml'] .= \"<div {$imgThumb}><img style='float:left; margin-right:5px;' width='90px' src='\".$params['args']['src'].\"'></div>\";\n $params['innerHtml'] .= \"<div {$imgThumb}>\".$thumb.\"</div>\";\n $params['innerHtml'] .= \"<div class='avia_title_container' {$template}>\".$params['args']['title'].\"</div>\";\n $params['innerHtml'] .= \"<div style='clear:both;'></div>\";\n\n return $params;\n }", "function renderDescriptionColumn($model,$key,$index,$column){\n //TODO when we have permissions, this link should be rendered only if user can create parameters\n $content=Html::a($model->name,['view','id'=>$model->id]);\n $out = Html::tag('div',$content,['class'=>'param_name']);\n $out .= Html::tag('div',$model->description,['class'=>'param_description']);\n return $out;\n}", "function HTMLInput ($params) {\n if (!isset($params['type'])) {\n $params['type'] = 'text';\n }\n if (!isset($params['name'])) {\n if (isset($params['id'])) {\n $params['name'] = $params['id'];\n }\n }\n $ck = $params['checked'];\n unset($params['checked']);\n $str = '';\n foreach ($params as $k=>$v) {\n $str .= \" {$k}=\\\"{$v}\\\"\";\n }\n return \"<input {$str} {$ck} />\";\n }", "public function shortcode_parameters( $params ) {\n\t\t// General tab\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Widget Title', 'mountain' ),\n\t\t\t'description' => __( 'Enter text which will be used as widget title. Leave blank if no title is needed.', 'mountain' ),\n\t\t\t'param_name' => 'widget_title'\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Categories', 'mountain' ),\n\t\t\t'description' => __( 'If you want to narrow output, enter category names here. Note: Only listed categories will be included.', 'mountain' ),\n\t\t\t'param_name' => 'categories'\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Tags', 'mountain' ),\n\t\t\t'description' => __( 'If you want to narrow output, enter tag names here. Note: Only listed tags will be included.', 'mountain' ),\n\t\t\t'param_name' => 'tags'\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Display Mode', 'mountain' ),\n\t\t\t'param_name' => 'mode',\n\t\t\t'std' => 3,\n\t\t\t'value' => array(\n\t\t\t\t__( 'Grid Classic', 'mountain' ) => 'grid',\n\t\t\t\t__( 'Grid Masonry', 'mountain' ) => 'masonry',\n\t\t\t\t__( 'Grid No Margin', 'mountain' ) => 'no-margin',\n\t\t\t\t__( 'Carousel', 'mountain' ) => 'carousel'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Columns', 'mountain' ),\n\t\t\t'description' => __( 'The number of columns will be shown', 'mountain' ),\n\t\t\t'param_name' => 'columns',\n\t\t\t'std' => 3,\n\t\t\t'value' => array(\n\t\t\t\t__( '1 Column', 'mountain' ) => 1,\n\t\t\t\t__( '2 Columns', 'mountain' ) => 2,\n\t\t\t\t__( '3 Columns', 'mountain' ) => 3,\n\t\t\t\t__( '4 Columns', 'mountain' ) => 4,\n\t\t\t\t__( '5 Columns', 'mountain' ) => 5,\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Show Items Filter', 'mountain' ),\n\t\t\t'param_name' => 'filter',\n\t\t\t'std' => 'yes',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Yes', 'mountain' ) => 'yes',\n\t\t\t\t__( 'No', 'mountain' ) => 'no'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Filter By', 'mountain' ),\n\t\t\t'param_name' => 'filter_by',\n\t\t\t'std' => 'category',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Categories', 'mountain' ) => 'category',\n\t\t\t\t__( 'Tags', 'mountain' ) => 'tag'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Limit', 'mountain' ),\n\t\t\t'description' => __( 'The number of posts will be shown', 'mountain' ),\n\t\t\t'param_name' => 'limit',\n\t\t\t'value' => 9\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Offset', 'mountain' ),\n\t\t\t'description' => __( 'The number of posts to pass over', 'mountain' ),\n\t\t\t'param_name' => 'offset',\n\t\t\t'value' => 0\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Thumbnail Size', 'mountain' ),\n\t\t\t'description' => __( 'Enter image size. Example: \"thumbnail\", \"medium\", \"large\", \"full\" or other sizes defined by current theme. Alternatively enter image size in pixels: 200x100 (Width x Height). Leave empty to use \"thumbnail\" size.', 'mountain' ),\n\t\t\t'param_name' => 'thumbnail_size'\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Order By', 'mountain' ),\n\t\t\t'description' => __( 'Select how to sort retrieved posts.', 'mountain' ),\n\t\t\t'param_name' => 'order',\n\t\t\t'std' => 'date',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Date', 'mountain' ) => 'date',\n\t\t\t\t__( 'ID', 'mountain' ) => 'ID',\n\t\t\t\t__( 'Author', 'mountain' ) => 'author',\n\t\t\t\t__( 'Title', 'mountain' ) => 'title',\n\t\t\t\t__( 'Modified', 'mountain' ) => 'modified',\n\t\t\t\t__( 'Random', 'mountain' ) => 'rand',\n\t\t\t\t__( 'Comment count', 'mountain' ) => 'comment_count',\n\t\t\t\t__( 'Menu order', 'mountain' ) => 'menu_order'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Order Direction', 'mountain' ),\n\t\t\t'description' => __( 'Designates the ascending or descending order.', 'mountain' ),\n\t\t\t'param_name' => 'direction',\n\t\t\t'std' => 'DESC',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Ascending', 'mountain' ) => 'ASC',\n\t\t\t\t__( 'Descending', 'mountain' ) => 'DESC'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Extra Class', 'mountain' ),\n\t\t\t'description' => __( 'If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'mountain' ),\n\t\t\t'param_name' => 'class'\n\t\t);\n\n\t\t// Carousel Options\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Autoplay?', 'mountain' ),\n\t\t\t'param_name' => 'autoplay',\n\t\t\t'group' => __( 'Carousel Options', 'mountain' ),\n\t\t\t'std' => 'yes',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Yes', 'mountain' ) => 'yes',\n\t\t\t\t__( 'No', 'mountain' ) => 'no'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Stop On Hover?', 'mountain' ),\n\t\t\t'description' => __( 'Rewind speed in milliseconds', 'mountain' ),\n\t\t\t'param_name' => 'hover_stop',\n\t\t\t'group' => __( 'Carousel Options', 'mountain' ),\n\t\t\t'std' => 'yes',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Yes', 'mountain' ) => 'yes',\n\t\t\t\t__( 'No', 'mountain' ) => 'no'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'checkbox',\n\t\t\t'heading' => __( 'Slider Controls', 'mountain' ),\n\t\t\t'param_name' => 'controls',\n\t\t\t'group' => __( 'Carousel Options', 'mountain' ),\n\t\t\t'std' => 'navigation,rewind-navigation,pagination,pagination-numbers',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Navigation', 'mountain' ) => 'navigation',\n\t\t\t\t__( 'Rewind Navigation', 'mountain' ) => 'rewind-navigation',\n\t\t\t\t__( 'Pagination', 'mountain' ) => 'pagination',\n\t\t\t\t__( 'Pagination Numbers', 'mountain' ) => 'pagination-numbers'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Scroll Per Page?', 'mountain' ),\n\t\t\t'param_name' => 'scroll_page',\n\t\t\t'group' => __( 'Carousel Options', 'mountain' ),\n\t\t\t'std' => 'yes',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Yes', 'mountain' ) => 'yes',\n\t\t\t\t__( 'No', 'mountain' ) => 'no'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Allow Mouse Drag?', 'mountain' ),\n\t\t\t'param_name' => 'mouse_drag',\n\t\t\t'group' => __( 'Carousel Options', 'mountain' ),\n\t\t\t'std' => 'yes',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Yes', 'mountain' ) => 'yes',\n\t\t\t\t__( 'No', 'mountain' ) => 'no'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Allow Touch Drag?', 'mountain' ),\n\t\t\t'param_name' => 'touch_drag',\n\t\t\t'group' => __( 'Carousel Options', 'mountain' ),\n\t\t\t'std' => 'yes',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Yes', 'mountain' ) => 'yes',\n\t\t\t\t__( 'No', 'mountain' ) => 'no'\n\t\t\t)\n\t\t);\n\n\t\t// Speed\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Autoplay Speed', 'mountain' ),\n\t\t\t'description' => __( 'Autoplay speed in milliseconds', 'mountain' ),\n\t\t\t'param_name' => 'autoplay_speed',\n\t\t\t'group' => __( 'Speed', 'mountain' ),\n\t\t\t'value' => 5000\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Slide Speed', 'mountain' ),\n\t\t\t'description' => __( 'Slide speed in milliseconds', 'mountain' ),\n\t\t\t'param_name' => 'slide_speed',\n\t\t\t'group' => __( 'Speed', 'mountain' ),\n\t\t\t'value' => 200\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Pagination Speed', 'mountain' ),\n\t\t\t'description' => __( 'Pagination speed in milliseconds', 'mountain' ),\n\t\t\t'param_name' => 'pagination_speed',\n\t\t\t'group' => __( 'Speed', 'mountain' ),\n\t\t\t'value' => 200\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'textfield',\n\t\t\t'heading' => __( 'Rewind Speed', 'mountain' ),\n\t\t\t'description' => __( 'Rewind speed in milliseconds', 'mountain' ),\n\t\t\t'param_name' => 'rewind_speed',\n\t\t\t'group' => __( 'Speed', 'mountain' ),\n\t\t\t'value' => 200\n\t\t);\n\n\t\t// Responsive\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Enable Responsive?', 'mountain' ),\n\t\t\t'param_name' => 'responsive',\n\t\t\t'group' => __( 'Responsive', 'mountain' ),\n\t\t\t'std' => 'yes',\n\t\t\t'value' => array(\n\t\t\t\t__( 'Yes', 'mountain' ) => 'yes',\n\t\t\t\t__( 'No', 'mountain' ) => 'no'\n\t\t\t)\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Items On Tablet', 'mountain' ),\n\t\t\t'description' => __( 'The maximum amount of items displayed at a time on tablet device', 'mountain' ),\n\t\t\t'param_name' => 'tablet_items',\n\t\t\t'group' => __( 'Responsive', 'mountain' ),\n\t\t\t'value' => array_combine( range( 1, 6 ), range( 1, 6 ) ),\n\t\t\t'std' => 2\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'dropdown',\n\t\t\t'heading' => __( 'Items On Mobile', 'mountain' ),\n\t\t\t'description' => __( 'The maximum amount of items displayed at a time on mobile device', 'mountain' ),\n\t\t\t'param_name' => 'mobile_items',\n\t\t\t'group' => __( 'Responsive', 'mountain' ),\n\t\t\t'value' => array_combine( range( 1, 6 ), range( 1, 6 ) ),\n\t\t\t'std' => 1\n\t\t);\n\n\t\t$params[] = array(\n\t\t\t'type' => 'css_editor',\n\t\t\t'param_name' => 'css',\n\t\t\t'group' => __( 'Design Options', 'mountain' )\n\t\t);\n\t\treturn $params;\n\t}", "public function getParamsToView();", "public function menu (\\stdClass $param);", "function parseParameterValues($source) {\n\t$parameterValues = array();\n\t$parameter = preg_split(\"/<br>/\", $source); // get array from the source string\n\t\n\tfor ($i = 0; $i < count($parameter); $i++) {\n\t\t$parameter[$i] = preg_replace(\"/(<p)+[^<]+/\", \"\", $parameter[$i]); // rip off <p> tag\n\t\t$parameter[$i] = preg_replace(\"/<\\/p>/\", \"\", $parameter[$i]); // rip of </p> tag\n\t\t$list = preg_split(\"/=/\", $parameter[$i]);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\" && $paramName != \"delay\" && $paramName != null) {\n\t\t\tarray_push($parameterValues, $paramVal); // push to the parameter value array;\n\t\t}\n\t}\n\t\n\tif (count($parameterValues) > 0) {\n\t\t$result = \"<param name=\\\"information\\\">\". join($parameterValues, \"^\") . \"</param>\"; // create parameter value string\n\t}\n\t\n\t/*\n\tforeach ($parameter as $item) {\n\t\techo $item;exit;\n\t\t\n\t\t\n\t\t$list = preg_split(\"/=/\", $item);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif (sizeof($parameter) > 0) {\n\t\t\t$result = $result;\n\t\t}\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\") { // filter out non-parameter name\n\t\t\t\n\t\t}\n\t}*/\n\treturn $result;\n}", "function action_attach_tags_print_fields() {\n\t\techo '<tr ',helper_alternate_class(),'><td class=\"category\">',lang_get('tag_attach_long'),'</td><td>';\n\t\tprint_tag_input();\n\t\techo '<input type=\"submit\" class=\"button\" value=\"' . lang_get( 'tag_attach' ) . ' \" /></td></tr>';\n\t}", "public function params() {\n\t\treturn nl2br($this -> params);\n\t}", "function sGetProvHtmlDescription ($aArgProvincia) {\n\t\n\textract ($aArgProvincia);\n\t$aProvDescription = array();\n\tif ($count_dst_id) {\n\t\t$aProvDescription[] = '<p>In questa provincia sono presenti '.$count_dst_id.' distributori di latte crudo.</p>';\n\t\t$aProvDescription[] = '<p><a href=\"?z='.$prv_key.'#down\">Entra e visualizza distributori</a></p>';\n\t} else {\n\t\t$aProvDescription[] = '<p>In questa provincia non sono presenti distributori di latte crudo. :-(</p>';\n\t\t$aProvDescription[] = '<p><a href=\"?z='.$prv_key.'#down\">Entra comunque</a></p>';\n\t}\n\treturn implode(\"\\n\",$aProvDescription);\n}", "function printEditLink($params)\n{\n extract($params);\n return \"\n <input type=hidden name='hDataID$counter' id='hDataID$counter' value='\" . $record['id'] . \"' />\n <input type=hidden name='hDataEmployeeID$counter' id='hDataEmployeeID$counter' value='\" . $record['employeeID'] . \"' />\n <input type=hidden name='hDataEmployeeName$counter' id='hDataEmployeeName$counter' value='\" . $record['employeeName'] . \"' />\n <input type='hidden' name='hDataAddress$counter' id='hDataAddress$counter' value='\" . $record['primaryAddress'] . \"' />\n <input type='hidden' name='hDataDepartment$counter' id='hDataDepartment$counter' value='\" . $record['departmentCode'] . \"' />\n <a href=\\\"javascript:myClient.editData($counter)\\\">Edit</a>\";\n}", "function html()\n\t{\n /**\n * @global string $_REQUEST['opcion'] variable que contiene la opcion para ser dirijido a una funcion especifica\n */\n\t\tif(!isset($_REQUEST['opcion']))\n\t\t{\n\t\t\t$_REQUEST['opcion']=\"consultar\";\n\t\t}\n\n\t\tswitch($_REQUEST['opcion'])\n\t\t{\n \n default:\n $this->funcion->verificarTipoPago();\n break;\n\n\t\t}\n\t}", "public function format(IEvent $event, $parameter) {\n\t\t$params = \\json_decode($parameter, true);\n\t\tif (!isset($params['url'])) {\n\t\t\t// we can't work without a url\n\t\t\treturn '';\n\t\t}\n\t\t$url = $params['url'];\n\t\tif (\\preg_match('#https?://#', $url) !== 1) {\n\t\t\t// we need an absolute url\n\t\t\treturn '';\n\t\t}\n\t\t$name = $url;\n\t\tif (isset($params['name'])) {\n\t\t\t$name = Util::sanitizeHTML($params['name']);\n\t\t}\n\t\t$target = false;\n\t\tif (isset($params['target']) && \\in_array($params['target'], ['_self', '_blank', '_parent', '_top'])) {\n\t\t\t$target = $params['target'];\n\t\t}\n\t\t$link = '<a href=\"' . $url . '\"';\n\t\tif ($target !== false) {\n\t\t\t$link .= ' target=\"' . $target . '\"';\n\t\t}\n\t\t$link .= '>' . $name . '</a>';\n\t\treturn '<parameter>' . $link . '</parameter>';\n\t}", "protected function tagShow($params)\n {\n return $this->toHtml($params);\n }", "public function buildHtml()\n\t{\n\t\tif (isset($this->parameters[Feature::F_EDIT])) {\n\t\t\t$value = $this->value ?: date('Y-m-d');\n\t\t\t$date = explode('-', substr($value, 0, 10));\n\t\t\t/** @var $template Template */\n\t\t\t$template = Builder::create(Template::class, [$this, null, Feature::F_EDIT]);\n\t\t\t$template->setParameters(array_merge($this->parameters, [\n\t\t\t\t'name' => $this->property->pathAsField(),\n\t\t\t\tself::DAY => $date[2],\n\t\t\t\tParameter::IS_INCLUDED => true,\n\t\t\t\tself::MONTH => $date[1],\n\t\t\t\tself::YEAR => $date[0]\n\t\t\t]));\n\t\t\treturn $template->parse();\n\t\t}\n\t\telse {\n\t\t\treturn $this->value;\n\t\t}\n\t}", "function field_details() \n { ?>\n <div class=\"field-details\">\n <?php if($this->setting['type'] != 'radio' && $this->setting['type'] != 'checkbox') : ?><label <?php $this->for_tag(\"inferno-concrete-setting-\"); ?>><?php endif; ?>\n <?php echo $this->setting['desc']; ?>\n <?php if($this->setting['type'] != 'radio' && $this->setting['type'] != 'checkbox') : ?></label><?php endif; ?>\n\n <?php if(isset($this->setting['more']) && $this->setting['more'] != '') : ?>\n <span class=\"more\"><?php echo $this->setting['more']; ?></span>\n <?php endif; ?>\n\n <?php if($this->setting['type'] == 'font') : ?>\n <div class=\"googlefont-desc\">\n <label <?php $this->for_tag(\"inferno-concrete-setting-\", \"-googlefont\"); ?>>\n <?php _e('Enter the Name of the Google Webfont You want to use, for example \"Droid Serif\" (without quotes). Leave blank to use a Font from the selector above.', 'inferno'); ?>\n </label>\n <span class=\"more\">\n <?php _e('You can view all Google fonts <a href=\"http://www.google.com/webfonts\">here</a>. Consider, that You have to respect case-sensitivity. If the font has been successfully recognized, the demo text will change to the entered font.', 'inferno'); ?>\n </span>\n </div>\n <?php endif; ?>\n </div>\n <?php\n }", "function buildTip(){\n\t\treturn $this->builder->insert($this->getParameters());\n\t}", "function pqurc_display_extra()\n {\n $extra_fi = get_option('pqurcode_extra');\n printf(\"<input type='text' id='%s' name='%s' value='%s' />\", 'pqurcode_extra', 'pqurcode_extra', $extra_fi);\n }", "function inspiry_render_additional_details( $title = '', $value = '' ) {\n\t\t?>\n <div class=\"inspiry-detail\">\n <div class=\"inspiry-detail-sort-handle\"><i class=\"fas fa-grip-horizontal\"></i></div>\n <div class=\"inspiry-detail-title\">\n <input type=\"text\" name=\"detail-titles[]\" value=\"<?php echo esc_attr( $title ); ?>\" placeholder=\"<?php esc_attr_e( 'Title', 'framework' ); ?>\"/>\n </div>\n <div class=\"inspiry-detail-value\">\n <input type=\"text\" name=\"detail-values[]\" value=\"<?php echo esc_attr( $value ); ?>\" placeholder=\"<?php esc_attr_e( 'Value', 'framework' ); ?>\"/>\n </div>\n <div class=\"inspiry-detail-remove-detail\">\n <button class=\"remove-detail btn btn-primary\"><i class=\"fas fa-trash-alt\"></i></button>\n </div>\n </div>\n\t\t<?php\n\t}", "function printParambers($params){\n $parLength = count($params); // Number of parameters\n \n // No parameters and should be closed \n if($parLength == 0){\n echo \")\";\n }\n else{\n for($parCounter = 0; $parCounter < $parLength - 1; $parCounter++){\n $par = $params[$parCounter];\n echo $par->__get(\"type\") . \" \" . $par->__get(\"name\") . \",\";\n }\n $par = $params[$parLength - 1];\n echo $par->__get(\"type\") . \" \" . $par->__get(\"name\") . \")\";\n }\n }", "function editor_element($params)\n {\n extract(av_backend_icon($params)); // creates $font and $display_char if the icon was passed as param \"icon\" and the font as \"font\"\n\n $inner = \"<div class='avia_button_box avia_hidden_bg_box avia_textblock avia_textblock_style'>\";\n $inner .= \"\t\t<div \" . $this->class_by_arguments('icon_select, color, size, position',\n $params['args']) . \">\";\n $inner .= \"\t\t\t<span \" . $this->class_by_arguments('font', $font) . \">\";\n $inner .= \"\t\t\t<span data-update_with='label' class='avia_iconbox_title' >\" . $params['args']['label'] . \"</span>\";\n $inner .= \"\t\t\t<span \" . $this->class_by_arguments('font', $font) . \">\";\n $inner .= \"\t\t</div>\";\n $inner .= \"</div>\";\n\n $params['innerHtml'] = $inner;\n $params['content'] = null;\n $params['class'] = \"\";\n\n return $params;\n }", "function printNumberInput($isPro,$options, $label, $id, $description, $type = 'text', $default = '', $url='', $showSave = false) {\r\n $offset = '';\r\n if (ai_startsWith($label, 'i-')) {\r\n $offset = 'class=\"'.substr($label,0, 5).'\" ';\r\n $label = substr($label, 5);\r\n }\r\n \r\n if (!isset($options[$id])) {\r\n $options[$id] = '0';\r\n }\r\n if ($options[$id] == '' && $default != '') {\r\n $options[$id] = $default;\r\n }\r\n if (!isset($options['demo']) || $options['demo'] == 'false') {\r\n $isPro = false;\r\n }\r\n $pro_class = $isPro ? ' class=\"ai-pro\"':'';\r\n\r\n if ($isPro) {\r\n $label = '<span alt=\"Pro feature\" title=\"Pro feature\">'.$label.'</span>';\r\n }\r\n\r\n echo '\r\n <tr'.$pro_class.'>\r\n <th scope=\"row\" '.$offset.'>' . $label . renderExampleIcon($url) . renderExternalWorkaroundIcon($showSave). '</th>\r\n <td><span class=\"hide-print\">\r\n <input name=\"' . $id . '\" type=\"' . $type . '\" id=\"' . $id . '\" style=\"width:150px;\" onblur=\"aiCheckInputNumber(this)\" value=\"' . esc_attr($options[$id]) . '\" /><br></span>\r\n <p class=\"description\">' . $description . '</p></td>\r\n </tr>\r\n ';\r\n}", "public static function render_teamwork_html_parameters() {\n return new external_function_parameters(\n array(\n 'courseid' => new external_value(PARAM_INT, 'course id int', VALUE_DEFAULT, null),\n 'activityid' => new external_value(PARAM_INT, 'activity id int', VALUE_DEFAULT, null),\n 'moduletype' => new external_value(PARAM_RAW, 'moduletype text', VALUE_DEFAULT, null),\n 'selectgroupid' => new external_value(PARAM_RAW, 'selectgroupid text', VALUE_DEFAULT, null),\n )\n );\n }", "public static function render_block_html_page_parameters() {\n return new external_function_parameters(\n array(\n 'courseid' => new external_value(PARAM_INT, 'course id int', VALUE_DEFAULT, null),\n 'activityid' => new external_value(PARAM_INT, 'activity id int', VALUE_DEFAULT, null),\n 'moduletype' => new external_value(PARAM_RAW, 'moduletype text', VALUE_DEFAULT, null),\n 'selectgroupid' => new external_value(PARAM_RAW, 'selectgroupid text', VALUE_DEFAULT, null),\n )\n );\n }", "function format_input_hidden($p_id, $p_value){\n\treturn '<input type=\"hidden\" id=\"' . $p_id . '\" name=\"' . $p_id . '\" value=\"' . $p_value . '\"/>';\n}", "private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }", "function listTitles($parameter)\n\t\t{\n\t\t\t$parameter = decodeAscii($parameter);\n\t\t\t$tabParameter = split(\" id:\", $parameter);\n\t\t\t//suppression du premier élement qui correspond à la requette\n\t\t\tarray_shift($tabParameter);\n\n\n\t\t\tforeach ($tabParameter as $key => $value) \n\t\t\t{\n\t\t\t\t//$titleId = substr($tabParameter[$key], 0,strpos($tabParameter[$key], ' '));\n\t\t\t\t$titleId = substr($value, 0, strpos($value, \" \"));\n\t\t\t\t//echo \"contenu de id $id \\n\";\n\t\t\t\t//$artwork = get_string_between($tabParameter[$key],\"track_id:\",\" title\");\n\t\t\t\t//echo \"contenu de artwork $artwork \\n\";\n\t\t\t\t$title = get_string_between($value,\"title:\",\" genre:\");\n\t\t\t\t//echo \"contenu de title $title \\n\";\n\t\t\t\t$artist = get_string_between($value,\" artist:\",\" album:\");\n\n\t\t\techo \"<ul id=\\\"$title|$titleId\\\">\";\n\t\t\techo \"<li class=\\\"genre\\\" id=\\\"$title|$titleId\\\">Titre:$title Artist:$artist</li>\";\n\t\t\techo \"<img class=\\\"button\\\" id=\\\"buttonAddTitle\\\" src=\\\"1_music/view/images/player/plus.png\\\">\";\n\t\t\techo \"</ul>\";\n\n\n\t\t\t}\n\n\n\n\t\t}", "protected static function getParamsFormControl($key, array $info, array $options, &$tools) {\n $r = '';\n $fieldPrefix = (isset($options['fieldNamePrefix']) ? $options['fieldNamePrefix'] . '-' : '');\n $ctrlOptions = [\n 'label' => lang::get($info['display']),\n // Note we can't fit help text in the toolbar versions of a params form.\n 'helpText' => $options['helpText'] ? $info['description'] : '',\n 'fieldname' => $fieldPrefix . $key,\n 'nocache' => isset($options['nocache']) && $options['nocache'],\n ];\n // If this parameter is in the URL or post data, put it in the control\n // instead of the original default.\n if (isset($options['defaults'][$key])) {\n $ctrlOptions['default'] = $options['defaults'][$key];\n }\n elseif (isset($info['default'])) {\n $ctrlOptions['default'] = $info['default'];\n }\n if ($info['datatype'] === 'idlist') {\n // Idlists are not for human input so use a hidden.\n $r .= \"<input type=\\\"hidden\\\" name=\\\"$fieldPrefix$key\\\" value=\\\"\" . self::get_preset_param($options, $key) . \"\\\" class=\\\"{$fieldPrefix}idlist-param\\\" />\\n\";\n }\n elseif (isset($options['extraParams']) && array_key_exists($key, $options['extraParams'])) {\n $r .= \"<input type=\\\"hidden\\\" name=\\\"$fieldPrefix$key\\\" value=\\\"\" . self::get_preset_param($options, $key) . \"\\\" />\\n\";\n // If the report parameter is a lookup and its population_call is set to\n // species_autocomplete. Options such as @speciesIncludeBothNames can be\n // included as a [params] control form structure option.\n }\n elseif ($info['datatype'] === 'lookup' && (isset($info['population_call']) && $info['population_call'] === 'autocomplete:species')) {\n $ctrlOptions['extraParams'] = $options['readAuth'];\n if (!empty($options['speciesTaxonListId'])) {\n $ctrlOptions['extraParams']['taxon_list_id'] = $options['speciesTaxonListId'];\n }\n if (!empty($options['speciesIncludeBothNames']) && $options['speciesIncludeBothNames'] == TRUE) {\n $ctrlOptions['speciesIncludeBothNames'] = TRUE;\n }\n if (!empty($options['speciesIncludeTaxonGroup']) && $options['speciesIncludeTaxonGroup'] == TRUE) {\n $ctrlOptions['speciesIncludeTaxonGroup'] = TRUE;\n }\n $r .= data_entry_helper::species_autocomplete($ctrlOptions);\n }\n elseif ($info['datatype'] == 'lookup' && isset($info['population_call'])) {\n // Population call is colon separated, of the form\n // direct|report:table|view|report:idField:captionField:params(key=value,key=value,...).\n $popOpts = explode(':', $info['population_call'], 5);\n $extras = [];\n // If there are any extra parameters on the report lookup call, apply\n // them.\n if (count($popOpts) > 4) {\n // 5th item is a list of parameters.\n $extraItems = explode(',', $popOpts[4]);\n foreach ($extraItems as $extraItem) {\n $extraItem = explode('=', $extraItem, 2);\n self::replacePopulationCallParamValueTags($options['extraParams'], $extraItem);\n $extras[$extraItem[0]] = $extraItem[1];\n }\n }\n // Allow local page configuration to apply extra restrictions on the\n // return values: e.g. only return some location_types from the termlist.\n if (isset($options['param_lookup_extras']) && isset($options['param_lookup_extras'][$key])) {\n foreach ($options['param_lookup_extras'][$key] as $param => $value) {\n // Direct table access can handle 'in' statements, reports can't.\n $extras[$param] = ($popOpts[0] == 'direct' ? $value : (is_array($value) ? implode(',', $value) : $value));\n }\n }\n if (!isset($extras['orderby'])) {\n $extras['orderby'] = $popOpts[3];\n }\n $ctrlOptions = array_merge($ctrlOptions, [\n 'valueField' => $popOpts[2],\n 'captionField' => $popOpts[3],\n 'blankText' => '<please select>',\n 'extraParams' => $options['readAuth'] + $extras,\n ]);\n if ($popOpts[0] == 'direct') {\n $ctrlOptions['table'] = $popOpts[1];\n }\n else {\n $ctrlOptions['report'] = $popOpts[1];\n }\n if (isset($info['linked_to']) && isset($info['linked_filter_field'])) {\n // Exclude null entries from filter field by default.\n $ctrlOptions['filterIncludesNulls'] = $info['filterIncludesNulls'] ?? FALSE;\n if (isset($options['extraParams']) && array_key_exists($info['linked_to'], $options['extraParams'])) {\n // If the control this is linked to is hidden because it has a preset\n // value, just use that value as a filter on the population call for\n // this control.\n $ctrlOptions = array_merge($ctrlOptions, [\n 'extraParams' => array_merge($ctrlOptions['extraParams'], [\n 'query' => json_encode([\n 'in' => [\n $info['linked_filter_field'] => [\n $options['extraParams'][$info['linked_to']],\n NULL,\n ],\n ],\n ]),\n ]),\n ]);\n }\n else {\n // Otherwise link the 2 controls.\n $ctrlOptions = array_merge($ctrlOptions, [\n 'parentControlId' => $fieldPrefix . $info['linked_to'],\n 'filterField' => $info['linked_filter_field'],\n 'parentControlLabel' => $options['form'][$info['linked_to']]['display'],\n ]);\n }\n }\n $r .= data_entry_helper::select($ctrlOptions);\n }\n elseif ($info['datatype'] == 'lookup' && isset($info['lookup_values'])) {\n // Convert the lookup values into an associative array.\n $lookups = explode(',', $info['lookup_values']);\n $lookupsAssoc = [];\n foreach ($lookups as $lookup) {\n $lookup = explode(':', $lookup);\n $lookupsAssoc[$lookup[0]] = $lookup[1];\n }\n $ctrlOptions = array_merge($ctrlOptions, [\n 'blankText' => '<' . lang::get('please select') . '>',\n 'lookupValues' => $lookupsAssoc,\n ]);\n $r .= data_entry_helper::select($ctrlOptions);\n }\n elseif ($info['datatype'] == 'date') {\n $r .= data_entry_helper::date_picker($ctrlOptions);\n }\n elseif ($info['datatype'] == 'geometry') {\n $tools = ['Polygon', 'Line', 'Point'];\n }\n elseif ($info['datatype'] == 'polygon') {\n $tools = ['Polygon'];\n }\n elseif ($info['datatype'] == 'line') {\n $tools = ['Line'];\n }\n elseif ($info['datatype'] == 'point') {\n $tools = ['Point'];\n }\n else {\n if (method_exists('data_entry_helper', $info['datatype'])) {\n $ctrl = $info['datatype'];\n $r .= data_entry_helper::$ctrl($ctrlOptions);\n }\n else {\n $r .= data_entry_helper::text_input($ctrlOptions);\n }\n }\n return $r;\n }", "public function _open_tag() \n\t{\n\t\t$id = $this->EE->TMPL->fetch_param('id');\n\t\t$name = $this->EE->TMPL->fetch_param('name');\n\t\t$class = $this->EE->TMPL->fetch_param('class');\n\t\t\n\t\t$return = '<select';\n\t\tif($id) {\n\t\t\t$return .= ' id=\"'.$id.'\"';\n\t\t}\n\t\tif($name) {\n\t\t\t$return .= ' name=\"'.$name.'\"';\n\t\t}\n\t\tif($class) {\n\t\t\t$return .= ' class=\"'.$class.'\"';\n\t\t}\n\t\t$return .= \">\";\n\t\treturn $return;\n\t}", "public function start_el(&$output, $item, $depth=0, $args=array(), $id = 0){\n $item->title = str_repeat(\"&#45; \", $depth ) . $item->title;\n parent::start_el($output, $item, $depth, $args);\n\n $output = str_replace( '<a', '<option', $output );\n $output = str_replace( 'href=', 'value=', $output );\n\n }", "protected function generateParameterWrapToken() {}", "function zen_draw_hidden_field($name, $value = '', $parameters = '') {\n $field = '<input type=\"hidden\" name=\"' . zen_sanitize_string(zen_output_string($name)) . '\"';\n\n if (zen_not_null($value)) {\n $field .= ' value=\"' . zen_output_string($value) . '\"';\n } elseif (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {\n $field .= ' value=\"' . zen_output_string(stripslashes($GLOBALS[$name])) . '\"';\n }\n\n if (zen_not_null($parameters)) $field .= ' ' . $parameters;\n\n $field .= ' />';\n\n return $field;\n }", "protected function generateHtml()\n\t{\n\t}", "private function get_rujukan_detail($parameter) {\n\n }", "private function callback_html( $args ) {\n echo $this->get_field_description( $args );\n }", "public function getHtml($strParam) {\n\n $strTmp = '';\n switch ($strParam) {\n case 'thumbs':\n // return thumbs html string \n foreach ($this->arrConf['pageItems'] as $value) {\n $strTmp .= $value['thumb'];\n }\n break;\n case 'info':\n // return thumbs info html string \n foreach ($this->arrConf['pageItems'] as $value) {\n $strTmp .= $value['info'];\n }\n break;\n\n default:\n break;\n }\n return $strTmp;\n }", "public function inputlabel (\\stdClass $param);", "function caDetailLink($po_request, $ps_content, $ps_classname, $ps_table, $pn_id, $pa_additional_parameters=null, $pa_attributes=null, $pa_options=null) {\n\t\tif (!($vs_url = caDetailUrl($po_request, $ps_table, $pn_id, false, $pa_additional_parameters, $pa_options))) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t$vs_tag = \"<a href='\".$vs_url.\"'\";\n\t\t\n\t\tif ($ps_classname) { $vs_tag .= \" class='$ps_classname'\"; }\n\t\tif (is_array($pa_attributes)) {\n\t\t\tforeach($pa_attributes as $vs_attribute => $vs_value) {\n\t\t\t\t$vs_tag .= \" $vs_attribute='\".htmlspecialchars($vs_value, ENT_QUOTES, 'UTF-8').\"'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$vs_tag .= '>'.$ps_content.'</a>';\n\t\t\n\t\treturn $vs_tag;\n\t}", "function printGetParameters() {\n $this->printDebugMessage('printGetParameters', 'Begin', 1);\n $paramList = $this->getParameters();\n print \"<ul>\\n\";\n foreach($paramList as $paramName) {\n print '<li>' . $paramName . \"</li>\\n\";\n }\n print \"</ul>\\n\";\n $this->printDebugMessage('printGetParameters', 'End', 1);\n }", "public static function param_form($param_id, $value = NULL)\n {\n //javascript will have to look up the value of box and translate it on iniit\n //javascript will have to translate the state into the separate vars\n //javascript will have to translate the box corners into the muxed var\n\n $v = NULL == $value ? \"\" : \"value='$value' \";\n\n //pick up value\n switch ($param_id)\n {\n case 2:\n // vertical before horizontal... vertical is the major axis of the survey\n $v_v = \"\";\n $v_h = \"\";\n \n if (NULL != $value)\n {\n list($v1, $v2) = explode(\",\", $value);\n $v_v = \"value='$v1' \";\n $v_h = \"value='$v2' \";\n $v = \"PLACEHOLDER\";\n }\n break;\n\n default:\n }\n\n\n $name = \"param_$param_id\";\n switch ($param_id)\n {\n case 1: //thrust ratio\n return \"<input type='text' name='$name' id='ap_thrust_ratio' $v/>\";\n \n case 5: //altitude\n return \"<input type='text' name='$name' id='ap_altitude' $v/>\";\n \n case 6: //depth\n return \"<input type='text' name='$name' id='ap_depth' $v/>\";\n \n case 8: //timeout\n return \"<input type='text' name='$name' id='ap_timeout' $v/>\";\n \n case 9: //trackline spacing\n return \"<input type='text' name='$name' id='ap_trackline_spacing' $v/>\";\n\n case 2: //box\n //need 2 hidden vars, one to take input from javscript and one to provide\n // \"output\" from javascript, that will get logged to the DB\n $id = \"ap_box\";\n return \"\n <input type='hidden' name='ap_box_input' id='$id' />\n <input type='hidden' name='$name' id='{$id}_output' />\n <input type='text' name='ap_box_v' id='ap_box_v' $v_v/>\n <br /><input type='text' name='ap_box_h' id='ap_box_h' $v_h/>\" . \n self::param_checkbox($param_id, $id, $v);\n \n case 3: //latitude\n $id = \"ap_lookatTerrainLat\";\n return \"<input type='text' name='$name' id='$id' $v/>\" . \n self::param_checkbox($param_id, $id, $v);\n \n case 4: //longitude\n $id = \"ap_lookatTerrainLon\";\n return \"<input type='text' name='$name' id='$id' $v/>\" .\n self::param_checkbox($param_id, $id, $v);\n \n case 7: //heading\n $id = \"ap_lookatHeading\";\n return \"<input type='text' name='$name' id='$id' $v/>\" .\n self::param_checkbox($param_id, $id, $v);\n \n default:\n return \"[unknown param '$param_id']\";\n \n }\n\n }", "function components_list(){\n\n\t\t?><li data-type=\"test\" title=\"Sample Title\"></li><?php\n\t}", "public function g() {\n $args = func_get_args();\n return htmlspecialchars(call_user_func_array(array($this, 'get'), $args));\n }", "function gtags_show_tags_chooser(){\n\t?>\n\t<span class=\"fr\">\n\t\tSuggestions : <span class=\"highlight etiquette\"><?php echo gtags_show_tags_in_add_form(); ?></span>\n\t</span>\n\t<?php \n}", "function inputDataToTemplate ($idHtml, $labelHtml, $type, $eventFunction, $projectName,$value,$disabled) {\n\n\tswitch($type){\n\t\tcase \"INPUT\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml:</label>\";\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\"\";\n\t\t\techo \"value = \\\"$value\\\"\";\n\t\t\tif ($disabled==\"D\")\n\t\t\techo \"Disabled=\\\"Disabled\\\"\";\n\t\t\techo \" />\";\n\t\t\techo\"<br>\";\n\t\t\tbreak;\n\t\tcase \"SELECT\":\n\t\t\t$idHtmltemp = getOptions($idHtml);\n\t\t\tfor($i=0;$i<count($idHtmltemp);$i++){\n\t\t\t\tif($idHtmltemp[$i]==$value){\n\t\t\t\t\t$j=$i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($idHtml!=\"billinginfo\")\n\t\t\t$j++;\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\tif (count($idHtmltemp)!= 1){\n\t\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\t\tfor($i=0;$i<count($idHtmltemp);$i++){\n\t\t\t\t\t$idHtmltemp1=explode(\":\",$idHtmltemp[$i]);\n\t\t\t\t\tif($idHtmltemp1[0]==$value)\n\t\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\" Selected>$idHtmltemp1[0]</option>\";\n\t\t\t\t\telse\n\t\t\t\t\techo \"<option value =\\\"$idHtmltemp[$i]\\\">$idHtmltemp1[0]</option>\";\n\t\t\t\t}\n\t\t\t\techo \"<option value =\\\"Rejected\\\">Rejected</option>\";\n\t\t\t}\n\t\t\telse\n\t\t\techo \"<option value =\\\"$idHtmltemp[0]\\\">$idHtmltemp[0]</option>\";\n\t\t\techo \"</select><br>\";\n\n\n\t\t\tbreak;\n\t\tcase \"SELECT_ARRAY\":\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml :</label>\";\n\t\t\techo \"<select name=\\\"$idHtml\\\" id=\\\"$idHtml\\\" onchange=\\\"$eventFunction\\\">\";\n\t\t\techo \"<option value =\\\"\\\">Please Select</option>\";\n\t\t\tfor($i=0;$i<Count($projectName);$i++){\n\t\t\t\tif($projectName[$i]==$value)\n\t\t\t\techo \"<option value =\\\"$projectName[$i]\\\"Selected>$projectName[$i]</option>\";\n\t\t\t\telse\n\t\t\t\techo \"<option value =\\\"$projectName[$i]\\\">$projectName[$i]</option>\";\n\t\t\t}\n\t\t\techo \"</select><br>\";\n\t\t\tbreak;\n\n\t\tcase \"DATE\":\n echo\"<br>\";\n\t\t\techo \"<label for=\\\"$idHtml\\\">$labelHtml: (yyyy-mm-dd)</label>\";\n\t\t\techo \"<input type=\\\"text\\\" name=\\\"$idHtml\\\" id=\\\"$idHtml\\\"\";\n\t\t\techo \" value = \\\"$value\\\"\";\n\t\t\tif ($disabled==\"D\")\n\t\t\techo \"Disabled=\\\"Disabled\\\"\";\n\t\t\techo \" />\";\n\t\t\t$idHtmlbtn=\"$idHtml\".\"btn\";\n\t\t\techo \"<button id= \\\"$idHtmlbtn\\\"\";\n\t\t\tif ($disabled==\"D\")\n\t\t\techo \"Disabled=\\\"Disabled\\\"\";\n\t\t\techo \">:::</button>\";\n\t\t\techo \"<script type=\\\"text/javascript\\\">\";\n\t\t\techo \"var cal = Calendar.setup({\";\n\t\t\techo \"onSelect: function(cal) { cal.hide() }\";\n\t\t\techo \"});\";\n\t\t\techo \"cal.manageFields( \\\"$idHtmlbtn\\\",\\\"$idHtml\\\", \\\"%Y-%m-%d\\\");\";\n\t\t\techo \"cal.manageFields( \\\"$idHtmlbtn\\\", \\\"$idHtml\\\",\\\"%Y-%m-%d\\\");\";\n\t\t\techo \"</script>\";\n\t\t\techo\"<br>\";\n\t\t\tbreak;\n\t}\n}", "function wpp_contextual_help( $data ) {\n\n $data[ 'Developer' ][ ] = '<h3>' . __( 'Developer', 'wpp' ) . '</h3>';\n $data[ 'Developer' ][ ] = '<p>' . __( 'The <b>slug</b> is automatically created from the title and is used in the back-end. It is also used for template selection, example: floorplan will look for a template called property-floorplan.php in your theme folder, or default to property.php if nothing is found.' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( 'If <b>Searchable</b> is checked then the property will be loaded for search, and available on the property search widget.' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( 'If <b>Location Matters</b> is checked, then an address field will be displayed for the property, and validated against Google Maps API. Additionally, the property will be displayed on the SuperMap, if the feature is installed.' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( '<b>Hidden Attributes</b> determine which attributes are not applicable to the given property type, and will be grayed out in the back-end.' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( '<b>Inheritance</b> determines which attributes should be automatically inherited from the parent property' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( 'Property attributes are meant to be short entries that can be searchable, on the back-end attributes will be displayed as single-line input boxes. On the front-end they are displayed using a definitions list.' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( 'Making an attribute as \"searchable\" will list it as one of the searchable options in the Property Search widget settings.' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( 'Be advised, attributes added via add_filter() function supercede the settings on this page.' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( '<b>Search Input:</b> Select and input type and enter comma-separated values that you would like to be used in property search, on the front-end.', 'wpp' ) . '</p>';\n $data[ 'Developer' ][ ] = '<p>' . __( '<b>Data Entry:</b> Enter comma-separated values that you would like to use on the back-end when editing properties.', 'wpp' ) . '</p>';\n\n return $data;\n\n }", "public function open() { \n echo \"<{$this->name}\";\n if ($this->properties) {\n // recorre las propiedades\n foreach ($this->properties as $name => $value) {\n echo \"{$name}=\\\"{$value}\\\"\";\n }\n \n }\n echo '>';\n }", "abstract public function generateHtml();", "function text()\n {\n ?>\n <input type=\"text\" <?php $this->name_tag(); ?> value=\"<?php echo esc_attr( $this->setting_value ); ?>\" class=\"inferno-setting\" <?php $this->id_tag(\"inferno-concrete-setting-\"); ?> />\n <?php \n if($this->setting['type'] == 'range') {\n $this->range();\n }\n }", "public static function get_parameters() {\n return array(\n array(\n 'name' => 'termlist_id',\n 'caption' => 'Term List',\n 'description' => 'The term list being edited.',\n 'type' => 'select',\n 'table' => 'termlist',\n 'captionField' => 'title',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n ),\n array(\n 'name' => 'language_id',\n 'caption' => 'Language',\n 'description' => 'The language that terms are created in.',\n 'type' => 'select',\n 'table' => 'language',\n 'captionField' => 'language',\n 'valueField' => 'id',\n 'siteSpecific'=>true,\n 'group' => 'Terms',\n 'required'=>true\n )\n );\n }", "public function quicktags()\n\t{\n\t\t/* Output */\n\t\t\\IPS\\Output::i()->title\t\t= \\IPS\\Member::loggedIn()->language()->addToStack( 'quick_tags' );\n\t\t\\IPS\\Output::i()->output \t= \\IPS\\Theme::i()->getTemplate( 'forms' )->quicktagsList();\n\t}", "function printLink($params)\n{\n extract($params);\n $strResult = \"<a href=\\\"javascript:openWindowDialog('templates/training_request_print.html?dataID=\" . $record['id'] . \"');\\\">\" . getWords(\n \"print\"\n ) . \"</a>\";\n return $strResult;\n}", "public function html()\n {\n return $this->builder()\n ->columns($this->getColumns())\n ->minifiedAjax()\n ->addAction(['width' => '100px'])\n ->parameters([\n 'lengthMenu' => ['15', '25', '50'],\n 'order' => [[0, 'desc']],\n ]);\n }", "public function getParameter();", "public function getParameter();", "public function xhtml() {\n\t global $container;\n $tag = new xo_codetag(xo_basename(__FILE__),__LINE__,get_class(),__FUNCTION__);\n $hid = $this->id;\n\t\t$class = $this->class;\n\t\t\n\t\t$multiple = ( $this->multiple && is_numeric($this->multiple))? \" multiple size=\\\"$this->multiple\\\" \": \"\";\n\t\t\n\t\t$html = '<select '.$multiple . ' title=\"'.$this->title . '\" style=\"' . $this->xml['style'] . '\" class=\"'. $class . '\" name=\"' . $hid . '\" id=\"'. $hid .'\">';\n\t\t\n\t\t// add default option\n $c = $container->userstring(\"choose\");\n\t\t$html .= '<option value=\"\">'.$c.'</option>';\n\t\t\n\t\tforeach ( $this->nv_pairs as $id => $name ) {\n if ( $container->debug) echo \"$tag->event_format: setting pair for $id => $name<br>\\r\\n\";\n\t\t $selected = $this->default == $id ? 'selected=\"selected\"' : '';\n\t\t\t// set optional class for multiple values\n // set optional class for multiple values\n if ( preg_match('/\\,/',$id)) {\n $vals = explode(',',$id);\n $class = ' class=\"alt-'.$vals[1].'\" ';\n }\n\n $html .= '<option ' . $selected . ' value=\"' . $id . '\">' . $name . '</option>';\n\n\n\n }\n $html .= '</select>';\n\n return $html;\n\t}", "function i4web_toolbox($instance){\n \n $toolbox_info = $instance; \n?>\n <p><?php echo $toolbox_info['toolbox_lead_txt'];?></p>\n <ul class=\"sern-toolbox-list\">\n <li><kbd><?php echo $toolbox_info['toolbox_arr1'];?></kbd></li>\n <li><kbd><?php echo $toolbox_info['toolbox_arr2'];?></kbd></li>\n <li><kbd><?php echo $toolbox_info['toolbox_arr3'];?></kbd></li>\n <li><kbd><?php echo $toolbox_info['toolbox_arr4'];?></kbd></li> \n </ul>\n \n \n\t \n<?php }", "abstract protected function getInputHtml();", "function hidden() {\n\t\t$args = func_get_args();\n\n\t\twhile (list($name,$val) = each($args[0]))\n\t\t\t$this->buffer .= \"<input type=\\\"hidden\\\" name=\\\"$name\\\" value=\\\"$val\\\" id=\\\"$name\\\" />\";\n\n\t\treturn $this->output();\n\t}", "abstract public function getFormDesc();" ]
[ "0.662042", "0.60239315", "0.59981346", "0.58638406", "0.58331907", "0.579795", "0.5721968", "0.56367147", "0.56109595", "0.56058973", "0.55893224", "0.5545003", "0.55305463", "0.5518914", "0.5516466", "0.5512661", "0.5501899", "0.5493844", "0.5478075", "0.547442", "0.54715633", "0.54666954", "0.5460942", "0.54578245", "0.5442532", "0.5433717", "0.5419055", "0.5408377", "0.54053694", "0.53922683", "0.5352483", "0.53510046", "0.5345093", "0.5324651", "0.53108436", "0.5298974", "0.5278265", "0.5266009", "0.5256224", "0.5250758", "0.5237731", "0.5226636", "0.52175266", "0.5215403", "0.5202644", "0.51767665", "0.5173222", "0.51721466", "0.51629573", "0.51565164", "0.5156045", "0.5152682", "0.5149514", "0.51477236", "0.51442987", "0.5130133", "0.5126126", "0.51222944", "0.51199234", "0.5105785", "0.5100216", "0.5095572", "0.5095454", "0.5094774", "0.5088775", "0.50875837", "0.50822425", "0.50772315", "0.5073082", "0.5072658", "0.50624967", "0.5062383", "0.5061616", "0.5047087", "0.50284195", "0.5023942", "0.5019536", "0.5016805", "0.5015732", "0.501194", "0.50041944", "0.4989308", "0.4988545", "0.49855727", "0.49855623", "0.49846897", "0.49789888", "0.49786755", "0.49694258", "0.49660987", "0.49652648", "0.4963326", "0.49626455", "0.49580842", "0.49580842", "0.49564183", "0.494948", "0.4947992", "0.49465644", "0.4944999" ]
0.6084122
1
Output a submission form
function printForm() { $this->printDebugMessage('printForm', 'Begin', 1); $stypeStr = $this->paramDetailToStr('stype'); $programStr = $this->paramDetailToStr('program'); $databaseStr = $this->paramDetailToStr('database', TRUE); $scoresStr = $this->paramDetailToStr('scores'); $alignmentsStr = $this->paramDetailToStr('alignments'); $expStr = $this->paramDetailToStr('exp'); print <<<EOF <form method="POST"> <p>E-mail: <input type="text" name="email" />&nbsp; Job title: <input type="text" name="title" /></p> <p>$stypeStr<br /> <a href="?paramDetail=sequence">Sequence</a>:<br /> <textarea name="sequence" rows="5" cols="80"> </textarea></p> <p>$programStr $databaseStr</p> <p>$scoresStr $alignmentsStr $expStr</p> <p align="right"> <input type="submit" value="Submit" /> <input type="reset" value="Reset" /> </p> </form> EOF ; $this->printDebugMessage('printForm', 'End', 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function outputForm()\n {\n $out = <<<EOD\n <form method=\"post\" action=\"../webroot/rm-movies.php\" onsubmit=\"\">\n <input type=hidden name=search value='simple-search'/>\n <input type='text' name='title-simple' placeholder='Sök Filmtitel' />\n </form>\nEOD;\n return $out;\n }", "public static function renderSubmit();", "public function output() {\n $form_div = new div();\n $form_div->setId('form_' . $this->_fname);\n $form_div->setClass('form_elements');\n\n $form_div->add(implode(\"\\n\",$this->_output));\n\n if (!empty($this->_output_submit)) {\n $submitWrapper = new div();\n $submitWrapper->setId('form_submit_' .$this->_fname);\n $submitWrapper->setClass('form_submit_elements');\n $form_div->add($submitWrapper->add(implode(\"\\n\",$this->_output_submit)));\n }\n\n return $form_div->html();\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 submission_form()\n\t{\n\t\t$this->load->library('submission_library');\n\t\t$this->load->model('timecard_submission_model', '', TRUE);\n\n\t\t$this->load->view('timecard_submission', array('is_admin_timecard' => TRUE));\n\t}", "public function cs_generate_form() {\n global $post;\n }", "function printForm(){\n\n\t\tif( $this->returnOutput ){\n\n\t\t\tob_start();\n\t\t\techo $this->openForm();\n\t\t\tfor ($n=0; $n < $this->columns; $n++) $this->_outputField($n);\n\t\t\techo $this->closeForm();\n\t\t\t$html_block = ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\treturn $html_block;\n\n\t\t} else {\n\n\t\t\t$this->openForm();\n\t\t\tfor ($n=0; $n < $this->columns; $n++) $this->_outputField($n);\n\t\t\t$this->closeForm();\n\n\t\t}\n\n\t}", "public function output() {\n\t\trequire_once WPCF7_ENTRIES_PLUGIN_DIR. '/includes/class-wpcf7-forms-table.php';\n\t\t$forms = new WPCF7_Forms_Table();\n\t\t$forms->prepare_items(); ?>\n\n <div class=\"wrap\">\n\t\t\t<h1 class=\"wp-heading-inline\"><?php _e('Form Submissions', 'wpcf7-entries'); ?></h1>\n\n <form method=\"post\">\n <?php $forms->search_box( __( 'Search Forms', 'wpcf7-entries' ), 'form' ); ?>\n <?php $forms->display(); ?>\n </form>\n </div>\n <?php\n }", "public function submit(){\n return $this->surround('<button type=\"submit\">Envoyer</button>');\n }", "public function BuildEndForm($action) {\n echo \"<INPUT TYPE='hidden' NAME='action' VALUE='$action'>\"; // this is coded in \n echo \"<p class='submit'> <input type='submit' value='Submit' /></p>\"; \n echo \"</fieldset>\"; \n echo \"</FORM>\"; \n }", "public function printForm() {\n\t\t$html = $this->printPre().'<input type=\"file\" id=\"'.$this->name().'\" name=\"'.$this->name().'\" />'.$this->printPost().$this->printDescription();\n\n\t\tif ($this->allowMultiple) {\n\t\t\t$html .= $this->print_js();\n\t\t}\n\t\treturn $html;\n\t}", "public function get_form( $atts = array() ) {\r\n\t\t\r\n\t\t\tob_start();\r\n\t\t\t$this->output( $atts );\r\n\t\t\treturn ob_get_clean();\r\n\t\t\r\n\t}", "function renderWholeForm() {\n\t\t$output = $this->renderCurrentStep();\n\t\t$output .= $this->renderSubmitButtons();\n\n\t\treturn $this->wrapWithForm ($output);\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}", "function displayFormChoiseAgent(){\n\t$contents='<form method=\"post\" action=\"index.php\" name=\"formChoiseAgent\" id=\"formChoiseAgent\" > \n\t\t\t <fieldset>\n\t\t\t <legend>Choix action</legend>\n\n\t\t\t \t<input type=\"submit\" name=\"newPatient\" id=\"newPatient\" value=\"Nouveau patient\" />\n\n\t\t\t <input type=\"submit\" name=\"FormSynthese\" id=\"FormSynthese\" value=\"Synthese patient & modif info\" />\n\t\t\t <input type=\"submit\" name=\"displayFormNssPatient\" id=\"displayFormNssPatient\" value=\"Recherche nss patient\" />\n\t\t\t <input type=\"submit\" name=\"displayTakeAppointment\" id=\"displayTakeAppointment\" value=\"Prendre un rdv\" />\n\t\t\t <input type=\"submit\" name=\"displayPayementDepot\" id=\"displayPayementDepot\" value=\"Payer & depot\" /> \n\t\t\t </fieldset>\n\t\t\t</form>';\n\treturn $contents;\n}", "function submit() {\n\t\tThesisHandler::setupTemplate();\n\n\t\t$journal = &Request::getJournal();\n\t\t$journalId = $journal->getJournalId();\n\n\t\t$thesisPlugin = &PluginRegistry::getPlugin('generic', 'ThesisPlugin');\n\n\t\tif ($thesisPlugin != null) {\n\t\t\t$thesesEnabled = $thesisPlugin->getEnabled();\n\t\t}\n\n\t\tif ($thesesEnabled) {\n\t\t\t$thesisPlugin->import('StudentThesisForm');\n\n\t\t\t$templateMgr = &TemplateManager::getManager();\n\t\t\t$templateMgr->append('pageHierarchy', array(Request::url(null, 'thesis'), 'plugins.generic.thesis.theses'));\n\t\t\t$thesisDao = &DAORegistry::getDAO('ThesisDAO');\n\n\t\t\t$thesisForm = &new StudentThesisForm();\n\t\t\t$thesisForm->initData();\n\t\t\t$thesisForm->display();\n\n\t\t} else {\n\t\t\t\tRequest::redirect(null, 'index');\n\t\t}\n\t}", "private function formSubmitted() {\n\t\t\t\n\t\t\t// connect db\n\t\t\t$this->db->replicaConnect(Database::getName($this->par['lang'], $this->par['project']));\n\t\t\t\n\t\t\t// build query for outgoing links\n\t\t\t$this->par['page'] = str_replace(' ', '_', $this->par['page']);\n\t\t\t$t1 = 'SELECT s.pl_title';\n\t\t\t$t1 .= ' FROM pagelinks s';\n\t\t\t$t1 .= ' INNER JOIN page tp ON (s.pl_title = tp.page_title AND s.pl_namespace = tp.page_namespace)';\n\t\t\t$t1 .= ' INNER JOIN page sp ON (s.pl_from = sp.page_id AND s.pl_namespace = sp.page_namespace AND sp.page_title = ?)';\n\t\t\t$t1 .= ' WHERE s.pl_namespace = 0';\n\t\t\t$t1 .= ' AND s.pl_from_namespace = 0';\n\t\t\t\n\t\t\t// execute query\n\t\t\t$q1 = $this->db->executePreparedQuery($t1, 's', $this->par['page']);\n\t\t\t\n\t\t\t// check for sql errors\n\t\t\tif (Database::checkSqlQueryObject($q1) === false) {\n\t\t\t\t$this->page->openBlock('div', 'iw-content');\n\t\t\t\t$this->page->addInline('p', 'SQL Error: ' . $this->db->error, 'iw-error');\n\t\t\t\t$this->page->closeBlock();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$r1 = Database::fetchResult($q1);\n\t\t\t\n\t\t\t// build query for incoming links\n\t\t\t$t2 = 'SELECT tp.page_title';\n\t\t\t$t2 .= ' FROM page tp';\n\t\t\t$t2 .= ' INNER JOIN pagelinks t ON (tp.page_id = t.pl_from AND t.pl_title = ? AND t.pl_namespace = 0 AND t.pl_from_namespace = 0)';\n\t\t\t$t2 .= ' WHERE tp.page_is_redirect = 0';\n\t\t\t\n\t\t\t// execute query\n\t\t\t$q2 = $this->db->executePreparedQuery($t2, 's', $this->par['page']);\n\n\t\t\t// check for sql errors\n\t\t\tif (Database::checkSqlQueryObject($q2) === false) {\n\t\t\t\t$this->page->openBlock('div', 'iw-content');\n\t\t\t\t$this->page->addInline('p', 'SQL Error: ' . $this->db->error, 'iw-error');\n\t\t\t\t$this->page->closeBlock();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$r2 = Database::fetchResult($q2);\n\t\t\t\n\t\t\t$out = [];\n\t\t\t$inc = [];\n\t\t\t$common = [];\n\t\t\t$noback = [];\n\t\t\t$nolink = [];\n\t\t\tforeach ($r1 as $l1) {\n\t\t\t\t$out[] = $l1['pl_title'];\n\t\t\t}\n\t\t\tforeach ($r2 as $l2) {\n\t\t\t\t$inc[] = $l2['page_title'];\n\t\t\t}\n\t\t\t\n\t\t\t// get arrays\n\t\t\t$common = array_intersect($out, $inc);\n\t\t\t$noback = array_diff($out, $inc);\n\t\t\t$nolink = array_diff($inc, $out);\n\t\t\t\n\t\t\t// sort arrays\n\t\t\tsort($common);\n\t\t\tsort($noback);\n\t\t\tsort($nolink);\n\t\t\t\n\t\t\t// close queries\n\t\t\t$q1->close();\n\t\t\t$q2->close();\n\t\t\t\n\t\t\t// open statistics area\n\t\t\t$this->page->openBlock('div', 'iw-content');\n\t\t\t$this->page->addInline('h2', 'Statistics');\n\t\t\t\n\t\t\t$this->page->addInline('p', 'Page conjunction for ' . Hgz::buildWikilink($this->par['lang'], $this->par['project'], $this->par['page'], str_replace('_', ' ', $this->par['page']))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t. ' (' . Hgz::buildWikilink($this->par['lang'], $this->par['project'], 'Special:Whatlinkshere/' . $this->par['page'], 'What links here') . ')');\n\t\t\t\n\t\t\t// statistics\n\t\t\t$this->page->openBlock('p');\n\t\t\t$this->page->openBlock('ul');\n\t\t\t$this->page->addInline('li', count($out) . ' links on this page');\n\t\t\t$this->page->addInline('li', count($inc) . ' links to this page');\n\t\t\t$this->page->addInline('li', '<a href=\"#noback\">' . count($noback) . ' links on this page without backlinks</a>');\n\t\t\t$this->page->addInline('li', '<a href=\"#nolink\">' . count($nolink) . ' incoming links without corresponding outgoing links</a>');\n\t\t\t$this->page->addInline('li', '<a href=\"#mutual\">' . count($common) . ' mutual links</a>');\n\t\t\t$this->page->closeBlock(2);\n\t\t\t\n\t\t\t// open result area\n\t\t\t$this->page->closeBlock();\n\t\t\t$this->page->openBlock('div', 'iw-content');\n\t\t\t$this->page->addInline('h2', 'Results');\n\t\t\t\n\t\t\t// no backlinks\n\t\t\tif (count($noback) != 0) {\n\t\t\t\t$this->page->addHTML('<span id=\"noback\"></span>');\n\t\t\t\t$this->page->addInline('h3', 'Articles linked from ' . str_replace('_', ' ', $this->par['page']) . ' with no backlinks:');\n\t\t\t\t$this->page->openBlock('ul');\n\t\t\t\tforeach ($noback as $v1) {\n\t\t\t\t\t$this->page->addInline('li', Hgz::buildWikilink($this->par['lang'], $this->par['project'], $v1, str_replace('_', ' ', $v1)));\n\t\t\t\t}\n\t\t\t\t$this->page->closeBlock();\n\t\t\t}\n\n\t\t\t// no wikilinks\n\t\t\tif (count($nolink) != 0) {\n\t\t\t\t$this->page->addHTML('<span id=\"nolink\"></span>');\n\t\t\t\t$this->page->addInline('h3', 'Articles with links to ' . str_replace('_', ' ', $this->par['page']) . ' but no links from here:');\n\t\t\t\t$this->page->openBlock('ul');\n\t\t\t\tforeach ($nolink as $v2) {\n\t\t\t\t\t$this->page->addInline('li', Hgz::buildWikilink($this->par['lang'], $this->par['project'], $v2, str_replace('_', ' ', $v2)));\n\t\t\t\t}\n\t\t\t\t$this->page->closeBlock();\n\t\t\t}\n\n\t\t\t// common links\n\t\t\tif (count($common) != 0) {\n\t\t\t\t$this->page->addHTML('<span id=\"mutual\"></span>');\n\t\t\t\t$this->page->addInline('h3', 'Articles linked from ' . str_replace('_', ' ', $this->par['page']) . ' with backlinks (mutual links):');\n\t\t\t\t$this->page->openBlock('ul');\n\t\t\t\tforeach ($common as $v3) {\n\t\t\t\t\t$this->page->addInline('li', Hgz::buildWikilink($this->par['lang'], $this->par['project'], $v3, str_replace('_', ' ', $v3)));\n\t\t\t\t}\n\t\t\t\t$this->page->closeBlock();\n\t\t\t}\n\t\t\t\n\t\t\t// close result area\n\t\t\t$this->page->closeBlock();\n\t\t}", "function form_end($text = '') {\n $output = '';\n if(!empty($text)) {\n $output .= form_submit($text);\n }\n\n $output .= '</form>';\n\n return html__output($output);\n}", "public function endForm()\r\n {\r\n echo '<div class=\"panel-footer\">\r\n <input type=\"submit\" class=\"btn btn-primary btn-sm\" value=\"Vote\" />\r\n </div>\r\n </form>';\r\n }", "function renderForm()\n{\n ?>\n <form method=\"POST\">\n <label>Nome <input name=\"name\" value=\"<?php echo $_POST['name'] ?? '' ?>\"></label><br/>\n <label>Messaggio <input name=\"message\" value=\"<?php echo $_POST['message'] ?? '' ?>\"></label><br/>\n <input type=\"submit\" value=\"Invia\">\n </form>\n <?php\n}", "public function outputSetupForm() {\n\t\t$this->_directFormHtml( 'webinarjamstudio' );\n\t}", "function printSurveyCreationForm() {\n\tglobal $tool_content, $langTitle, $langPollStart, \n\t\t$langPollEnd, $langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langCreate, $langSurveyContinue, $start_cal_Survey, $end_cal_Survey;\n\t\n\t$CurrentDate = date(\"Y-m-d H:i:s\");\n\t$CurrentDate = htmlspecialchars($CurrentDate);\n\t$tool_content .= <<<cData\n\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t<input type=\"hidden\" value=\"0\" name=\"MoreQuestions\">\n\t<table><thead></thead>\n\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\"></td></tr>\n\t\t<tr><td>$langPollStart</td><td colspan=\"2\">\n\t\t\t$start_cal_Survey\n\t\t</td></tr>\n\t\t<tr><td>$langPollEnd</td><td colspan=\"2\">$end_cal_Survey</td></tr>\n\t\t<!--<tr>\n\t\t <td>$langType</td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"1\" />\n\t $langSurveyMC</label></td>\n\t\t <td><label>\n\t\t <input name=\"UseCase\" type=\"radio\" value=\"2\" />\n\t $langSurveyFillText</label></td>\n\t\t</tr>-->\n\t\t<input name=\"UseCase\" type=\"hidden\" value=\"1\" />\n\t\t<tr><td colspan=\"3\" align=\"right\">\n <input name=\"$langSurveyContinue\" type=\"submit\" value=\"$langSurveyContinue -&gt;\"></td></tr>\n\t</table>\n\t</form>\ncData;\n}", "public function displayForm() {\n\t\t$output = $this->getOutput();\n\n\t\t$form_class = $this->adapter->getFormClass();\n\t\t// TODO: use interface. static ctor.\n\t\tif ( $form_class && class_exists( $form_class ) ) {\n\t\t\t$form_obj = new $form_class();\n\t\t\t$form_obj->setGateway( $this->adapter );\n\t\t\t$form_obj->setGatewayPage( $this );\n\t\t\t$form = $form_obj->getForm();\n\t\t\t$output->addModules( $form_obj->getResources() );\n\t\t\t$output->addModuleStyles( $form_obj->getStyleModules() );\n\t\t\t$output->addHTML( $form );\n\t\t} else {\n\t\t\t$this->logger->error( \"Displaying fail page for bad form class '$form_class'\" );\n\t\t\t$this->displayFailPage( false );\n\t\t}\n\t}", "public function displayForm() {\n\t\t$output = $this->getOutput();\n\n\t\t$form_class = $this->adapter->getFormClass();\n\t\t// TODO: use interface. static ctor.\n\t\tif ( $form_class && class_exists( $form_class ) ){\n\t\t\t$form_obj = new $form_class();\n\t\t\t$form_obj->setGateway( $this->adapter );\n\t\t\t$form_obj->setGatewayPage( $this );\n\t\t\t$form = $form_obj->getForm();\n\t\t\t$output->addModules( $form_obj->getResources() );\n\t\t\t$output->addModuleStyles( $form_obj->getStyleModules() );\n\t\t\t$output->addHTML( $form );\n\t\t} else {\n\t\t\t$this->logger->error( \"Displaying fail page for bad form class '$form_class'\" );\n\t\t\t$this->displayFailPage( false );\n\t\t}\n\t}", "public function submit_form()\n\t{\n\t\tDisplay::message('user_profil_submit', ROOT . 'index.' . PHPEXT . '?p=profile&amp;module=contact', 'forum_profil');\n\t}", "public function generateFormSubmitted($form) {\n $values = $form->getValues();\n $this->actionPdf($values);\n }", "public function submitPage() {}", "protected function renderForm()\n {\n $this->addAttribute(\"method\",$this->getMethod());\n \n if($this->getHasFile()) $this->addAttribute(\"enctype\",\"multipart/form-data\");\n\n $ret = '<form '.$this->getAttributes().'>';\n if($this->getHasFile())\n {\n $ret .= \"<input type='hidden' name='MAX_FILE_SIZE' value='10485760' />\";\n }\n if($this->error)\n {\n $ret .= \"<div class='fapi-error'><ul>\";\n foreach($this->errors as $error)\n {\n $ret .= \"<li>$error</li>\";\n }\n $ret .= \"</ul></div>\";\n }\n $ret .= $this->renderElements();\n\n $onclickFunction = \"fapi_ajax_submit_\".$this->getId().\"()\";\n $onclickFunction = str_replace(\"-\",\"_\",$onclickFunction);\n \n if($this->getShowClear())\n {\n $clearButton = '<input class=\"fapi-submit\" type=\"reset\" value=\"Clear\"/>';\n }\n\n if($this->getShowSubmit())\n {\n $ret .= '<div id=\"fapi-submit-area\">';\n $submitValue = $this->submitValue?('value=\"'.$this->submitValue.'\"'):\"\";\n if($this->ajaxSubmit)\n {\n $ret .= sprintf('<input class=\"fapi-submit\" type=\"button\" %s onclick=\"%s\" /> %s',$submitValue,$onclickFunction,$clearButton);\n }\n else\n {\n $ret .= sprintf('<input class=\"fapi-submit\" type=\"submit\" %s /> %s',$submitValue,$clearButton);\n }\n $ret .= '</div>';\n }\n $id = $this->getId();\n \n if($id != '')\n {\n $ret .= \"<input type='hidden' name='is_form_{$id}_sent' value='yes' />\";\n }\n \n $ret .= '<input type=\"hidden\" name=\"is_form_sent\" value=\"yes\" />';\n $ret .= '</form>';\n\n if($this->ajaxSubmit)\n {\n $elements = $this->getFields();\n $ajaxData = array();\n foreach($elements as $element)\n {\n $id = $element->getId();\n if($element->getStorable())\n {\n $ajaxData[] = \"'\".urlencode($id).\"='+document.getElementById('$id').\".($element->getType()==\"Field\"?\"value\":\"checked\");\n }\n $validations = $element->getJsValidations();\n $validators .= \"if(!fapiValidate('$id',$validations)) error = true;\\n\";\n }\n $ajaxData[] = \"'fapi_dt=\".urlencode($this->getDatabaseTable()).\"'\";\n $ajaxData = addcslashes(implode(\"+'&'+\", $ajaxData),\"\\\\\");\n\n $ret .=\n \"<script type='text/javascript'>\n function $onclickFunction\n {\n var error = false;\n $validators\n if(error == false)\n {\n \\$.ajax({\n type : 'POST',\n url : '{$this->ajaxAction}',\n data : $ajaxData\n });\n }\n }\n </script>\";\n }\n return $ret;\n }", "function mpc_html_form_code() {\n echo '<form action=\"' .esc_url( $_SERVER['REQUEST_URI'] ) . '\" method=\"post\">';\n echo '<p>';\n echo 'Il tuo Nome <br>';\n echo '<input type=\"text\" name=\"mpc-name\" pattern=\"[a-zA-Z0-9]+\" value=\"' . ( isset($_POST[\"mpc-name\"]) ? esc_attr( $_POST[\"mpc-name\"]) : '' ) . '\" size=40></p>';\n echo '<p>La tua email <br>';\n echo '<input type=\"email\" name=\"mpc-email\" value=\"' . ( isset($_POST[\"mpc-email\"]) ? esc_attr( $_POST[\"mpc-email\"]) : '' ) . '\" size=40></p>';\n echo 'Oggetto <br/>';\n\techo '<input type=\"text\" name=\"mpc-subject\" pattern=\"[a-zA-Z ]+\" value=\"' . ( isset( $_POST[\"mpc-subject\"] ) ? esc_attr( $_POST[\"mpc-subject\"] ) : '' ) . '\" size=\"40\" />';\n\techo '</p>';\n\techo '<p>Il tuo messaggio <br/>';\n\techo '<textarea rows=\"10\" cols=\"35\" name=\"mpc-message\">' . ( isset( $_POST[\"mpc-message\"] ) ? esc_attr( $_POST[\"mpc-message\"] ) : '' ) . '</textarea>';\n\techo '</p>';\n\techo '<p><input type=\"submit\" name=\"mpc-submitted\" value=\"Invia\"></p>';\n\techo '</form>';\n}", "function endForm($send){\n $out = '';\n if ($send) $out .= '<input type=\"submit\" value=\"'.$send.'\" name=\"submit\" >';\n $out .= \"</form>\";\n return $out;\n }", "public function forms()\n\t{\n\t\techo view('sketchpad::help/output/form', ['form' => Sketchpad::$form]);\n\t}", "public function submit() {\n\tparent::submit();\n\tif( $this->notify() ) {\n\t echo '<div class=\"alert alert-success\">' . $this->message_form_send . '</div>';\n\t}\n }", "function display_footer_subscriber_acquisition_form($pre_form_content = '')\n{\n\n\t$acquisition_copy = '<h3>Stay inspired.</h3><p>Weekly motivating thoughts and ideas to help you keep your team engaged.</p>';\n\n\t/* Build the form and set it to the form_string variable. */\n\t$form_output_string = '\n\t\t<section class=\"footer-subscriber-acquisition\">\n\t\t\t<div class=\"inner-container\">\n\t\t\t\t'. $pre_form_content .'\n\t\t\t\t'. $acquisition_copy .'\n\t\t\t\t<form action=\"'. $_SERVER['REQUEST_URI'] .'\" method=\"post\" name=\"footerSubscriberAcquisitionForm\" class=\"single-input-form\" id=\"footer-subscriber-acquisition-form\">\n\t\t\t\t\t<input name=\"footerSubscriberAcquisitionEmail\" type=\"text\" placeholder=\"Enter your email here\">\n\t\t\t\t\t<input name=\"footerSubscriberAcquisitionSubmit\" type=\"submit\" value=\"Sign me up!\">\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</section>';\n\n\techo $form_output_string;\n}", "function post_form($placeholder) {\n\n\n \techo '<form action=\"' . esc_url( $_SERVER['REQUEST_URI'] ) . '\" method=\"post\">';\n \techo '<p>';\n \techo 'Your Name (required) <br/>';\n \techo '<input class=\"inp\" type=\"text\" name=\"cf-name\" pattern=\"[a-zA-Z0-9 ]+\" value=\"' . ( isset( $_POST[\"cf-name\"] ) ? esc_attr( $_POST[\"cf-name\"] ) : '' ) . '\" size=\"40\" />';\n \techo '</p>';\n \techo '<p>';\n \techo 'Your Email (required) <br/>';\n \techo '<input class=\"inp\" type=\"email\" name=\"cf-email\" value=\"' . ( isset( $_POST[\"cf-email\"] ) ? esc_attr( $_POST[\"cf-email\"] ) : '' ) . '\" size=\"40\" />';\n \techo '</p>';\n \techo '<p>';\n \techo 'Subject (required) <br/>';\n \techo '<input class=\"inp\" type=\"text\" name=\"cf-subject\" pattern=\"[a-zA-Z ]+\" value=\"' . ( isset( $_POST[\"cf-subject\"] ) ? esc_attr( $_POST[\"cf-subject\"] ) : '' ) . '\" size=\"40\" />';\n \techo '</p>';\n \techo '<p>';\n \techo 'Your Message (required) <br/>';\n \techo '<textarea rows=\"10\" cols=\"35\" name=\"cf-message\" placeholder=\"'.$placeholder.'\">' . ( isset( $_POST[\"cf-message\"] ) ? esc_attr( $_POST[\"cf-message\"] ) : '' ) . '</textarea>';\n \techo '</p>';\n \techo '<p><input class=\"inp\" type=\"submit\" name=\"cf-submitted\" value=\"Send\"></p>';\n \techo '</form>';\n }", "public function submit()\n {\n if ($_POST['name'] == 'preview') { $this->preview(); }\n elseif ($_POST['name'] == 'create') { $this->save(); }\n }", "public function renderForm()\n\t{\n\t\t$this->beginForm();\n\t\t$this->renderMessageInput();\n\t\techo Html::beginTag('div', array('class' => 'chat-from-actions'));\n\t\t$this->renderSubmit();\n\t\techo Html::endTag('div');\n\t\t$this->endForm();\n\t}", "function ACPRenderSubmissionBox($preid, $presubid, $pretitle, $precontent, $prelink)\n\t{\n\t\t$pagecontent = '<form class=\"SSky_Form\" action=\"./acp.php?acp_page=' . $_GET['acp_page'] . '\" method=\"post\">';\t\n\t\t$pagecontent .= '<b> GameID: </b><input type=\"text\" name=\"gameid\" value=\"' . $preid . '\"><br>';\n\t\t$pagecontent .= '<b> Base Submission ID: </b><input type=\"text\" name=\"basesubid\" value=\"' . $presubid . '\"><br>';\n\t\t$pagecontent .= '<b> Submission Title (Max 64 chars): </b><input type=\"text\" maxlength=\"64\" name=\"subtitle\" value=\"' . $pretitle . '\"><br>';\n\t\t$pagecontent .= '<b> Submission Description (Max 5000 chars): </b><br><textarea rows=\"16\" maxlength=\"5000\" id=\"desc\" name=\"content\">' . $precontent . '</textarea><br>';\n\t\t$pagecontent .= '<b> URL: </b><input type=\"text\" name=\"sublink\" value=\"' . $prelink . '\"><br>';\n\t\t$pagecontent .= '<input type=\"submit\" value=\"Post Submission\">';\n\t\t$pagecontent .= '</form>';\n\t\treturn $pagecontent;\n\t}", "function form_shortcode( $atts ) {\n \n if ( isset( $atts['form'] ) ) {\n \n $form_id_or_key = $atts['form'];\n unset( $atts['form'] );\n \n ob_start();\n \n $this->render( $form_id_or_key, $atts );\n \n $output = ob_get_clean();\n \n return $output;\n \n }\n \n }", "function closeForm($submitValue=\"Submit\",$attr=\"\",$resetValue=\"Reset Form\",$printReset=true){\n\n\t\tif( $this->returnOutput ){ ob_start(); }\n\n\t\t//output hidden pkey field for update opertaions\n\t\tif( isset($this->pkeyID) ){\n\t\t\tif( isset($this->rc4key) ){\n\t\t\t\t$pkeyVal = $this->rc4->_encrypt( $this->rc4key, $this->rc4key.$this->pkeyID );\n\t\t\t} else $pkeyVal = $this->pkeyID;\n\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"pkey\\\" value=\\\"$pkeyVal\\\"/>\\n\";\n\t\t}\n\t\t//output hidden signature field for security check\n\t\tif( isset($this->rc4key) ){\n\t\t\t$sigVal = $this->rc4->_encrypt( $this->rc4key, implode(\",\",$this->signature) );\n\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"formitable_signature\\\" value=\\\"$sigVal\\\"/>\\n\";\n\t\t}\n\n\t\tif( isset($this->multiPageSubmitValue) ) $submitValue=$this->multiPageSubmitValue;\n\t\techo \"<div class=\\\"button\\\">\".($printReset?\"<input type=\\\"reset\\\" value=\\\"$resetValue\\\" class=\\\"reset\\\"/>\":\"\");\n\t\tif(strstr($submitValue,\"image:\"))\n\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"submit\\\"><input type=\\\"image\\\" src=\\\"\".str_replace(\"image:\",\"\",$submitValue).\"\\\" class=\\\"img\\\"\".($attr!=\"\"?\" \".$attr:\"\").\"/>\";\n\t\telse echo \"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"$submitValue\\\" class=\\\"submit\\\"\".($attr!=\"\"?\" \".$attr:\"\").\"/>\";\n\t\techo \"</div></form>\\n\";\n\n\t\tif( $this->returnOutput ){\n\t\t\t$html_block = ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\treturn $html_block;\n\t\t}\n\n\t}", "function membersemail_form()\n{\n $content = '';\n $content .= '<form method=\"post\" action=\"http://localhost/wordpress/thank-you/\">';\n\n $content .= '<input type=\"text\" name=\"full_name\" placeholder=\"Your Full Name\"/>';\n $content .= '<br />';\n\n $content .= '<input type=\"text\" name=\"email_address\" placeholder=\"Enter Email Address\"/>';\n $content .= '<br />';\n\n\n\n $content .= '<input type=\"submit\" name=\"membersemail_submit_form\" value=\"SUBMIT\" >';\n\n\n $content .= '</form>';\n return $content;\n}", "function form_submit($text = 'Submit', $options = array()) {\n $defaults = array(\n 'wrap' => true,\n 'class' => 'submit'\n );\n\n $options = array_merge($defaults, $options);\n\n $string = '<input type=\"submit\" value=\"' . $text . '\" />';\n\n if($options['wrap']) {\n $string = form__wrap(\n $string,\n array(\n 'label' => false\n )\n );\n }\n\n return html__output($string);\n}", "public function outputSetupForm()\n {\n $this->_directFormHtml('iContact');\n }", "function get_form( $id, $output = true ) {\n $_config = get('site');\n\n $the_form = $_config['forms'][$id];\n\n # Prepend output\n $output = '<div id=\"cf-form-' . $id . '\" class=\"cf-form\">\n <form action=\"/submit/'. $id .'\" method=\"post\">';\n\n # Build HTML\n foreach ( $the_form['fields'] as $key => $field ) {\n $output .= '<div class=\"field field-name-' . $key . ' field-type-' . $field['type'] . '\">\n ' . get_field_html($id, $key) . '\n </div>';\n }\n\n # Append output\n $output .= '<div class=\"field\">\n <button type=\"submit\" id=\"submit\">Submit</button>\n </div>\n</form>\n</div>';\n\n if ( $output === true ) {\n return $output;\n }\n\n echo $output;\n \n}", "function finishForm(& $agent) \n {\n $form = str_replace('{value}', $agent->query, $this->_inputTemplate);\n $form = str_replace('{name}', $this->_http_parameters['query'], $form);\n $form = str_replace('{namegroup}', $this->_http_parameters['group'], $form).'<br>';\n $form .= \"\\n\\tResults per page: \".$this->_getSelect(\n $this->_http_parameters['pagesize'],\n array('10' => '10', '20' => '20', '50' => '50')).'<br>';\n $form .= \"\\n\\tMatch: \".$this->_getSelect(\n $this->_http_parameters['mode'],\n array('All' => 'all', 'Any' => 'any', 'Boolean' => 'bool')).'<br>';\n $form .= \"\\n\\tSearch for: \".$this->_getSelect(\n $this->_http_parameters['wordmatch'],\n array(\n 'Whole word' => 'wrd',\n 'Beginning' => 'beg',\n 'Ending' => 'end',\n 'Substring' => 'sub'\n )).'<br>';\n $form .= \"\\n\\tSearch through: \".$this->_getSelect(\n $this->_http_parameters['type'],\n array(\n 'All types' => '',\n 'text/html' => 'text/html',\n 'text/plain' => 'text/plain'\n )).'<br>';\n $form .= \"\\n\\tSort by: \".$this->_getSelect(\n $this->_http_parameters['sortorder'],\n array('Relevancy' => 'RPD', 'Last Modified Date' => 'DRP')).'<br>';\n $form .= \"\\n\\tSearch in: \".$this->_getSelect(\n $this->_http_parameters['weightfactor'],\n array(\n 'all sections' => '2221',\n 'Description' => '2000',\n 'Keywords' => '0200',\n 'Title' => '0020',\n 'Body' => '0001'\n )).'<br>';\n \n $this->_form = str_replace('{content}', $form, $this->_formTemplate); \n $this->_html = $this->_form.\"\\n<hr>\".$this->_html;\n }", "protected function outputHTML() {\r\n echo new \\view\\components\\ErrorMessage(array(\r\n \"errorMessage\" => $this->errorMessage\r\n ));\r\n echo new \\view\\components\\ResultMessage(array(\r\n \"resultMessage\" => $this->resultMessage\r\n ));\r\n\t\t\r\n\t\techo new \\view\\components\\ObjavaForm(array(\r\n\t\t\t\"postAction\" => \\route\\Route::get('d3')->generate(array(\r\n\t\t\t\t\"controller\" => 'ozsn',\r\n\t\t\t\t\"action\" => 'modifyObjava'\r\n\t\t\t)) . \"?id=\" . $this->objava->idObjave,\r\n\t\t\t\"submitButtonText\" => \"Spremi promjene\",\r\n\t\t\t\"elektrijade\" => $this->elektrijade,\r\n\t\t\t\"mediji\" => $this->mediji,\r\n\t\t\t\"objava\" => $this->objava,\r\n\t\t\t\"objaveOElektrijadi\" => $this->objaveOElektrijadi\r\n\t\t));\r\n }", "function process_form()\n {\n }", "function sf_submission_form() \n{\n\tglobal $sfBaseDir;\n\t\n\t// output form jQuery\n\t$form .= '<script type=\"text/javascript\">\n\t\t//<![CDATA[\n\t\tjQuery(function($){\n\n\t\t\t$(\"#sf_submission\").submit(function() {\n\t\t\t // validate and process form here\n\t\t\t\tvar str = $(this).serialize();\t\t\t\t\t \n\t\t\t\t $.ajax({\n\t\t\t\t type: \"POST\",\n\t\t\t\t url: \"' . $sfBaseDir . 'includes/process-submission.php\",\n\t\t\t\t data: str,\n\t\t\t\t success: function(msg){\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#note\").ajaxComplete(function(event, request, settings)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tif(msg == \"OK\") // Message Sent? Show the Thank You message and hide the form\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tresult = \"Your question has been submitted. Thank you!\";\n\t\t\t\t\t\t\t\t$(\"#sf_submission\").fadeOut();\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\tresult = msg;\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t$(this).html(result);\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\treturn false;\n\t\t\t});\t\t\t\t\n\n\t\t}); // end jquery(function($))\n\t\t//]]> \n\t</script>';\t\n\t\n\t// form CSS\n\t$form .= '\n\t<style type=\"text/css\">\n\t\t#sf_submission fieldset { margin: 20px 0; }\n\t\t#sf_submission input, #sf_submission textarea { width: 99%; }\n\t\t#sf_submission #sf_submit { width: auto; }\n\t\t#note { color: #0085b9; }\n\t\t#note .notification_error { color: #b81236; }\n\t</style>\n\t';\n\t\n\t// output form HTML\n\t$form .= '<form id=\"sf_submission\">';\n\t\t$form .= '<fieldset>';\n\t\t\t$form .= '<div>';\n\t\t\t\t$form .= '<label for=\"sf_name\">Your Name</label><br/>';\n\t\t\t\t$form .= '<input type=\"text\" name=\"sf_name\" id=\"sf_name\"/>';\n\t\t\t$form .= '</div>';\n\t\t\t$form .= '<div>';\n\t\t\t\t$form .= '<label for=\"sf_email\">Your E-Mail</label><br/>';\n\t\t\t\t$form .= '<input type=\"text\" name=\"sf_email\" id=\"sf_email\"/>';\n\t\t\t$form .= '</div>';\n\t\t\t$form .= '<div>';\n\t\t\t\t$form .= '<label for=\"sf_title\">Question Title</label><br/>';\n\t\t\t\t$form .= '<input type=\"text\" name=\"sf_title\" id=\"sf_title\"/>';\n\t\t\t$form .= '</div>';\n\t\t\t$form .= '<div>';\n\t\t\t\t$form .= '<label for=\"sf_topic\">Question Topic</label><br/>';\n\t\t\t\t$form .= '<select name=\"sf_topic\" id=\"sf_topic\">';\n\t\t\t\t\t$terms = get_terms('faq_topics', array('hide_empty' => 0));\n\t\t\t\t\tforeach($terms as $term) {\n\t\t\t\t\t\t$form .= '<option value=\"' . $term->name .'\">' . $term->name . '</option>';\n\t\t\t\t\t}\n\t\t\t\t$form .= '</select>';\n\t\t\t$form .= '</div>';\n\t\t\t$form .= '<div>';\n\t\t\t\t$form .= '<label for=\"sf_question\">Your Question</label><br/>';\n\t\t\t\t$form .= '<textarea name=\"sf_question\" id=\"sf_question\" rows=\"8\">Ask your question here</textarea>';\n\t\t\t$form .= '</div>';\n\t\t\t$form .= '<div>';\n\t\t\t\t$math1 = rand(1,10);\n\t\t\t\t$math2 = rand(1,10);\n\t\t\t\t$form .= '<label for=\"sf_math\">Validate that you are human: ' . $math1 . '+' . $math2 . '</label><br/>';\n\t\t\t\t$form .= '<input type=\"text\" name=\"sf_math\" id=\"sf_math\"/><br/>';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"sf_math_1\" value=\"' . $math1 . '\"/>';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"sf_math_2\" value=\"' . $math2 . '\"/>';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"sf_referrer\" value=\"' . get_permalink() . '\"/>';\n\t\t\t\t$form .= '<input type=\"submit\" id=\"sf_submit\" value=\"Send Question\"/>';\n\t\t\t$form .= '</div>';\n\t\t$form .= '</fieldset>';\n\t$form .= '</form>';\n\t$form .= '<div id=\"note\"></div>';\n\n\treturn $form;\n}", "function content() {\n echo \"\n <form action='http://{$_SERVER['SERVER_NAME']}/mailmaid/subscriber/add' method='post'>\n <input name='token' type='hidden' value='{$this->params['token']}'>\n <label for='username'>Name</label>\n <input name='name' placeholder='Name' id='name' type='text' required>\n <label for='description'>Description</label>\n <input name='description' placeholder='Description (Optional)' id='description' type='text'>\n <input type='submit' value='Create List'>\n </form>\n \";\n }", "public function create_submit_form($cmid, $quba, $slot, $level) {\n $output = '';\n\n $processurl = new moodle_url('/mod/adaptivequiz/attempt.php');\n\n // Start the form.\n $attr = array('action' => $processurl, 'method' => 'post', 'enctype' => 'multipart/form-data', 'accept-charset' => 'utf-8',\n 'id' => 'responseform');\n $output .= html_writer::start_tag('form', $attr);\n $output .= html_writer::start_tag('div');\n\n // Print the question.\n $options = new question_display_options();\n $options->hide_all_feedback();\n $options->flags = question_display_options::HIDDEN;\n $options->marks = question_display_options::MAX_ONLY;\n\n $output .= $quba->render_question($slot, $options);\n\n $output .= html_writer::start_tag('div', array('class' => 'submitbtns adaptivequizbtn'));\n $output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'submitanswer',\n 'value' => get_string('submitanswer', 'mod_adaptivequiz')));\n $output .= html_writer::end_tag('div');\n\n // Some hidden fields to track what is going on.\n $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'cmid', 'value' => $cmid));\n\n $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'uniqueid', 'value' => $quba->get_id()));\n\n $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));\n\n $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'slots', 'value' => $slot));\n\n $output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'dl', 'value' => $level));\n\n // Finish the form.\n $output .= html_writer::end_tag('div');\n $output .= html_writer::end_tag('form');\n\n return $output;\n }", "public function submit() {\n $post = Post::submit();\n require_once('view/posts/submit.php');\n \n \n }", "private function output_acf_form($args = []){\n //if step 1 create new post, otherwise get post_id from url\n $requested_post_id = $this->get_requested_post_id();\n\n //get the current step we are in\n $requested_step = $this->get_requested_step();\n\n $args = wp_parse_args(\n $args,\n array(\n 'post_id' => $requested_post_id,\n 'step' => 'new_post' === $requested_post_id ? 1 : $requested_step,\n 'post_type' => $this->post_type,\n 'post_status' => 'publish',\n )\n );\n\n $submit_label = $args['step'] < count($this->step_ids) ? esc_html__('Save and Continue', 'caims') : esc_html__('Finish', 'caims');\n $current_step_fields = ($args['post_id'] !== 'new_post' && $args['step'] > 1) ? $this->step_ids[(int) $args['step'] - 1] : $this->step_ids[0];\n\n //show the progress bar before the form\n $this->display_progress_bar($args);\n\n /**\n * display the form with acf_form()\n */\n acf_form(\n array(\n 'id' => $this->form_id,\n 'post_id' => $args['post_id'],\n 'new_post' => array(\n 'post_type' => $args['post_type'],\n 'post_status' => $args['post_status']\n ),\n 'field_groups' => $current_step_fields,\n 'submit_value' => $submit_label,\n 'html_after_fields' => $this->output_hidden_fields($args)\n )\n );\n }", "function displayForm() {\n $output = '<form action=\"\" method=\"post\" name=\"commentForm\">' . \"\\n\";\n\n if ( $this->allow ) {\n $pos = strpos(\n strtoupper( addslashes( $this->allow ) ),\n strtoupper( addslashes( $this->getUser()->getName() ) )\n );\n }\n\n // 'comment' user right is required to add new comments\n if ( !$this->getUser()->isAllowed( 'comment' ) ) {\n $output .= wfMessage( 'comments-not-allowed' )->parse();\n } else {\n // Blocked users can't add new comments under any conditions...\n // and maybe there's a list of users who should be allowed to post\n // comments\n if ( $this->getUser()->isBlocked() == false && ( $this->allow == '' || $pos !== false ) ) {\n $output .= '<div class=\"c-form-title\">' . wfMessage( 'comments-submit' )->plain() . '</div>' . \"\\n\";\n $output .= '<div id=\"replyto\" class=\"c-form-reply-to\"></div>' . \"\\n\";\n // Show a message to anons, prompting them to register or log in\n if ( !$this->getUser()->isLoggedIn() ) {\n $login_title = SpecialPage::getTitleFor( 'Userlogin' );\n $register_title = SpecialPage::getTitleFor( 'Userlogin', 'signup' );\n $output .= '<div class=\"c-form-message\">' . wfMessage(\n 'comments-anon-message',\n htmlspecialchars( $register_title->getFullURL() ),\n htmlspecialchars( $login_title->getFullURL() )\n )->text() . '</div>' . \"\\n\";\n }\n\n $output .= '<textarea name=\"commentText\" id=\"comment\" rows=\"5\" cols=\"64\"></textarea>' . \"\\n\";\n $output .= '<div class=\"c-form-button\"><input type=\"button\" value=\"' .\n wfMessage( 'comments-post' )->plain() . '\" class=\"site-button\" /></div>' . \"\\n\";\n }\n $output .= '<input type=\"hidden\" name=\"action\" value=\"purge\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"pageId\" value=\"' . $this->id . '\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"commentid\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"lastCommentId\" value=\"' . $this->getLatestCommentID() . '\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"commentParentId\" />' . \"\\n\";\n $output .= '<input type=\"hidden\" name=\"' . $this->pageQuery . '\" value=\"' . $this->getCurrentPagerPage() . '\" />' . \"\\n\";\n $output .= Html::hidden( 'token', $this->getUser()->getEditToken() );\n }\n $output .= '</form>' . \"\\n\";\n return $output;\n }", "function submit_form($form)\n {\n }", "function tower_claims_form() {\n ob_start();\n include('template-parts/form-claim.php');\n $html = ob_get_contents();\n ob_end_clean();\n return $html;\n}", "function newPostForm($returnFile) {\n\t\tglobal $mysqli, $loggedInUser, $wallUsername;\n\t\t\n\t\trestartMysqli();\n\t\t\n\t\tprintf(\"<div class='post'>\");\n\t\tprintf(\"<div class='postHeader'>Write on %s's wall: </div>\", $wallUsername);\n\t\tprintf('<form action=\"addPost.php\" method=\"post\">');\n\t\tprintf('Title: <input type=\"text\" name=\"title\"><br>');\n\n\t\tprintf('Content: <input type=\"textarea\" name=\"content\"><br>');\n\t\tprintf('Embed Photo: <input type=\"text\" name=\"photo\"> <br>');\n\t\t$query = sprintf(\"select * from location\");\n\t\t//drop down for locations\n\t\t$locationResults = $mysqli->query($query);\n\t\tprintf('Location: <select name=\"location\">');\n\t\tprintf('<option value=\"\"></option>');\n\t\tif ($locationResults->num_rows > 0) {\n\t\t\twhile ($location = $locationResults->fetch_assoc()) {\n\t\t\t\tprintf('<option value=\"%s\">%s</option>', $location[\"locName\"], $location[\"locName\"]);\n\t\t\t}\n\t\t}\n\t\tprintf('</select><br>');\n\t\t//drop down for visibility\n\t\t$query = sprintf(\"select * from visibility\");\n\t\t$visibilityResults = $mysqli->query($query);\n\t\tprintf('Visibility: <select name=\"visibility\">');\n\t\tif ($visibilityResults->num_rows > 0) {\n\t\t\twhile ($visibilityRow = $visibilityResults->fetch_assoc()) {\n\t\t\t\tprintf('<option value=\"%s\">%s</option>', $visibilityRow[\"level\"], $visibilityRow[\"level\"]);\n\t\t\t}\n\t\t}\n\t\tprintf('</select><br>');\n\t\tprintf('<input type=\"hidden\" name=\"poster\" value=\"%s\">', $loggedInUser);\n\t\tprintf('<input type=\"hidden\" name=\"postee\" value=\"%s\">', $wallUsername);\n\t\tprintf('<input type=\"hidden\" name=\"returnFile\" value=\"%s\">', $returnFile);\n\t\tprintf('<input type=\"submit\" value=\"POST\">');\n\t\tprintf('</form>');\n\t\tprintf(\"</div>\");\n\t}", "function printForm(){\r\n\techo '<h2>Course Lookup</h2>';\r\n\t// print user entry form\r\n echo '<a class=\"btn\" href=\"https://github.com/cmstewar/cis355\" >Git-Hub code</a>';\r\n echo '&nbsp; &nbsp;<a class=\"btn\" href=\"index.php\">Homepage</a><br><br>';\r\n\techo \"<form action='courses.php'>\";\r\n\techo \"Course Prefix (Department)<br/>\";\r\n\techo \"<input type='text' placeholder='Either CS or CIS' name='prefix'><br/>\";\r\n\techo \"Course Number<br/>\";\r\n\techo \"<input type='text' placeholder='Course Number (116)' name='courseNumber'><br/>\";\r\n\techo \"Instructor<br/>\";\r\n\techo \"<input type='text' placeholder='Username (gpcorser)' name='instructor'><br/>\";\r\n\techo \"Day of the week<br/>\";\r\n echo \"<input type='text' placeholder='Day of the Week' name='weekDay'><br><br/>\";\r\n\techo \"<input type='submit' value='Submit'>\";\r\n\techo \"</form>\";\r\n}", "public function form()\r\n\t{\r\n\t?>\r\n\t\t<table class=\"form-table\">\r\n\t\t\t<tbody>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t<?php _e( 'Lorsqu\\'une nouvelle contribution est publiée', 'tify' );?>\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\t\ttify_control_switch( \r\n\t\t\t\t\t\t\tarray( \r\n\t\t\t\t\t\t\t\t'name' \t\t=> 'tify_forum_options[mailing][contribs_notify]', \r\n\t\t\t\t\t\t\t\t'checked' \t=> (int) \\tiFy\\Plugins\\Forum\\Options::get( 'mailing::contribs_notify' ),\r\n\t\t\t\t\t\t\t\t'value_on'\t=> 1,\r\n\t\t\t\t\t\t\t\t'value_off'\t=> 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?>\t\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th scope=\"row\">\r\n\t\t\t\t\t\t<?php _e( 'Lorsqu\\'une contribution est en attente de modération', 'tify' );?>\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\t\ttify_control_switch( \r\n\t\t\t\t\t\t\tarray( \r\n\t\t\t\t\t\t\t\t'name' \t\t=> 'tify_forum_options[mailing][moderation_notify]', \r\n\t\t\t\t\t\t\t\t'checked' \t=> (int) \\tiFy\\Plugins\\Forum\\Options::get( 'mailing::moderation_notify' ),\r\n\t\t\t\t\t\t\t\t'value_on'\t=> 1,\r\n\t\t\t\t\t\t\t\t'value_off'\t=> 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?>\t\r\n\t\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t<?php\t\t\r\n\t}", "function displayForm($email, $accessToken) {\n echo <<<END\n<form method=\"POST\" action=\"oauth2.php\">\n <h1>Please enter your e-mail address: </h1>\n <input type=\"text\" name=\"email\" value=\"$email\"/>\n <p>\n <h1>Please enter your access token: </h1>\n <input type=\"text\" name=\"access_token\" value=\"$accessToken\"/>\n <input type=\"submit\"/>\n</form>\n<hr>\nEND;\n}", "function onGetFormHead($output = false) {\n\t\t\n\t\t$html = '<div id=\"bf_previewform_div_' . $this->_FORM_CONFIG ['id'] . '\"></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_preview\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t//$html .= '<div id=\"bf_pleasewait_submit\"><h2>' . bfText::_ ( 'Please wait a moment, while we validate &amp; submit your submission...' ) . '</h2><br/><img src=\"' . bfCompat::getLiveSite () . '/' . bfCompat::mambotsfoldername () . '/system/blueflame/view/images/check_throbber.gif\" alt=\"throbber\" /></div>';\n\t\t$html .= \"\\n\\n\" . '<form %s>';\n\t\t\n\t\t$JMenu = JMenu::getInstance ( 'site' );\n\t\t$activeMenu = $JMenu->getActive ();\n\t\t$activeMenu === null ? $Itemid = 1 : $Itemid = $activeMenu->id;\n\t\t\n\t\t$attributes = array ();\n\t\t$attributes ['method'] = 'method=\"' . strtolower ( $this->_FORM_CONFIG ['method'] ) . '\"';\n\t\t$attributes ['action'] = 'action=\"' . ($this->_FORM_CONFIG ['processorurl'] ? $this->_FORM_CONFIG ['processorurl'] : bfCompat::getLiveSite () . '/index.php?Itemid=' . ($Itemid ? $Itemid : '1')) . '\"';\n\t\t$attributes ['name'] = 'name=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['id'] = 'id=\"' . 'BF_FORM_' . $this->_FORM_CONFIG ['id'] . '\"';\n\t\t$attributes ['enctype'] = 'enctype=\"' . $this->_FORM_CONFIG ['enctype'] . '\"';\n\t\t$attributes ['class'] = ' class=\"bfform ' . $this->_FORM_CONFIG ['layout'] . 'form\"';\n\t\t$attributes ['target'] = ' target=\"' . ($this->_FORM_CONFIG ['target'] ? $this->_FORM_CONFIG ['target'] : '_self') . '\"';\n\t\t\n\t\tksort ( $attributes );\n\t\t\n\t\t$attributes = implode ( ' ', $attributes );\n\t\t\n\t\t$html = sprintf ( $html, $attributes );\n\t\t\n\t\tswitch ($output) {\n\t\t\tcase true :\n\t\t\t\techo $html;\n\t\t\t\tbreak;\n\t\t\tcase false :\n\t\t\t\treturn $html;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn true;\n\t}", "public function form()\n\t{\n\t\tglobal $L;\n\n\t\t$html = '<div class=\"mb-3\">';\n\t\t$html .= '<label class=\"form-label\" for=\"label\">' . $L->get('Label') . '</label>';\n\t\t$html .= '<input class=\"form-control\" id=\"label\" name=\"label\" type=\"text\" value=\"' . $this->getValue('label') . '\">';\n\t\t$html .= '<div class=\"form-text\">' . $L->get('This title is almost always used in the sidebar of the site') . '</div>';\n\t\t$html .= '</div>';\n\n\t\tif (defined('BLUDIT_PRO')) {\n\t\t\t$html .= '<div class=\"mb-3\">';\n\t\t\t$html .= '<label class=\"form-label\" for=\"excludeAdmins\">' . $L->get('Exclude administrators users') . '</label>';\n\t\t\t$html .= '<select class=\"form-select\" id=\"excludeAdmins\" name=\"excludeAdmins\">';\n\t\t\t$html .= '<option value=\"true\" ' . ($this->getValue('excludeAdmins') === true ? 'selected' : '') . '>' . $L->get('Enabled') . '</option>';\n\t\t\t$html .= '<option value=\"false\" ' . ($this->getValue('excludeAdmins') === false ? 'selected' : '') . '>' . $L->get('Disabled') . '</option>';\n\t\t\t$html .= '</select>';\n\t\t\t$html .= '</div>';\n\t\t}\n\n\t\treturn $html;\n\t}", "public function submit() {\r\n\t\t$name_value_pairs = array();\r\n\t\tforeach ( $this->request_data as $key => $value ) {\r\n\t\t\t$name_value_pairs[] = $key . '=' . rawurlencode( $value );\r\n\t\t}\r\n\r\n\t\t$url = 'https://mms.paymentsensegateway.com/Pages/PublicPages/PaymentForm.aspx';\r\n\t\t$params = implode( '&', $name_value_pairs );\r\n\t\theader( 'Location: ' . $url . '?' . $params, false );\r\n\t\texit();\r\n\t}", "function process_form_submission() {\n\t\t// Add a filter to replace tokens in the subject field with sanitized field values\n\t\tadd_filter( 'contact_form_subject', array( $this, 'replace_tokens_with_input' ), 10, 2 );\n\n\t\t$id = stripslashes( $_POST['contact-form-id'] );\n\n\t\tif ( is_user_logged_in() ) {\n\t\t\tcheck_admin_referer( \"contact-form_{$id}\" );\n\t\t}\n\n\t\t$is_widget = 0 === strpos( $id, 'widget-' );\n\n\t\t$form = false;\n\n\t\tif ( $is_widget ) {\n\t\t\t// It's a form embedded in a text widget\n\n\t\t\t$this->current_widget_id = substr( $id, 7 ); // remove \"widget-\"\n\t\t\t$widget_type = implode( '-', array_slice( explode( '-', $this->current_widget_id ), 0, -1 ) ); // Remove trailing -#\n\n\t\t\t// Is the widget active?\n\t\t\t$sidebar = is_active_widget( false, $this->current_widget_id, $widget_type );\n\n\t\t\t// This is lame - no core API for getting a widget by ID\n\t\t\t$widget = isset( $GLOBALS['wp_registered_widgets'][$this->current_widget_id] ) ? $GLOBALS['wp_registered_widgets'][$this->current_widget_id] : false;\n\n\t\t\tif ( $sidebar && $widget && isset( $widget['callback'] ) ) {\n\t\t\t\t// This is lamer - no API for outputting a given widget by ID\n\t\t\t\tob_start();\n\t\t\t\t// Process the widget to populate Grunion_Contact_Form::$last\n\t\t\t\tcall_user_func( $widget['callback'], array(), $widget['params'][0] );\n\t\t\t\tob_end_clean();\n\t\t\t}\n\t\t} else {\n\t\t\t// It's a form embedded in a post\n\n\t\t\t$post = get_post( $id );\n\n\t\t\t// Process the content to populate Grunion_Contact_Form::$last\n\t\t\tapply_filters( 'the_content', $post->post_content );\n\t\t}\n\n\t\t$form = Grunion_Contact_Form::$last;\n\n\t\tif ( ! $form )\n\t\t\treturn false;\n\n\t\tif ( is_wp_error( $form->errors ) && $form->errors->get_error_codes() )\n\t\t\treturn $form->errors;\n\n\t\t// Process the form\n\t\treturn $form->process_submission();\n\t}", "function print_form($val) {\n\n\n\n #$sign = hash_hmac('sha256', $_SESSION['login'], $_SESSION['username']);\n $sign = hash('sha256', $_SESSION['username']);\n\n /* This line is purely stylistic. */\n echo '<p><i>Leave a question/comment:</i></p>';\n\n echo '<span id=\"helpBlock\" class=\"help-block\" style=\"color:red;\"></span>';\n\n $form = '<form method=\"post\" onsubmit=\"return checkValid(comment)\" action=\"#\"><textarea name=\"comment\" id=\"comment\" style=\"';\n\n /* toggle CSS on textarea based on validation */\n if (($val == 1)||($val == 3)) {\n\n $form .= 'border: 1px solid #912; ';\n\n }\n\n $form .= 'width: 80%; height: 10em;\">';\n\n /* display post data if any part of the form is invalid */\n if ($val != 0) {\n\n $form .= ($_POST['comment']);\n\n }\n\n $form .= '</textarea><p><i>Your name: </i> <b>';\n\n $form .= '<input type=\"hidden\" name=\"token256\" id=\"token256\" value=\"' . $sign . '\">';\n $form .= $_SESSION['username'] . '</b>';\n\n $form .= '</p><p><input type=\"Submit\" value=\"Post comment\"></p>';\n\n $from .= '<span id=\"helpBlock\" class=\"help-block\" style=\"color:red;\"></span></form>';\n\n $form .= '<form method=\"post\"><p><input type=\"submit\" value=\"Log me out\" name=\"logout\" ></p></form>';\n \n echo $form;\n\n\n}", "public static function display_create_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=save' method='post'>\";\n echo \"Name: <input type='text' name='name' /><br />\";\n echo \"Description: <textarea name='description'></textarea><br />\";\n echo \"<input type='submit' value='Save' />\";\n echo \"</form>\";\n }", "function PrintHTML(){ if(isset($_SESSION['form_msg'])) {\r\n $html = \"<div class=\\\"wrapper wrapper-content msg-form\\\">\";\r\n $html .= \" <div class=\\\"alert alert-success\\\" role=\\\"alert\\\">\" . $_SESSION['form_msg'] . \"</div>\";\r\n $html .= \"</div>\";\r\n $this->html .= $html;\r\n unset($_SESSION['form_msg']);\r\n }\r\n\r\n\r\n //Tem mensagem pra exibir?\r\n if(isset($_SESSION['form_msg_error'])) {\r\n $html = \"<div class=\\\"wrapper wrapper-content msg-form\\\">\";\r\n $html .= \" <div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\" . $_SESSION['form_msg_error'] . \"</div>\";\r\n $html .= \"</div>\";\r\n $this->html .= $html;\r\n unset($_SESSION['form_msg_error']);\r\n }\r\n\r\n\r\n // Content..\r\n $html = \"<div class=\\\"wrapper wrapper-content animated fadeInRight\\\">\";\r\n $html .= \" <div class=\\\"row\\\">\";\r\n $html .= \" <form method=\\\"post\\\" class=\\\"$this->class form-horizontal\\\" action=\\\"\" . get_config('SITE_URL') . \"/script/\" . $this->script_action . \"\\\">\";\r\n\r\n //Se for edição, adiciona campo oculto com ID\r\n if(isset($this->reg->ID)){\r\n $html .= \"<input name=\\\"id\\\" value=\\\"\" . $this->reg->ID . \"\\\" type=\\\"hidden\\\">\";\r\n }\r\n\r\n // BOXES\r\n foreach($this->boxes as $box){\r\n $html .= $box->GetHTML();\r\n }\r\n\r\n\r\n //Ações\r\n $html .= \"<div class=\\\"clearboth\\\"></div>\";\r\n $html .= \"<!-- ACTIONS -->\";\r\n $html .= \"<div class=\\\"col-lg-12\\\">\";\r\n $html .= \" <div class=\\\"form-group\\\">\";\r\n $html .= \" <div class=\\\"pull-right btn-actions\\\">\";\r\n\r\n if(GetParam(GetParamsCount()-2) == 'edit'){\r\n\r\n if(empty($this->linkNovo))\r\n $this->linkNovo = GetLink(GetPage()) . '/add';\r\n\r\n $html .= \" <a href=\\\"\" . $this->linkNovo . \"\\\" class=\\\"btn btn-info btn-xs\\\" type=\\\"submit\\\">Adicionar novo</a>\";\r\n }\r\n\r\n if(empty($this->linkVoltar))\r\n $this->linkVoltar = GetLink(GetPage());\r\n\r\n $html .= \" <a href=\\\"\" . $this->linkVoltar . \"\\\" class=\\\"btn btn-white\\\" type=\\\"submit\\\">Voltar</a>\";\r\n $html .= \" <button class=\\\"btn btn-primary\\\" type=\\\"submit\\\">\" . ( (GetParam(GetParamsCount()-1) == 'add')?'Adicionar':'Atualizar' ) . \"</button>\";\r\n $html .= \" </div>\";\r\n $html .= \" </div>\";\r\n $html .= \"</div>\";\r\n\r\n\r\n $html .= \" </form>\";\r\n $html .= \" </div>\";\r\n $html .= \"</div>\";\r\n $this->html .= $html;\r\n\r\n echo($this->html);\r\n }", "function show_form()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$raw_post = \"\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Unconvert the saved post if required\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! isset($_POST['Post']) )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// If we're using RTE, then just clean up html\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->han_editor->method == 'rte' )\n\t\t\t{\n\t\t\t\t$raw_post = $this->parser->convert_ipb_html_to_html( $this->orig_post['post'] );\n\n\t\t\t\tif( intval($this->orig_post['post_htmlstate']) AND $this->forum['use_html'] AND $this->ipsclass->member['g_dohtml'] )\n\t\t\t\t{\n\t\t\t\t\t# Make EMO_DIR safe so the ^> regex works\n\t\t\t\t\t$raw_post = str_replace( \"<#EMO_DIR#>\", \"&lt;#EMO_DIR&gt;\", $raw_post );\n\t\t\t\t\t\n\t\t\t\t\t# New emo\n\t\t\t\t\t$raw_post = preg_replace( \"#(\\s)?<([^>]+?)emoid=\\\"(.+?)\\\"([^>]*?)\".\">(\\s)?#is\", \"\\\\1\\\\3\\\\5\", $raw_post );\n\t\t\t\t\t\n\t\t\t\t\t# And convert it back again...\n\t\t\t\t\t$raw_post = str_replace( \"&lt;#EMO_DIR&gt;\", \"<#EMO_DIR#>\", $raw_post );\n\n\t\t\t\t\t$raw_post = $this->parser->convert_std_to_rte( $raw_post );\n\t\t\t\t}\n\n\t\t\t\tif( isset($this->orig_post['post_htmlstate']) AND $this->orig_post['post_htmlstate'] == 2 )\n\t\t\t\t{\n\t\t\t\t\t$raw_post = str_replace( '&lt;br&gt;', \"<br />\", $raw_post );\n\t\t\t\t\t$raw_post = str_replace( '&lt;br /&gt;', \"<br />\", $raw_post );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->orig_post['post_htmlstate'] = isset($this->orig_post['post_htmlstate']) ? $this->orig_post['post_htmlstate'] : 0;\n\t\t\t\t$this->parser->parse_html = intval($this->orig_post['post_htmlstate']) AND $this->forum['use_html'] AND $this->ipsclass->member['g_dohtml'] ? 1 : 0;\n\t\t\t\t$this->parser->parse_nl2br = (isset($this->orig_post['post_htmlstate']) AND $this->orig_post['post_htmlstate'] == 2) ? 1 : 0;\n\t\t\t\t$this->parser->parse_smilies = intval($this->orig_post['use_emo']);\n\t\t\t\t$this->parser->parse_bbcode = $this->forum['use_ibc'];\n\n\t\t\t\tif( $this->parser->parse_html )\n\t\t\t\t{\n\t\t\t\t\t# Make EMO_DIR safe so the ^> regex works\n\t\t\t\t\t$this->orig_post['post'] = str_replace( \"<#EMO_DIR#>\", \"&lt;#EMO_DIR&gt;\", $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\t# New emo\n\t\t\t\t\t$this->orig_post['post'] = preg_replace( \"#(\\s)?<([^>]+?)emoid=\\\"(.+?)\\\"([^>]*?)\".\">(\\s)?#is\", \"\\\\1\\\\3\\\\5\", $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\t# And convert it back again...\n\t\t\t\t\t$this->orig_post['post'] = str_replace( \"&lt;#EMO_DIR&gt;\", \"<#EMO_DIR#>\", $this->orig_post['post'] );\n\t\t\t\t\n\t\t\t\t\t$this->orig_post['post'] = $this->parser->convert_ipb_html_to_html( $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\t$this->orig_post['post'] = htmlspecialchars( $this->orig_post['post'] );\n\t\t\t\t\t\n\t\t\t\t\tif( $this->parser->parse_nl2br )\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->orig_post['post'] = str_replace( '&lt;br&gt;', \"\\n\", $this->orig_post['post'] );\n\t\t\t\t\t\t$this->orig_post['post'] = str_replace( '&lt;br /&gt;', \"\\n\", $this->orig_post['post'] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$raw_post = $this->parser->pre_edit_parse( $this->orig_post['post'] );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( $this->han_editor->method != 'rte' )\n\t\t\t{\n\t\t\t\t$_POST['Post'] = str_replace( '&', '&amp;', $_POST['Post'] );\n\t\t\t}\n\n\t\t\tif ( $this->ipsclass->input['_from'] == 'quickedit' )\n\t\t\t{\n\t\t\t\t$this->orig_post['post_htmlstatus'] = isset($this->orig_post['post_htmlstatus']) ? $this->orig_post['post_htmlstatus'] : 0;\n\t\t\t\t$this->parser->parse_html = intval($this->orig_post['post_htmlstatus']) AND $this->forum['use_html'] AND $this->ipsclass->member['g_dohtml'] ? 1 : 0;\n\t\t\t\t$this->parser->parse_nl2br = (isset($this->ipsclass->input['post_htmlstatus']) AND $this->ipsclass->input['post_htmlstatus'] == 2) ? 1 : 0;\n\t\t\t\t$this->parser->parse_smilies = intval($this->orig_post['use_emo']);\n\t\t\t\t$this->parser->parse_bbcode = $this->forum['use_ibc'];\n\n\t\t\t\tif ( $this->han_editor->method == 'rte' )\n\t\t\t\t{\n\t\t\t\t\t$raw_post = $this->parser->convert_std_to_rte( $this->ipsclass->txt_stripslashes( $_POST['Post'] ) );\n\t\t\t\t\t\n\t\t\t\t\tforeach( $this->ipsclass->skin['_macros'] as $row )\n\t\t\t \t{\n\t\t\t\t\t\tif ( $row['macro_value'] != \"\" )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$raw_post = str_replace( \"<{\".$row['macro_value'].\"}>\", $row['macro_replace'], $raw_post );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$raw_post = str_replace( \"<#IMG_DIR#>\", $this->ipsclass->skin['_imagedir'], $raw_post );\n\t\t\t\t\t$raw_post = str_replace( \"<#EMO_DIR#>\", $this->ipsclass->skin['_emodir'] , $raw_post );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$raw_post = $this->ipsclass->txt_stripslashes( $_POST['Post'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$raw_post = $this->ipsclass->txt_stripslashes( $_POST['Post'] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Is this the first post in the topic?\n\t\t//-----------------------------------------\n\t\t\n\t\t$topic_title = \"\";\n\t\t$topic_desc = \"\";\n\t\t\n\t\tif ( $this->edit_title == 1 )\n\t\t{\n\t\t\t$topic_title = isset($_POST['TopicTitle']) ? $this->ipsclass->input['TopicTitle'] : $this->topic['title'];\n\t\t\t$topic_desc = isset($_POST['TopicDesc']) ? $this->ipsclass->input['TopicDesc'] : $this->topic['description'];\n\t\t\t\n\t\t\t$topic_title = $this->ipsclass->compiled_templates['skin_post']->topictitle_fields( array( 'TITLE' => $topic_title, 'DESC' => $topic_desc ) );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Do we have any posting errors?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( isset($this->obj['post_errors']) AND $this->obj['post_errors'] )\n\t\t{\n\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_post']->errors( $this->ipsclass->lang[ $this->obj['post_errors'] ]);\n\t\t}\n\t\t\n\t\tif ( isset($this->obj['preview_post']) AND $this->obj['preview_post'] )\n\t\t{\n\t\t\t$this->output .= $this->ipsclass->compiled_templates['skin_post']->preview( $this->show_post_preview( $this->post['post'], $this->post_key ) );\n\t\t}\n\t\t\n\t\t$this->output .= $this->html_start_form( array( 1 => array( 'CODE' , '09' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t2 => array( 't' , $this->topic['tid']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t3 => array( 'p' , $this->ipsclass->input['p'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t4 => array( 'st' , $this->ipsclass->input['st'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t5 => array( 'attach_post_key', $this->post_key )\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\t\t\n\t\t//-----------------------------------------\n\t\t// START TABLE\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_post']->table_structure();\n\t\t\n\t\t$start_table = $this->ipsclass->compiled_templates['skin_post']->table_top( \"{$this->ipsclass->lang['top_txt_edit']} {$this->topic['title']}\");\n\t\t\n\t\t$name_fields = $this->html_name_field();\n\t\t\n\t\t$post_box = $this->html_post_body( $raw_post );\n\t\t\t\n\t\t$mod_options = $this->edit_title == 1 ? $this->mod_options('edit') : '';\n\t\t\n\t\t$end_form = $this->ipsclass->compiled_templates['skin_post']->EndForm( $this->ipsclass->lang['submit_edit'] );\n\t\t\n\t\t$post_icons = $this->html_post_icons($this->orig_post['icon_id']);\n\t\t\n\t\t$upload_field = $this->can_upload ? $this->html_build_uploads($this->post_key,'edit',$this->orig_post['pid']) : '';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Still here?\n\t\t//-----------------------------------------\n\t\t\n\t\t$poll_box = \"\";\n\t\t\n\t\tif ( $this->can_add_poll )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Did someone hit preview / do we have\n\t\t\t// post info?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$poll_questions = \"\";\n\t\t\t$poll_choices = \"\";\n\t\t\t$poll_votes = \"\";\n\t\t\t$show_open = 0;\n\t\t\t$is_mod = 0;\n\t\t\t$poll_only\t\t= \"\";\n\t\t\t$poll_multi\t\t= \"\";\t\t\t\n\t\t\t\n\t\t\tif ( isset($_POST['question']) AND is_array( $_POST['question'] ) and count( $_POST['question'] ) )\n\t\t\t{\n\t\t\t\tforeach( $_POST['question'] as $id => $question )\n\t\t\t\t{\n\t\t\t\t\t$poll_questions .= \"\\t{$id} : '\".str_replace( \"'\", '&#39;', $question ).\"',\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_question = $this->ipsclass->input['poll_question'];\n\t\t\t\t$show_open = 1;\n\t\t\t\t\n\t\t\t\tif ( is_array( $_POST['choice'] ) and count( $_POST['choice'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $_POST['choice'] as $id => $choice )\n\t\t\t\t\t{\n\t\t\t\t\t\t$poll_choices .= \"\\t'{$id}' : '\".str_replace( \"'\", '&#39;', $choice ).\"',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( isset($_POST['multi']) AND is_array( $_POST['multi'] ) and count( $_POST['multi'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $_POST['multi'] as $id => $checked )\n\t\t\t\t\t{\n\t\t\t\t\t\t$poll_multi .= \"\\t{$id} : '{$checked}',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( is_array( $_POST['votes'] ) and count( $_POST['votes'] ) )\n\t\t\t\t{\n\t\t\t\t\tforeach( $_POST['votes'] as $id => $vote )\n\t\t\t\t\t{\n\t\t\t\t\t\t$poll_votes .= \"\\t'{$id}' : '\".$vote.\"',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_only = 0;\n\t\t\t\t\n\t\t\t\tif( $this->ipsclass->vars['ipb_poll_only'] AND $this->ipsclass->input['poll_only'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t$poll_only = \"checked='checked'\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_questions = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_questions );\n\t\t\t\t$poll_choices = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_choices );\n\t\t\t\t$poll_multi \t= preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_multi );\n\t\t\t\t$poll_votes = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_votes );\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Load the poll from the DB\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'polls', 'where' => \"tid=\".$this->topic['tid'] ) );\n\t\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t \t\t$this->poll_data = $this->ipsclass->DB->fetch_row();\n\t \t\t\n\t \t\t$this->poll_answers = $this->poll_data['choices'] ? unserialize(stripslashes($this->poll_data['choices'])) : array();\n\n \t\t//-----------------------------------------\n \t\t// Lezz go\n \t\t//-----------------------------------------\n \t\t\n \t\tforeach( $this->poll_answers as $question_id => $data )\n \t\t{\n \t\t\t$poll_questions .= \"\\t{$question_id} : '\".str_replace( \"'\", '&#39;', $data['question'] ).\"',\\n\";\n \t\t\t\n \t\t\t$data['multi']\t = isset($data['multi']) ? intval($data['multi']) : 0;\n \t\t\t$poll_multi \t.= \"\\t{$question_id} : '\".$data['multi'].\"',\\n\";\n \t\t\t\n \t\t\tforeach( $data['choice'] as $choice_id => $text )\n\t\t\t\t\t{\n\t\t\t\t\t\t$choice = $text;\n\t\t\t\t\t\t$votes = intval($data['votes'][ $choice_id ]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$poll_choices .= \"\\t'{$question_id}_{$choice_id}' : '\".str_replace( \"'\", '&#39;', $choice ).\"',\\n\";\n\t\t\t\t\t\t$poll_votes .= \"\\t'{$question_id}_{$choice_id}' : '\".$votes.\"',\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$poll_only = 0;\n\t\t\t\t\n\t\t\t\tif ( $this->ipsclass->vars['ipb_poll_only'] AND $this->poll_data['poll_only'] == 1 )\n\t\t\t\t{\n\t\t\t\t\t$poll_only = \"checked='checked'\";\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Trim off trailing commas (Safari hates it)\n\t\t\t\t//-----------------------------------------\n\t\t\t\t\n\t\t\t\t$poll_questions = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_questions );\n\t\t\t\t$poll_choices = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_choices );\n\t\t\t\t$poll_multi \t= preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_multi );\n\t\t\t\t$poll_votes = preg_replace( \"#,(\\n)?$#\", \"\\\\1\", $poll_votes );\n\t\t\t\t\n\t\t\t\t$poll_question = $this->poll_data['poll_question'];\n\t\t\t\t$show_open = $this->poll_data['choices'] ? 1 : 0;\n\t\t\t\t$is_mod = $this->can_add_poll_mod;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Print poll box\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$poll_box = $this->ipsclass->compiled_templates['skin_post']->poll_box( $this->max_poll_questions, $this->max_poll_choices_per_question, $poll_questions, $poll_choices, $poll_votes, $show_open, $poll_question, $is_mod, $poll_multi, $poll_only );\n\t\t}\n\t\t\n\t\t$edit_option = \"\";\n\t\t\n\t\tif ($this->ipsclass->member['g_append_edit'])\n\t\t{\n\t\t\t$checked = \"\";\n\t\t\t$show_reason = 0;\n\t\t\t\n\t\t\tif ($this->orig_post['append_edit'])\n\t\t\t{\n\t\t\t\t$checked = \"checked\";\n\t\t\t}\n\t\t\t\n\t\t\tif ( $this->moderator['edit_post'] OR $this->ipsclass->member['g_is_supmod'] )\n\t\t\t{\n\t\t\t\t$show_reason = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$edit_option = $this->ipsclass->compiled_templates['skin_post']->add_edit_box( $checked, $show_reason, $this->ipsclass->input['post_edit_reason'] ? $this->ipsclass->input['post_edit_reason'] : $this->orig_post['post_edit_reason'] );\n\t\t}\n\t\t\n\t\t$this->output = str_replace( \"<!--START TABLE-->\" , $start_table , $this->output );\n\t\t$this->output = str_replace( \"<!--NAME FIELDS-->\" , $name_fields , $this->output );\n\t\t$this->output = str_replace( \"<!--POST BOX-->\" , $post_box , $this->output );\n\t\t$this->output = str_replace( \"<!--POLL BOX-->\" , $poll_box , $this->output );\n\t\t$this->output = str_replace( \"<!--POST ICONS-->\" , $post_icons , $this->output );\n\t\t$this->output = str_replace( \"<!--END TABLE-->\" , $end_form , $this->output );\n\t\t$this->output = str_replace( \"<!--UPLOAD FIELD-->\", $upload_field , $this->output );\n\t\t$this->output = str_replace( \"<!--MOD OPTIONS-->\" , $edit_option . $mod_options , $this->output );\n\t\t$this->output = str_replace( \"<!--FORUM RULES-->\" , $this->ipsclass->print_forum_rules($this->forum), $this->output );\n\t\t$this->output = str_replace( \"<!--TOPIC TITLE-->\" , $topic_title , $this->output );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Add in siggy buttons and such\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->input['post_htmlstatus'] = $this->orig_post['post_htmlstate'];\n\t\t$this->ipsclass->input['enablesig']\t\t = $this->orig_post['use_sig'];\n\t\t$this->ipsclass->input['enableemo']\t\t = $this->orig_post['use_emo'];\n\t\t\n\t\t$this->html_checkboxes('edit', $this->topic['tid'], $this->forum['id']);\n\t\t\n\t\t$this->html_topic_summary( $this->topic['tid'] );\n\t\t\n\t\t$this->show_post_navigation();\n\t\t\t\t\t\t \n\t\t$this->title = $this->ipsclass->lang['editing_post'].' '.$this->topic['title'];\n\t\t\n\t\t$this->ipsclass->print->add_output( $this->output );\n\t\t\n $this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->vars['board_name'].\" -> \".$this->title,\n \t\t\t\t\t \t 'JS' => 1,\n \t\t\t\t\t \t 'NAV' => $this->nav,\n \t\t\t\t\t ) );\n\t}", "public function form()\n\t{\n\t\tglobal $L;\n\t\t$sentEmails = $this->getSentEmailsArray();\n\n\t\t$html = '<div class=\"alert alert-primary\" role=\"alert\">';\n\t\t$html .= $this->description();\n\t\t$html .= '</div>';\n\n\t\t$html .= '<div>';\n\t\t// API key\n\t\t$html .= '<label><strong>Buttondown API Key</strong></label>';\n\t\t$html .= '<input id=\"apiKey\" name=\"apiKey\" type=\"text\" value=\"'.$this->getValue('apiKey').'\">';\n\t\t$html .= '<span class=\"tip\">Copy your API key on https://buttondown.email/settings/programming </span>';\n\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('paused').'</label>';\n\t\t$html .= '<select id=\"paused\" name=\"paused\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('paused')===true?'selected':'').'>'.$L->get('is-paused').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('paused')===false?'selected':'').'>'.$L->get('is-active').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('paused-tip').'</span>';\n\n\t\t// Start date\n\t\t$html .= '<label>'.$L->get('send-after').'</label>';\n\t\t$html .= '<input id=\"startDate\" name=\"startDate\" type=\"text\" value=\"'.$this->getValue('startDate').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('send-after-tip').'</span>';\n\t\t// Subject Prefix\n\t\t$html .= '<label>'.$L->get('subject-prefix').'</label>';\n\t\t$html .= '<input id=\"subjectPrefix\" name=\"subjectPrefix\" type=\"text\" value=\"'.$this->getValue('subjectPrefix').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('subject-prefix-tip').'</span>';\n\t\t\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('include-cover').'</label>';\n\t\t$html .= '<select id=\"includeCover\" name=\"includeCover\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('includeCover')===true?'selected':'').'>'.$L->get('yes').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('includeCover')===false?'selected':'').'>'.$L->get('no').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('include-cover-tip').'</span>';\n\t\t$html .= '</div><hr>';\n\t\t// List of page keys for which mail was sent \n\t\t$html .= '<h4>'.$L->get('sent-list').'</h4>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('sent-list-tip').'</span>';\n\t\t$html .= '<div style=\"overflow-y: scroll; height:400px;\"><ul>';\n\t\tforeach ($sentEmails as $sentKey):\n\t\t\t$html .= '<li>'.$sentKey.'</li>';\n\t\tendforeach;\n\t\t$html .= '</ul></div>';\n\t\t$html .= '<div><a target=\"_blank\" rel=\"noopener\" href=\"https://buttondown.email/archive\">Buttondown Archive</a></div>';\n\t\treturn $html;\n\t}", "public function render() {\n\n\t\tif(!$this->commentsField) return \"Unable to determine comments field\";\n\t\t$options = $this->options; \t\n\t\t$labels = $options['labels'];\n\t\t$attrs = $options['attrs'];\n\t\t$id = $attrs['id'];\n\t\t$submitKey = $id . \"_submit\";\n\t\t$honeypot = $options['requireHoneypotField'];\n\t\t$inputValues = array('cite' => '', 'email' => '', 'website' => '', 'stars' => '', 'text' => '', 'notify' => '');\n\t\tif($honeypot) $inputValues[$honeypot] = '';\n\t\t\n\t\t$user = $this->wire('user'); \n\n\t\tif($user->isLoggedin()) {\n\t\t\t$inputValues['cite'] = $user->name; \n\t\t\t$inputValues['email'] = $user->email;\n\t\t}\n\t\t\n\t\t$input = $this->wire('input'); \n\t\t$divClass = 'new';\n\t\t$class = trim(\"CommentForm \" . $attrs['class']); \n\t\t$note = '';\n\n\t\t/*\n\t\t * Removed because this is not cache safe! Converted to JS cookie. \n\t\t * \n\t\tif(is_array($this->session->CommentForm)) {\n\t\t\t// submission data available in the session\n\t\t\t$sessionValues = $this->session->CommentForm;\n\t\t\tforeach($inputValues as $key => $value) {\n\t\t\t\tif($key == 'text') continue; \n\t\t\t\tif(!isset($sessionValues[$key])) $sessionValues[$key] = '';\n\t\t\t\t$inputValues[$key] = htmlentities($sessionValues[$key], ENT_QUOTES, $this->options['encoding']); \n\t\t\t}\n\t\t\tunset($sessionValues);\n\t\t}\n\t\t*/\n\n\t\tforeach($options['presets'] as $key => $value) {\n\t\t\tif(!is_null($value)) $inputValues[$key] = $value; \n\t\t}\n\n\t\t$out = '';\n\t\t$showForm = true; \n\t\t\n\t\tif($options['processInput'] && $input->post->$submitKey == 1) {\n\t\t\t$comment = $this->processInput(); \n\t\t\tif($comment) { \n\t\t\t\t$out .= $this->renderSuccess($comment); // success, return\n\t\t\t} else {\n\t\t\t\t$inputValues = array_merge($inputValues, $this->inputValues);\n\t\t\t\tforeach($inputValues as $key => $value) {\n\t\t\t\t\t$inputValues[$key] = htmlentities($value, ENT_QUOTES, $this->options['encoding']);\n\t\t\t\t}\n\t\t\t\t$note = \"\\n\\t$options[errorMessage]\";\n\t\t\t\t$divClass = 'error';\n\t\t\t}\n\n\t\t} else if($this->options['redirectAfterPost'] && $input->get('comment_success') === \"1\") {\n\t\t\t$note = $this->renderSuccess();\n\t\t}\n\n\t\t$form = '';\n\t\tif($showForm) {\n\t\t\tif($this->options['depth'] > 0) {\n\t\t\t\t$form = $this->renderFormThread($id, $class, $attrs, $labels, $inputValues);\n\t\t\t} else {\n\t\t\t\t$form = $this->renderFormNormal($id, $class, $attrs, $labels, $inputValues); \n\t\t\t}\n\t\t\tif(!$options['presetsEditable']) {\n\t\t\t\tforeach($options['presets'] as $key => $value) {\n\t\t\t\t\tif(!is_null($value)) $form = str_replace(\" name='$key'\", \" name='$key' disabled='disabled'\", $form); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$out .= \n\t\t\t\"\\n<div id='{$id}' class='{$id}_$divClass'>\" . \t\n\t\t\t\"\\n\" . $this->options['headline'] . $note . $form . \n\t\t\t\"\\n</div><!--/$id-->\";\n\n\n\t\treturn $out; \n\t}", "public function post() {\n\t\t$this->html .= upload2::upld();\n\t\t$this->html .= showcsv::getform('CSVdata');\n\t\t$this->html .= scanfolder::ScFd('CSVdata');\n\t}", "function process() {\n // We always call the parent's method\n parent::process();\n $d = $this->getDocument();\n \n // We pass the form our request object and the location of us so the form\n // will make us handle the input (as actually we take care of processing\n // this form) - it could link to any other action as long as it is aware\n // of the form\n $form = new Form($this->getRequest(), new Location($this), Request::METHOD_POST);\n \n // This is how you prepare values for the radio buttons\n $radios = array('visa', 'master');\n \n // This is how we prepare the fields\n $form->addField('text1', new TextInputField('Your name here please', \n new RegexValidator('^[[:alpha:]]+[[:space:]][[:alpha:]]+$')));\n $form->addField('pass1', \n new TextInputField('', new RegexValidator('^[[:digit:]]{16}$'), TextInputField::PASSWORD));\n $form->addField('text2', new TextInputField('', null, TextInputField::TEXTAREA));\n $form->addField('check1', new CheckBoxInputField());\n $form->addField('payment', new RadioButtonInputField('visa', $radios));\n \n // Here we test if the form was correctly submitted\n if($form->isValidSubmission()) {\n // Normally, we would do something useful here and redirect to another page\n // since this form uses the POST method\n $d->setVariable('success', true);\n }\n \n // Here we place the form into the document variable so it can process it\n $d->setVariable('form', $form);\n }", "function printTFQuestionForm() {\n\tglobal $tool_content, $langTitle, $langSurveyStart, $langSurveyEnd, \n\t\t$langType, $langSurveyMC, $langSurveyFillText, \n\t\t$langQuestion, $langCreate, $langSurveyMoreQuestions, \n\t\t$langSurveyCreated, $MoreQuestions;\n\t\t\n\t\tif(isset($_POST['SurveyName'])) $SurveyName = htmlspecialchars($_POST['SurveyName']);\n\t\tif(isset($_POST['SurveyEnd'])) $SurveyEnd = htmlspecialchars($_POST['SurveyEnd']);\n\t\tif(isset($_POST['SurveyStart'])) $SurveyStart = htmlspecialchars($_POST['SurveyStart']);\n\t\t\n//\tif ($MoreQuestions == 2) {\n\tif ($MoreQuestions == $langCreate) {\n\t\tcreateTFSurvey();\n\t} else {\n\t\t$tool_content .= <<<cData\n\t\t<form action=\"addsurvey.php\" id=\"survey\" method=\"post\">\n\t\t<input type=\"hidden\" value=\"2\" name=\"UseCase\">\n\t\t<table>\n\t\t\t<tr><td>$langTitle</td><td colspan=\"2\"><input type=\"text\" size=\"50\" name=\"SurveyName\" value=\"$SurveyName\"></td></tr>\n\t\t\t<tr><td>$langSurveyStart</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyStart\" value=\"$SurveyStart\"></td></tr>\n\t\t\t<tr><td>$langSurveyEnd</td><td colspan=\"2\"><input type=\"text\" size=\"20\" name=\"SurveyEnd\" value=\"$SurveyEnd\"></td></tr>\ncData;\n\t\t$counter = 0;\n\t\tforeach (array_keys($_POST) as $key) {\n\t\t\t++$counter;\n\t\t $$key = $_POST[$key];\n\t\t if (($counter > 4 )&($counter < count($_POST)-1)) {\n\t\t\t\t$tool_content .= \"<tr><td>$langQuestion</td><td><input type='text' name='question{$counter}' value='${$key}'></td></tr>\"; \n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$tool_content .= <<<cData\n\t\t\t<tr><td>$langQuestion</td><td><input type='text' name='question'></td></tr>\n\t\t\t<tr>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langSurveyMoreQuestions\" />\n\t\t </td>\n\t\t\t <td>\n\t\t\t <input name=\"MoreQuestions\" type=\"submit\" value=\"$langCreate\" />\n\t\t </td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</form>\ncData;\n\t}\n}", "public function makeOutput()\n\t{\n\t\t$formId = $this->name;\n\t\t$enctype = 'application/x-www-form-urlencoded';\n\n\t\t$formHtml = new HtmlObject('form');\n\t\t$formHtml->property('method', $this->form->getMethod())->\n\t\t\t\t\tproperty('id', $formId)->\n\t\t\t\t\tproperty('action', $this->form->getAction());\n\n\t\t$jsStartup = array();\n\n\t\tforeach($this->inputs as $inputs) {\n\t\t\tforeach($inputs as $input) {\n\t\t\t\tif(($input->type == 'checkbox' || $input->type == 'radio') && isset($input->properties['value'])) {\n\t\t\t\t\t$inputId = $formId . '_' . $input->name . '_' . $input->properties['value'];\n\t\t\t\t} else {\n\t\t\t\t\t$inputId = $formId . '_' . $input->name;\n\t\t\t\t}\n\t\t\t\t$input->property('id', $inputId);\n\t\t\t}\n\t\t}\n\n\t\tforeach($this->inputs as $section => $inputs)\n\t\t{\n\t\t\t$sectionHtml = new HtmlObject('fieldset');\n\t\t\t$sectionHtml->property('id', $formId . \"_section_\" . $section);\n\n\t\t\tif(isset($this->sectionClasses[$section])) {\n\t\t\t\tforeach($this->sectionClasses[$section] as $class) {\n\t\t\t\t\t$sectionHtml->addClass($class);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->sectionClasses[$section] = array();\n\t\t\t}\n\n\t\t\tif(!in_array('mf-toggle-hide', $this->sectionClasses[$section]) && \n\t\t\t !in_array('mf-toggle-none', $this->sectionClasses[$section])) {\n\t\t\t\t$sectionHtml->addClass('mf-toggle-show');\n\t\t\t}\n\n\n\t\t\tif(isset($this->sectionLegends[$section]))\n\t\t\t\t$sectionHtml->insertNewHtmlObject('legend')->\n\t\t\t\t\twrapAround($this->sectionLegends[$section]);\n\n\t\t\t$sectionDiv = new HtmlObject('div');\n\t\t\t$sectionDiv->addClass('fieldset_contents')->\n\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_contents');\n\n\t\t\tif(isset($this->sectionIntro[$section]))\n\t\t\t\t$sectionDiv->insertNewHtmlObject('div')->\n\t\t\t\t\twrapAround($this->sectionIntro[$section])->\n\t\t\t\t\taddClass('fieldset_intro')->\n\t\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_intro');\n\n\t\t\t$sectionHtml->wrapAround($sectionDiv);\n\n\t\t\t$hasInputs = false;\n\n\t\t\t$controlsDiv = new HtmlObject('div');\n\t\t\t$controlsDiv->addClass('fieldset_controls')->\n\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_controls');\n\n\t\t\t$sectionDiv->wrapAround($controlsDiv);\n\n\t\t\tforeach($inputs as $input)\n\t\t\t{\n\t\t\t\t$inputId = $input->property('id');\n\n\t\t\t\tif($input->type === 'submit' && !$this->includeSubmit)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tif($input->type === 'richtext') {\n\t\t\t\t\t$input->property($this->form->getMarkup(), 'true');\n\t\t\t\t\t$input->type = 'textarea';\n\t\t\t\t\t$input->addClass('fulltext');\n\t\t\t\t}\n\n\t\t\t\t$plugins = new Hook();\n\t\t\t\t$plugins->enforceInterface('FormToHtmlHook');\n\t\t\t\t$plugins->loadPlugins('Forms', 'HtmlConvert', 'Base');\n\t\t\t\t$plugins->loadPlugins('Forms', 'HtmlConvert', $input->type);\n\t\t\t\t$plugins->setInput($input);\n\n\t\t\t\t$jsStartup = array_merge_recursive($jsStartup,\n\t\t\t\t\t\t\t\tHook::mergeResults($plugins->getCustomJavaScript()));\n\n\t\t\t\tif(in_array(true, Hook::mergeResults($plugins->overrideHtml())))\n\t\t\t\t{\n\t\t\t\t\t$plugins->createOverriddingHtml($sectionHtml);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\n\t\t\t\tif($inputStartupJs = $this->getInputJavascript($input))\n\t\t\t\t\t$jsStartup = array_merge_recursive($jsStartup, $inputStartupJs);\n\n\t\t\t\t$inputHtml = $this->getInputHtmlByType($input);\n\t\t\t\t$plugins->setCustomHtml($inputHtml);\n\n\t\t\t\tif($inputOptions = $this->getInputMetaData($input) ) //count($inputOptions > 0))\n\t\t\t\t{\n\t\t\t\t\t$metaDataClass = json_encode($inputOptions);\n\t\t\t\t\t$inputHtml->addClass($metaDataClass);\n\t\t\t\t}\n\n\t\t\t\tif($input->type == 'file')\n\t\t\t\t\t$enctype = 'multipart/form-data';\n\n\t\t\t\tif($input->type == 'hidden') {\n\t\t\t\t\t$inputHtml->close(false);\n\t\t\t\t\t$formHtml->wrapAround($inputHtml);\n\t\t\t\t} else {\n\t\t\t\t\t$inputHtml->wrapAround($input->property('contents'));\n\n\t\t\t\t\t$labelHtml = new HtmlObject('label');\n\n\t\t\t\t\t$labelHtml->property('for', $inputId)->\n\t\t\t\t\t\tproperty('id', $inputId . '_label');\n\n\t\t\t\t\tif(isset($input->pretext))\n\t\t\t\t\t\t$controlsDiv->wrapAround($input->pretext);\n\n\t\t\t\t\tif(isset($input->label))\n\t\t\t\t\t{\n\t\t\t\t\t\t$labelHtml->wrapAround($input->label);\n\t\t\t\t\t\tif(isset($input->description))\n\t\t\t\t\t\t\t$labelHtml->property('title', $input->description);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($input->type == 'radio' || $input->type == 'checkbox')\n\t\t\t\t\t\t$inputHtml->addClass('small_input');\n\n\t\t\t\t\tif(isset($input->labelAfter) && $input->labelAfter) {\n\t\t\t\t\t\t$labelHtml->addClass('label_after');\n\t\t\t\t\t\t$inputHtml->addClass('input_label_after');\n\n\t\t\t\t\t\t$controlsDiv->wrapAround($inputHtml)->\n\t\t\t\t\t\t\twrapAround($labelHtml);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$labelHtml->addClass('label_before');\n\t\t\t\t\t\t$inputHtml->addClass('input_label_before');\n\n\t\t\t\t\t\t$controlsDiv->wrapAround($labelHtml)->\n\t\t\t\t\t\t\twrapAround($inputHtml);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isset($this->errors[$input->name])) {\n\t\t\t\t\t\t$errorLabel = new HtmlObject('label');\n\t\t\t\t\t\t$errorLabel->addClass('error')->\n\t\t\t\t\t\t\tproperty('for', $inputId)->\n\t\t\t\t\t\t\tproperty('generated', true);\n\t\t\t\t\t\t$errorVal = '';\n\n\t\t\t\t\t\tforeach($this->errors[$input->name] as $error)\n\t\t\t\t\t\t\t$errorVal .= $error . ' ';\n\n\t\t\t\t\t\t$errorLabel->wrapAround(trim($errorVal));\n\t\t\t\t\t\t$controlsDiv->wrapAround($errorLabel);\n\t\t\t\t\t}\n\n\t\t\t\t\tif(isset($input->posttext))\n\t\t\t\t\t\t$controlsDiv->wrapAround($input->posttext);\n\n\t\t\t\t\tif(!isset($input->noBreak) || $input->noBreak === false)\n\t\t\t\t\t\t$controlsDiv->insertNewHtmlObject('br');\n\n\t\t\t\t\t$hasInputs = true;\n\t\t\t\t}\n\t\t\t}//foreach($this->inputs as $section => $inputs)\n\n\t\t\tif(isset($this->sectionOutro[$section]))\n\t\t\t\t$sectionDiv->insertNewHtmlObject('div')->\n\t\t\t\t\twrapAround($this->sectionOutro[$section])->\n\t\t\t\t\taddClass('fieldset_outro')->\n\t\t\t\t\tproperty('id', $formId . \"_section_\" . $section . '_outro');\n\n\t\t\tif($hasInputs)\n\t\t\t\t$formHtml->wrapAround($sectionHtml);\n\n\t\t\t$formHtml->property('enctype', $enctype);\n\t\t}\n\n\t\tif(!$this->submitButton && $this->includeSubmit)\n\t\t{\n\t\t\t$sectionHtml = new HtmlObject('div');\n\t\t\t$sectionHtml->property('id', $this->name . \"_section_\" . 'control');\n\t\t\t$inputHtml = new HtmlObject('input');\n\t\t\t$inputHtml->name = $input->name;\n\t\t\t$inputHtml->property('name', 'Submit')->property('type', 'Submit')->property('value', 'Submit');\n\n\t\t\t$labelHtml = new HtmlObject('label');\n\t\t\t$sectionHtml->wrapAround($labelHtml)->wrapAround($inputHtml)->wrapAround('<br>');\n\t\t\t$formHtml->wrapAround($sectionHtml);\n\t\t}\n\n\t\t$formHtml = (string) $formHtml;\n\n\t\t$output = $this->fullForm\n\t\t\t? (string) $formHtml\n\t\t\t: (string) $sectionHtml;\n\n\t\t$formJsOptions = array();\n\t\t$formJsOptions['validateOnLoad'] = $this->form->wasSubmitted();\n\t\t$jsStartup[] = '$(\"#' . $this->name . '\").MortarForm(' . json_encode($formJsOptions) . ');';\n\n\t\tif(class_exists('ActivePage', false))\n\t\t{\n\t\t\t$page = ActivePage::getInstance();\n\t\t\t$page->addStartupScript($jsStartup);\n\t\t}\n\t\treturn $output;\n\t}", "public function _renderSubmission($params = array()) {\n\t\treturn $this->_editForm($params->get('trusted_mode'));\n\t}", "function zen_draw_form($name, $action, $method = 'post', $parameters = '') {\n $form = '<form name=\"' . zen_output_string($name) . '\" action=\"' . zen_output_string($action) . '\" method=\"' . zen_output_string($method) . '\"';\n\n if (zen_not_null($parameters)) $form .= ' ' . $parameters;\n\n $form .= '>';\n if (strtolower($method) == 'post') $form .= '<input type=\"hidden\" name=\"securityToken\" value=\"' . $_SESSION['securityToken'] . '\" />';\n return $form;\n }", "function foobar_playlist_form() {\r\n?>\r\n <p>You can copy a foobar playlist just by selecting your songs and ctrl + c, but it paste's in a form that i find inconvenient.</p>\r\n <p>This little webapp exists so i can reformat my list before i print, and i may do more with it later but for now that's all it'll do.</p>\r\n <p>&nbsp;</p>\r\n <br />\r\n \r\n <FORM ACTION=\"foobar.php\" METHOD=POST>\r\n <table border=\"0\">\r\n <col width=\"100\"><col width=\"410\"><col width=\"10\">\r\n <tr>\r\n Database Fields: <textarea id=\"database\" cols=\"60\" rows=\"15\" name=\"database\"></textarea> </BR> </BR>\r\n </tr>\r\n \r\n <tr>\r\n <td>For Facebook:</td>\r\n <td><input type=\"checkbox\" name=\"facebook\" value=\"1\"/></td>\r\n </tr>\r\n <tr>\r\n <td></td>\r\n <td></td>\r\n <td><INPUT TYPE=\"submit\" value=\"Foobar PL\"></td>\r\n </tr>\r\n\r\n </table></FORM>\r\n<?php\r\n}", "function startForm($name, $id, $action, $method ='', $enctype=\"\", $class=\"\"){\n if (!$method) $method = 'POST';\n $out = \"<form name='$name' id='$id' action='\".BASE_PATH . $action .\"' method='$method' enctype='$enctype' class='$class' >\";\n return $out;\n }", "public function submit()\n {\n dd(['subject' => 'Twitch', 'content' => post()]);\n }", "function submit()\n {\n }", "function submit()\n {\n }", "function submit()\n {\n }", "public function render()\n {\n return view('components.submit-form', [\n 'buttonName' => $this->buttonName\n ]);\n }", "function showL1editFormPage() {\n /*\n Composing some elements of the form.\n */\n /*\n Composing $nodeDivs.\n */\n $nodeDivs = composeL1EditForm_nodeDivs();\n /*\n Composing $buttonsDiv.\n */\n// $buttonsDiv = composeL1EditForm_buttonsDiv();\n\n//Put $ sign back in front of buttonsDiv in heredoc\n//after debugging.\n\n /*\n Sending the form to the browser.\n */\n $submitToken = time();\n $_SESSION['EKA_submitToken'] = $submitToken;\n\n site_header('Edit Knowledge Article');\n $php_self = $_SERVER['PHP_SELF'];\n $page_str = <<<EOPAGESTR\n\n\n<form action=\"$php_self\" method=\"post\">\n$nodeDivs\nbuttonsDiv\n <div>\n <input type=\"hidden\" name=\"submitToken\" value=\"$submitToken\">\n </div>\n</form>\n\n\nEOPAGESTR;\n echo $page_str;\n site_footer();\n return;\n}", "function PKG_OptionPageTail($layout)\n{\nPKG_OptionPageSaveAlsParameters($layout);\n\nPKG_OptionPageRender($layout);\n\necho(\"\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\\\"2\\\">\n\t\t\t\t\t\t<center>\n\t\t\t\t\t\t\t<input type=\\\"submit\\\" name=\\\"BUT_save\\\" value=\\\"Save\\\">\n\t\t\t\t\t\t</center>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>\n\t</td>\n<tr>\n</table>\n</form>\n</body>\n</html>\");\n}", "public function formAction() {}", "public static function form(){\n\t\treturn \"\";\n\t}", "function action()\n{\n echo \"<br>Running our ACTION HANDLER code\";\n // When SUBMIT is pressed, browser loads the ACTION file\n echo \"<form action='11E2-Schinasi.php' method='POST'>\";\n echo \"<br> Print Name <input type='text' name='name'>\";\n echo \"<br> Artist <input type='text' name='artist'>\";\n echo \"<br> Price <input type='text' name='price'>\";\n echo \"<br> <input type='submit'>\";\n echo \"</form>\";\n\n }", "function ch_qti2_display_form()\n{\n $name_tools = get_lang('ImportQtiQuiz');\n $form = '<div class=\"actions\">';\n $form .= '<a href=\"' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?show=test&'.api_get_cidreq().'\">'.\n Display :: return_icon('back.png', get_lang('BackToExercisesList'), '', ICON_SIZE_MEDIUM).'</a>';\n $form .= '</div>';\n $formValidator = new FormValidator(\n 'qti_upload',\n 'post',\n api_get_self().\"?\".api_get_cidreq(),\n null,\n array('enctype' => 'multipart/form-data')\n );\n $formValidator->addElement('header', $name_tools);\n $formValidator->addElement('file', 'userFile', get_lang('DownloadFile'));\n $formValidator->addButtonImport(get_lang('Upload'));\n $form .= $formValidator->returnForm();\n echo $form;\n}", "function formEnd(){\n \n $form = '</form>';\n\n echo $form;\n}", "public function render_moodleform($form) {\n ob_start();\n $form->display();\n $output = ob_get_contents();\n ob_clean();\n return $output;\n }", "function raamatuVorm(){\n echo '\n <form action=\"'.$_SERVER['PHP_SELF'].'\" method=\"post\">\n Pealkiri: <input type=\"text\" name=\"title\"><br />\n Autor: <input type=\"text\" name=\"author\"><br />\n Trükikoda: <input type=\"text\" name=\"print\"><br />\n Seisund: <input type=\"text\" name=\"status\"><br />\n <input type=\"submit\" value=\"Salvesta!\">\n </form> \n ';\n}", "public function output_shortcode(){\n if(!is_user_logged_in()){\n echo '<p>Please login</p>';\n\n return false;\n }\n\n ob_start();\n\n if(!function_exists('acf_form')){ return; }\n\n //user is currently filling out the form\n if(!this->current_multistep_form_is_finished()){\n $this->output_acf_form(array('post_type' => $this->post_type));\n }\n else{\n //form has been filled entirely\n $form_complete_message = get_field('kickoff_form_complete_message', 'option');\n echo apply_filters('the_content', wp_kses_post($form_complete_message));\n }\n\n return ob_get_clean();\n }", "function formSubmit($name, $value){\n \n $submit = '<input type=\"submit\" name =\"';\n $submit .= $name; \n $submit .= '\" value=\"';\n $submit .= $value;\n $submit .= '\"/>';\n\n echo $submit;\n \n // <input type=\"submit\" name=\"submit\" value=\"Create Account\" />\n}", "function sexy_submit_tag($value = 'Save changes', $options = array())\n{\n return sexy_button_to_function( $value, \"var form = this; \".\n \"while(null != (form = form.parentNode)) if( form.nodeName == 'FORM') \".\n \"if( (form.onsubmit && form.onsubmit()) || (!(form.onsubmit)) ) form.submit();\",\n $options );\n}", "function displayPayement(){ \n $contents='<form method=\"post\" action=\"index.php\" name=\"payement\" id=\"payement\" onSubmit=\"return addPayementSuccess(this)\" >\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>Payement du rendez-vous </legend>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<label for=\"nss\"> Indiquer le NSS : </label>\n\t\t\t\t\t\t<input type=\"text\" name=\"nss\" id=\"nss\" onBlur=\"checkNss(this)\" />\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<label for=\"prix\">Prix du rendez-vous : </label>\n\t\t\t\t\t\t<input type=\"text\" name=\"prix\" id=\"prix\" onBlur=\"checkPrix(this)\" />\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<input type=\"submit\" value=\"Payer\" name=\"payer\"/>\n\t\t\t\t\t</p>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>';\n\treturn $contents;\n}", "public static abstract function postSubmit(Form $form);", "abstract function form();", "public function submission_form_fields() {\n\n\t\t$fields = $this->get_custom_fields();\n\n\t\tif ( ! empty( $fields ) ) {\n\n\t\t\tforeach ( $fields as $name => $field ) {\n\n\t\t\t\t/* Do not display core fields */\n\t\t\t\tif ( true === $field['args']['core'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this_field = new CustomField( $name, $field );\n\t\t\t\t$output = $this_field->get_output();\n\n\t\t\t\techo $output;\n\n\t\t\t}\n\n\t\t}\n\n\t}", "public function form()\n { ?>\n\n <form method=\"post\" action=\"\" enctype=\"multipart/form-data\">\n <table class=\"form-table\">\n <tbody>\n <tr valign=\"top\">\n <th scope=\"row\"><?php _e('Roles', 'wpsearchconsole'); ?></th>\n <td>\n <?php foreach ($this->roles as $key => $role) :\n\n $role_obj = get_role($key);\n $role_caps = $role_obj->capabilities;\n\n $name = ($key ? $key : false);\n $checked = (array_key_exists($this->capability, $role_caps) ? 1 : 0);\n $show = ($role ? $role : false);\n $disabled = ($key == 'administrator' ? ' disabled=\"disabled\"' : false);\n\n $this->role_check($name, $checked, $disabled, $role);\n\n endforeach; ?>\n </td>\n </tr>\n </tbody>\n </table>\n <?php submit_button(__('Give Access', 'wpsearchconsole'), 'primary', 'wpsearchconsole_give_access', false); ?>\n </form>\n <?php\n }", "public static function run () {\n\t\t\t$form = new FormHandler();\n\n\t\t\t$form->addValuesArray($_POST);\n\n\t\t\t# Add all the fields\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'title', \n\t\t\t\t'title'\t\t=> Lang::get('Site Title'),\n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'url', \n\t\t\t\t'title'\t\t=> Lang::get('URL'),\n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'thumb_url', \n\t\t\t\t'title'\t\t=> Lang::get('URL to Thumbnail')\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'content', \n\t\t\t\t'title'\t\t=> Lang::get('Description'), \n\t\t\t\t'type'\t\t=> 'textarea',\n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'author', \n\t\t\t\t'title'\t\t=> Lang::get('Your Name'), \n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'email', \n\t\t\t\t'title'\t\t=> Lang::get('And E-mail'), \n\t\t\t\t'required'\t=> true\n\t\t\t));\n\t\t\t$form->addField(array(\n\t\t\t\t'name'\t\t=> 'add_site_submit', \n\t\t\t\t'type'\t\t=> 'hidden', \n\t\t\t\t'value'\t\t=> '1'\n\t\t\t));\n\n\t\t\t# User is submitting form\n\t\t\t# Make sure form is valid (true => check for spam as well)\n\t\t\tif (isset($_POST['add_site_submit']) and $form->validate(true)) {\n\t\t\t\t# Add new site\n\t\t\t\tSites::insert(array(\n\t\t\t\t\t'author'\t\t=> $_POST['author'], \n\t\t\t\t\t'email'\t\t\t=> $_POST['email'], \n\t\t\t\t\t'title'\t\t\t=> $_POST['title'], \r\n\t\t\t\t\t'content'\t\t=> $_POST['content'], \r\n\t\t\t\t\t'thumb_url'\t\t=> isset($_POST['thumb_url']) ? $_POST['thumb_url'] : '', \r\n\t\t\t\t\t'url'\t\t\t=> $_POST['url'], \r\n\t\t\t\t\t'url_str'\t\t=> Router::urlize($_POST['title']), \n\t\t\t\t\t'pub_date'\t\t=> date('Y-m-d H:i:s')\n\t\t\t\t));\n\n\t\t\t\t# Redirect after POST\n\t\t\t\tredirect('?added_site');\r\n\t\t\t}\n\n\t\t\t# Form has been submitted\n\t\t\tif (isset($_GET['added_site'])) {\n\t\t\t\tself::$tplFile = 'ThankYou';\n\t\t\t}\n\t\t\t# Form has NOT been submitted\n\t\t\telse {\n\t\t\t\t# Assign form HTML to template vars\n\t\t\t\tself::$tplVars['form_html'] = $form->asHTML();\n\t\t\t}\n\t\t}", "function pexeto_contact_form() {\r\n\t\t$html='<div class=\"widget-contact-form\">\r\n\t\t\t<form action=\"'.get_template_directory_uri().'/includes/send-email.php\" method=\"post\" \r\n\t\t\tid=\"submit-form\" class=\"pexeto-contact-form\">\r\n\t\t\t<div class=\"error-box error-message\"></div>\r\n\t\t\t<div class=\"info-box sent-message\"></div>\r\n\t\t\t<input type=\"text\" name=\"name\" class=\"required placeholder\" id=\"name_text_box\" \r\n\t\t\tplaceholder=\"'.pexeto_text( 'name_text' ).'\" />\r\n\t\t\t<input type=\"text\" name=\"email\" class=\"required placeholder email\" \r\n\t\t\tid=\"email_text_box\" placeholder=\"'.pexeto_text( 'your_email_text' ).'\" />\r\n\t\t\t<textarea name=\"question\" rows=\"\" cols=\"\" class=\"required\"\r\n\t\t\tid=\"question_text_area\"></textarea>\r\n\t\t\t<input type=\"hidden\" name=\"widget\" value=\"true\" />\r\n\r\n\t\t\t<a class=\"button send-button\"><span>'.pexeto_text( 'send_text' ).'</span></a>\r\n\t\t\t<div class=\"contact-loader\"></div><div class=\"check\"></div>\r\n\r\n\t\t\t</form><div class=\"clear\"></div></div>';\r\n\t\treturn $html;\r\n\t}" ]
[ "0.74276227", "0.7110519", "0.7077868", "0.70413005", "0.68974894", "0.6851609", "0.67297137", "0.67210627", "0.66656846", "0.6647954", "0.6602743", "0.6595912", "0.65378773", "0.65333515", "0.6524798", "0.6523023", "0.6510401", "0.64726377", "0.64703196", "0.6455231", "0.64440185", "0.64344215", "0.64293236", "0.6419068", "0.6405016", "0.6395509", "0.63948554", "0.63933146", "0.6385269", "0.63841087", "0.63738734", "0.6338641", "0.6312586", "0.63007134", "0.6294269", "0.6275785", "0.6270842", "0.626751", "0.62607884", "0.6259695", "0.6255911", "0.6253144", "0.62494284", "0.62427914", "0.62341803", "0.6233205", "0.6230919", "0.6207131", "0.61889595", "0.6182748", "0.61801285", "0.6178308", "0.6172919", "0.617273", "0.6170028", "0.6165999", "0.61572826", "0.61526793", "0.61516154", "0.6131104", "0.61306447", "0.61272496", "0.6126423", "0.612222", "0.6115584", "0.61041456", "0.6093242", "0.6091528", "0.6089294", "0.6085112", "0.6070592", "0.6059505", "0.60547733", "0.605348", "0.60502017", "0.60499644", "0.6047213", "0.6042848", "0.6042848", "0.6042848", "0.60407513", "0.6036877", "0.6036031", "0.6033368", "0.6032255", "0.60245705", "0.60234666", "0.6021029", "0.6018762", "0.6013554", "0.60105574", "0.60090446", "0.6007813", "0.600203", "0.5998931", "0.59989065", "0.5998511", "0.5998147", "0.5995804", "0.59923965" ]
0.6971556
4
Submit a job to the service.
function submitJob($options) { $this->printDebugMessage('submitJob', 'Begin', 1); $params = array(); foreach($options as $key => $val) { switch($key) { case 'stype': $params[$key] = $val; break; case 'sequence': $params[$key] = $val; break; case 'program': $params[$key] = $val; break; case 'database': $params[$key] = $val; break; case 'scores': $params[$key] = $val; break; case 'alignments': $params[$key] = $val; break; } } $jobId = $this->run( $options['email'], $options['title'], $params ); echo "<p>Job Id: <a href=\"?jobId=$jobId\">$jobId</a></p>"; echo "<p>Please wait...</p>"; $this->printDebugMessage('submitJob', 'End', 1); return $this->genMetaRefresh($jobId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "public function executeJob()\n {\n // Fetch a job\n echo \"_\";\n $job = $this->queue\n ->watch('testtube')\n ->ignore('default')\n ->reserve();\n // Ensure we got a job.\n if ($job !== false) {\n // Extract job data.\n $jobData = json_decode($job->getData());\n \n switch ($jobData->Name) {\n case 'Wait':\n $result = $this->wait($jobData->Time);\n break;\n \n default:\n // Job definition unknown.\n break;\n }\n \n if (isset($result) && $result === true) {\n // Job succeeded. Remove it.\n $this->queue->delete($job);\n } else {\n // Job Failed. Bury it. \n $this->queue->bury($job);\n }\n }\n }", "private function submit(){\n $post_params['authToken'] = $this->usersAuthToken;\n $post_params['internalSystemAuth'] = $this->internalSystemAuth;\n $post_params['job_id'] = $this->job_id;\n $post_params['status'] = $this->status;\n $post_params['additional_info'] = $this->additional_info;\n $post_params['datasource_id'] = $this->datasource_id;\n \n //$response = $this->utilities->curlPost($this->baseDomain.$this->url_path, $post_params);\n $response = $this->postCurlCall($this->baseDomain.$this->url_path, $post_params);\n $curInfo = $this->utilities->getLastCurlInfo();\n\n if($response == '{\"status\":\"UPDATED\"}'){\n $this->errors = 'Update Failed';\n return true;\n }\n else\n return false;\n }", "public function work(Job $job);", "public function work(Job $job);", "public function saveJob(Job $job);", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "abstract public function makeJob();", "abstract public function makeJob();", "public function execute() {\n $sql = \"SELECT gcj_id_job\n FROM gems__comm_jobs\n WHERE gcj_active = 1\n ORDER BY gcj_id_order, \n CASE WHEN gcj_id_survey IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_round_description IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_id_track IS NULL THEN 1 ELSE 0 END,\n CASE WHEN gcj_id_organization IS NULL THEN 1 ELSE 0 END\";\n\n $jobs = $this->db->fetchAll($sql);\n\n if ($jobs) {\n $batch = $this->getBatch();\n foreach ($jobs as $job) {\n $batch->addTask('Mail\\\\ExecuteMailJobTask', $job['gcj_id_job']);\n }\n } else {\n $this->getBatch()->addMessage($this->_('Nothing to do, please create a mail job first.'));\n }\n }", "public function queueJob(Job $job) {\n $jobKey = $job->getKey();\n\n // add job details to hash for easy lookup of submission time\n $this->client->hset($jobKey, \"submitted\", time());\n $this->client->hset($jobKey, \"submitterId\", $job->getSubmitterId());\n $this->client->hset($jobKey, \"command\", $job->getCommand());\n $this->client->hset($jobKey, \"priority\", $job->getPriority());\n \n // add jobkey to sorted set, which acts as the job queue\n $this->client->zincrby(\"jobqueue\", 1, $jobKey);\n }", "private function send(Job $job)\n {\n $request = $this\n ->serialization\n ->serializeJob($job);\n\n $exchange = $this\n ->declarationManager\n ->exchange();\n\n $this\n ->declarationManager\n ->jobQueue($job->type());\n\n $this\n ->channel\n ->basic_publish(\n new AMQPMessage($request),\n $exchange,\n $job->type()\n );\n }", "public function startjobAction(){\n\t\ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$paymentMade = 0;\n\t\t\t\t\n\t\t\t\tif(!empty($posts['invoice_number'])){ // If no invoice is attached then start the job\n\t\t\t\t\t$xero = new \\Invoice\\Model\\Xero($sm);\n\t\t\t\t\t$invoice = $xero->getInvoiceById($posts['invoice_number']);\n\t\t\t\t\t\n\t\t\t\t\t$paymentMade = ($invoice->Invoices->Invoice->AmountPaid * 100) / $invoice->Invoices->Invoice->Total;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(empty($posts['invoice_number']) || $paymentMade < 40){ // If payment made more than 40% then start else wait for approval\t\t\t\t\t\n\t\t\t\t\techo 2;\n\t\t\t\t}else{\n\t\t\t\t\t$data = array('status' => 1);\n\t\t\t\t\t\n\t\t\t\t\t$jobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t\techo $response = $jobPacketTable->startJob($posts['start_job_id'], $data);\n\t\t\t\t}\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "public abstract function sendJobs();", "public function submit() {\r\n global $db;\r\n\r\n $this->status = SUBMITTED;\r\n $this->saveMe();\r\n\r\n $sql = \"SELECT d.division_id FROM users as u\r\n LEFT JOIN departments AS d ON d.department_id = u.department_id\r\n WHERE u.user_id = \" . $this->userId;\r\n $divisionId = $db->getRow($sql);\r\n\r\n // save the approvals to the database\r\n foreach($this->approvals as $approval) {\r\n $approval->save($divisionId['division_id']);\r\n }\r\n\r\n $sql = sprintf(\"UPDATE `forms_tracking` SET\r\n `submit_date` = NOW()\r\n WHERE `form_tracking_id` = %s\",\r\n $this->trackingFormId\r\n );\r\n $db->Execute($sql);\r\n\r\n $this->sendSubmissionConfirmationEmail();\r\n\r\n // send notifications\r\n $this->notifyORS();\r\n\r\n // notify Dean if deadline is within DEAN_NOTIFICATION_THRESHOLD_DAYS\r\n if(isset($this->deadline)) {\r\n $dateThreshold = strtotime(DEAN_NOTIFICATION_THRESHOLD_DAYS);\r\n $deadline = strtotime($this->deadline);\r\n if($deadline < $dateThreshold) {\r\n $this->notifyDean();\r\n }\r\n }\r\n\r\n if($this->compliance->requiresBehavioural()) {\r\n $this->notifyHREB();\r\n }\r\n }", "public function store(StoreJobRequest $request)\n {\n // Save the job\n $job = new Job;\n\n $job->name = $request->name;\n $job->agility = $request->agility;\n $job->dexterity = $request->dexterity;\n $job->strength = $request->strength;\n $job->mind = $request->mind;\n $job->intelligence = $request->intelligence;\n $job->charisma = $request->charisma;\n\n if($job->save()) {\n Session::flash('alert-success', 'Job created');\n return back(); // TODO: Send them to the job list instead\n } else {\n Session::flash('alert-error', 'Could not create job');\n return back();\n }\n }", "public function doAction() : void {\n $this->doJob();\n }", "abstract public function submit($data);", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "protected function process() {\n\n $jobId = $this->param();\n\n $jobTitle = $this->app()->request->post(\"title\");\n $jobDescription = $this->app()->request->post(\"description\");\n $jobSkills = $this->app()->request->post(\"skills\");\n\n $jobPositions = $this->app()->request->post(\"positions\");\n $jobLocation = $this->app()->request->post(\"location\");\n $jobType = $this->app()->request->post(\"type\");\n $jobStart = $this->app()->request->post(\"start\");\n\n\n if($jobType == 'temporary') {\n $jobDuration = $this->app()->request->post(\"duration\");\n }\n else {\n $jobDuration = '';\n }\n\n $skills = explode(\",\", $jobSkills);\n\n if(!$this->validPost($jobTitle, $jobDescription, $jobSkills, $jobPositions, $jobLocation, $jobDuration, $jobStart, $jobType)) {\n return;\n }\n\n require_once 'models/Job.php';\n\n\n switch($jobType) {\n case 'temporary':\n require_once 'models/TemporaryJob.php';\n $job = new TemporaryJob($jobId);\n $job->setTitle($jobTitle);\n $job->setDescription($jobDescription);\n $job->setSkills($skills);\n $job->setPositions($jobPositions);\n $job->setLocation($jobLocation);\n $job->setStartTime($jobStart);\n $job->setDuration($jobDuration);\n $job->saveToDb();\n break;\n\n case 'permanent':\n require_once 'models/PermanentJob.php';\n $job = new PermanentJob($jobId);\n $job->setTitle($jobTitle);\n $job->setDescription($jobDescription);\n $job->setSkills($skills);\n $job->setPositions($jobPositions);\n $job->setLocation($jobLocation);\n $job->setStartTime($jobStart);\n $job->saveToDb();\n break;\n }\n }", "public function company_can_post_a_job()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(2))\n ->visit('/post-a-job')\n ->type('email', '[email protected]')\n ->click('@post-a-job-button')\n ->assertSee('Laravel');\n });\n }", "public function process(Job $job): void\n {\n }", "function run_job()\r\n\t{\r\n\t}", "public function save_job(Request $request)\n {\n $company_id = CompanyHelper::touch($request->user_id);\n $item_id = CompanyProjectHelper::save_data($company_id, $request->job);\n\n return response()->json([\n 'status' => 'OK',\n 'id' => $item_id\n ]);\n }", "public function execute() {\n\t\tContext::get()->setSourceType( 'job-runner' );\n\t\t// Get some defaults from configuration\n\t\t$basePath = 'maintenance/job-runner/';\n\n\t\t$consumer = new JobQueueConsumer(\n\t\t\t$this->getOption( 'queue' ),\n\t\t\t$this->getOptionOrConfig( 'time-limit', $basePath . 'time-limit' ),\n\t\t\t$this->getOptionOrConfig( 'max-messages', $basePath . 'message-limit' )\n\t\t);\n\n\t\t$startTime = time();\n\t\t$messageCount = $consumer->dequeueMessages();\n\n\t\t$successCount = $consumer->getSuccessCount();\n\t\t$elapsedTime = time() - $startTime;\n\t\tLogger::info(\n\t\t\t\"Processed $messageCount ($successCount successful) jobs in $elapsedTime seconds.\"\n\t\t);\n\t}", "public function postAction(Request $request)\n {\n $result = 0;\n $msg = '';\n $code = 200;\n try {\n $this->init($request);\n if (!$request->request->get('number')) {\n throw new \\Exception('Job Number is Empty');\n }\n if (!$request->request->get('title')) {\n throw new \\Exception('Job Title is Empty');\n }\n $jobId = guid();\n $created = tstobts(time());\n $jobs = new Jobs();\n $jobs->setJobId($jobId);\n $jobs->setUserId($this->userId);\n $jobs->setTitle($request->request->get('title'));\n $jobs->setApplicationMethod($request->request->get('apply'));\n $jobs->setApplicationEmail($request->request->get('email'));\n $jobs->setApplicationEmailCc($request->request->get('CCemail'));\n $jobs->setApplicationUrl($request->request->get('url'));\n $city = $request->request->get('city');\n $emGet = $this->getDoctrine()->getManager();\n $query = $emGet->createQuery(\n 'SELECT c from JobsServiceBundle:GeoCities as c WHERE c.ctyId = ?1'\n );\n $query->setParameter(1, $city);\n $dataCity = $query->getResult();\n //$cityName = isset($city['name']) ? $city['name'] : $city;\n $jobs->setCity($city);\n //$cityId = isset($city['id']) ? $city['id'] : null;\n //$jobs->setCityId($cityId);\n $state = $request->request->get('state');\n //$stateId = isset($state['name']) ? $state['name'] : null;\n $jobs->setState($state);\n $country = $request->request->get('country');\n //$countryId = isset($country['name']) ? $country['name'] : null;\n $jobs->setCountry($country);\n $jobs->setNumber($request->request->get('number'));\n $jobs->setAreaCode($request->request->get('areaCode'));\n $jobs->setZipcode($request->request->get('postalCode'));\n $jobs->setDescription($request->request->get('description'));\n $jobs->setShowName($this->setCheckbox($request->request->get('contact_name')));\n $jobs->setShowAddress1($this->setCheckbox($request->request->get('contact_address1')));\n $jobs->setShowAddress2($this->setCheckbox($request->request->get('contact_address2')));\n $jobs->setShowCity($this->setCheckbox($request->request->get('contact_city')));\n $jobs->setShowState($this->setCheckbox($request->request->get('contact_state')));\n $jobs->setShowEmail($this->setCheckbox($request->request->get('contact_email')));\n $jobs->setShowPhone($this->setCheckbox($request->request->get('contact_phone')));\n $jobs->setShowZipcode($this->setCheckbox($request->request->get('contact_zip')));\n \n $latitude = ($dataCity[0]->getLatitude()) ? $dataCity[0]->getLatitude() : null;\n $longitude = ($dataCity[0]->getLongitude()) ? $dataCity[0]->getLongitude() : null;\n $jobs->setLatitude($latitude);\n $jobs->setLongitude($longitude);\n $jobs->setJobCreatedDt($created);\n $jobs->setJobDeleted(0);\n $jobs->setJobDeletedDt(0);\n $jobs->setJobModifiedDt($created);\n $status = $request->request->get('status');\n $jobs->setJobStatus($status);\n $em = $this->getDoctrine()->getManager();\n $em->persist($jobs);\n $position = $request->request->get('position');\n if (!empty($position)) {\n $counter = 0;\n foreach ($position as $type) {\n $JobsPositionType[$counter] = new JobsPositionType();\n $JobsPositionType[$counter]->setJobId($jobId);\n $JobsPositionType[$counter]->setPositionType($type);\n $em->persist($JobsPositionType[$counter]);\n $counter++;\n }\n }\n $skills = $request->request->get('skills');\n $skills = trim($skills);\n if (!empty($skills)) {\n $counter = 0;\n $skill = explode(',', $skills);\n foreach ($skill as $keyword) {\n $JobsKeywords[$counter] = new JobsKeywords();\n $JobsKeywords[$counter]->setJobId($jobId);\n $JobsKeywords[$counter]->setKeyword(trim($keyword));\n $em->persist($JobsKeywords[$counter]);\n $counter++;\n }\n }\n $em->flush();\n $msg = 'Success';\n $result = 1;\n } catch (\\Exception $e) {\n $msg = $e->getMessage();\n $result = 0;\n $code = $e->getCode();\n }\n $arr = array('success' => $result, 'message' => $msg, 'code' => $code, 'post' => $_POST);\n $json = json_encode($arr);\n return new Response($json);\n }", "public function submit()\n {\n $this->waitFor(20000, function () {\n return $this->present();\n });\n $this->xpath($this->selectors['submit'])->click();\n $this->waitFor(20000, function () {\n return $this->xpath($this->selectors['formSubmitted']) !== null;\n });\n }", "abstract public function enqueue($Job, $priority = null);", "public function push($job, $data = '', $queue = null);", "public function runAction(Request $request)\n {\n // Get params from request\n $params = $this->getPostJson($request);\n\n // check params against ES mapping\n $this->checkMappingParams($params);\n\n // Create new job\n /** @var Job $job */\n $job = $this->createJob('run', $params);\n\n // Add job to Elasticsearch\n try {\n $jobId = $this->getJobManager()->indexJob($job);\n } catch (\\Exception $e) {\n throw new ApplicationException(\"Failed to create job\", $e);\n }\n\n // Add job to SQS\n $queueName = 'default';\n $queueParams = $this->container->getParameter('queue');\n\n if (isset($queueParams['sqs'])) {\n $queueName = $queueParams['sqs'];\n }\n $messageId = $this->enqueue($jobId, $queueName);\n\n $this->logger->info('Job created', [\n 'sqsQueue' => $queueName,\n 'sqsMessageId' => $messageId,\n 'job' => $job->getLogData()\n ]);\n\n // Response with link to job resource\n return $this->createJsonResponse([\n 'id' => $jobId,\n 'url' => $this->getJobUrl($jobId),\n 'status' => $job->getStatus()\n ], 202);\n }", "public function processed($job)\n {\n $this->client->queue($this->queueName)->processed($job);\n }", "public function run()\n {\n DB::table('job_service')->insert([\n 'jobId' => 1,\n 'serviceId' => 1,\n 'isActive' => 1,\n 'isComplete' => 1,\n 'isVoid' => 0,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n \n DB::table('job_service')->insert([\n 'jobId' => 2,\n 'serviceId' => 1,\n 'isActive' => 1,\n 'isComplete' => 1,\n 'isVoid' => 0,\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now()\n ]);\n }", "public function work() {\n $this->model = ModelManager::getInstance()->getModel(QueueModel::NAME);\n\n do {\n $data = $this->model->popJobFromQueue($this->name);\n if ($data) {\n echo $this->name . ': Invoking job #' . $data->id . ' ... ';\n $dateReschedule = $this->invokeJob($data);\n\n if ($dateReschedule == -1) {\n echo \"error\\n\";\n } else {\n echo \"done\\n\";\n\n if (is_numeric($dateReschedule) && $dateReschedule > time()) {\n echo $this->name . ': Rescheduling job #' . $data->id . ' from ' . date('Y-m-d H:i:s', $dateReschedule) . \"\\n\";\n $queueModel->pushJobToQueue($data->job, $dateReschedule);\n }\n }\n } elseif (!$this->sleepTime) {\n echo $this->name . \": Nothing to be done and no sleep time. Exiting ...\\n\";\n break;\n }\n\n if ($this->sleepTime) {\n echo $this->name . ': Sleeping ' . $this->sleepTime . \" second(s)...\\n\";\n sleep($this->sleepTime);\n }\n } while (true);\n }", "function PKG_addJob($client,$packageName,$priority,$params)\n{\n\tPKG_addStatusJob($client,$packageName,$priority,$params,\"waiting\");\n}", "abstract public function push($job, $queue = null);", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function pushOn($queue, $job, $data = '');", "public function run() {\n // Run until we break\n while (true) {\n $i++;\n $job = $this->fetch();\n\n // Break if there are no jobs to run\n if (!$job) {\n break;\n }\n\n $this->info($job->getRequestID().' - running job'); \n $result = $job->run();\n \n // Log any errors we hit and run the next\n if (!$result || !$result['success']) {\n $this->alert($job->getRequestID().' - error running job');\n\n continue;\n }\n\n $this->info($job->getRequestID().' - successfully completed job');\n }\n }", "public function doQueueJob()\n {\n try {\n //TODO: ideally we would use transactions here.\n ProcessInvoiceGeneration::queueInvoiceProcessingJob($this->ID);\n $this->Status = self::STATUS_QUEUED;\n $this->write();\n return 'Job has been queued for processing';\n } catch (Exception $e) {\n error_log($e->getTraceAsString());\n return 'An error has occurred while queueing this job.';\n }\n }", "public function store(QuoteRequest $request, $job_id)\n {\n /////////////////////////////////////////////////\n // CHECKLIST //\n /////////////////////////////////////////////////\n // X Generate formatted quote ID w/ versioning //\n // X Update job model status //\n // X Update updated_at timestamp on job model //\n // X Send email to user //\n // X Create internal note //\n // Send push notification to user //\n /////////////////////////////////////////////////\n\n // Set up formatted quote number based on job id\n $alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];\n $job = Job::with('quotes')->findOrFail($job_id);\n $quote_number = 'Q' . $job->job_number . ucfirst($alpha[$job->quotes->count()]);\n\n // Create quote model\n $quote = new Quote($request->all() + [\n 'expires_at' => date('Y-m-d H:i:s', strtotime('+1 month')),\n 'quote_number' => $quote_number\n ]);\n\n // Set relationships (foreign keys)\n $quote->job()->associate(Job::findOrFail($job_id));\n $quote->status()->associate(Status::findOrFail(6));\n $quote->tax()->associate(Tax::findOrFail($request->tax_id));\n $quote->jewelryType()->associate(JewelryType::findOrFail($request->jewelry_type_id));\n\n // Save the quote\n Auth::user()->quotes()->save($quote);\n\n // Trigger quote was sent event\n event(new QuoteWasSent($quote));\n\n // Log event\n event(new LoggableEventOccurred('Quote sent by', Auth::user(), $job));\n\n // Update the parent job's status\n $job = Job::findOrFail($job_id);\n $job->status()->associate(Status::findOrFail(3));\n $job->save();\n\n // Optionally send a message to the user\n if (! empty($request->get('message'))) {\n $message = new Message(['body' => $request->message]);\n $message->user()->associate(Auth::user());\n $quote->messages()->save($message);\n\n event(new MessageWasSent($message, $job));\n }\n\n // Optionally add a note to the quote\n if (! empty($request->get('quote_note'))) {\n $note = new Note(['body' => $request->quote_note]);\n $note->user()->associate(Auth::user());\n $quote->notes()->save($note);\n }\n\n // Send push notification\n foreach ($job->account->devices as $device) {\n $payload = 'You have a new quote in job #' . $job->job_number . ' - ' . $job->nickname;\n\n PushNotificationService::send($device, $payload);\n }\n\n // Success message\n Session::flash('success', 'Quote created and sent');\n\n // Redirect user to the job detail view\n return redirect(\"/jobs/$job_id#quotes\");\n }", "public function withQueue()\n {\n // You can pass anything you need into the job so there is no worrying about losing\n // access to needed resources when the job is actually running, passing time in as an example\n // but you can pass models in or anything you want really.\n LongTask::dispatch(5);\n Session::flash('success', 'Successfully queued long running task');\n return redirect()->route('queueExample');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public function run()\n {\n $date = date('Y-m-d H:i:s');\n\n $data = [\n [\n 'id' => '1',\n 'title' => 'Web Programmer Senior',\n 'description' => 'Dibutuhkan web programmer senior dengan kualifikasi berikut.',\n 'posted_by' => 1,\n 'company_id' => 1,\n 'created_at' => $date,\n 'updated_at' => $date\n ],\n [\n 'id' => '2',\n 'title' => 'Flutter Developer',\n 'description' => 'Dibutuhkan mobile programmer dengan kualifikasi berikut.',\n 'posted_by' => 1,\n 'company_id' => 1,\n 'created_at' => $date,\n 'updated_at' => $date\n ]\n ];\n \n $table = $this->table('jobs');\n $table->insert($data)->save();\n }", "public function upload(Job $job)\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to upload a file for a job that is already submitted.');\n }\n set_time_limit(0);\n /** @var \\TusPhp\\Tus\\Server $server */\n $server = app('tus-server');\n $server->setApiPath(route('jobs.upload', $job, false))\n ->setUploadDir($job->getAbsoluteJobDirectory());\n $response = $server->serve();\n\n return $response->send();\n }", "protected function submit_request( Requests\\RequestInterface $request ) {\n\t\treturn $this->client->set_request( $request )->execute();\n\t}", "public function run()\n {\n DB::table('job')->insert([\n \t[\n\t 'title' => 'job 1',\n\t 'minimumWorkExperience' => 5,\n\t 'state' => 'state',\n\t 'countryID' => 1,\n\t 'responsibilities' => 'eating',\n\t 'workLocation' => 'Subang',\n\t 'jobLevelID' => 1,\n\t 'status' => 1,\n\t\t 'created_at' => new DateTime,\n\t\t 'updated_at' => new DateTime\n \t],\n \t\n ]);\n }", "public function submitOccupation (User $user, $company, $job)\r\n {\r\n $userOccupation = $this->em->getRepository('YilinkerCoreBundle:UserOccupation')->findOneByUser($user);\r\n\r\n if ($userOccupation instanceof UserOccupation) {\r\n $this->updateOccupation($userOccupation, $company, $job);\r\n }\r\n else {\r\n $this->createOccupation ($user, $company, $job);\r\n }\r\n\r\n }", "public function run()\n {\n Job::create(['url'=> 'https://proxify.io']);\n\n Job::create(['url'=> 'https://reddit.com']);\n\n Job::factory(1000)->create();\n }", "public static function pushJob(JobInterface $queue, $content = null): bool {\n $workerJob = new TaskJob();\n\n $beforeSendCallback = $queue->getBeforeSendCallback();\n self::_performCallback($beforeSendCallback, $queue);\n\n if ($queue->getLocale() !== null) {\n I18n::setLocale($queue->getLocale());\n } else {\n I18n::setLocale(Configure::read('Queue.defaultLocale'));\n }\n\n /**\n * @TODO \n * Save in the database\n * and return true or false \n * if is saved \n */\n //$queue->schedule($content);\n echo \"saving job in the database\" . PHP_EOL;\n\n $afterSendCallback = $queue->getAfterSendCallback();\n self::_performCallback($afterSendCallback);\n\n return true;\n }", "public function admin_api_run() {\n\t\tif (PROJECT_SCHEDULED_JOBS !== 'http') {\n\t\t\tthrow new InternalServerErrorException('HTTP API for scheduled jobs is disabled.');\n\t\t}\n\t\t$response = new JSendResponse();\n\n\t\t$result = Jobs::runFrequency($this->request->frequency);\n\n\t\tif ($result) {\n\t\t\t$response->success();\n\t\t} else {\n\t\t\t$response->fail();\n\t\t}\n\t\t$this->render([\n\t\t\t'type' => $this->request->accepts(),\n\t\t\t'data' => $response->to('array')\n\t\t]);\n\t}", "public function jobAction()\n {\n $context = $this->_helper->ajaxContext()->getCurrentContext();\n $request = $this->getRequest();\n if ($request->isPost()) {\n $this->view->status = \"error\";\n if ($this->isCsrfTokenValid()) {\n\n // get the search data\n $post = $request->getPost();\n\n // search for matching jobs\n $this->view->categories = $this->Search->job($this->_getSubdomain(), $post['value']);\n $this->view->status = \"success\";\n\n } else {\n $this->view->status = \"error\";\n }\n }\n\n // redirect if not using the json context\n if ($context != 'json') {\n $this->_redirect('/');\n }\n }", "public function run()\n {\n $this->setStatus(Job::STATUS_RUNNING);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'running'), time(), $this->payload);\n Stats::incr('running', 1);\n Stats::incr('running', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_RUNNING, $this);\n }", "public function enqueue($type, $payload = null)\n {\n $job = Job::create($type, $payload);\n\n if ($this->logger) {\n $this->logger->debug(\n 'jobqueue.queue enqueue successful: {job}',\n [\n 'job' => $job,\n ]\n );\n }\n\n $this->send($job);\n }", "public function store(JobRequest $request)\n {\n $jobInsertStatus = $this->jobRepo->insertNewJob();\n \n if ($jobInsertStatus) {\n Session::flash('success', \"New job created successfully.\");\n }\n else {\n Session::flash('error', \"Sorry! error occured\");\n }\n \n return redirect('/job');\n }", "public function store(Request $request, Job $job)\n {\n $job->create($request->only([\n 'name',\n 'phone',\n 'service_type',\n 'kilogram',\n 'washer_mode',\n 'dryer_mode',\n 'detergernt',\n 'bleach',\n 'fabric_conditioner',\n 'is_press',\n 'is_fold',\n 'bleach_qty',\n 'detergent_qty',\n 'fabric_conditioner_qty'\n ]));\n\n $job->save();\n\n return redirect('/jobs')->with('success', 'Job Created!');\n }", "public function submit( $args ) {\n\t\tif ( empty( $args ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$submission = new WPHF_Submit( $args );\n\n\t\tif ( $submission->is_valid() ) {\n\t\t\treturn $submission->send();\n\t\t} else {\n\t\t\treturn $submission->prepare_response();\n\t\t}\n\t}", "public function jobsPost($x_oc_api_key, $body) {\n \n // verify the required parameter 'x_oc_api_key' is set\n if ($x_oc_api_key === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $x_oc_api_key when calling jobsPost');\n }\n \n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling jobsPost');\n }\n \n\n // parse inputs\n $resourcePath = \"/jobs\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"POST\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = $this->apiClient->selectHeaderAccept(array());\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());\n\n \n // header params\n if($x_oc_api_key !== null) {\n $headerParams['X-Oc-Api-Key'] = $this->apiClient->toHeaderValue($x_oc_api_key);\n }\n \n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n // for HTTP post (form)\n $httpBody = $formParams;\n }\n\n // authentication setting, if any\n $authSettings = array();\n\n // make the API Call\n $response = $this->apiClient->callAPI($resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, $authSettings);\n\n if(! $response) {\n return null;\n }\n\n $responseObject = $this->apiClient->deserialize($response,'Job');\n return $responseObject;\n }", "public function store(JobCreateOrUpdateRequest $request)\n {\n $user = Auth::user();\n $employerProfile = $user->employerProfile;\n $job = new Job($request->all());\n $job->employer_profile_id = $employerProfile->id;\n $job->status = config('user.job_status.active');\n $job->save();\n\n return redirect()\n ->route('employer.jobs', ['profile' => $employerProfile])\n ->with('success', __('messages.update-success'));\n }", "public function submitJobsById($jobId)\n {\n return $this->submitJobsBy('id', $jobId, 1);\n }", "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "public function queue(IElement $element): IJobQueue;", "function submitAddStok()\n\t{\n\t\t# code...\n\t}", "public function handle()\n\t{\n\t\t$this->dispatcher->dispatchNow($this->job);\n\t}", "public function startjobrequestAction(){\n\t\ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t\n\t\t\t\t$jobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t$approval_code = time().rand(99999, 99999999);\n\n\t\t\t\tif($response = $jobPacketTable->startJob($posts['start_job_id'], array('approval_code' => $approval_code, 'status' => 3))){\n\t\t\t\t\n\t\t\t\t\t$orderTable = $sm->get('Order\\Model\\OrderTable');\n\t\t\t\t\n\t\t\t\t\t$jobDetails = (array)$orderTable->fetchJobDetails($posts['start_job_id']);\n\t\t\t\t\t\n\t\t\t\t\t$jobDetails['approval_code'] = $approval_code;\n\t\t\t\t\t$jobDetails['display_job_id'] = \\De\\Service\\CommonService::generateStockCode($jobDetails['job_id'], 'order');\n\n\t\t\t\t\t$alertTable = $sm->get('Alert\\Model\\AlertTable');\n\t\t\t\t\t$viewUrl = sprintf('/jobdetails/%s', $jobDetails['job_id']);\n\t\t\t\t\t$approvalUrl = sprintf('/approvejob/%s/%s', $jobDetails['job_id'], $jobDetails['approval_code']);\n\n\t\t\t\t\t$reason = $posts['start_comment'];\n\t\t\t\t\tif ($reason != '') {\n\t\t\t\t\t\t$reason = ' (' . $reason . ')';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t'Job <a href=\"%s\">%s</a> needs approval%s. <a href=\"%s\">Click to approve</a>.',\n\t\t\t\t\t\t\t$viewUrl,\n\t\t\t\t\t\t\t$jobDetails['display_job_id'],\n\t\t\t\t\t\t\t$reason,\n\t\t\t\t\t\t\t$approvalUrl\n\t\t\t\t\t\t\t);\n\t\t\t\t\t/* TODO: don't hardcode role ID */\n\t\t\t\t\t$alertTable->createRoleAlert($identity['user_id'], 1, $message);\n\t\t\t\t\t\n\t\t\t\t\techo 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t}", "public function add() {\n $this->out('CakePHP Queue Example task.');\n $this->hr();\n $this->out('This is a very simple example of a QueueTask.');\n $this->out('I will now add an example Job into the Queue.');\n $this->out('This job will only produce some console output on the worker that it runs on.');\n $this->out(' ');\n $this->out('To run a Worker use:');\n $this->out('\tbin/cake queue runworker');\n $this->out(' ');\n $this->out('You can find the sourcecode of this task in: ');\n $this->out(__FILE__);\n $this->out(' ');\n\n //$options = getopt('',['id:']);\n /*\n * Adding a task of type 'example' with no additionally passed data\n */\n //if ($this->QueuedJobs->createJob('RemittanceApi', ['id'=>4033, 'batch_id'=>'58e44de0f33a7'])) {\n if ($this->QueuedJobs->createJob('RemittanceApi', null)) {\n $this->out('OK, job created, now run the worker');\n } else {\n $this->err('Could not create Job');\n }\n }", "function submitOrder() {\n\techo \"Submitting Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order', $data);\n\tprintInfo($response);\n}", "public function handle()\n {\n $job = (new SendRequestJob)\n ->onQueue('sender:request')\n ->delay(Carbon::now()->addSeconds(5));\n\n dispatch($job);\n }", "function submit()\n {\n\t\t//all data is handled by submit2()\n }", "public function action() {\n $this->getSettings();\n if (!date_default_timezone_set($this->timezone)) {\n // invalid timezone\n $this->setError(sprintf('[%s - %s] %s', __METHOD__, __LINE__,\n sprintf(\"The timezone '%s' is invalid, please check the settings for kitCronjob!\", $this->timezone)));\n // set Europe/Berlin as timezone and continue the job.\n date_default_timezone_set('Europe/Berlin');\n }\n if (!$this->cronjob_active) {\n // the cronjob is not active, so terminate immediate!\n $this->log[self::LOG_STATUS] = self::STATUS_INACTIVE;\n $this->log[self::LOG_MESSAGE] = 'The cronjob is inactive and does not execute any job.';\n $this->writeLog();\n exit('OK');\n }\n if (!$this->checkCronjobKey()) {\n // the cronjob KEY is not set or invalid\n $this->log[self::LOG_STATUS] = self::STATUS_ERROR;\n $this->log[self::LOG_MESSAGE] = 'The cronjob.php was called without the parameter KEY or with a wrong passphrase for the KEY.';\n $this->writeLog();\n exit($this->getError());\n }\n // check the scheduled jobs\n $this->checkScheduledJobs();\n\n if (!$this->cronjob_executed) {\n // nothing to do - still quit\n $this->log[self::LOG_STATUS] = self::STATUS_OK;\n $this->log[self::LOG_MESSAGE] = 'Nothing to do.';\n $this->log[self::CRONJOB_ID] = -1;\n $this->log[self::CRONJOB_NAME] = '';\n $this->writeLog();\n }\n exit('OK');\n }", "public function store(CreatePaperRequest $request)\n {\n $this->dispatch(\n new CreateJob($request)\n );\n }", "public function run($request)\n {\n $jobID = $request->getVar('id');\n\n if (!$jobID) {\n $this->exitWithError('No job id is given');\n }\n\n /* @var $job BatchUploadJob */\n $job = BatchUploadJob::get()->byID($jobID);\n if ($job->Status !== BatchUploadJob::STATUS_PENDING) {\n $this->exitWithError('This job is not under PENDING status');\n }\n\n $job->Status = BatchUploadJob::STATUS_PROCESSING;\n $job->write();\n\n $playlist = $job->Playlist();\n $files = $job->StreamFiles();\n foreach ($files as $file) {\n /* @var $file File */\n echo 'Processing File: ' . $file->getFilename() . \"\\n\";\n\n try {\n $song = Song::create();\n $song->StreamFile = $file;\n $info = $song->getID3Info();\n foreach ($info as $key => $value) {\n $song->$key = $value;\n }\n $song->write();\n $song->StreamFile->owner->publishRecursive();\n\n // add to playlist if need\n if ($playlist->exists()) {\n $playlist->addSong($song);\n }\n\n /** @noinspection IncrementDecrementOperationEquivalentInspection */\n $job->ProcessedNumberOfFiles += 1;\n $job->write();\n } catch (\\Exception $e) {\n $job->Status = BatchUploadJob::STATUS_ERROR;\n $job->Remark = $e->getMessage();\n $job->write();\n $this->exitWithError($e);\n }\n }\n\n $job->Status = BatchUploadJob::STATUS_FINISHED;\n $job->write();\n }", "public function addJobToPB()\n {\n $input = Request::onlyLegacy('board_ids', 'job_id');\n\n $validator = Validator::make($input, ProductionBoard::getJobRule());\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $boardIds = arry_fu($input['board_ids']);\n\n if (empty($boardIds)) {\n return ApiResponse::errorGeneral('Invalid progress board ids.');\n }\n\n $job = $this->jobRepo->getById($input['job_id']);\n try {\n $this->service->addJobToPB($job, $boardIds);\n\n $type = 'Job';\n if ($job->isProject()) {\n $type = 'Project';\n }\n\n return ApiResponse::success([\n 'message' => trans('response.success.job_add_to_pb', ['attribute' => $type])\n ]);\n } catch (ModelNotFoundException $e) {\n return ApiResponse::errorNotFound($e->getMessage());\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function actionSubmit() {\n if (Yii::app()->request->isAjaxRequest && isset($_GET['id'])) {\n $model = $this->loadModel();\n $model->setScenario('submitToAidPartner');\n $model->status = '1';\n if ($model->save() && Generic::newState($model->id, $model->status)) {\n Yii::app()->user->setFlash('projectSubmitted', \"Your project was submitted.\");\n echo CJSON::encode(array('status' => 't', 'response' => $this->createUrl('/project/myProjects')));\n Yii::app()->end();\n } else {\n echo CJSON::encode(array('status' => 'f', 'response' => CHtml::errorSummary($model)));\n Yii::app()->end();\n }\n }\n }", "public function store(Request $request)\n {\n $input = $request->all();\n\n// dd($input);\n\n $job = new Job();\n\n $job->title = $input['title'];\n\n $job->lat = $input['lat'];\n\n $job->lng = $input['lng'];\n\n $job->address = $input['address'];\n\n $job->description = $input['description'];\n\n $job->user_id = Auth::user()->id;\n\n $job->save();\n \n Event::fire(new JobCreated($job));\n \n return redirect('/jobs');\n }", "public function handle()\n {\n Bus::chain([\n new SaveOrdersJob($this->parser('orders.json')),\n new SaveCustomersJob($this->parser('customers.json')),\n new SaveProductsJob($this->parser('products.json')),\n ])->dispatch();\n\n\n }", "public function testJobPostController()\n {\n $response = $this->post('/crawl', [\n 'URL' => 'https://medium.com/swlh/fun-with-python-3-hacking-instagram-giveaways-35e5b1d51670',\n 'CSS3' => 'article.meteredContent',\n ]);\n\n $response->assertStatus(200);\n $response->assertSeeText('Data inserted:');\n }", "function submit_current_job()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\t#User has posted their current job details\n\t\tif(!empty($_POST['schoolid']))\n\t\t{\n\t\t\t$result = $this->_job->submit_current_job($this->input->post(NULL, TRUE));\n\t\t\t$data['msg'] = $result? \"Your job has been submitted for approval\": \"ERROR: Your job could not be submitted for approval.\";\n\t\t}\n\t\t\n\t\t$data['area'] = \"submit_current_job\";\n\t\t$this->load->view('job/addons', $data);\n\t}", "public function submit()\n {\n $request = new HTTP_Request($this->requestURL);\n\n foreach ($this->parameters as $key => $value) {\n $request->addQueryString($key, $value);\n }\n\n $result = $request->sendRequest();\n if (PEAR::isError($result)) {\n throw new Services_Yahoo_Exception($result->getMessage());\n }\n\n return new Services_Yahoo_ContentAnalysis_Response($request);\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "function deploy()\n {\n $client = new Client();\n\n $client->request('POST', $this->keyword->getToUrl(), ['form_params' => $this->payload]);\n }", "public function handle()\n {\n $queue = 'fila_teste';\n $job = (new TestJob())->onQueue($queue);\n dispatch($job);\n }", "public function submitForm(array &$form, FormStateInterface $form_state)\n {\n }", "public function release($job);", "public function store(Request $request)\n {\n // Validate request\n $this->validate($request, [\n 'email' => 'required|email',\n 'title' => 'required|max:255',\n 'description' => 'required|min:5',\n ]);\n\n // Check if it is first job post with that email\n $first = true;\n if(Job::where('email', $request->email)->exists()){\n // We check if tere is job in database with that email\n // Optionaly, we could also check if it is first approved job\n $first = false;\n }\n\n // Create Job\n $job = new Job;\n $job->email = $request->email;\n $job->title = $request->title;\n $job->description = $request->description;\n $job->status = $first ? 'pending' : 'approved';\n $job->moderate_token = $first ? str_random(35) : null;\n try{\n $job->save();\n }catch(\\Exception $e){\n session()->flash('flash-message', 'Error saving job to database.');\n session()->flasj('flash-level', 'danger');\n\n return back();\n }\n\n // If this is first job post for given email, dispatch event\n if($first){\n event(new FirstJobPosted($job));\n }\n\n // Flash success message\n session()->flash('flash-message', 'Job posted successfully.');\n\n // Return back\n return redirect('/');\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "public function submitEvent();", "public function store(Request $request, Job $job)\n {\n $country = Country::all()->where('iso_3166_3', $request->country)->first();\n $job->country_id = $country->id;\n $job->country = $request->country;\n $job->company_name = $request->company_name;\n $job->title = $request->title;\n $job->salary = $request->salary;\n $job->qualifications = $request->qualifications;\n $job->description = $request->description;\n $job->category = $request->category;\n $job->expirience = $request->expirience;\n $job->expiry = $request->expiry;\n $job->country = $request->country;\n $job->save();\n \n\t\treturn redirect()->back()->with( ['success'=> __('app.action_ok',['item'=>'Job','action'=> __('app.added')])]);\n\n }", "public function fire($job, $data ) {\n\n if( $job->attempts() > 10 ){ //remove job after 10 tries\n return $job->delete();\n }\n\n if( !isset($data['endpoint']) || !isset($data['username']) || !isset($data['password']) || !isset($data['statement']) ){\n \\Log::error('Insufficient data passed to xapi statement job', $data);\n return $job->delete();\n }\n\n //Setup the endpoint and version\n $this->lrs->setEndpoint( $data['endpoint'] );\n $this->lrs->setVersion( \"1.0.1\" );\n\n //Set the auth details\n switch( $data['type'] ){\n default:\n case \"basic\":\n $this->lrs->setAuth( $data['username'], $data['password']);\n break;\n }\n\n $error_msg = 'XAPI error - failed sending statement';\n\n try {\n //Send the statement\n //This will attempt to push the statement a maximum of 3 times before deleting the job and creating an error\n $response = $this->lrs->saveStatement($data['statement']);\n if( $response->success ){\n //remove the job if succesfull\n return $job->delete();\n } else {\n $content = json_decode($response->content, true);\n if( isset($content['message']) && isset($content['message'][0]) ){\n $error_msg .= \" - \".$content['message'][0];\n }\n \\Log::error($error_msg, [\n 'content' => $content,\n 'data' => $data\n ]);\n return $job->release(10);\n }\n } catch (\\Exception $e) {\n $error_msg .= \" - \".$e->getMessage();\n \\Log::error($error_msg, [\n 'exception' => $e,\n 'data' => $data\n ]);\n return $job->release(10);\n }\n\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Job::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tJob::create($data);\n\t\tif($this->data['setting']->job_notification==1)\n\t\t{\n\t\t\t// Send email to all Employees\n\t\t\t$employees = Employee::select('email')->where('status', '=', 'active')->get();\n\t\t\tforeach ($employees as $employee) {\n\t\t\t\t$email = \"{$employee->email}\";\n\n\t\t\t\t$this->data['employee_name'] = $employee->fullName;\n\n\t\t\t\t//Send Email to All active users\n\t\t\t\tMail::send('emails.admin.noticeboard', $this->data, function ($message) use ($email) {\n\t\t\t\t\t$message->from($this->data['setting']->email, $this->data['setting']->name);\n\t\t\t\t\t$message->to($email)\n\t\t\t\t\t ->subject('New Job Vacancy - ' . $this->data['setting']->website);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tSession::flash('success', Lang::get('messages.successAdd'));\n\n\t\treturn Redirect::route('admin.jobs.index');\n\t}", "private function mpowerSubmit($pfJobInput)\n {\n // Send the job\n $bytesWritten = fwrite($this->_socket, $pfJobInput);\n if (!$bytesWritten) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\"[MPServer::mpowerSubmit]Socket fwrite failed\");\n }\n // Wait for it to finish and read job log.\n $reply = '';\n $timeoutInSeconds = 90;\n $start = time();\n while (!feof($this->_socket)) {\n $reply .= fread($this->_socket, 8192);\n $current = time();\n if ($current - $start > $timeoutInSeconds) {\n Logger::debug('Timeout of ' . $timeoutInSeconds . ' reached during MPower job submission, terminating.');\n break;\n }\n }\n // Try to make sense of the job log (only look for job id, documents and pages rendered)\n $success = strpos($reply, \"Job Status = SUCCESS\");\n //\n $lines = explode(\"\\n\", $reply);\n if (count($lines) < 17) {\n Logger::debug('Response: ' . print_r($lines, true));\n }\n if ($success) {\n $statInfoLine = explode(' ', $lines[count($lines) - 2]);\n $this->_currJob->setMpJobId($statInfoLine[2]);\n $jobInfoLine = explode(' ', $lines[count($lines) - 3]);\n $this->_currJob->setDocumentCount($jobInfoLine[4]);\n $this->_currJob->setPageCount($jobInfoLine[7]);\n }\n if (!$success) {\n throw new \\Exception(\"[MPServer::mpowerSubmit]Job failure.\" . $reply);\n }\n\n }", "public function run() {\n $job_list = $this->find_all_jobs();\n $jobby = new \\Jobby\\Jobby();\n\n $this->register_tasks( $jobby, $job_list );\n return $jobby->run();\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function store(Request $request, Job $job)\n {\n $this->validate($request,[\n 'title'=>'required',\n 'date'=>'required',\n 'description'=>'required',\n 'car_mileage'=>'required'\n ]);\n\n $job = new Job;\n $job->title = $request->title;\n $job->car_id = \n $job->date = $request->date;\n $job->description = $request->description;\n $job->car_mileage = $request->car_mileage;\n $car->jobs()->save($job);\n \n return back();\n }", "protected function executeJobActionRequest($job_id, $action_request = null)\n {\n // verify the required parameter 'job_id' is set\n if ($job_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $job_id when calling executeJobAction'\n );\n }\n\n $resourcePath = '/management/jobs/{jobId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($job_id !== null) {\n $resourcePath = str_replace(\n '{' . 'jobId' . '}',\n ObjectSerializer::toPathValue($job_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($action_request)) {\n $_tempBody = $action_request;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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 HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\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 }", "public function fire($job, $data)\n {\n // Q: Can returned SKUs be processed in the same transaction as a purchase SKU? YES - Confirmed by Danny\n\n\n\n\n /**\n * Required:\n * - transaction_id\n * - person_id\n * - transaction_items\n * - product ID / sku\n * - product category\n * - value (+/-)\n *\n * To do:\n * - Work out what they have just purchased\n * - Check returncount against member resource\n * - Apply reward logic to purchase\n * - Apply reward - add to rewards table\n * - Create plain-english event(s) for what just happened\n * - Queue email\n */\n\n\n\n // Deletes the job from the iron.io queue\n $job->delete();\n\n // Save the incoming job's ID and mark it as done\n IronWorkerLog::mark_done($job->getJobId());\n }", "public function pingJob(): void\n {\n $this->storage->pingJob($this->storedJob);\n }", "public function perform(JobHandler $job)\n\t{\n\t\t$result = null;\n\t\ttry {\n\t\t\tEvent::trigger('afterFork', $job);\n\t\t\t$result = $job->perform();\n\t\t} catch (Exception $e) {\n\t\t\t$context = array('job' => $job, 'exception' => $e);\n\t\t\t$this->logger->log(LogLevel::CRITICAL, '{job} has failed {exception}', $context);\n\t\t\t$job->fail($e);\n\t\t\treturn;\n\t\t} catch (Error $e) {\n\t\t\t$context = array('job' => $job, 'exception' => $e);\n\t\t\t$this->logger->log(LogLevel::CRITICAL, '{job} has failed {exception}', $context);\n\t\t\t$job->fail($e);\n\t\t\treturn;\n\t\t}\n\n\t\t$job->updateStatus(Status::STATUS_COMPLETE, $result);\n\t\t$this->logger->log(LogLevel::NOTICE, '{job} has finished', array('job' => $job));\n\t}", "public function post(): ?ResponseInterface\n {\n // Validate\n $validation = service('validation')->reset()->setRules([\n 'name' => 'required|max_length[255]',\n 'summary' => 'max_length[255]',\n ]);\n\n if (! $validation->withRequest($this->request)->run()) {\n return redirect()->back()->withInput()->with('errors', $validation->getErrors());\n }\n\n // Try to update the job\n if (! $this->jobs->update($this->job->id, $this->request->getPost())) {\n return redirect()->back()->withInput()->with('errors', $this->jobs->errors());\n }\n\n return null;\n }", "public function send()\n\t{\n\t\t$message = $this->message ?: ucwords($this->getSystemUser()).' ran the ['.$this->task.'] task.';\n\n\t\t$payload = ['text' => $message, 'channel' => $this->channel];\n\n Request::post(\"https://{$this->team}.slack.com/services/hooks/incoming-webhook?token={$this->token}\")->sendsJson()->body($payload)->send();\n\t}" ]
[ "0.65849286", "0.62562317", "0.61752015", "0.5990964", "0.5990964", "0.59484506", "0.58963776", "0.5862521", "0.5862521", "0.58070415", "0.57911265", "0.57883614", "0.5757296", "0.5731822", "0.55884624", "0.5587641", "0.5566198", "0.5560653", "0.55572766", "0.5459537", "0.54570246", "0.545055", "0.54189086", "0.5380234", "0.53568983", "0.53462034", "0.5331927", "0.53312135", "0.53310895", "0.53304714", "0.52993226", "0.52608", "0.52573377", "0.52440375", "0.5224226", "0.5214966", "0.5211008", "0.51836973", "0.5179901", "0.51721215", "0.5167625", "0.5159006", "0.5147857", "0.51431644", "0.512812", "0.5124261", "0.5120685", "0.5105519", "0.5103572", "0.5100834", "0.5088394", "0.50868535", "0.50848067", "0.5054344", "0.50509256", "0.50455195", "0.5040574", "0.5037522", "0.50312454", "0.5030272", "0.5027296", "0.5018017", "0.50180054", "0.5011788", "0.5011605", "0.5008222", "0.5006074", "0.49956915", "0.49943158", "0.49932295", "0.49805382", "0.49797973", "0.49702707", "0.49700266", "0.49634787", "0.49623632", "0.49602112", "0.49534565", "0.4950709", "0.49491286", "0.49482235", "0.49410984", "0.49351493", "0.49141368", "0.49014187", "0.48969805", "0.48956463", "0.4893427", "0.48863432", "0.48700997", "0.48587734", "0.48579368", "0.48520327", "0.48493353", "0.48324347", "0.48247403", "0.48232457", "0.48200423", "0.48169458", "0.48160952" ]
0.67827356
0
Get the status of a job.
function printStatus($jobId) { $this->printDebugMessage('printStatus', 'Begin', 1); $retVal = ''; $status = $this->getStatus($jobId); echo "<p>Status for job <a href=\"?jobId=$jobId\">$jobId</a>: $status</p>\n"; if($status == 'FINISHED') { $this->printResultsSummary($jobId); } else { $retVal = $this->genMetaRefresh($jobId); } $this->printDebugMessage('printStatus', 'End', 1); return $retVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJobStatus()\n {\n return $this->jobStatus;\n }", "static function getStatusOfJob( $jobId ) {\n return self::getJobDetails( $jobId )->status;\n }", "public function getJobStatus()\n {\n }", "public function getJobStatus($jobId)\n {\n $data[\"Envelope\"] = array(\n \"Body\" => array(\n \"GetJobStatus\" => array(\n \"JOB_ID\" => $jobId\n ),\n ),\n );\n\n $response = $this->_request($data);\n $result = $response[\"Envelope\"][\"Body\"][\"RESULT\"];\n\n if($this->_isSuccess($result)) {\n if(isset($result['JOB_STATUS']))\n return $result;\n else {\n throw new Exception('Job status query was successful but no status was found.');\n }\n }\n else {\n throw new Exception(\"getJobStatus Error: \".$this->_getErrorFromResponse($response));\n }\n }", "public static function getJobStatus($jobname) {\n\t\tif (array_key_exists($jobname, self::$jobs)) {\n\t\t\treturn self::$jobs[$jobname]['running'];\n\t\t}\n\t\treturn false;\n\t}", "public function getStatus()\r\n\t{\r\n\t\t$select\t= $this->_db->select()->from('Cron_Jobs', array('active'))->where('id = ?', $this->_getId());\r\n\t\t$status\t= $this->_db->fetchRow($select);\r\n\t\t\r\n\t\treturn $status['active'];\r\n\t}", "private function checkStatusOfSearchJob() {\n $response = $this->client->request('GET', \"search/jobs/{$this->jobId}\", ['http_errors' => false]);\n if ($response->getStatusCode() === 429) {\n return self::RATE_LIMITED;\n }\n $data = json_decode($response->getBody());\n $state = $data->state;\n switch ($state) {\n case \"NOT STARTED\" :\n return self::NOT_STARTED;\n case \"GATHERING RESULTS\";\n return self::IN_PROGRESS;\n case \"DONE GATHERING RESULTS\";\n return self::COMPLETE;\n default:\n return self::CANCELLED;\n }\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getStatus()\n {\n return $this->_makeCall('status');\n }", "Public Function GetJobstatus($jobId)\n {\n \t$this->jobId = $jobId;\n \t$this->status = 'Not in bevomedia_queue';\n \t\n \t\t$DatabaseObj = Zend_Registry::get('Instance/DatabaseObj');\n\t\t\t\n \t//Lets get all entries that have envelopes and have not been started\n \t$Query = \"\n \t\tSELECT\n \t\t\tstarted, completed, Deleted\n \t\tFROM\n \t\t\tbevomedia_queue\n \t\tWHERE\n \t\t\tjobId = '{$this->jobId}'\t\n \t\t\n \t\";\n \t\n \t$Results = $DatabaseObj->fetchAll($Query);\n \tif(count($Results)>0)\n \t{\n\t \tforeach($Results as $Value)\n\t \t{\n\t \t\tif($Value->started == '0000-00-00 00:00:00' && $Value->completed == '0000-00-00 00:00:00')\n\t \t\t{\n\t \t\t\t$this->status = 'bevomedia_queued';\n\t \t\t}\n\t \t\telseif($Value->started == '0000-00-00 00:00:00' && $Value->completed != '0000-00-00 00:00:00')\n\t \t\t{\n\t \t\t\t$this->status = 'Processing';\n\t \t\t}\n\t \t\telseif($Value->started != '0000-00-00 00:00:00' && $Value->completed != '0000-00-00 00:00:00')\n\t \t\t{\n\t \t\t\t$this->status = 'completed';\n\t \t\t}\n\t \t\telseif($Value->Deleted == 1)\n\t \t\t{\n\t \t\t\t$this->status = 'Deleted';\n\t \t\t}\n\t \t\telse \n\t \t\t{\n\t \t\t\t//Not sure what this could be\n\t \t\t\t$this->status = 'Error';\n\t \t\t}\n\t \t}\n \t}\n\n \treturn $this->status; \t\n \t\n }", "public function getStatus()\n {\n return $this->getIfSet('status');\n }", "function status ($id = null) {\n\n $this->disableCache();\n\n $j = $this->Job->read(array (\n 'Job.id',\n 'Job.title',\n 'Job.status',\n 'Job.created',\n ), $id);\n\n $skey = 'jobstatus' . $j['Job']['id'] . 'since';\n if ($this->Session->check ($skey)) {\n $since = $this->Session->read ($skey);\n }\n else {\n $since = time ();\n }\n $this->Session->write ($skey, time());\n\n $this->set ('job', $j);\n $status = $this->Job->bgpGetStatus ();\n $this->set ('status', $status);//$since)); ignoring this for now as status update page currently too simple for it\n $async = $this->RequestHandler->isAjax ();\n $this->set ('async', $async);\n \n \n if ($j['Job']['status'] >= 2) // if job is complete, with or without error\n $this->redirect(array('action' => 'report', $id));\n elseif ($j['Job']['status'] == 0 && !$async) // job is pending\n $this->Job->tryProcessNext();\n elseif ($j['Job']['status'] == 1) // job is running\n $this->Job->bgpBOYD(); // check if *this job* has crashed\n \n if (!!$async) {\n $sd = md5(serialize($status['statusFile']));\n if ($this->Session->read ('Job.statustxt.lastStatusData') !== $sd) {\n // data have changed\n $this->Session->write ('Job.statustxt.lastStatusData',$sd);\n $this->Session->write ('Job.statustxt.lastStatusTime',time());\n }\n header ('ax-new-epoch: ' . time());\n header ('ax-latest-epoch: ' . $this->Session->read ('Job.statustxt.lastStatusTime'));\n }\n }", "public function getJob()\n {\n return $this->job;\n }", "public function getJob()\n {\n return $this->job;\n }", "public function getStatus()\n {\n return $this->getData('status');\n }", "public function get_status() {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->get(self::STATUS);\n }", "public function getStatus()\n {\n return $this->data['status'];\n }", "public function getStatus()\n {\n $rtn = $this->data['status'];\n\n return $rtn;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus() {\n\t\treturn $this->status;\n\t}", "public function getStatus() {\n\t\treturn $this->status;\n\t}", "public function getStatus() {\n return $this->status;\n }", "public function getStatus()\r\n\t\t{\r\n\t\t\treturn $this->status;\r\n\t\t}", "function getStatus() {\n\t\treturn $this->getData('status');\n\t}", "public function getStatus()\n {\n \n return $this->status;\n }", "public function getStatus()\r\n {\r\n return $this->status;\r\n }", "public function getStatus()\r\n {\r\n return $this->status;\r\n }", "public function getStatus()\n {\n $this->execute();\n \n return $this->status;\n }" ]
[ "0.8235965", "0.77991986", "0.7383032", "0.7224963", "0.7199093", "0.71062624", "0.6998778", "0.6985483", "0.69854116", "0.69244903", "0.6920633", "0.6870623", "0.68196374", "0.6810396", "0.6810396", "0.67212075", "0.67009777", "0.6686452", "0.66558796", "0.66387594", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.6623571", "0.66224474", "0.66224474", "0.66091436", "0.6608052", "0.65984136", "0.6596903", "0.6594648", "0.6594648", "0.65819305" ]
0.0
-1
Print details of available results for a job
function printResultsSummary($jobId) { $this->printDebugMessage('printResultsSummary', 'Begin', 1); echo "<p>Results:</p>\n"; echo "<ul>\n"; $resultTypes = $this->getResultTypes($jobId); foreach($resultTypes as $resultType) { $resultUrl = "?jobId=$jobId&resultType=" . $resultType->identifier; print "<li><a href=\"$resultUrl\">" . $resultType->label . "</a>"; if(isset($resultType->description)) { print ": " . $resultType->description . "\n"; } print "</li>\n"; } echo "</ul>\n"; $this->printDebugMessage('printResultsSummary', 'End', 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function print_results() {\r\n if ($list = $this->print_list()) {\r\n echo '<p>' . $this->print_count() . '</p>';\r\n echo $list;\r\n echo '<p class=\"more\">' . $this->print_more() . '</p>';\r\n }\r\n else {\r\n echo $this->zero_results;\r\n }\r\n }", "public function getJobsInfo(){ return $this->APICallSub( '/jobs', '', \"Couldn't lookup the job list\" ); }", "public function print_result(){\n $parsed_result = (array) $this->get_result()->parse_result();\n foreach($parsed_result['items'] as $repository_detail){\n $out .= $repository_detail->full_name.': '.$repository_detail->description.'<br />';\n }\n echo $out;\n }", "function printResults () {\n\n if (! $this->isActive()) { return; }\n\n $unstoppedTasks = array_keys($this->startTime);\n if (count($unstoppedTasks)) {\n Tht::error('Unstopped Perf task: `' . $unstoppedTasks[0] . '`');\n }\n\n $results = $this->results();\n\n // Have to do this outside of results() or the audit calls will show up in the perf tasks.\n // $results['imageAudit'] = Tht::module('Image')->auditImages(Tht::path('public'));\n\n $thtDocLink = Tht::getThtSiteUrl('/reference/perf-panel');\n $compileMessage = Compiler::getDidCompile() ? '<div class=\"bench-compiled\">Files were updated. Refresh to see compiled results.</div>' : '';\n\n $table = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['single']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'value' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Peak Memory (MB)', 'Detail' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n $tableGroup = OTypeString::getUntyped(\n Tht::module('Web')->u_table(OList::create($results['group']),\n OList::create([ 'task', 'durationMs', 'memoryMb', 'numCalls' ]),\n OList::create([ 'Task', 'Duration (ms)', 'Memory (MB)', 'Calls' ]),\n OMap::create(['class' => 'bench-result'])\n ), 'html');\n\n\n $opCache = '';\n if (Tht::isOpcodeCacheEnabled()) {\n $opCache = '<span style=\"color: #393\">ON</span>';\n }\n else {\n $opCache = '<span style=\"color: #c33\">OFF</span>';\n }\n\n $appCache = Tht::module('Cache')->u_get_driver();\n if ($appCache == 'file') {\n $appCache = '<span style=\"color: #c33\">' . $appCache . '</span>';\n }\n else {\n $appCache = '<span style=\"color: #393\">' . $appCache . '</span>';\n }\n\n\n\n $phpVersion = phpVersion();\n\n\n echo $this->perfPanelCss();\n echo $this->perfPanelJs($results['scriptTime']);\n\n ?>\n <div id=\"perf-score-container\">\n\n <div class=\"perfSection\">\n <div class='perfHeader'>Perf Score: <span id='perfScoreTotalLabel'></span><span id='perfScoreTotal'></span></div>\n\n <div class=\"perfHelp\"><a href=\"<?= $thtDocLink ?>\" style=\"font-weight:bold\">About This Score</a></div>\n </div>\n\n <?= $compileMessage ?>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Page Execution: <span id=\"perfScoreServer\"><?= $results['scriptTime'] ?> ms</span></div>\n <div>Network - Transfer: <span id='perfScoreNetwork'></span></div>\n <div>Browser - window.onload: <span id='perfScoreClient'></span></div>\n </div>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfTotals\">\n <div>Server - Peak Memory: <span><?= $results['peakMemory'] ?> MB</span></div>\n </div>\n </div>\n\n <div class=\"perfSection tasksGrouped\">\n <div class=\"perfSubHeader\">Top Tasks (Grouped)</div>\n <?= $tableGroup ?>\n </div>\n\n <div class=\"perfSection\">\n <div class=\"perfSubHeader\">Top Tasks (Individual)</div>\n <?= $table ?>\n <div style='text-align:center; margin-top:48px;'>\n <p style=\"font-size: 80%\"> Sub-task time is not included in parent tasks.</p>\n </div>\n </div>\n\n\n\n <div class=\"perfSection\">\n <div class=\"perfHeader\">PHP Info</div>\n\n <div style=\"text-align: left; width: 300px; display: inline-block; margin-top: 32px\">\n <li>PHP Version: <b><?= $phpVersion ?></b></li>\n <li>Opcode Cache: <b><?= $opCache ?></b></li>\n <li>App Cache Driver: <b><?= $appCache ?></b></li>\n </div>\n </div>\n\n <div class=\"perfSection\">\n Perf Panel only visible to localhost or <code>devIp</code> in <code>config/app.jcon</code>\n </div>\n\n </div>\n <?php\n\n }", "public function results()\n\t{\n\t\t// This function return entries\n\t\treturn $this->EE->job_search->results();\n\t}", "public function ViewResults() {\n echo \"<pre>\" . print_r($this->rs, TRUE) . \"</pre>\";\n }", "public function showTestResults() {\n echo \"Tests: {$this->tests}\\n\";\n echo \"Pass: {$this->pass}\\n\";\n echo \"Fail: {$this->fail}\\n\";\n }", "function printStatus($jobId) {\n $this->printDebugMessage('printStatus', 'Begin', 1);\n $retVal = '';\n $status = $this->getStatus($jobId);\n echo \"<p>Status for job <a href=\\\"?jobId=$jobId\\\">$jobId</a>: $status</p>\\n\";\n if($status == 'FINISHED') {\n $this->printResultsSummary($jobId);\n }\n else {\n $retVal = $this->genMetaRefresh($jobId);\n }\n $this->printDebugMessage('printStatus', 'End', 1);\n return $retVal;\n }", "public function execute() {\n $this->response = $this->printerManager->listJobsFromPrinter($this->printer);\n }", "function printResult($jobId, $resultType) {\n $this->printDebugMessage('printResult', 'Begin', 1);\n echo \"<p>Result for job <a href=\\\"?jobId=$jobId\\\">$jobId</a>:</p>\\n\";\n $resultTypeObjs = $this->getResultTypes($jobId);\n foreach($resultTypeObjs as $resultTypeObj) {\n if($resultTypeObj->identifier == $resultType) {\n\t$selResultTypeObj = $resultTypeObj;\n }\n }\n // Plain text\n if($selResultTypeObj->mediaType == 'text/plain') {\n $resultStr = $this->getResult($jobId, $resultType);\n echo \"<p><pre>$resultStr</pre></p>\\n\";\n }\n // Image, embed using img tag using service REST API for document\n elseif(strpos($selResultTypeObj->mediaType, 'image') === 0 &&\n\t strpos($selResultTypeObj->mediaType, 'xml') == 0) {\n $resultUrl = 'http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/';\n $resultUrl .= $jobId . '/' . $resultType;\n echo \"<img src=\\\"$resultUrl\\\"></img>\";\n }\n // Other, embed in iframe using service REST API for document\n else {\n $resultUrl = 'http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/';\n $resultUrl .= $jobId . '/' . $resultType;\n echo \"<iframe src=\\\"$resultUrl\\\" width=\\\"100%\\\" height=\\\"100%\\\"></iframe>\";\n }\n $this->printDebugMessage('printResult', 'Begin', 1);\n }", "public function showResults()\n {\n $tracker = Tracker::getInstance();\n\n $tracker->outputStats();\n if (count($tracker->getFailures())) {\n $tracker->output(\"\\nFAILURES\\n\", null, null, true);\n $tracker->outputFailures();\n }\n\n if (count($tracker->getErrors())) {\n $tracker->output(\"\\nERRORS\\n\");\n $tracker->outputErrors();\n }\n\n $tracker->output(\"\\n\");\n\n if (count($tracker->getFailures())) {\n return;\n }\n\n if ($this->coverageDirectory()) {\n $tracker->output('Generating coverage report as html...' . \"\\n\");\n $this->_generateCoverageHtml();\n return $tracker->output('Done' . \"\\n\");\n }\n\n if ($this->showCoverage()) {\n $this->_generateCoverageCommandLine();\n return;\n }\n }", "public function show(Job $job)\n {\n //\n }", "public function showResults(){\n $this->extractQuestions();\n }", "function tripal_jobs_report () {\n //$jobs = db_query(\"SELECT * FROM {tripal_jobs} ORDER BY job_id DESC\");\n $jobs = pager_query(\n \"SELECT TJ.job_id,TJ.uid,TJ.job_name,TJ.modulename,TJ.progress,\n TJ.status as job_status, TJ,submit_date,TJ.start_time,\n TJ.end_time,TJ.priority,U.name as username\n FROM {tripal_jobs} TJ \n INNER JOIN {users} U on TJ.uid = U.uid \n ORDER BY job_id DESC\", 10,0,\"SELECT count(*) FROM {tripal_jobs}\");\n\t\n // create a table with each row containig stats for \n // an individual job in the results set.\n $output .= \"Waiting jobs are executed first by priority level (the lower the \".\n \"number the higher the priority) and second by the order they \".\n \"were entered\";\n $output .= \"<table class=\\\"tripal-table tripal-table-horz\\\">\". \n \" <tr>\".\n \" <th>Job ID</th>\".\n \" <th>User</th>\".\n \" <th>Job Name</th>\".\n \" <th nowrap>Dates</th>\". \n\t\t\t \" <th>Priority</th>\".\n\t\t\t \" <th>Progress</th>\".\n \" <th>Status</th>\".\n \" <th>Actions</th>\".\n \" </tr>\";\n $i = 0;\n while($job = db_fetch_object($jobs)){\n $class = 'tripal-table-odd-row';\n if($i % 2 == 0 ){\n $class = 'tripal-table-even-row';\n }\n $submit = tripal_jobs_get_submit_date($job);\n $start = tripal_jobs_get_start_time($job);\n $end = tripal_jobs_get_end_time($job);\n\n $cancel_link = '';\n if($job->start_time == 0 and $job->end_time == 0){\n $cancel_link = \"<a href=\\\"\".url(\"admin/tripal/tripal_jobs/cancel/\".$job->job_id).\"\\\">Cancel</a><br>\";\n }\n $rerun_link = \"<a href=\\\"\".url(\"admin/tripal/tripal_jobs/rerun/\".$job->job_id).\"\\\">Re-run</a><br>\";\n $view_link =\"<a href=\\\"\".url(\"admin/tripal/tripal_jobs/view/\".$job->job_id).\"\\\">View</a>\";\n $output .= \" <tr class=\\\"$class\\\">\";\n $output .= \" <td>$job->job_id</td>\".\n \" <td>$job->username</td>\".\n \" <td>$job->job_name</td>\".\n \" <td nowrap>Submit Date: $submit\".\n \" <br>Start Time: $start\".\n \" <br>End Time: $end</td>\".\n \" <td>$job->priority</td>\".\n\t\t\t\t \" <td>$job->progress%</td>\".\n \" <td>$job->job_status</td>\".\n \" <td>$cancel_link $rerun_link $view_link</td>\".\n \" </tr>\";\n $i++;\n }\n $output .= \"</table>\";\n\t$output .= theme_pager();\n return $output;\n}", "public function getJobs();", "public function getJobs();", "public function printResults() {\n $assertions = $this->getAssertions();\n $failures = $this->getFailures();\n $errors = $this->getErrors();\n return \"Assertions: \" . $assertions . \", Failures: \" . $failures . \" and \" . $errors . \" errors.\";\n }", "public function getResults();", "function showResults(){\n global $ilUser, $tpl, $ilTabs, $ilLocator, $ilToolbar;\n\n $ilTabs->activateTab(\"showResults\");\n\n $ilToolbar->setFormAction($this->ctrl->getFormAction($this));\n $ilToolbar->addFormButton($this->txt(\"results_export\"), 'exportResultData');\n\n $tpl->setContent($this->initResultsTable());\n }", "public function viewJob()\n {\n $result = Job::paginate(50);\n return view('data.list_job', ['job' => $result]);\n }", "public function printResultSectionLinks() {}", "public function outputResults()\r\n {\r\n // loop all products and display results per product\r\n foreach ($this->Products->getAllProducts() as $productId => $productName) {\r\n echo \"Product ID: \" . $productId . \"\\n\";\r\n echo \"Product Name: \" . $productName . \"\\n\";\r\n echo \"Total Units Sold: \" . $this->ProductsSold->getSoldTotal($productId) . \"\\n\";\r\n echo \"Total Units Purchased and Pending: \" . $this->ProductsPurchased->getPurchasedPendingTotal($productId) . \"\\n\";\r\n echo \"Total Units Purchased and Received: \" . $this->ProductsPurchased->getPurchasedReceivedTotal($productId) . \"\\n\";\r\n echo \"Current Stock Level: \" . $this->Inventory->getStockLevel($productId) . \"\\n\\n\";\r\n }\r\n }", "function printResults(&$results) {\n // the profile name and total sessions.\n if (count($results->getRows()) > 0) {\n\n // Get the profile name.\n $profileName = $results->getProfileInfo()->getProfileName();\n\n // Get the entry for the first entry in the first row.\n $rows = $results->getRows();\n $sessions = $rows[0][0];\n\n // Print the results.\n print \"First view (profile) found: $profileName\\n\";\n print \"Total sessions: $sessions\\n\";\n } else {\n print \"No results found.\\n\";\n }\n}", "function printJobsTable($JobInformation)\r\n\t\t{\r\n\r\n\t\t\twhile ($row = $JobInformation->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\t\techo \"<tr>\";\r\n\t\t\t\techo \"<td>\" . $row['propertyref'] . \"</td>\";\r\n\t\t\t\techo \"<td>\" . $row['jobdescription'] . \"</td>\";\r\n\t\t\t\techo \"<td>\" . $row['description'] . \"</td>\";\r\n\t\t\t\techo \"</tr>\";\r\n\t\t\t}\r\n\r\n\t\t}", "public function printResultBar() \n { \n \n if( $this->getTotalOfResults() > 0 ) { \n printf(\"\n <div id=\\\"result-bar\\\">\n Showing page <span>%s</span> of <span>\n %s</span> available pages for\n <span>%s</span> \n results. \n </div>\n \"\n , $this->getCurrentPage()\n , $this->getTotalOfPages()\n , $this->getTotalOfResults()\n );\n \n } else { \n print \"<div id=\\\"result-bar-not-found\\\">\n No records were found to your search.</div>\"; \n } \n \n }", "public function get_results()\n {\n }", "public function get_results()\n {\n }", "function display_result_details($branch, $what='all', $html=false)\n{\n\tglobal $db;\n\n\tif ($html) $etag = check_send_etag($branch, $what);\n\n\t$select = $db->prepare(\"SELECT results.*,scripts.label AS script_label,scripts.details AS script_details,suites.label AS suite_label,\nbranch.label AS branch_label,\nCOALESCE(success.label,success) AS success_revision,\nCOALESCE(failed.label,failed) AS failed_revision,\nCOALESCE(first_failed.label,first_failed) AS first_failed_revision\nFROM results\nJOIN labels AS branch ON results.branch=branch.id AND branch.details='***branch***'\nJOIN labels AS scripts ON results.script=scripts.id\nJOIN labels AS suites ON results.suite=suites.id\nLEFT JOIN labels AS success ON results.success=success.id AND success.details='***revision***'\nLEFT JOIN labels AS failed ON results.failed=failed.id AND failed.details='***revision***'\nLEFT JOIN labels AS first_failed ON results.first_failed=first_failed.id AND first_failed.details='***revision***'\nWHERE branch=:branch\".limit_script_sql($what).'\nORDER BY script,suite,test');\n\t$select->setFetchMode(PDO::FETCH_ASSOC);\n\tif ($select->execute(array(\n\t\t'branch' => label2id($branch),\n\t)))\n\t{\n\t\tif ($html)\n\t\t{\n\t\t\techo \"<table class='details' data-etag='\".htmlspecialchars($etag).\"'>\\n\";\n\t\t\techo \"<tr class='header'><th class='expandAll'></th><th>Script</th><th>Suite</th><th>Test</th><th>Branch</th>\".\n\t\t\t\t\"<th>Last success</th><th>Failed</th><th>First failed</th><th>Time</th><th title='Notes' class='notes'>N</th></tr>\\n\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"Script\\t\\t\\tSuite\\t\\t\\tTest\\tBranch\\tLast success\\tFailed\\tFirst failed\\tTime\\n\\n\";\n\t\t}\n\t\tforeach($select as $result)\n\t\t{\n\t\t\t$result['time'] = isset($result['time']) ? number_format($result['time'], 2, '.', '') : '';\n\t\t\t$description = get_test_description($result['script_label'], $result['suite_label'], $result['test']);\n\t\t\tif (!$html)\n\t\t\t{\n\t\t\t\techo \"\\n$result[script_label]\\t$result[suite_label]\\t\".\n\t\t\t\t\t$result['test'].(!empty($description) ? ': '.$description : '').\"\\t\".\n\t\t\t\t\t\"$result[branch_label]\\t$result[success_revision]\\t\".\n\t\t\t\t\t\"$result[failed_revision]\\t$result[first_failed_revision]\\t$result[time]\\n\";\n\t\t\t\tif (!empty($result['details'])) echo \"$result[details]\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!empty($result['failed']))\n\t\t\t{\n\t\t\t\techo '<tr class=\"red\">';\n\t\t\t}\n\t\t\telseif (!empty($result['success']))\n\t\t\t{\n\t\t\t\techo '<tr class=\"green\">';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<tr class=\"ignored\">';\n\t\t\t}\n\t\t\tif (!empty($result['details']) || !empty($result['protocol']))\n\t\t\t{\n\t\t\t\techo '<td class=\"expand\">';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<td>';\n\t\t\t}\n\n\t\t\techo \"</td><td class='script'>\".htmlspecialchars($result['script_label']).\n\t\t\t\t\"</td><td>\".htmlspecialchars($result['suite_label']).\n\t\t\t\t\"</td><td>\".htmlspecialchars($result['test']).(!empty($description) ? ': '.htmlspecialchars($description) : '').\n\t\t\t\t\"</td><td>\".htmlspecialchars($result['branch_label']).\n\t\t\t\t\"</td><td class='revision'>\".htmlspecialchars($result['success_revision']).\n\t\t\t\t\"</td><td class='revision'>\".htmlspecialchars($result['failed_revision']).\n\t\t\t\t\"</td><td class='revision'>\".htmlspecialchars($result['first_failed_revision']).\n\t\t\t\t\"</td><td class='time' title='\".htmlspecialchars($result['updated']).\"'>\".htmlspecialchars($result['time']).\n\t\t\t\t\"</td><td class='\".(empty($result['notes']) ? 'noNotes' : 'haveNotes').\"'>\".\n\t\t\t\t\"</td></tr>\\n\";\n\n\t\t\tif (!empty($result['details']) || !empty($result['protocol']))\n\t\t\t{\n\t\t\t\techo '<tr style=\"display:none\" class=\"details\"><td></td><td colspan=\"8\" class=\"output\">'.htmlspecialchars($result['details']).htmlspecialchars($result['protocol']).\"</td></tr>\\n\";\n\t\t\t}\n\t\t\techo '<tr style=\"display:none\" class=\"notes\" id=\"'.htmlspecialchars($result['branch'].'-'.$result['script'].'-'.$result['suite'].'-'.$result['test']).\n\t\t\t\t'\"><td/><td colspan=\"7\"><textarea class=\"notes\">'.htmlspecialchars($result['notes']).\"</textarea></td>\".\n\t\t\t\t\"<td colspan='2' class='updateNotes'><button>Update</button></tr>\\n\";\n\t\t}\n\t}\n}", "function action_listinstancejobs() {\n global $CFG, $USER;\n\n //report specified by URL\n $report = $this->required_param('report', PARAM_ALPHAEXT);\n\n //get the necessary data\n $recordset = block_php_report_get_report_jobs_recordset($report);\n\n //set up a job if none exist and a special parameter\n //is passed in to signal this functinality\n $createifnone = optional_param('createifnone', 0, PARAM_INT);\n if ($createifnone) {\n if (!$recordset\n or $recordset->_numOfRows == 0\n or $recordset->EOF) {\n\n //set up a job for this report\n $this->action_default();\n return;\n }\n }\n\n //import necessary CSS\n $stylesheet_web_path = $CFG->wwwroot . '/blocks/php_report/styles.php';\n echo '<style>@import url(\"' . $stylesheet_web_path . '\");</style>';\n\n if ($recordset = block_php_report_get_report_jobs_recordset($report)\n and $recordset->_numOfRows != 0\n and !$recordset->EOF) {\n //we actually have scheduled instances for this report\n\n //display appropriate headers\n $this->render_listinstancejobs_header(true, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n\n //set up our form\n echo '<form action=\"' . $this->get_url() . '\" method=\"post\">';\n //used by the \"select all\" functionality to identify a defining div\n echo '<div id=\"list_display\">';\n echo '<input type=\"hidden\" id=\"report\" name=\"report\" value=\"' . $report . '\"/>';\n\n //table setup\n $table = new stdClass;\n\n //headers, with a \"select all\" checkbox in the first column\n require_js($CFG->wwwroot . '/blocks/php_report/lib.js');\n $checkbox = print_checkbox('selectall', '', false, get_string('listinstancejobs_header_select', 'block_php_report'), '', 'select_all()', true);\n $table->head = array($checkbox,\n get_string('listinstancejobs_header_label', 'block_php_report'),\n get_string('listinstancejobs_header_owner', 'block_php_report'),\n get_string('listinstancejobs_header_lastrun', 'block_php_report'),\n get_string('listinstancejobs_header_nextrun', 'block_php_report'),\n get_string('listinstancejobs_header_lastmodified', 'block_php_report'));\n\n //left align all columns\n $table->align = array();\n foreach ($table->head as $column_header) {\n $table->align[] = 'left';\n }\n\n $table->data = array();\n\n //run through available schedules\n while ($record = rs_fetch_next_record($recordset)) {\n $config_data = unserialize($record->config);\n $tz = $config_data['timezone'];\n //echo \"action_listinstancejobs():: {$config_data['label']}: nextruntime = {$record->nextruntime}<br/>\";\n\n //convert the last run time to the appropraite format\n if ($record->lastruntime == 0) {\n //special case: never run before\n $lastruntime = get_string('no_last_runtime', 'block_php_report');\n } else {\n $lastruntime = userdate($record->lastruntime, '', $tz)\n . ' (' . usertimezone($tz) .')';\n debug_error_log(\"/blocks/php_report/lib/schedulelib.php::action_listinstancejobs(); {$config_data['label']}: record->lastruntime = {$record->lastruntime}, tz = {$tz}\");\n }\n\n // convert 'will run next at' time to appropriate format\n $jobenddate = $config_data['schedule']['enddate'];\n debug_error_log(\"/blocks/php_report/lib/schedulelib.php::action_listinstancejobs(); {$config_data['label']}: nextruntime = {$record->nextruntime}, jobenddate = {$jobenddate}\");\n if (!empty($record->nextruntime) &&\n (empty($jobenddate)\n || $record->nextruntime < ($jobenddate + DAYSECS))\n ) {\n $nextruntime = userdate($record->nextruntime, '', $tz)\n . ' (' . usertimezone($tz) .')';\n } else {\n $nextruntime = get_string('job_completed',\n 'block_php_report');\n }\n $checkbox = '<input type=\"checkbox\" name=\"schedule_' . $record->scheduleid . '\">';\n\n //link for editing this particular schedule instance\n $edit_schedule_params = array('id' => $record->scheduleid);\n $edit_schedule_link = '<a href=\"' . $this->get_url($edit_schedule_params) . '\">' . $config_data['label'] . '</a>';\n\n //data row\n $table->data[] = array($checkbox,\n $edit_schedule_link,\n fullname($record),\n $lastruntime,\n $nextruntime,\n userdate($config_data['timemodified']),);\n }\n\n print_table($table);\n\n print_spacer();\n\n //display the dropdown and button in an enabled state\n $this->render_listinstancejobs_actions_dropdown(true);\n\n echo '</div>';\n echo '</form>';\n } else {\n //display header info\n $this->render_listinstancejobs_header(false, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n\n //display the dropdown and button in a disabled state\n $this->render_listinstancejobs_actions_dropdown(false);\n\n print_spacer();\n }\n\n //general footer\n $this->render_listinstancejobs_footer();\n }", "public function show()\n {\n global $wpdb;\n print_r($wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}queue\"));\n }", "function print_ua_faculty_jobs( $args = array() ) {\n\n\t// Set up the arguments\n\t$defaults = array(\n\t\t'keywords' => NULL,\n 'highlight_keywords' => true,\n 'show_all' => true,\n\t);\n\n\t// Parse the args\n\t$args = wp_parse_args( $args, $defaults );\n\textract( $args, EXTR_OVERWRITE );\n\n\t// Clean up the keywords\n\tif ( ! empty( $keywords ) ) {\n\n\t\t// Make sure $keywords is an array\n\t\tif ( ! is_array( $keywords ) )\n\t\t\t$keywords = explode( ',', $keywords );\n\n\t\t// Clean up the array\n\t\t$keywords = array_map( 'trim', $keywords );\n\n\t}\n\n // Setup gather args\n $gather_args = array(\n 'keywords' => $show_all ? NULL : $keywords,\n );\n\n\t// Get the jobs\n\tif ( ! ( $jobs = gather_ua_faculty_jobs( $gather_args ) ) ) {\n\n\t\t?><p><em><?php _e( 'There are no faculty jobs at this time.', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></em></p><?php\n\t\treturn;\n\n\t}\n\n\t// Sort jobs by keyword first\n\t$keyword_jobs = array();\n\t$nonkeyword_jobs = array();\n\tforeach ( $jobs as $job ) :\n\n\t\t// Search title and content for keywords\n\t\tif ( ! empty( $keywords ) && is_array( $keywords ) ) :\n\n\t\t\t// Create the search regex\n\t\t\t$search_regex = '/(' . implode( '|', $keywords ) . ')/i';\n\n\t\t\t// Create the regex\n\t\t\t$replace_regex = '/(' . implode( '|', $keywords ) . ')/i';\n\n\t\t\t// Keyword exist?\n\t\t\t$keyword_exist = false;\n\n\t\t\t// Keywords in the title?\n\t\t\tif ( preg_match( $search_regex, $job->title ) ) {\n\n\t\t\t\t$keyword_exist = true;\n\n\t\t\t\t// Add the highlight span\n if ( $highlight_keywords )\n $job->title = preg_replace( $replace_regex, \"<span class=\\\"highlight-keyword\\\">$1</span>\", $job->title );\n\n\t\t\t}\n\n\t\t\t// Keywords in the author?\n\t\t\tforeach( $job->authors as $author ) {\n\n\t\t\t\t// Search the name\n\t\t\t\tif ( isset( $author->name ) && preg_match( $search_regex, $author->name ) ) {\n\n\t\t\t\t\t$keyword_exist = true;\n\n\t\t\t\t\t// Add the highlight span\n if ( $highlight_keywords )\n $author->name = preg_replace( $replace_regex, \"<span class=\\\"highlight-keyword\\\">$1</span>\", $author->name );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Keywords in the content?\n\t\t\tif ( preg_match( $search_regex, $job->content ) ) {\n\n\t\t\t\t$keyword_exist = true;\n\n\t\t\t\t// Add the highlight span\n if ( $highlight_keywords )\n $job->content = preg_replace( $replace_regex, \"<span class=\\\"highlight-keyword\\\">$1</span>\", $job->content );\n\n\t\t\t}\n\n\t\t\t// Add to the top of the list\n\t\t\tif ( $keyword_exist ) {\n\n\t\t\t\t$keyword_jobs[] = $job;\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\tendif;\n\n\t\t// Add everything else to the end fo the list\n\t\t$nonkeyword_jobs[] = $job;\n\n\tendforeach;\n\n\t?><ul class=\"ua-faculty-jobs\"><?php\n\n\t\tforeach( array( 'keyword-jobs' => $keyword_jobs, 'nonkeyword-jobs' => $nonkeyword_jobs ) as $job_list => $job_list_jobs ) :\n\t\t\tforeach( $job_list_jobs as $job ) :\n\n // Assign classes\n $job_item_classes = array( $job_list );\n\n // Highlight job items if 'highlight_keywords' is true\n if ( $highlight_keywords && 'keyword-jobs' == $job_list )\n $job_item_classes[] = 'highlight';\n\n\t\t\t?><li class=\"<?php echo implode( ' ', $job_item_classes ); ?>\">\n\t\t\t\t<span class=\"title\"><a href=\"<?php echo esc_url( $job->permalink ); ?>\" target=\"_blank\"><?php _e( $job->title, GATHER_UA_JOBS_TEXT_DOMAIN ); ?></a></span>\n\t\t\t\t<ul>\n\t\t\t\t\t<li class=\"published\"><strong><?php _e( 'Published:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php echo $job->published->format( 'F j, Y \\a\\t g:i a' ); ?></li><?php\n\n\t\t\t\t\t\tif ( $job->published != $job->updated ) {\n\t\t\t\t\t\t\t?><li class=\"updated\"><strong><?php _e( 'Updated:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php echo $job->updated->format( 'F j, Y \\a\\t g:i a' ); ?></li><?php\n\t\t\t\t\t\t}\n\n\t\t\t\t\t?><li class=\"authors\"><strong><?php _e( 'Authors:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php\n\n\t\t\t\t\t\t// Build author name array\n\t\t\t\t\t\t$author_names = array();\n\t\t\t\t\t\tforeach( $job->authors as $author ) {\n\t\t\t\t\t\t\tif ( isset( $author->name ) )\n\t\t\t\t\t\t\t\t$author_names[] = $author->name;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Print author names\n\t\t\t\t\t\techo ! empty( $author_names ) ? implode( ', ', $author_names ) : NULL;\n\n\t\t\t\t\t?></li>\n\t\t\t\t\t<li class=\"content\"><strong><?php _e( 'Description:', GATHER_UA_JOBS_TEXT_DOMAIN ); ?></strong> <?php _e( $job->content, GATHER_UA_JOBS_TEXT_DOMAIN ); ?></li>\n\t\t\t\t</ul>\n\t\t\t</li><?php\n\n\t\t\tendforeach;\n\t\tendforeach;\n\n\t?></ul><?php\n\n}", "public function execute() {\n\t\t$data = $this->getResultData();\n\t\t$this->printText($data[0]);\n\t}", "function printResults(&$results) {\n\t // the profile name and total sessions.\n\t if (count($results->getRows()) > 0) {\n\n\t // Get the profile name.\n\t $profileName = $results->getProfileInfo()->getProfileName();\n\n\t // Get the entry for the first entry in the first row.\n\t $rows = $results->getRows();\n\t $sessions = $rows[0][0];\n\n\t // Print the results.\n\t print \"First view (profile) found: $profileName\\n\";\n\t print \"Total sessions: $sessions\\n\";\n\t } else {\n\t print \"No results found.\\n\";\n\t }\n\t}", "private function showInfo()\n {\n $this->results = array('error' => '');\n $this->countMulticolumnElements();\n $this->findDifferentMCElementConfigs();\n $this->isGridelementsInstalled();\n return $this->returnResults();\n }", "public function immediateAction() {\n \n $this->searchParams['status']='immidiate';\n //print_r($this->searchParams);die;\n $this->searchParams['jobtype']='simple';\n $this->view->immediate = $this->jobs->search($this->searchParams);\n $this->view->paginator = Zend_Paginator::factory(range(1, ((int) $this->view->immediate['total'])));\n $this->view->paginator->setCurrentPageNumber((int) $this->searchParams['page'] ? $this->searchParams['page'] : 1);\n $this->view->paginator->setItemCountPerPage((int) $this->searchParams['rows'] ? $this->searchParams['rows'] : 10 );\n $this->view->paginator->setPageRange(10);\n $this->view->immediatejob = $this->view->immediate['rows'];\n //echo '<pre>';\n //print_r($this->view->jobs);\n }", "public function jobs()\n {\n $this->validateManagerType('dtc_queue.manager.job');\n $this->checkDtcGridBundle();\n $managerType = $this->container->getParameter('dtc_queue.manager.job');\n $rendererFactory = $this->container->get('dtc_grid.renderer.factory');\n $renderer = $rendererFactory->create('datatables');\n $gridSource = $this->container->get('dtc_queue.grid_source.jobs_waiting.'.('mongodb' === $managerType ? 'odm' : $managerType));\n $renderer->bind($gridSource);\n $params = $renderer->getParams();\n $this->addCssJs($params);\n\n $params['worker_methods'] = $this->container->get('dtc_queue.manager.job')->getWorkersAndMethods();\n $params['prompt_message'] = 'This will archive all non-running jobs';\n\n return $this->render('@DtcQueue/Queue/jobs.html.twig', $params);\n }", "public function printResult() {\n $this->result->path = $this->getType() . 's/' . $this->getName() . '#tmp';\n\n // text/plain is used to support IE\n header('Cache-Control: no-cache');\n header('Content-Type: text/plain; charset=utf-8');\n\n print $this->getResult();\n }", "public function getPrintJobResult($printJobId){\r\n\t\tini_set('display_errors','on');\r\n\t\ttry{\r\n\t\t\t$printJob = Membership_Controller_Job::getInstance()->get($printJobId);\r\n\t\t\t$data = $printJob->getData();\r\n\t\t\t$storageId = $data['printJobStorageId'];\r\n\t\t\t//createFromFileSystem($id, $basePath)\r\n\t\t\t$storageConf = \\Tinebase_Config::getInstance()->getConfig('printjobs', NULL, TRUE)->value;\r\n\t\t\t$basePath = $storageConf['storagepath'];\r\n\t\t\t$printJobStorage = \\org\\sopen\\app\\api\\filesystem\\storage\\FileProcessStorage::createFromFileSystem(\r\n\t\t\t\t'',\r\n\t\t\t\t$basePath,\r\n\t\t\t\t$storageId\r\n\t\t\t);\r\n\t\t\t$printJobStorage->addProcessLines(array('in','convert','out'));\r\n\t\t\t\t\r\n\t\t\theader(\"Pragma: public\");\r\n\t header(\"Cache-Control: max-age=0\");\r\n\t header('Content-Disposition: attachment; filename=print.pdf');\r\n\t header(\"Content-Description: Pdf Datei\"); \r\n\t // readfile($outFile);\r\n\t\t\theader('Content-Type: application/pdf');\r\n\t\t\t\r\n\t\t\t$path = \"//out/result/merge/pdf/final\";\r\n\t\t\tif(array_key_exists('storagePath', $data)){\r\n\t\t\t\t$path = $data['storagePath'];\r\n\t\t\t}\r\n\r\n\t\t\techo $printJobStorage->getFileContent($path);\r\n\t\t}catch(Exception $e){\r\n\t\t\techo $e->__toString();\r\n\t\t}\r\n\t}", "public function jobShow($id){\n MyLogger::info(\"Entering RestController jobShow()\");\n\n $job = $this->restService->getJob($id);\n $result = NULL;\n if($job){\n $result = new DTO(\"200\", \"Job Found\", $job);\n }else{\n $result = new DTO(\"404\", \"No Job Found\", NULL);\n }\n\n MyLogger::info(\"Exiting RestController jobShow()\");\n\n return json_encode($result);\n }", "public function report()\r\n {\r\n echo \"Question Bank Work is finish\";\r\n\r\n echo \"<br>\";\r\n\r\n echo \"Please Check Storage Folder\";\r\n\r\n echo \"<br>\";\r\n\r\n echo 'Count of Questions Get From Hsmai Server is: ' . count($this->questionInfo->items);\r\n\r\n echo \"questions\";\r\n }", "function jobDetail() {\n $pk = $_GET['pk'];\n $apply = ($_GET['apply'] == 1) ? \"<strong><a href=\\\"./apply.php?pk=$pk\\\">APPLY FOR THIS JOB</a></strong><br /><br />\": '';\n $mark = ($_GET['apply'] == 1) ? \"<br /><br /><strong><a href=\\\"./process/processMark.php?pk=$pk\\\">MARK AS INAPPROPRIATE/SPAM</a></strong>\": '';\n \n connectDatabase();\n \n queryDatabase(\"UPDATE job\n SET viewed = viewed + 1\n WHERE pk = $pk\");\n\n $result = queryDatabase(\"SELECT title, description, inserted, status, salary, measure, fk_category, fk_location\n FROM job\n WHERE pk = $pk\");\n\n $row = mysql_fetch_object($result);\n \n if ($row->status == 'F')\n $status = 'Full-time';\n elseif ($row->status == 'P')\n $status = 'Part-time';\n elseif ($row->status == 'C')\n $status = 'Contract';\n else\n $status = 'Other';\n\n if ($row->measure == 'H')\n $measure = 'Hourly';\n elseif ($row->measure == 'W')\n $measure = 'Weekly';\n elseif ($row->measure == 'M')\n $measure = 'Monthly';\n elseif ($row->measure == 'A')\n $measure = 'Annually';\n else\n $measure = 'Other';\n\n $category = explodeFK($row->fk_category, 'category');\n $location = explodeFK($row->fk_location, 'location');\n \n $row->title = wordwrap($row->title, 60, \"\\n\", true);\n $row->description = wordwrap($row->description, 60, \"\\n\", true);\n \n \n echo <<< END\n$apply\n<fieldset>\n<legend><strong>Title:</strong></legend>\n$row->title\n</fieldset>\n<br />\n<br />\n<fieldset>\n<legend><strong>Description:</strong></legend>\n$row->description\n$mark\n</fieldset>\n<br />\n<br />\n<fieldset>\n<legend><strong>Status:</strong></legend>\n$status\n</fieldset>\n<br />\n<br />\n<fieldset>\n<legend><strong>Salary:</strong></legend>\n$row->salary - $measure\n</fieldset>\n<br />\n<br />\n<fieldset>\n<legend><strong>Category:</strong></legend>\n$category\n</fieldset>\n<br />\n<br />\n<fieldset>\n<legend><strong>Location:</strong></legend>\n$location\n</fieldset>\nEND;\n}", "public function seekers_results()\n\t{\n\t\t// This function return entries\n\t\treturn $this->EE->job_search->seekers_results();\n\t}", "public function printResult() {\n $result = array($this->callerFunctionName => array());\n foreach ($this->stacks as $caller_name => $stack_info) {\n $result[$this->callerFunctionName][] = array(\n $caller_name => $stack_info['count'],\n );\n }\n if (is_callable($this->resultPrintFunction)) {\n $this->resultPrintFunction($result);\n }\n }", "function viewSearchedJobs() {\n connectDatabase();\n\t\n $pk = mysql_real_escape_string($_GET['pk']);\n if (isset($_GET['start']))\n $start = $_GET['start'];\n else\n $start = 0;\n \n \n $result = queryDatabase(\"SELECT total, fk_job\n FROM search\n WHERE pk = $pk\");\n\n $row = mysql_fetch_object($result);\n \n $total = $row->total;\n \n if ($total > 0) {\n $results = (($start + 15) > $total) ? $total: ($start + 15);\n \n echo \"<div class=\\\"good\\\">Results \" . ($start + 1) . \"-$results of $total job(s) found</div><br />\";\n } else\n echo \"<div class=\\\"bad\\\">Your search did not match any jobs in our database</div><br />\";\n\n // fk_job parse\n if ($row->fk_job <> 'EMPTY') {\n $row->fk_job = explode(' ', $row->fk_job);\n \n $row->fk_job = array_slice($row->fk_job, $start, 15);\n \n if (count($row->fk_job) > 1) {\n $default = 1;\n \n foreach ($row->fk_job as $value) {\n if (!empty($value)) {\n if ($default == 1)\n $job_regexp = '[[:<:]]' . $value . '[[:>:]]';\n else\n $job_regexp .= '|[[:<:]]' . $value . '[[:>:]]';\n\n $default++;\n }\n }\n } elseif (count($row->fk_job) == 1)\n $job_regexp = '[[:<:]]' . $row->fk_job[0] . '[[:>:]]';\n\n $result = queryDatabase(\"SELECT pk, title, inserted, fk_location\n FROM job\n WHERE pk REGEXP '$job_regexp'\n ORDER BY pk DESC\");\n \n echo '<table cellspacing=\"0\" cellpadding=\"0\">';\n\n $default = 1;\n \n while ($row = mysql_fetch_object($result)) {\n $location = explodeFK($row->fk_location, 'location', 1);\n $row->inserted = substr($row->inserted, 5, 2) . \"/\" . substr($row->inserted, 8, 2) . \"/\" . substr($row->inserted, 0, 4);\n\n $backgroundColor = ($default%2) ? '#FFFACD': '#FFFFFF';\n \n $row->title = wordwrap($row->title, 30, \"\\n\", true);\n \n echo <<< END\n<tr>\n<td style=\"background-color:$backgroundColor; height:77px; text-align:left; vertical-align:top; width:280px;\">\n<strong>Title:</strong><br />\n<a href=\"javascript:popUp('detail.php?pk=$row->pk&apply=1')\">$row->title</a>\n</td>\n<td style=\"background-color:$backgroundColor; text-align:left; vertical-align:top; width:100px;\">\n<strong>Inserted:</strong><br />\n$row->inserted\n</td>\n<td style=\"background-color:$backgroundColor; text-align:left; vertical-align:top; width:245px;\">\n<strong>Location:</strong><br />\n$location\n</td>\n</tr>\nEND;\n\n $default++;\n }\n\n echo '</table>';\n \n if (($start - 15) >= 0) {\n $previous = $start - 15;\n echo \"<a href=\\\"./browse.php?pk=$pk&start=$previous\\\" alt=\\\"\\\">Previous 15 Jobs</a>&nbsp;&nbsp;&nbsp;\";\n }\n\n if (($start + 15) < $total) {\n $start += 15;\n $next = (($start + 15) <= $total) ? 15: ($total - $start);\n echo \"<a href=\\\"./browse.php?pk=$pk&start=$start\\\" alt=\\\"\\\">Next $next Job(s)</a>\";\n }\n \n }\n}", "public function view_results()\n {\n $obj = new CombinedAnalysis();\n $this->final_results = $obj->fetchResultsFromFiles($this->id);\n\n // show everthing in template\n $this->show_template();\n }", "public function jobsAll()\n {\n $this->validateManagerType('dtc_queue.manager.job');\n $this->checkDtcGridBundle();\n\n $class1 = $this->container->getParameter('dtc_queue.class.job');\n $class2 = $this->container->getParameter('dtc_queue.class.job_archive');\n $label1 = 'Non-Archived Jobs';\n $label2 = 'Archived Jobs';\n\n $params = $this->getDualGridParams($class1, $class2, $label1, $label2);\n\n return $this->render('@DtcQueue/Queue/grid.html.twig', $params);\n }", "public function getJobsString();", "function get_title_runjobs() {\n return $this->get_title_listinstancejobs();\n }", "public function getResults()\n {\n }", "public function action_list() {\n global $CFG;\n require_once($CFG->dirroot . '/blocks/php_report/sharedlib.php');\n\n //import necessary CSS\n $stylesheet_web_path = $CFG->wwwroot . '/blocks/php_report/styles.php';\n echo '<style>@import url(\"' . $stylesheet_web_path . '\");</style>';\n\n $category_members = block_php_report_get_names_by_category(true, NULL, php_report::EXECUTION_MODE_SCHEDULED);\n\n //set up the basics of our table\n $table = new stdClass;\n $table->head = array(get_string('list_report_name_header', 'block_php_report'),\n get_string('list_schedule_header', 'block_php_report'));\n $table->align = array('left',\n 'left');\n $table->rowclass = array();\n $table->data = array();\n\n $categories = block_php_report_get_category_mapping();\n\n //go through categories and append items\n foreach ($categories as $category_key => $category_display) {\n if (!empty($category_members[$category_key])) {\n\n //set up a row for the category header\n $table->data[] = array($category_display, '');\n //cass class for specially styling the category header row\n $table->rowclass[] = 'php_report_scheduling_list_category';\n\n //go through and add all report entries below the category header\n foreach ($category_members[$category_key] as $member_shortname => $member_display) {\n //set up a link for executing the report\n $execute_report_url = $CFG->wwwroot . '/blocks/php_report/render_report_page.php?report=' . $member_shortname;\n\n $execute_report_link = php_report::get_default_instance($member_shortname)\n ? '<a href=\"' . $execute_report_url . '\">' . $member_display . '</a>'\n : $member_display;\n\n //set up a link for scheduling the report\n $execute_report_url_params = array('action' => 'listinstancejobs',\n 'report' => $member_shortname);\n $execute_report_url = $this->get_url($execute_report_url_params);\n $schedule_report_link = '';\n if (php_report::get_default_instance($member_shortname, NULL, php_report::EXECUTION_MODE_SCHEDULED)) {\n $schedule_report_link = '<a href=\"' . $execute_report_url . '\">\n <img src=\"' . $CFG->wwwroot . '/blocks/php_report/pix/schedule.png\"/>\n </a>';\n }\n\n //append info to the row\n $table->data[] = array($execute_report_link, $schedule_report_link);\n $table->rowclass[] = '';\n }\n }\n }\n\n if (count($table->data > 0)) {\n print_table($table);\n } else {\n //error case\n }\n }", "public function printResult ($term = NULL) {\n print $this->saveResult($term);\n\n }", "private function showProgress()\n {\n $allQuestions = $this->questionRepository->list(['id', 'question']);\n $this->transformProgressList($allQuestions);\n\n $this->console->info( ' ************ Your progress is ************');\n\n foreach ($this->progress as $option) {\n $validate = $option['is_true'] ? __('True') : __('False');\n $this->console->info( ' Question: ' . $option['question']);\n if(null !== $option['is_true'])\n $this->console->info( ' Answer: ' . $option['answer'] . '('.$validate .')');\n $this->console->info( ' ');\n }\n $this->console->info( ' *******************************************');\n }", "public function getJobSummary()\n {\n return $this->job_summary;\n }", "public function show($id)\n {\n return 'View job details';\n }", "public abstract function getResults();", "public function logResults() {\n\t\tforeach ( $this->records as $outcome) {\n\t\t\t$this->log($outcome);\n\t\t}\n\t}", "public function generate_results($argv)\n {\n $this->stats->print_results($argv);\n }", "public function info()\n {\n $iCount = QueueUser::where([\n ['queue_id', '=', $this->c->active]\n ])->count();\n\n $strRes = 'Current queue: \"'. $this->q->name .'\", the queue is currently '. ($this->q->is_open == 1 ? 'open for \"'. $this->getUserLevel($this->q->user_level) .'\"' : 'closed') .' and contains '. $iCount .' user'. ($iCount == 1 ? '' : 's');\n\n // List available queues\n $aQueues = Queue::where([\n ['channel_id', '=', $this->c->id],\n ['id', '!=', $this->q->id]\n ])->get();\n\n if($aQueues && !$aQueues->isEmpty())\n {\n foreach($aQueues AS $oQueue)\n {\n $aQueueNames[] = $oQueue->name;\n }\n $strRes .= \". Available queues: [\". implode(\", \", $aQueueNames) .\"]\";\n }\n\n return $this->returnText($strRes);\n }", "public function scheduledjobsAction()\n {\n //removed-1 from total\n $this->searchParams['jobtype']='simple';\n $this->view->scheduledjobs = $this->jobs->scheduledjobs($this->searchParams);\n $this->view->paginator = Zend_Paginator::factory(range(1, ((int) $this->view->scheduledjobs['total'] )));\n $this->view->paginator->setCurrentPageNumber((int) $this->searchParams['page'] ? $this->searchParams['page'] : 1);\n $this->view->paginator->setItemCountPerPage((int) $this->searchParams['rows'] ? $this->searchParams['rows'] : 10 );\n $this->view->paginator->setPageRange(10);\n // print_r($this->view->specialscheduledjobs);die;\n \n $this->view->jobs = $this->view->scheduledjobs['rows'];\n }", "public function jobsRunning()\n {\n $this->validateManagerType('dtc_queue.manager.job');\n $this->checkDtcGridBundle();\n $managerType = $this->container->getParameter('dtc_queue.manager.job');\n $rendererFactory = $this->container->get('dtc_grid.renderer.factory');\n $renderer = $rendererFactory->create('datatables');\n $gridSource = $this->container->get('dtc_queue.grid_source.jobs_running.'.('mongodb' === $managerType ? 'odm' : $managerType));\n $renderer->bind($gridSource);\n $params = $renderer->getParams();\n $this->addCssJs($params);\n\n $params['worker_methods'] = $this->container->get('dtc_queue.manager.job')->getWorkersAndMethods(BaseJob::STATUS_RUNNING);\n $params['prompt_message'] = 'This will prune all stalled jobs';\n\n return $this->render('@DtcQueue/Queue/jobs_running.html.twig', $params);\n }", "public function Results(){\r\n\t\treturn self::get_results();\r\n\t}", "public function printout()\n\t\t{\tif (isset($this->res) && (mysql_num_rows($this->res) > 0))\n\t\t\t{\tmysql_data_seek($this->res, 0);\n\t\t\t\t$num = mysql_num_fields($this->res);\n\n\t\t\t\techo \"<table border=1>\";\n\t\t\t\techo \"<tr>\";\n\n\t\t\t\tfor ($i = 0; $i < $num; $i++)\n\t\t\t\t{\techo \"<th>\";\n\t\t\t\t\techo mysql_field_name($this->res, $i);\n\t\t\t\t\techo \"</th>\";\n\t\t\t\t}\n\t\t\t\techo \"</tr>\";\n\n\t\t\t\twhile ($row = mysql_fetch_row($this->res))\n\t\t\t\t{\techo \"<tr>\";\n\n\t\t\t\t\tforeach($row as $elem)\n\t\t\t\t\t{\techo \"<td>$elem</td>\";\n\t\t\t\t\t}\n\n\t\t\t\t\techo \"</tr>\";\n\t\t\t\t}\n\n\t\t\t\techo \"</table>\";\n\t\t\t}\n\n\t\t\telse\n\t\t\t\techo \"There is nothing to print! <br />\";\n\t\t}", "public function data()\r\n {\r\n echo json_encode($this->AdminJobModel->jobsList());\r\n }", "function action_runjobs() {\n global $CFG;\n\n //need the code that defines the scheduled export behaviour\n require_once($CFG->dirroot . '/blocks/php_report/runschedule.php');\n\n $scheduleids = array();\n if ($data = data_submitted()) {\n foreach ($data as $key => $value) {\n if (strpos($key, 'schedule_') === 0) {\n $scheduleid = (int)substr($key, strlen('schedule_'));\n if ($this->can_do_schedule_action($scheduleid)) {\n $scheduleids[] = $scheduleid;\n }\n }\n }\n }\n\n //re-display the list of scheduled jobs for this report\n $this->action_listinstancejobs();\n\n if (count($scheduleids) > 0) {\n //include the necessary javascript libraries for the ASYNC request stuff\n require_js(array('yui_yahoo', 'yui_event'));\n\n //one or more schedules selected, so open the popup to run them\n echo '<script type=\"text/javascript\">\n YAHOO.util.Event.onDOMReady(function() {\n openpopup(\\'/blocks/php_report/lib/run_schedule_popup.php?scheduleids=' . urlencode(json_encode($scheduleids)) . '\\', \\'runjobsnow\\', \\'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\\', 0);\n });\n </script>';\n }\n }", "public function status() {\n\t\t$output = array(\n\t\t\tarray('CURRENT', ''),\n\t\t array('Queue', 'Size'),\n\t\t array('----', '---'),\n\t\t);\n\n\t\tforeach($this->queues as $queue) {\n\t\t $output[] = array( $queue, ResqueProxy::size( $queue ) );\n\t\t}\n\n\t\t$output[] = array( 'failed', ResqueProxy::redis()->llen('failed') );\n\n\n\t\t$output[] = array('----', '---');\n\t\t$output[] = array('TOTALS', '');\n\t\t$output[] = array( 'processed', ResqueProxy::redis()->get('resque:stat:processed') );\n\t\t$output[] = array( 'failed', ResqueProxy::redis()->get('resque:stat:failed') );\n\n\t\t$this->columns($output);\n\t}", "public function getResults(){\n $this->results;\n }", "public function print_results($argv)\n {\n if($this->request == false)\n {\n return;\n }\n\n $this->file = fopen($this->file, \"w\");\n if($this->file == false)\n {\n fwrite(STDERR, \"Error, creating the statistics file!\\n\");\n exit(12);\n }\n\n foreach ($argv as $argument)\n {\n if ($argument == \"--loc\")\n {\n fwrite($this->file ,$this->instructions);\n fwrite($this->file, \"\\n\");\n }\n else if($argument == \"--comments\")\n {\n fwrite($this->file, $this->comments);\n fwrite($this->file, \"\\n\");\n }\n else if($argument == \"--labels\")\n {\n fwrite($this->file, $this->labels);\n fwrite($this->file, \"\\n\");\n }\n else if($argument == \"--jumps\")\n {\n fwrite($this->file, $this->jumps);\n fwrite($this->file, \"\\n\");\n }\n }\n\n fclose($this->file);\n }", "public function actionPrint()\n {\n $model = new LibraryMagazineIssueSearch();\n $this->layout = false;\n $sql = \"SELECT CONCAT_WS(' ', mm.Member_First_Name, mm.Member_Middle_Name, mm.Member_Last_Name) as Name,tm.Magazine_Title,\n mi.Magazine_Issue_Date,mi.Magazine_Due_Date,mi.Remarks\" \n . \" FROM library_magazine_issue mi,library_magazine_title_master tm,library_member_master mm,library_magazine_subscription_master sm \"\n . \"WHERE mi.Magazine_Id=sm.Magazine_Subscription_Id AND sm.Magazine_Title_Id=tm.Magazine_Id AND mi.Magazine_Person_Id=mm.Member_Id\";\n $connection = Yii::$app->getDb();\n $command = $connection->createCommand($sql);\n $data = $command->queryAll();\n return $this->render('print', ['data' => $data]);\n exit;\n \n }", "function print_element(Printable $job){\n if($job->visible){\n echo '<li class=\"work-position\">';\n echo '<h5>'. $job->getTitle() .'</h5>';\n echo '<p>Experience: '.$job->getDurationAsString().'</p>';\n echo '<p>'. $job->getDescription() .'</p>';\n echo '<strong>Achievements:</strong>';\n echo '<ul>';\n echo '<li>Lorem ipsum dolor sit amet, 80% consectetuer adipiscing elit.</li>';\n echo '<li>Lorem ipsum dolor sit amet, 80% consectetuer adipiscing elit.</li>';\n echo '<li>Lorem ipsum dolor sit amet, 80% consectetuer adipiscing elit.</li>';\n echo '</ul>';\n echo '</li>';\n } //End if\n}", "public function getJobDescriptions(){\n return JobDescription::all();\n }", "protected function PollJobs() {\n\n\t\tforeach($this->_running_queue as $i=>$rjob) {\n\t\t\techo (\"Index is $i<br/>\");\n\t\t\t//job finished?\n\t\t\t$status = $this->JobPollAsync($rjob);\n\t\t\tif ($status === false) {\n\t\t\t\t$this->LogEntry(\"Status is false for job $i and slots are \" . $this->_slots .\"<br/>\");\n\t\t\t\tunset($this->_running_queue[$i]);\n\t\t\t\t$this->_finished_count++;\n\t\t\t\tif (count($this->_waiting_queue)) {\n\t\t\t\t\t$this->LogEntry(\"Adding a job because finish count is \" . $this->_finished_count . \" and job count is \" . $this->_job_count . \" so slot count becomes \" . $this->_slots +1 . \"<br/>\");\n\t\t\t\t\t$this->_slots++;\n\t\t\t\t} else {\n\t\t\t\t\t$this->LogEntry(\"Finish count is ! < job count and slots are \" . $this->_slots. \"<br/>\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->LogEntry(\"Status of job $i is $status\\n\");\n\t\t\t}\n\t\t}\n\t}", "protected function _report()\n {\n // report summary\n $done = $this->_info['done'];\n $plan = $this->_info['plan'];\n $time = $this->_info['time'];\n \n $this->_log(\"$done/$plan tests, $time seconds\");\n \n $tmp = array();\n $show = array('fail', 'todo', 'skip', 'pass');\n foreach ($show as $type) {\n $count = count($this->_info[$type]);\n $tmp[] = \"$count $type\";\n }\n $this->_log(implode(', ', $tmp));\n }", "public function jobsAllAction()\n {\n $this->validateManagerType('dtc_queue.default_manager');\n $class1 = $this->container->getParameter('dtc_queue.class_job');\n $class2 = $this->container->getParameter('dtc_queue.class_job_archive');\n $label1 = 'Non-Archived Jobs';\n $label2 = 'Archived Jobs';\n\n $params = $this->getDualGridParams($class1, $class2, $label1, $label2);\n\n return $this->render('@DtcQueue/Queue/grid.html.twig', $params);\n }", "public function showResults(): array\n {\n return [\n 'result' => $this->result,\n 'resultCount' => count($this->result),\n ];\n }", "function printSummary () {\n foreach ($this->ids as $i) {\n $this->link[$i]->printSummary();\n }\n }", "function printResult($result) {\n\t\t\t\techo \"<div class='Pokeguide'>\n\t\t\t\techo \"<table>\";\n\n\t\t\t\twhile ($row = OCI_Fetch_Array($result, OCI_BOTH)) {\n\t\t\t\t\tfor ($i = 0; $i < 15; $i++){\n\t\t\t\t\t\techo \"<tr><td>\" . $row[$i] . \"</td></tr>\"; //or just use \"echo $row[0]\" \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\techo \"</table>\";\n\t\t\t\techo \"</div>\";\n\t\t\t}", "public function getJobNames();", "function system ($mod = null) {\n \n // $mod controls how much info to show\n $mod = (in_array ($mod,array ('simple'))) ? $mod : null;\n $this->set(compact('mod'));\n \n // Get num processes which actually have PIDs (are really running)\n $this->Job->recursive = 0;\n $numProcs = array (\n 'running' => $this->Job->_bgpCountRunningJobProcesses(),\n 'maxThreads' => $this->Job->maxThreads,\n 'queue' => 0\n );\n \n // Get currently running jobs\n $this->Job->recursive = 1;\n $running = $this->Job->_bgpGetRunningJobs(array (\n 'fields' => array (\n 'Job.id',\n 'Job.user_id',\n 'User.id',\n 'User.name',\n 'User.photo',\n 'User.institution',\n 'User.url'\n ),\n 'limit' => $numProcs['maxThreads']\n ));\n $numProcs['statusRunning'] = count ($running);\n $queue = $this->Job->find('all',array (\n 'fields' => array (\n 'Job.id',\n 'Job.user_id',\n 'User.id',\n 'User.name',\n 'User.photo',\n 'User.institution',\n 'User.url'\n ),\n 'conditions' => array (\n 'Job.status' => '0'\n ),\n 'limit' => 3\n ));\n //$numProcs['queue'] = count ($queue);\n $numProcs['queue'] = $this->Job->find('count',array (\n 'conditions' => array (\n 'Job.status' => '0'\n )\n ));\n \n // Occasionally, batched jobs will just stop randomly for some reason.\n // The following works around said feature.\n if ($numProcs['queue'] > 0 && $numProcs['running'] < $this->Job->maxThreads) {\n $this->Job->tryProcessNext();\n }\n \n $jobbage = array (&$running, &$queue);\n foreach ($jobbage as &$jobs) {\n if (is_array ($jobs))\n foreach ($jobs as &$job) {\n $job['Job']['percent_complete'] = $this->Job->getJobPercentComplete($job['Job']['id']);\n }\n }\n \n $memFree = $this->Job->getFreeMemAll();\n \n // Handle header update info timestamps n stuff\n $data = compact ('running', 'numProcs', 'queue', 'memFree');\n $sd = serialize($data);\n if ($this->Session->read ('Job.status.lastStatusData') !== $sd) {\n // data have changed\n $this->Session->write ('Job.status.lastStatusData',$sd);\n $this->Session->write ('Job.status.lastStatusTime',time());\n }\n $this->set ($data);\n header ('ax-new-epoch: ' . time());\n header ('ax-latest-epoch: ' . $this->Session->read ('Job.status.lastStatusTime'));\n }", "public function jobsAction()\n {\n $this->validateManagerType('dtc_queue.default_manager');\n $managerType = $this->container->getParameter('dtc_queue.default_manager');\n $rendererFactory = $this->get('dtc_grid.renderer.factory');\n $renderer = $rendererFactory->create('datatables');\n $gridSource = $this->get('dtc_queue.grid_source.live_jobs.'.('mongodb' === $managerType ? 'odm' : $managerType));\n $renderer->bind($gridSource);\n $params = $renderer->getParams();\n $this->addCssJs($params);\n\n return $params;\n }", "public function show_worker_availability()\n {\n if ( !$this->ownerLoggedIn() )\n {\n $this->restricted();\n return;\n }\n \n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n \n // add error form\n \n $employees = $this->workers_availability();\n \n require_once('views/FormError.class.php');\n require_once('views/WorkerAvailability.class.php');\n $error_page = new FormError();\n $site = new SiteContainer($this->db);\n $page = new WorkerAvailability();\n\n $site->printHeader();\n $site->printNav(\"owner\");\n $error_page->printHtml($error);\n $page->printHtml($employees);\n $site->printFooter(); \n\n }", "function display_results($branch, $html=false)\n{\n\tglobal $commit_url, $revision;\n\n\tif (!$html)\n\t{\n\t\techo \"Percent\\tSuccess\\tFailed\\tScript\\t(Features)\\tFile\\tUpdated\\tTime\\n\";\n\t}\n\telse\n\t{\n\t\t$etag = check_send_etag($branch);\n\t\thtml_header();\n\t\techo \"<div class='topmenu'>\".\n\t\t\t\"<input type='button' id='serverinfo' value='Edit serverinfo' onclick='location.href=\\\"/serverinfo.php\\\";'/>\\n\".\n\t\t\t\"Revision: <input id='revision' size='10' placeholder='\".htmlspecialchars($revision).\"' title='Set revision, if it can not be determined from git'/></div>\\n\";\n\t\techo \"<table class='results' data-commit-url='\".htmlspecialchars($commit_url).\"' data-etag='\".htmlspecialchars($etag).\"'>\\n\";\n\t\techo \"<tr class='header'><th></th><th>Percent</th><th>Success</th><th>Failed</th><th>Script (Features)</th><th>File</th><th>Updated</th><th class='time'>Time</th><th class='notes'>N</th></tr>\\n\";\n\t}\n\tforeach(get_script_results($branch) as $script)\n\t{\n\t\tif (empty($script['description']))\n\t\t{\n\t\t\t$script['description'] = strtr($script['name'], array(\n\t\t\t\t'/' => ' ',\n\t\t\t\t'.xml' => '',\n\t\t\t));\n\t\t}\n\t\tif ($script['ignore-all']) $script['require-feature'][] = 'ignore-all';\n\n\t\t$script['time'] = isset($script['time']) ? number_format($script['time'], 2, '.', '') : '';\n\n\t\tif (!$html)\n\t\t{\n\t\t\techo \"$script[percent]\\t$script[success]\\t$script[failed]\\t$script[description] (\".\n\t\t\t\timplode(', ', $script['require-feature']).\")\\t$script[name]\\t$script[updated]\\t$script[time]t$script[notes]\\n\";\n\t\t\tcontinue;\n\t\t}\n\t\t// todo html\n\t\tif (empty($script['name']))\n\t\t{\n\t\t\techo \"<tr class='footer'><td></td>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<tr id='\".htmlspecialchars($script['name']).\"' class='\".\n\t\t\t\t((string)$script['percent'] === '' ? 'ignored' :\n\t\t\t\t($script['percent']==100.0?'green':($script['percent'] < 50.0 ? 'red' : 'yellow'))).\"'>\".\n\t\t\t\t\"<td class='expand'></td>\";\n\t\t}\n\t\techo \"<td class='percent'>\".htmlspecialchars($script['percent']).\n\t\t\t\"</td><td class='success'>\".htmlspecialchars($script['success']).\n\t\t\t\"</td><td class='failed'>\".htmlspecialchars($script['failed']).\n\t\t\t\"</td><td>\".htmlspecialchars($script['description']).\n\t\t\t\t($script['require-feature'] ? ' ('.htmlspecialchars(implode(', ', $script['require-feature'])).')' : '').\n\t\t\t\"</td><td class='script'>\".htmlspecialchars($script['name']).\n\t\t\t\"</td><td class='updated'>\".htmlspecialchars(substr($script['updated'], 0, -3)).\n\t\t\t\"</td><td class='time'>\".htmlspecialchars($script['time']).\n\t\t\t\"</td><td class='notes'>\".htmlspecialchars($script['notes']).\n\t\t\t\"</td><tr>\\n\";\n\t}\n\tif ($html)\n\t{\n\t\techo \"</table>\\n</body>\\n</html>\\n\";\n\t}\n}", "public function getJobQueriesOperations(){ return $this->APICallSub( '/jobs', 'tools', \"Couldn't get the queries and operations.\" ); }", "public function getAllMyJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getMyPostedJobs($userID);\n }", "public function printWaitingJobs($queue) {\n\n\t\t//Connecting to the network printer\n\t\t$connection = $this->connect();\n\t\t\n\t\t//If fail, exit with false \n\t\tif(!$connection){\n\t\t\t$this->setError(\"Error in connection. Please change HOST or PORT.\");\n\t\t\treturn false;\n\t\t}else{\n\t\t\t//Print any waiting job\n\t\t\tfwrite($connection, chr(1).$queue.\"\\n\"); \n\t\t\t$this->setMessage(\"Print any waiting job...\");\n\t\t\n\t\t\t//Checking errors\n\t\t\tif (ord(fread($connection, 1)) != 0) {\n\t\t\t\t$this->setError(\"Error while start print jobs on queue \" . $queue);\n\t\t\t\t//Close connection\n\t\t\t\tfclose($connection);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//Close connection\n\t\t\tfclose($connection);\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}", "function showResults($results) {\n\t\techo \"<div class='results_column'>\";\n\t\techo \"<h2>\" . $this->name . \"</h2>\";\n\t\techo \"<ul>\";\n\t\t\n\t\tif (count($results) == 0 || !($results instanceof SimpleXMLElement || is_array($results))) {\n\t\t\techo \"<li>No results found.</li>\";\n\t\t} else {\n\t\t\tforeach($results as $result) {\n\t\t\t\t$this->showResult($result);\n\t\t\t}\n\t\t}\n\t\techo \"</ul>\";\n\t\techo \"</div>\";\n\t}", "private function print_active_jobs($this_job_only = false) {\n\t\t$cron = $this->get_cron();\n\t\t$ret = '';\n\n\t\tforeach ($cron as $time => $job) {\n\t\t\tif (!isset($job['updraft_backup_resume'])) continue;\n\t\t\tforeach ($job['updraft_backup_resume'] as $info) {\n\t\t\t\tif (isset($info['args'][1])) {\n\t\t\t\t\t$job_id = $info['args'][1];\n\t\t\t\t\tif (false === $this_job_only || $job_id == $this_job_only) {\n\t\t\t\t\t\t$ret .= $this->print_active_job($job_id, false, $time, $info['args'][0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// A value for $this_job_only implies that output is required\n\t\tif (false !== $this_job_only && !$ret) {\n\t\t\t$ret = $this->print_active_job($this_job_only);\n\t\t\tif ('' == $ret) {\n\t\t\t\tglobal $updraftplus;\n\t\t\t\t$log_file = $updraftplus->get_logfile_name($this_job_only);\n\t\t\t\t// if the file exists, the backup was booted. Check if the information about completion is found in the log, or if it was modified at least 2 minutes ago.\n\t\t\t\tif (file_exists($log_file) && ($updraftplus->found_backup_complete_in_logfile($this_job_only) || (time() - filemtime($log_file)) > 120)) {\n\t\t\t\t\t// The presence of the exact ID matters to the front-end - indicates that the backup job has at least begun\n\t\t\t\t\t$ret = '<div class=\"active-jobs updraft_finished\" id=\"updraft-jobid-'.$this_job_only.'\"><em>'.__('The backup has finished running', 'updraftplus').'</em> - <a class=\"updraft-log-link\" data-jobid=\"'.$this_job_only.'\">'.__('View Log', 'updraftplus').'</a></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}", "public function jobIndex(){\n MyLogger::info(\"Entering RestController jobIndex()\");\n\n\n $job = $this->restService->getAllJobs();\n $result = NULL;\n if ($job) {\n $result = new DTO(\"200\", \"Jobs Found\", $job);\n } else {\n $result = new DTO(\"404\", \"No Job Found\", NULL);\n }\n\n\n MyLogger::info(\"Exiting RestController jobIndex()\");\n\n return json_encode($result);\n }", "public function specialscheduledjobsAction()\n {\n \n //removed-1 from total\n $this->searchParams['jobtype']='special';\n $this->view->specialscheduledjobs = $this->jobs->scheduledjobs($this->searchParams);\n $this->view->paginator = Zend_Paginator::factory(range(1, ((int) $this->view->specialscheduledjobs['total'])));\n $this->view->paginator->setCurrentPageNumber((int) $this->searchParams['page'] ? $this->searchParams['page'] : 1);\n $this->view->paginator->setItemCountPerPage((int) $this->searchParams['rows'] ? $this->searchParams['rows'] : 10 );\n $this->view->paginator->setPageRange(10);\n // print_r($this->view->paginator);die;\n \n $this->view->jobs = $this->view->specialscheduledjobs['rows'];\n }", "function lists()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\t#If the user is logged in or attempting to access the full job report, check their access\n\t\tif($this->native_session->get('__user_id') || !empty($data['action']))\n\t\t{\n\t\t\t$instructions['action'] = array('view'=>'view_relevant_jobs', 'report'=>'view_job_applications','apply'=>'apply_for_job','saved'=>'view_my_saved_jobs','status'=>'view_job_application_status');\n\t\t\tcheck_access($this, get_access_code($data, $instructions));\n\t\t}\n\t\t#Fetch the saved job ids if this is the viewed list\n\t\tif(!empty($data['action']) && $data['action'] == 'view') $data['saved_jobs'] = $this->_job->get_saved_jobs();\n\t\t\n\t\tif(empty($data['action'])) $data['action'] = 'view';\n\t\t$data['list'] = $this->_job->get_list(array('action'=>$data['action']));\n\t\t\n\t\tif(!empty($data['action']) && $data['action'] == 'apply') $data['msg'] = \"Search the jobs below to select which one to apply for.\";\n\t\t\n\t\t$viewToLoad = $this->native_session->get('__user_id')? 'job/list_jobs': 'home';\n\t\t$this->load->view($viewToLoad, $data); \n\t}", "public function showJob($id)\n {\n $securityService = new SecurityService();\n $jobs_arr = $securityService->getJobByID($id);\n if(is_numeric($id))\n {\n if(!empty($jobs_arr))\n {\n $dto = new DTO('200', 'Successful Operation', $jobs_arr);\n return $dto->jsonSerialize();\n }\n else\n {\n $dto = new DTO('404', 'Job not found', $jobs_arr);\n return $dto->jsonSerialize();\n } \n }\n else \n {\n $dto = new DTO('400', 'Invalid Job ID Supplied', $jobs_arr);\n return $dto->jsonSerialize();\n }\n }", "public function allResults(){\n }", "public function getAvailableResults()\n {\n return $this->availableResults;\n }", "public function seekerjob(){\n\t\t\t$query=$this->db->select('Title,Posting_time,Skills,Eligibility,Salary,City,Job_id')->get('job');\n\t\t\treturn $query->result();\n\t\t}", "public function index()\n {\n // Ordering hints from http://stackoverflow.com/a/31711803\n $allRows = Job::orderBy(\\DB::raw('-completed'), 'asc')->get();\n $rows = Job::orderBy(\\DB::raw('-completed'), 'asc')->paginate(10);\n\n return view('admin.jobs.index', [\n 'rows' => $rows,\n 'title' => 'All',\n 'values' => $this->totalValue($allRows)\n ]\n );\n }", "function show_results()\n\t{\n\t\tglobal $ibforums, $std;\n\n\t\t$this->result_type = $ibforums->input['result_type'];\n\t\t$this->search_in = $ibforums->input['search_in'];\n\n\t\t//------------------------------------------------\n\t\t// We have a search ID, so lets get the parsed results.\n\t\t//------------------------------------------------\n\n\t\t$this->unique_id = $ibforums->input['searchid'];\n\n\t\tif (!$this->unique_id)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$stmt = $ibforums->db->query(\"SELECT *\n\t\t\t\t FROM ibf_search_results\n\t\t\t\t WHERE id='{$this->unique_id}'\");\n\n\t\t$sr = $stmt->fetch();\n\n\t\t$tmp_topics = $sr['topic_id'];\n\t\t$topic_max_hits = \"\"; //$sr['topic_max'];\n\t\t$tmp_posts = $sr['post_id'];\n\t\t$post_max_hits = \"\"; //$sr['post_max'];\n\n\t\t$this->sort_order = $sr['sort_order'];\n\t\t$this->sort_key = $sr['sort_key'];\n\n\t\t//------------------------------------------------\n\t\t// Remove duplicates from the topic_id and post_id\n\t\t//------------------------------------------------\n\n\t\t$topic_max_hits = self::unique_string_items($tmp_topics);\n\t\t$post_max_hits = self::unique_string_items($tmp_posts);\n\n\t\t$topics = $tmp_topics;\n\t\t$posts = $tmp_posts;\n\n\t\t//-------------------------------------\n\n\t\tif (!$topics and !$posts)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$url_words = $this->convert_highlite_words($ibforums->input['highlite']);\n\n\t\t$count = 0;\n\n\t\tif ($this->result_type == 'topics')\n\t\t{\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t FROM\n\t\t\t\t\t\tibf_topics t, ibf_forums f\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND f.id=t.forum_id\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY t.pinned DESC,\";\n\n\t\t\t\t// search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// we have tid and pid to sort out, woohoo NOT\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t// Array for forum id of each message\n\t\t\t\t$forum_posts = array();\n\n\t\t\t\tif ($posts)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tforum_id,\n\t\t\t\t\t\ttopic_id\n\t\t\t\t\tFROM ibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tpid IN({$posts})\n\t\t\t\t\t\tAND queued != 1\");\n\n\t\t\t\t\tif ($topics)\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = explode(',', $topics);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = array();\n\t\t\t\t\t}\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!in_array($pr['topic_id'], $topics))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$topics[] = $pr['topic_id'];\n\t\t\t\t\t\t\t$topic_max_hits++;\n\n\t\t\t\t\t\t\t$forum_posts[$pr['topic_id']] = $pr['forum_id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$topics = implode(',', $topics);\n\t\t\t\t}\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t \t FROM ibf_topics t\n\t\t\t\t\t LEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY\n\t\t\t\t\t\tt.pinned DESC,\";\n\n\t\t\t\t// Search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\tif ($stmt->rowCount())\n\t\t\t{\n\t\t\t\twhile ($row = $stmt->fetch())\n\t\t\t\t{\n\t\t\t\t\t// club tool\n\t\t\t\t\tif ($row['club'] and $std->check_perms($ibforums->member['club_perms']) == FALSE)\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$count++;\n\n\t\t\t\t\t$row['keywords'] = $url_words;\n\n\t\t\t\t\tif ($row['pinned'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderPinnedRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$std->Error(array(\n\t\t\t\t 'LEVEL' => 1,\n\t\t\t\t 'MSG' => 'no_search_results'\n\t\t\t\t ));\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\t$this->output .= View::make(\n\t\t\t\t\"search.end\",\n\t\t\t\t[\n\t\t\t\t\t'Data' => array(\n\t\t\t\t\t\t'SHOW_PAGES' => $this->links,\n\t\t\t\t\t\t'modform_close' => ($this->modfunctions)\n\t\t\t\t\t\t\t? View::make(\"search.modform_close\")\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t)\n\t\t\t\t]\n\t\t\t);\n\n\t\t} else // ( $this->result_type == 'posts' )\n\t\t{\n\n\t\t\t$this->parser = new PostParser();\n\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t\tFROM ibf_topics t\n\t\t\t\t\tLEFT JOIN ibf_posts p\n\t\t\t\t\t\tON (t.tid=p.topic_id\n\t\t\t\t\t\t AND p.new_topic=1\n\t\t\t\t\t\t AND p.use_sig=0)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tt.tid IN({$topics})\n\t\t\t\t\t\tAND p.queued != 1\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t$this->parser->prepareIcons();\n\n\t\t\t\tif ($topics)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tpid\n\t\t\t\t\tFROM\n\t\t\t\t\t\tibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttopic_id IN({$topics}) AND\n\t\t\t\t\t\tnew_topic=1 AND\n\t\t\t\t\t\tqueued != 1\");\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!preg_match(\"/,\" . $pr['pid'] . \",/\", $posts))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$posts .= $pr['pid'] . \",\";\n\t\t\t\t\t\t\t$post_max_hits++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$posts = str_replace(\",,\", \",\", $posts);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= $this->start_page($post_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tp.use_emo,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.forum_highlight,\n\t\t\t\t\t\tf.highlight_fid as hid,\n\t\t\t\t\t\tf.name as forum_name,\n\t\t\t\t\t\tf.use_html,\n\t\t\t\t\t\tg.g_dohtml,\n\t\t\t\t\t\tp.ip_address\n\t\t\t\t\tFROM ibf_posts p\n\t\t\t\t\tLEFT JOIN ibf_topics t\n\t\t\t\t\t\tON (t.tid=p.topic_id)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=p.forum_id)\n\t\t\t\t\tLEFT JOIN ibf_members m\n\t\t\t\t\t\tON (m.id=p.author_id)\n\t\t\t\t\tLEFT JOIN ibf_groups g\n\t\t\t\t\t\tON (m.mgroup=g.g_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.pid IN({$posts}) AND\n\t\t\t\t\t\tp.use_sig=0 AND\n\t\t\t\t\t\tp.queued != 1 AND\n\t\t\t\t\t\tt.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\t\t\t}\n\n\t\t\twhile ($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\tif ($ibforums->member['g_is_supmod'])\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"( <a href='{$ibforums->base_url}&act=modcp&CODE=ip&incoming={$row['ip_address']}' target='_blank'>{$row['ip_address']}</a> )\";\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"\";\n\t\t\t\t}\n\n\t\t\t\tif ($row['club'] and\n\t\t\t\t $std->check_perms($ibforums->member['club_perms']) == FALSE\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$count++;\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'TEXT' => $row['post'],\n\t\t\t\t\t'SMILIES' => $row['use_emo'],\n\t\t\t\t\t'CODE' => 1,\n\t\t\t\t\t'SIGNATURE' => 0,\n\t\t\t\t\t'HTML' => 1,\n\t\t\t\t\t'HID' => ($row['forum_highlight'])\n\t\t\t\t\t\t? $row['hid']\n\t\t\t\t\t\t: -1,\n\t\t\t\t\t'TID' => $row['topic_id'],\n\t\t\t\t\t'MID' => $row['author_id'],\n\t\t\t\t);\n\n\t\t\t\t$row['post'] = $this->parser->prepare($data);\n\n\t\t\t\tif (!trim($row['post']))\n\t\t\t\t{\n\t\t\t\t\t$count--;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$row['keywords'] = $url_words;\n\t\t\t\t$row['post_date'] = $std->get_date($row['post_date']);\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Parse HTML tag on the fly\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($row['use_html'] == 1)\n\t\t\t\t{\n\t\t\t\t\t// So far, so good..\n\n\t\t\t\t\tif (stristr($row['post'], '[dohtml]'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// [doHTML] tag found..\n\n\t\t\t\t\t\t$parse = ($row['use_html'] AND $row['g_dohtml'])\n\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t: 0;\n\n\t\t\t\t\t\t$row['post'] = $this->parser->post_db_parse($row['post'], $parse);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Do word wrap?\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($ibforums->vars['post_wordwrap'] > 0)\n\t\t\t\t{\n\t\t\t\t\t$row['post'] = $this->parser->my_wordwrap($row['post'], $ibforums->vars['post_wordwrap']);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= View::make(\"search.RenderPostRow\", ['Data' => $this->parse_entry($row, 1)]);\n\t\t\t}\n\n\t\t\t$this->output .= View::make(\"search.end_as_post\", ['Data' => array('SHOW_PAGES' => $this->links)]);\n\t\t}\n\n\t\tif ($count <= 0)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$this->page_title = $ibforums->lang['search_results'];\n\n\t\tif ($ibforums->input['nav'] == 'lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'my_lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['my_nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'lt')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_lt']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'au')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_au']);\n\t\t} else\n\t\t{\n\t\t\t$this->nav = array(\n\t\t\t\t\"<a href='{$this->base_url}&act=Search'>{$ibforums->lang['search_form']}</a>\",\n\t\t\t\t$ibforums->lang['search_title']\n\t\t\t);\n\t\t}\n\t}", "public function getJobDetail($jobId){\n $sql = $this->db->select()\n ->from(\"job\")\n ->join(\"city\", \"job.city_id=city.city_id\")\n ->where(\"job_id={$jobId}\")\n ;\n return $this->executeQuery($sql);\n }", "public function dump()\n {\n $this->composeQuery();\n $result = $this->connection->client()->search($this->queryBody);\n\n dd($result);\n }", "function getJobDetails( $job_id='/' )\n{\n return getRequestedDataFromURL('jobs/view/'.$job_id );\n}", "function jobInfoOutput($output)\n {\n\n $dataUndefined = empty($output) ? '' : $this->jobDetailsoutput($output);\n\n return response()->json(['job' => $dataUndefined]);\n }", "public function show(JobSeeker $jobSeeker)\n {\n //\n }" ]
[ "0.6637524", "0.65918285", "0.65476745", "0.6449444", "0.6433737", "0.63260406", "0.62924707", "0.6238771", "0.61837476", "0.61687607", "0.61496544", "0.609884", "0.6080599", "0.60290045", "0.5960076", "0.5960076", "0.591891", "0.5898498", "0.58954674", "0.58908653", "0.5880848", "0.58802056", "0.58312976", "0.58267933", "0.5794555", "0.57818735", "0.5780497", "0.57769877", "0.5767168", "0.575484", "0.57538813", "0.5752646", "0.5742517", "0.5738493", "0.5737545", "0.5733293", "0.5714511", "0.56894004", "0.56868094", "0.56813675", "0.56782055", "0.5673799", "0.56688386", "0.5654976", "0.5643594", "0.5631048", "0.56159484", "0.56087446", "0.55993044", "0.55970776", "0.5596683", "0.55757505", "0.55726177", "0.5565311", "0.55597407", "0.5559208", "0.5556767", "0.5548524", "0.55368054", "0.55277747", "0.5491849", "0.5486282", "0.5479973", "0.547794", "0.54665804", "0.5442476", "0.54264134", "0.54035157", "0.5391465", "0.53875256", "0.53820115", "0.5380657", "0.5378737", "0.5374637", "0.53727335", "0.53718007", "0.53682464", "0.5366315", "0.53594965", "0.5359107", "0.53549993", "0.53534055", "0.5342043", "0.53394425", "0.5331318", "0.5328388", "0.53273517", "0.53143495", "0.53016263", "0.5289837", "0.52795655", "0.5271504", "0.5270018", "0.526281", "0.5260946", "0.5259367", "0.5253454", "0.52526927", "0.5250281", "0.52484083" ]
0.7256187
0
Get a job result.
function printResult($jobId, $resultType) { $this->printDebugMessage('printResult', 'Begin', 1); echo "<p>Result for job <a href=\"?jobId=$jobId\">$jobId</a>:</p>\n"; $resultTypeObjs = $this->getResultTypes($jobId); foreach($resultTypeObjs as $resultTypeObj) { if($resultTypeObj->identifier == $resultType) { $selResultTypeObj = $resultTypeObj; } } // Plain text if($selResultTypeObj->mediaType == 'text/plain') { $resultStr = $this->getResult($jobId, $resultType); echo "<p><pre>$resultStr</pre></p>\n"; } // Image, embed using img tag using service REST API for document elseif(strpos($selResultTypeObj->mediaType, 'image') === 0 && strpos($selResultTypeObj->mediaType, 'xml') == 0) { $resultUrl = 'http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/'; $resultUrl .= $jobId . '/' . $resultType; echo "<img src=\"$resultUrl\"></img>"; } // Other, embed in iframe using service REST API for document else { $resultUrl = 'http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/'; $resultUrl .= $jobId . '/' . $resultType; echo "<iframe src=\"$resultUrl\" width=\"100%\" height=\"100%\"></iframe>"; } $this->printDebugMessage('printResult', 'Begin', 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_result() {\r\n\t\treturn $this->result;\r\n\t}", "public function get_result() {\n\t\treturn $this->_result;\n\t}", "public function getResult($queueJobId);", "private function getResult() {\n return $this->result;\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->get(self::RESULT);\n }", "public function getResult() {\n\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->result;\n }", "public function getResult(): Result\n {\n return $this->result;\n }", "public function getResult() {\n\t\treturn $this->result;\n\t}", "public function getResult() {\n\t\treturn $this->result;\n\t}", "public function result()\n {\n return $this->result;\n }", "public function result()\n {\n return $this->result;\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }", "public function getResult()\n {\n return $this->get(self::_RESULT);\n }" ]
[ "0.69990563", "0.68941873", "0.68019384", "0.67127824", "0.66680425", "0.6667634", "0.66664636", "0.66490686", "0.6605309", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.6589555", "0.65643126", "0.65450394", "0.65450394", "0.653678", "0.653678", "0.65364784", "0.65364784", "0.65364784", "0.65364784", "0.65364784", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754", "0.6535754" ]
0.0
-1
Generate metarefresh tag for a job.
function genMetaRefresh($jobId) { $this->printDebugMessage('genMetaRefresh', 'Begin', 2); $statusUrl = "?jobId=$jobId"; $retVal = "<meta http-equiv=\"refresh\" content=\"10;url=$statusUrl\">"; $this->printDebugMessage('genMetaRefresh', 'Begin', 2); return $retVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_metarefresh() {\n\t$post_url;\n\n // Redirects to a custom URL\n\tif(METAREFRESH_CUSTOM_URL){\n\t\t$post_url = METAREFRESH_URL ? METAREFRESH_URL : get_bloginfo('url');\n\n \n // Redirects to a random address within an array or URL\n\t} else if(METAREFRESH_CUSTOM_URL_ARRAY){\n\t\t$url_array = unserialize(METAREFRESH_URL_ARRAY);\n\t\t$post_url = $url_array[ rand(0, count($url_array)-1) ];\n\n \n // Redirects to 'previous post'\n\t} else {\n\t $prev_post = get_previous_post(true);\n\t if (!empty( $prev_post )){\n\t $post_url = get_permalink($prev_post->ID);\n\t } else {\n\t \t$recent_post = wp_get_recent_posts( array('numberposts' => 1), ARRAY_A );\n\t \t$post_url = get_permalink($recent_post[0]['ID']);\n\t \t}\n\t}\n\n // Print Refresh HTML tag\n echo '<meta http-equiv=\"refresh\" content=\"' . METAREFRESH_LENGTH . '; url=' . $post_url . '\">';\n}", "public static function refresh(int $interval): MetaTag {\n return static::httpEquiv('refresh', $interval);\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "public function testGenerateMetaTags()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "private function fragmentTag()\n {\n return '<!-- FGC: [' . current_time(\"Y-m-d H:i:s\", 1) .'| ' .$this->hash. ']-->';\n }", "public function getJobDescription() {\n\t\treturn t('Generate the sitemap.xml file that search engines use to crawl your site.');\n\t}", "function metarefresh_hook_cron(&$croninfo) {\n\tassert('is_array($croninfo)');\n\tassert('array_key_exists(\"summary\", $croninfo)');\n\tassert('array_key_exists(\"tag\", $croninfo)');\n\n\tSimpleSAML\\Logger::info('cron [metarefresh]: Running cron in cron tag [' . $croninfo['tag'] . '] ');\n\n\ttry {\n\t\t$config = SimpleSAML_Configuration::getInstance();\n\t\t$mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php');\n\n\t\t$sets = $mconfig->getConfigList('sets', array());\n\t\t$stateFile = $config->getPathValue('datadir', 'data/') . 'metarefresh-state.php';\n\n\t\tforeach ($sets AS $setkey => $set) {\n\t\t\t// Only process sets where cron matches the current cron tag\n\t\t\t$cronTags = $set->getArray('cron');\n\t\t\tif (!in_array($croninfo['tag'], $cronTags, true)) continue;\n\n\t\t\tSimpleSAML\\Logger::info('cron [metarefresh]: Executing set [' . $setkey . ']');\n\n\t\t\t$expireAfter = $set->getInteger('expireAfter', NULL);\n\t\t\tif ($expireAfter !== NULL) {\n\t\t\t\t$expire = time() + $expireAfter;\n\t\t\t} else {\n\t\t\t\t$expire = NULL;\n\t\t\t}\n\n\t\t\t$outputDir = $set->getString('outputDir');\n\t\t\t$outputDir = $config->resolvePath($outputDir);\n\t\t\t$outputFormat = $set->getValueValidate('outputFormat', array('flatfile', 'serialize'), 'flatfile');\n\n\t\t\t$oldMetadataSrc = SimpleSAML_Metadata_MetaDataStorageSource::getSource(array(\n\t\t\t\t'type' => $outputFormat,\n\t\t\t\t'directory' => $outputDir,\n\t\t\t));\n\n\t\t\t$metaloader = new sspmod_metarefresh_MetaLoader($expire, $stateFile, $oldMetadataSrc);\n\n\t\t\t# Get global blacklist, whitelist and caching info\n\t\t\t$blacklist = $mconfig->getArray('blacklist', array());\n\t\t\t$whitelist = $mconfig->getArray('whitelist', array());\n\t\t\t$conditionalGET = $mconfig->getBoolean('conditionalGET', FALSE);\n\n\t\t\t// get global type filters\n\t\t\t$available_types = array(\n\t\t\t\t'saml20-idp-remote',\n\t\t\t\t'saml20-sp-remote',\n\t\t\t\t'shib13-idp-remote',\n\t\t\t\t'shib13-sp-remote',\n\t\t\t\t'attributeauthority-remote'\n\t\t\t);\n\t\t\t$set_types = $set->getArrayize('types', $available_types);\n\n\t\t\tforeach($set->getArray('sources') AS $source) {\n\n\t\t\t\t// filter metadata by type of entity\n\t\t\t\tif (isset($source['types'])) {\n\t\t\t\t\t$metaloader->setTypes($source['types']);\n\t\t\t\t} else {\n\t\t\t\t\t$metaloader->setTypes($set_types);\n\t\t\t\t}\n\n\t\t\t\t# Merge global and src specific blacklists\n\t\t\t\tif(isset($source['blacklist'])) {\n\t\t\t\t\t$source['blacklist'] = array_unique(array_merge($source['blacklist'], $blacklist));\n\t\t\t\t} else {\n\t\t\t\t\t$source['blacklist'] = $blacklist;\n\t\t\t\t}\n\n\t\t\t\t# Merge global and src specific whitelists\n\t\t\t\tif(isset($source['whitelist'])) {\n\t\t\t\t\t$source['whitelist'] = array_unique(array_merge($source['whitelist'], $whitelist));\n\t\t\t\t} else {\n\t\t\t\t\t$source['whitelist'] = $whitelist;\n\t\t\t\t}\n\n\t\t\t\t# Let src specific conditionalGET override global one\n\t\t\t\tif(!isset($source['conditionalGET'])) {\n\t\t\t\t\t$source['conditionalGET'] = $conditionalGET;\n\t\t\t\t}\n\n\t\t\t\tSimpleSAML\\Logger::debug('cron [metarefresh]: In set [' . $setkey . '] loading source [' . $source['src'] . ']');\n\t\t\t\t$metaloader->loadSource($source);\n\t\t\t}\n\n\t\t\t// Write state information back to disk\n\t\t\t$metaloader->writeState();\n\n\t\t\tswitch ($outputFormat) {\n\t\t\t\tcase 'flatfile':\n\t\t\t\t\t$metaloader->writeMetadataFiles($outputDir);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'serialize':\n\t\t\t\t\t$metaloader->writeMetadataSerialize($outputDir);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif ($set->hasValue('arp')) {\n\t\t\t\t$arpconfig = SimpleSAML_Configuration::loadFromArray($set->getValue('arp'));\n\t\t\t\t$metaloader->writeARPfile($arpconfig);\n\t\t\t}\n\t\t}\n\n\t} catch (Exception $e) {\n\t\t$croninfo['summary'][] = 'Error during metarefresh: ' . $e->getMessage();\n\t}\n}", "function display_job_date() {\n\tglobal $post;\n\n\t$expired = get_post_meta( $post->ID, '_job_expires', true );\n\n\tif ( $expired ) {\n\t\techo $expired;\n\t}\n}", "public function getJobName() {\n\t\treturn t('Generate the sitemap.xml file');\n\t}", "public function generateMetaWidget(\\Twig_Environment $env)\n {\n $token = twig_escape_filter($env, $this->generateCsrfToken(), 'html');\n $tokenName = twig_escape_filter($env, $this->getTokenName(), 'html');\n\n return \"<meta name=\\\"$tokenName\\\" content=\\\"$token\\\" />\";\n }", "function wck_refresh_entry( $meta = '', $id = '', $element_id = '' ){\r\n\t\t\r\n\t\tif( $this->args['context'] == 'post_meta' )\r\n\t\t\t$results = get_post_meta($id, $meta, true);\r\n\t\telse if ( $this->args['context'] == 'option' )\r\n\t\t\t$results = get_option( apply_filters( 'wck_option_meta' , $meta, $element_id ) );\r\n\r\n\t\tob_start();\r\n\t\t\techo self::wck_output_entry_content( $meta, $id, $this->args['meta_array'], $results, $element_id );\r\n\t\t\tdo_action( \"wck_refresh_entry_{$meta}\", $id );\r\n\t\t$entry_content = ob_get_clean();\r\n\r\n\t\treturn $entry_content;\r\n\t}", "public function getJobPost(){\n $jobPost = uniqid('').'|'.$this->jobType; \n \n foreach( $this->params as $key=>$val ){\n $jobPost .= \"|\".$val;\n }\n return $jobPost.\"\\n\";\n }", "function createMetaTag($name, $content) {\n return sprintf('<meta name=\"%s\" content=\"%s\"/>', esc_attr($name), esc_attr($content));\n}", "protected function _createPayload($job)\n {\n return json_encode($job);\n }", "protected function buildUrl(string $job, array $tags = []): string\n {\n $url = \"{$this->url}/metrics/job/{$job}\";\n\n foreach ($tags as $tag => $value) {\n $url .= \"/{$tag}/{$value}\";\n }\n\n return $url;\n }", "public function add_meta_keyword() {\n\t\t// Get global settings\n\t\t$vfb_settings \t= get_option( 'vfb-settings' );\n\n\t\t// Settings - Disable meta tag version\n\t\t$settings_meta\t= isset( $vfb_settings['show-version'] ) ? '' : '<!-- <meta name=\"vfbPro\" version=\"'. VFB_PRO_VERSION . '\" /> -->' . \"\\n\";\n\n\t\techo apply_filters( 'vfb_show_version', $settings_meta );\n\t}", "public function getTag()\n\t{\n\t\treturn 'build';\n\t}", "public function getRefresh()\n {\n return $this->metaRefreshValues['refresh'];\n }", "function ajan_core_print_generation_time() {\n?>\n\n<!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q) -->\n\n\t<?php\n}", "public function getJob(): string\n {\n return $this->job;\n }", "private function simple_meta_track($build) {\n\n\t $params = $this->buildToParams($build);\n\n $exists = $this->database->get('*', 'shadow_meta', $params);\n $exists = count($exists) == 1 ? $exists[0] : $exists;\n\n $theUpdate = 'count = count+1';\n if($build->metaValue){\n $theUpdate = 'object_value = :object_value';\n }\n\n if ($exists) {\n if($build->metaValue){\n if($build->metaValue != $exists->object_value){\n $this->database->update($theUpdate, 'shadow_meta', $params, array('object_value'=>$build->metaValue));\n }\n } else {\n $this->database->update($theUpdate, 'shadow_meta', $params);\n }\n } else {\n if(!$build->metaValue){\n \t$params['count'] = 1;\n } else {\n \t$params['object_value'] = $build->metaValue;\n }\n if($build->expires){\n $params['expires'] = $build->expires;\n }\n \n $this->database->create('shadow_meta', $params);\n }\n\n }", "public function add_meta_keyword() {\n // Get global settings\n $swpm_settings = get_option('swpm-settings');\n\n // Settings - Disable meta tag version\n $settings_meta = isset($swpm_settings['show-version']) ? '' : '<!-- <meta name=\"swpm\" version=\"' . SWPMFB_VERSION . '\" /> -->' . \"\\n\";\n\n echo apply_filters('swpm_show_version', $settings_meta);\n }", "private function _compile_metas(){\n\t\t$compiled_metas = \"\";\n\t\tforeach($this->metas as $meta){\n\t\t\t$compiled_metas .= \"\\t\".'<meta name=\"'.$meta['name'].'\" content=\"'.$meta['content'].'\">'.\"\\n\";\n\t\t}\n\t\tif ($compiled_metas == \"\") return \"\";\n\t\t\n\t\treturn \"<!-- START Compiled META -->\\n\".$compiled_metas.\"\\t<!-- END Compiled META -->\\n\";\n\t}", "function meta_refresh($time, $url, $disable_cd_check = false)\n{\n\tglobal $template;\n\n\t$url = redirect($url, true, $disable_cd_check);\n\t$url = str_replace('&', '&amp;', $url);\n\n\t// For XHTML compatibility we change back & to &amp;\n\t$template->assign_vars(array(\n\t\t'META' => '<meta http-equiv=\"refresh\" content=\"' . $time . ';url=' . $url . '\" />')\n\t);\n\n\treturn $url;\n}", "private function build_meta_doc_comment($meta)\n {\n $output = \"<?php /**\\n *\\n \";\n\n foreach($meta as $tag => $value)\n {\n $output .= sprintf('* @%s %s', ucfirst($tag), $value);\n }\n\n $output .= \"\\n *\\n */ ?>\\n\\n\";\n\n return $output;\n }", "private function generateEtag()\n\t{\n\t\t$etag = $this->getTable() . $this->getKey();\n\n\t\tif ( $this->usesTimestamps() )\n\t\t{\n\t\t\t$datetime = $this->updated_at;\n\n\t\t\tif ( $datetime instanceof \\DateTime )\n\t\t\t{\n\t\t\t\t$datetime = $this->fromDateTime($datetime);\n\t\t\t}\n\n\t\t\t$etag .= $datetime;\n\n\t\t}\n\n \treturn md5( $etag );\n\t}", "public function getCacheValidityTag(): string;", "private function clearCache($metaTag)\n {\n Cache::flush();\n }", "public function buildMetaTags()\n\t{\n\t\t/* Set basic ones */\n\t\t$this->metaTags['og:site_name'] = \\IPS\\Settings::i()->board_name;\n\t\t$this->metaTags['og:locale'] = preg_replace( \"/^([a-zA-Z0-9\\-_]+?)(?:\\..*?)$/\", \"$1\", \\IPS\\Member::loggedIn()->language()->short );\n\t\t\n\t\t/* Add the site name to the title */\n\t\tif( \\IPS\\Settings::i()->board_name )\n\t\t{\n\t\t\t$this->title .= ' - ' . \\IPS\\Settings::i()->board_name;\n\t\t}\n\t\t\n\t\t/* Add Admin-specified ones */\n\t\tif( !$this->metaTagsUrl )\n\t\t{\n\t\t\t$protocol = ( \\IPS\\Request::i()->isSecure() ) ? \"https://\" : \"http://\";\n\t\t\t$this->metaTagsUrl\t= \\IPS\\Http\\Url::external( $protocol . parse_url( \\IPS\\Settings::i()->base_url, PHP_URL_HOST ) . $_SERVER['REQUEST_URI'] );\n\t\t\t$this->metaTagsUrl\t= urldecode( mb_substr( (string) $this->metaTagsUrl, mb_strlen( \\IPS\\Settings::i()->base_url ) ) );\n\t\n\t\t\tif ( isset( \\IPS\\Data\\Store::i()->metaTags ) )\n\t\t\t{\n\t\t\t\t$rows = \\IPS\\Data\\Store::i()->metaTags;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$rows = iterator_to_array( \\IPS\\Db::i()->select( '*', 'core_seo_meta' ) );\n\t\t\t\t\\IPS\\Data\\Store::i()->metaTags = $rows;\n\t\t\t}\n\t\t\t\n\t\t\tif( is_array( $rows ) )\n\t\t\t{\n\t\t\t\tforeach ( $rows as $row )\n\t\t\t\t{\n\t\t\t\t\tif( \\strpos( $row['meta_url'], '*' ) !== FALSE )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( preg_match( \"#^\" . str_replace( '*', '(.+?)', trim( $row['meta_url'], '/' ) ) . \"$#i\", trim( $this->metaTagsUrl, '/' ) ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_tags\t= json_decode( $row['meta_tags'], TRUE );\n\t\t\n\t\t\t\t\t\t\tif( is_array( $_tags ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach( $_tags as $_tagName => $_tagContent )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif( !isset( $this->metaTags[ $_tagName ] ) )\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$this->metaTags[ $_tagName ]\t= $_tagContent;\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\n\t\t\t\t\t\t\t/* Are we setting page title? */\n\t\t\t\t\t\t\tif( $row['meta_title'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->title\t\t\t= $row['meta_title'];\n\t\t\t\t\t\t\t\t$this->metaTagsTitle\t= $row['meta_title'];\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif( trim( $row['meta_url'], '/' ) == trim( $this->metaTagsUrl, '/' ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_tags\t= json_decode( $row['meta_tags'], TRUE );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( is_array( $_tags ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach( $_tags as $_tagName => $_tagContent )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->metaTags[ $_tagName ]\t= $_tagContent;\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\t/* Are we setting page title? */\n\t\t\t\t\t\t\tif( $row['meta_title'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->title\t\t\t= $row['meta_title'];\n\t\t\t\t\t\t\t\t$this->metaTagsTitle\t= $row['meta_title'];\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}", "protected function build_meta( Meta_Tags_Context $context ) {\n\t\treturn new Meta( $context, $this->container );\n\t}", "public function toMetaTags(): string\n {\n $metaTags = '';\n\n if (!$this->containsProperty('type')) {\n $this->addProperty('type', 'website');\n }\n\n if ($this->containsProperty('image')) {\n if (!$this->containsProperty('image:width')) {\n $this->addProperty('image:width', 1200);\n }\n\n if (!$this->containsProperty('image:height')) {\n $this->addProperty('image:height', 1200);\n }\n }\n\n $this->list->each(function ($item) use (&$metaTags) {\n if ($item['property'] === 'image') {\n $width = $this->list->where('property', 'image:width')->first()['content'];\n $height = $this->list->where('property', 'image:height')->first()['content'];\n\n $item['content'] = get_cdn_media($item['content'], $width . 'x' . $height, 'rc');\n }\n\n if ($item['property'] === 'description') {\n if (strlen($item['content']) >= 300) {\n $item['content'] = substr($item['content'], 0, 300) . '…';\n }\n }\n\n if ($item['property'] === 'twitterCard') {\n $metaTags .= '<meta name=\"twitter:card\" content=\"' . htmlentities($item['content']) . '\" />';\n } else {\n $metaTags .= '<meta property=\"og:' . htmlentities($item['property']) . '\" content=\"' . htmlentities($item['content']) . '\" />' . PHP_EOL;\n\n if ($item['property'] === 'title' || $item['property'] === 'description') {\n $metaTags .= '<meta name=\"twitter:' . htmlentities($item['property']) . '\" content=\"' . htmlentities($item['content']) . '\" />' . PHP_EOL;\n }\n }\n });\n\n return $metaTags;\n }", "public function onJobPosted(JobPost $job)\r\n {\r\n echo 'Hi ' . $this->name . '! New job posted: '. $job->getTitle() . PHP_EOL;\r\n }", "public function meta($name = \"\", $content =\"\") {\n echo \"<meta name='\" . $name . \"' content ='\" . $content . \"'>\";\n }", "public function getMetaTags()\n {\n $datetimeString = date('n/d/y @ g:ia', strtotime($this->eventdatetime->starttime));\n if ($this->isAllDay()) {\n $datetimeString = date('n/d/y', strtotime($this->eventdatetime->starttime));\n }\n\n $title = $this->event->displayTitle($this) . ' - ' . $datetimeString;\n\n // Add a description if it is set\n $description = 'Event on ' . $datetimeString;\n if (isset($this->event->description) && !empty($this->event->description)) {\n $description = $this->event->description;\n }\n\n // Add a image if it is set\n $image = '';\n if (isset($this->event->imagedata) && !empty($this->event->imagedata)) {\n $image = MetaTagUtility::getSiteURL() . '?image&amp;id=' . $this->event->id;\n }\n\n // Build the options\n $options = array(\n 'image' => $image,\n 'label1' => 'Calendar',\n 'data1' => $this->calendar->name,\n );\n\n $location = $this->eventdatetime->getLocation();\n $webcast = $this->eventdatetime->getWebcast();\n\n if ($location !== false && $webcast !== false) {\n $options['label2'] = 'In-Person and Online';\n $options['data2'] = $location->name . ' & ' . $webcast->title;\n } elseif ($location !== false) {\n $options['label2'] = 'Location';\n $options['data2'] = $location->name;\n } elseif ($webcast !== false) {\n $options['label2'] = 'Virtual Location';\n $options['data2'] = $webcast->title;\n }\n\n $metaTagUtility = new MetaTagUtility($this->getURL(), $title, $description, $options);\n\n return $metaTagUtility->getMetaTags();\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "public static function getCacheTag()\n {\n return static::$cacheTag;\n }", "function ubc_collab_comment_meta() {\n\techo apply_atomic_shortcode( 'comment_meta', '<div class=\"comment-meta comment-meta-data\"><cite>[comment-author]</cite> [comment-published] <span class=\"comment-action\">[comment-permalink before=\"\"] [comment-edit-link before=\"| \"] [comment-reply-link before=\"| \"]<span></div>' );\n}", "private static function getGFusionOAuthRefreshToken() {\n\t\treturn '1/zuRSQC5Q12yBoJ1idPljEw4xlolOWXrp4hyoKSC1C2o';\n\t}", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "function refresh($cooldown){\r\n\t\techo(\"<meta http-equiv='refresh' content='0'>\"); \r\n\r\n\t}", "public function generarCustomID(){\n return md5(\"$this->id $this->updated_at\");\n }", "public function getTag()\n {\n return 'nocache';\n }", "function xgb_submit_live_link_meta_box() {\n add_meta_box(\n 'xgb_live_link_id', \t\t\t// Unique ID\n esc_html__('Publishing Instructions','xgb'), // Box title\n 'xgb_submit_live_link_custom_box', \t// Content callback\n 'post',\t\t \t\t\t// Post type\n\t\t\t'side',\t\t\t\t\t\t\t\t\t// Context\n\t\t\t'high'\t\t\t\t\t\t\t\t\t// Priority\n );\n}", "public function toString()\n {\n return sprintf('<meta property=\"%s\" content=\"%s\"/>', $this->porperty, $this->content);\n }", "public static final function manageTAG (S $metaTAGName, S $metaTAGContent = NULL) {\r\n if ($metaTAGContent != NULL) {\r\n // If metaTAGContent contains something, added to the header;\r\n if (isset (self::$objMetaTAG[$metaTAGName])) {\r\n self::$objMetaTAG[$metaTAGName]['info']->appendString (_SP . $metaTAGContent);\r\n return TheFactoryMethodOfSingleton::getInstance (__CLASS__);\r\n } else {\r\n self::$objMetaTAG[$metaTAGName]['name'] = $metaTAGName;\r\n self::$objMetaTAG[$metaTAGName]['info'] = $metaTAGContent;\r\n return TheFactoryMethodOfSingleton::getInstance (__CLASS__);\r\n }\r\n } else {\r\n // Else, this means it was called without a parameter, remove it;\r\n if (isset (self::$objMetaTAG[$metaTAGName])) {\r\n unset (self::$objMetaTAG[$metaTAGName]);\r\n return TheFactoryMethodOfSingleton::getInstance (__CLASS__);\r\n } else {\r\n self::renderScreenOfDeath (new S (__CLASS__),\r\n new S (META_TAG_NOT_SET),\r\n new S (META_TAG_NOT_SET_FIX));\r\n }\r\n }\r\n }", "public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}", "public function getMetaUrl() {\n return (isset($this->metaUrl) && $this->metaUrl!='') ? $this->metaUrl : url('');\n }", "function generer_bing(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['bing']['id'])\n\t\treturn '<meta name=\"msvalidate.01\" content=\"' . $config['bing']['id'] . '\" />\n\t\t';\n}", "public function build(JobInterface $task_job) {\n if ($this->tempstoreRepository->has($task_job)) {\n $task_job = $this->tempstoreRepository->get($task_job);\n }\n\n /** @var \\Drupal\\task\\Entity\\Task $temp_task */\n $temp_task = $this->entityTypeManager->getStorage('task')->create([\n 'job' => $task_job,\n ]);\n $collect_resource_contexts = new CollectResourcesContextsEvent($temp_task);\n $this->eventDispatcher->dispatch(TaskEvents::COLLECT_RESOURCES_CONTEXTS, $collect_resource_contexts);\n $definitions = $this->blockManager->getFilteredDefinitions(\n 'task_job_resource',\n $collect_resource_contexts->getContexts() + [\n 'task' => new EntityContext(\n new EntityContextDefinition('task', $this->t('The Task')),\n $temp_task\n ),\n ]\n );\n\n $build = [\n '#type' => 'container',\n ];\n foreach ($definitions as $name => $definition) {\n $category = isset($definition['category']) ? (string) $definition['category'] : 'Other';\n if (!isset($build[$category])) {\n $build[$category]['#type'] = 'details';\n $build[$category]['#open'] = TRUE;\n $build[$category]['#title'] = $category;\n $build[$category]['links'] = [\n '#theme' => 'links',\n '#links' => [],\n ];\n }\n\n $build[$category]['links']['#links'][] = [\n 'title' => $definition['admin_label'],\n 'url' => Url::fromRoute(\n 'task_job.resource.add',\n [\n 'task_job' => $task_job->id(),\n 'plugin_id' => $name,\n ]\n ),\n 'attributes' => $this->getAjaxAttributes(),\n ];\n }\n\n return $build;\n }", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "public static function getCacheTag()\n\t{\n\t\treturn get_called_class() . '_common_cache';\n\t}", "private static final function getMetaTAGHeader () {\r\n $tagMetaHeaderString = new S;\r\n $tagMetaPureString = new FileContent (FORM_TP_DIR . _S . 'frm_web_head_meta.tp');\r\n foreach (self::$objMetaTAG as $k => $v) {\r\n $tagMetaHeaderString->appendString (str_replace (array ('[%META_NAME_REPLACE%]', '[%META_CONTENT_INFO%]'),\r\n array (self::$objMetaTAG[$k]['name'], self::$objMetaTAG[$k]['info']), $tagMetaPureString));\r\n }\r\n // Do return ...\r\n return $tagMetaHeaderString;\r\n }", "function get_google_job_post_javascript($job_details)\r\n{\r\n\t// $job_result = cura_search_joborder($filter);\r\n\t\r\n\t// $job_details = $job_result->jobOrder[0];\r\n\t\r\n\t$company_name = get_option('mindscope_webint_api_company_name');\r\n\t$website_url = get_option('mindscope_webint_api_website_url');\r\n\t$logo_url = get_option('mindscope_webint_api_logo_url');\r\n\t\r\n\t$job_description = strip_tags($job_details->jobFunction, \"<br><p><ul><li><h1><h2><h3><h4><h5><strong><em><b>\");\r\n\t\r\n\t$web_pub_date = date_parse($job_details->webPublicationDate);\r\n\t$web_pub_date_short = \"\";\r\n\tif ($web_pub_date[\"error_count\"] == 0)\r\n\t{\r\n\t\t$web_pub_date_short = $web_pub_date[\"year\"] . \"-\" . $web_pub_date[\"month\"] . \"-\" . $web_pub_date[\"day\"];\r\n\t}\r\n\t\r\n\t$google_javascript = '';\r\n\t\r\n\t$google_javascript .= '<script type=\"application/ld+json\">';\r\n\t\r\n\t$job_post_json = array(\r\n\t\t\"@context\" => \"https://schema.org/\",\r\n\t\t\"@type\" => \"JobPosting\",\r\n\t\t\"title\" => $job_details->position,\r\n\t\t\"description\" => $job_description,\r\n\t\t\"identifier\" => array(\r\n\t\t\t\t\t\"@type\" => \"PropertyValue\",\r\n\t\t\t\t\t\"name\" => $company_name,\r\n\t\t\t\t\t\"value\" => strval($job_details->jobOrderId)\r\n\t\t\t\t),\r\n\t\t\"datePosted\" => $web_pub_date_short,\r\n\t\t\"hiringOrganization\" => array(\r\n\t\t\t\t\t\"@type\" => \"Organization\",\r\n\t\t\t\t\t\"name\" => $company_name,\r\n\t\t\t\t\t\"sameAs\" => $website_url,\r\n\t\t\t\t\t\"logo\" => $logo_url\r\n\t\t\t\t),\r\n\t\t\"jobLocation\" => array(\r\n\t\t\t\t\t\"@type\" => \"Place\",\r\n\t\t\t\t\t\"address\" => array(\r\n\t\t\t\t\t\t\t\"@type\" => \"PostalAddress\",\r\n\t\t\t\t\t\t\t\"streetAddress\" => $job_details->street,\r\n\t\t\t\t\t\t\t\"addressLocality\" => $job_details->city,\r\n\t\t\t\t\t\t\t\"addressRegion\" => $job_details->province,\r\n\t\t\t\t\t\t\t\"postalCode\" => $job_details->postalZip,\r\n\t\t\t\t\t\t\t\"addressCountry\" => $job_details->country\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t);\r\n\t\r\n\t$google_javascript .= json_encode($job_post_json);\r\n\t\r\n\t$google_javascript .= '</script>';\r\n\t\r\n\treturn $google_javascript;\r\n}", "public static function get_cache_incrementor( $refresh = false ) {\n\t\t$incrementor_key = 'simple_history_incrementor';\n\t\t$incrementor_value = wp_cache_get( $incrementor_key );\n\n\t\tif ( false === $incrementor_value || $refresh ) {\n\t\t\t$incrementor_value = uniqid();\n\t\t\twp_cache_set( $incrementor_key, $incrementor_value );\n\t\t}\n\n\t\treturn $incrementor_value;\n\t}", "private function render_last_gen_report(MJKGenToolsPage $page): void {\r\n \r\n $last_ts = $page->last_gen();\r\n $last_success = $page->last_gen_success();\r\n $last_text = MJKGTSchedulerAJAX::format_last($last_ts, $last_success);\r\n printf('<b>Last generated</b> <span id=\"last_gen_%s\">%s</span><br>',\r\n $page->id(), $last_text);\r\n }", "protected function createPushedGaeJob($job)\n {\n return new GaeJob($this->container, $this, $job, true);\n }", "public function metaTag()\n {\n return $this->meta()->where('id', $this->meta_id)->first();\n }", "public function __toString(): string\n {\n return $this->toMetaTags();\n }", "function cl_version_in_header() {\n echo '<meta name=\"generator\" content=\"Custom Login v' . CUSTOM_LOGIN_VERSION . '\" />' . \"\\n\";\n }", "public function created(Job $job)\n {\n //\n }", "public function get_latest_tag() {\n\t\t\t$tagged_version = get_site_transient( md5( $this->config['slug'] ) . '_latest_tag' );\n\n\t\t\tif ( $this->overrule_transients() || empty( $tagged_version ) ) {\n\n\t\t\t\t$raw_response = wp_remote_get( trailingslashit( $this->config['api_url'] ) . 'releases' );\n\n\t\t\t\tif ( is_wp_error( $raw_response ) ) {\n\t\t\t\t\treturn '<div id=\"message\" class=\"error\"><p>' . $raw_response->get_error_message() . '</p></div>';\n\t\t\t\t}\n\n\t\t\t\t$releases = json_decode( $raw_response['body'] );\n\t\t\t\t$tagged_version = false;\n\n\t\t\t\tif ( is_array( $releases ) ) {\n\t\t\t\t\tforeach ( $releases as $release ) {\n\t\t\t\t\t\tif ( $release->prerelease ) {\n\t\t\t\t\t\t\t$tagged_version = $release->tag_name;\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}\n\n\t\t\t\t// refresh every 6 hours\n\t\t\t\tif ( ! empty( $tagged_version ) ) {\n\t\t\t\t\tset_site_transient( md5( $this->config['slug'] ) . '_latest_tag', $tagged_version, 60*60*6 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $tagged_version;\n\t\t}", "function buildfoot() {\n\tglobal $loq;\n $mtime = explode(\" \",microtime());\n\t$endtime = $mtime[1] + $mtime[0];\n\t\n\t$pagetime = round($endtime - $loq->begintime,5);\n\t$foot = \"\n<!--//\nThis page took $pagetime seconds to make\nPowered by Loquacity : http://www.loquacity.info/\n//-->\";\n\treturn $foot;\n}", "public function getGcTagId()\n {\n return $this->gc_tag_id;\n }", "function ua_webtide_print_jobs_meta_boxes( $post, $metabox ) {\n\t\n\tswitch( $metabox[ 'id' ] ) {\n\t\t\n\t\tcase 'mc-wt-job-notifications':\n\t\t\n\t\t\t// Get our notification time, if set, for the job postings subscription list\n\t\t\tif ( ( $notification_str = get_post_meta( $post->ID, '_mailchimp_webtide_job_subscription_notification', true ) )\n\t\t\t\t&& strtotime( $notification_str ) !== false ) {\n\t\t\t\t\t\n\t\t\t\t// Get the current date/time in Central time\n\t\t\t\t$right_now = new DateTime();\n\t\t\t\t$right_now->setTimeZone( new DateTimeZone( 'America/Chicago' ) );\n\t\t\t\t\n\t\t\t\t// Convert to central time\n\t\t\t\t$notification = new DateTime( $notification_str, new DateTimeZone( 'UTC' ) );\n\t\t\t\t$notification->setTimeZone( new DateTimeZone( 'America/Chicago' ) );\n\t\t\t\t\n\t\t\t\t?><p>This job <?php echo $notification > $right_now ? 'will be' : 'was'; ?> sent to the \"UA Job Postings For Web Professionals\" MailChimp mailing list on <strong><?php echo $notification->format( 'n/j/Y \\a\\t\\ g:i a' ); ?></strong>.</p><?php\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t?><p style=\"color:red;\">This job has not been sent to the \"UA Job Postings For Web Professionals\" MailChimp mailing list.</p><?php\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Get our notification time, if set, for the WebTide list\n\t\t\tif ( ( $notification_str = get_post_meta( $post->ID, '_mailchimp_webtide_job_webtide_notification', true ) )\n\t\t\t\t&& strtotime( $notification_str ) !== false ) {\n\t\t\t\t\t\n\t\t\t\t// Get the current date/time in Central time\n\t\t\t\t$right_now = new DateTime();\n\t\t\t\t$right_now->setTimeZone( new DateTimeZone( 'America/Chicago' ) );\n\t\t\t\t\n\t\t\t\t// Convert to central time\n\t\t\t\t$notification = new DateTime( $notification_str, new DateTimeZone( 'UTC' ) );\n\t\t\t\t$notification->setTimeZone( new DateTimeZone( 'America/Chicago' ) );\n\t\t\t\t\n\t\t\t\t?><p>This job <?php echo $notification > $right_now ? 'will be' : 'was'; ?> sent to the WebTide MailChimp mailing list on <strong><?php echo $notification->format( 'n/j/Y \\a\\t\\ g:i a' ); ?></strong>.</p><?php\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t?><p style=\"color:red;\">This job has not been sent to the WebTide MailChimp mailing list.</p><?php\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\t\t\n\t}\n\t\n}", "public static function migrationJobName(string $project, string $location, string $migrationJob): string\n {\n return self::getPathTemplate('migrationJob')->render([\n 'project' => $project,\n 'location' => $location,\n 'migration_job' => $migrationJob,\n ]);\n }", "protected function update_cache_on_create()\n {\n Moebooru\\CacheHelper::expire_tag_version();\n }", "function amwscp_add_xml_refresh_interval()\n{\n $current_delay = get_option('amwscpf_feed_delay');\n return array(\n 'refresh_interval' => array('interval' => $current_delay, 'display' => 'Amazon Feed refresh interval'),\n );\n}", "function getNewVersion($meta, $object);", "public function generate( $meta = array() )\n\t\t{\n\t\t\t$meta = parent::generate( $meta );\n\n\t\t\tforeach( $this->get( 'sections', array() ) as $section ){\n\n\t\t\t\t$meta = $section->postId( $this->postId )\n\t\t\t\t\t\t\t\t->containerId( $this->id )\n\t\t\t\t\t\t\t\t->generate( $meta );\n\t\t\t}\n\n\t\t\treturn $meta;\n\t\t}", "public function getCacheTagsToInvalidate();", "public function updated(Job $job)\n {\n //\n }", "public function getMetaAsRawString()\n\t{\n\t\t$meta = '';\n\t\t$title = $this->getTitleLineString();\n\t\t\n\t\tarray_shift($this->items);\n\t\t\n\t\tforeach ((array) $this->items as $type => $items) {\n\t\t\tforeach ((array) $items as $key => $item) {\n\t\t\t\t$meta .= \"<meta $type=\\\"{$key}\\\" content=\\\"{$item}\\\"/>\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $title . $this->getOgHeadLineString() . $meta;\n\t}", "public function release($job);", "public function nextJobId()\n\t{\n\t\treturn (string) Redis::incr('test:like_log_id');\n\t}", "function v2_mumm_add_meta_tags($open_graph_protocol) {\n $elements = array();\n $elements[] = array(\n '#type' => 'html_tag',\n '#tag' => 'meta',\n '#attributes' => array(\n 'property' => 'description',\n 'content' => htmlspecialchars_decode($open_graph_protocol['description'], ENT_QUOTES),\n ),\n );\n\n $i = 0;\n foreach ($elements as $element) {\n drupal_add_html_head($element, 'open_graph_protocol_' . $i++);\n }\n}", "function register_gather_ua_jobs_tools_page() {\n\tadd_management_page( __( 'Gather UA Jobs', GATHER_UA_JOBS_TEXT_DOMAIN ), __( 'Gather UA Jobs', GATHER_UA_JOBS_TEXT_DOMAIN ), 'edit_posts', 'gather-ua-jobs', 'print_gather_ua_jobs_tools_page' );\n\n}", "static function nextgen_version() {\n global $ngg;\n echo apply_filters('show_nextgen_version', '<!-- <meta name=\"NextGEN\" version=\"'. $ngg->version . '\" /> -->' . \"\\n\");\n }", "public function getRefreshPayload(): string\n {\n return $this->refreshPayload;\n }", "private function complex_meta_track($build) {\n\n $params = $this->buildToParams($build);\n\n $exists = $this->database->get('*', 'shadow_meta', $params);\n $exists = count($exists) == 1 ? $exists[0] : $exists;\n\n if ($exists) {\n $params['object_key'] = $build->metaComplexKey;\n\n $subExists = $this->database->get('*', 'shadow_meta', $params);\n\n if ($subExists) {\n $params['parent'] = $exists->id;\n\n if($build->metaValue){\n if($build->metaValue != $subExists[0]->object_value){\n $this->database->update('object_value = :object_value', 'shadow_meta', $params, array('object_value'=>$build->metaValue) );\n }\n } else {\n $this->database->update('count = count+1', 'shadow_meta', $params);\n }\n } else {\n $params['parent'] = $exists->id;\n $params['count'] = 1;\n $this->database->create('shadow_meta', $params);\n }\n\n } else {\n\t \n\t if($build->expires){\n $params['expires'] = $build->expires;\n }\n\n $this->database->create('shadow_meta', $params);\n\n unset($params['expires']);\n\n $lastID = $this->database->lastID();\n\n $params['object_key'] = $build->metaComplexKey;\n $params['parent'] = $lastID;\n\n if($build->metaValue){\n $params['object_value'] = $build->metaValue;\n } else {\n $params['count'] = 1;\n }\n $this->database->create('shadow_meta', $params);\n }\n }", "public function saved(MetaTag $metaTag)\n {\n // Removing Entries from the Cache\n $this->clearCache($metaTag);\n }", "public function getEtag($regen=false)\n\t{\n\t\tif ( $this->exists && ($this->etag === false || $regen === true) )\n \t{\n \t\t$this->etag = $this->generateEtag();\n \t}\n\n \treturn $this->etag;\n\t}", "public function generate_metadata_smushit( $meta, $attachment_id ) {\n \t\n \treturn $this->meta_smushit_media_sizes( $attachment_id, $meta, true );\n }", "protected function generateTag() {\n $this->callFormFactoryFunction('open',[$this->formTemplate['parameters']['id']],$this->formTemplate['methods']);\n\n parent::generateTag();\n\n }", "public function drawMeta($name) {\n\t\t\t// Is there scope for using Smarty or similar here?\n\t\t\tif ($name == 'description') {\n\t\t\t\treturn $this->meta_description;\n\t\t\t}\n\t\t\telse if ($name == 'keywords') {\n\t\t\t\treturn $this->meta_keywords;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn '<!-- Unknown \"meta\" data -->';\t\t\n\t\t\t}\n\t\t}", "private function print_active_job($job_id, $is_oneshot = false, $time = false, $next_resumption = false) {\n\n\t\t$ret = '';\n\t\t\n\t\tglobal $updraftplus;\n\t\t$jobdata = $updraftplus->jobdata_getarray($job_id);\n\n\t\tif (false == apply_filters('updraftplus_print_active_job_continue', true, $is_oneshot, $next_resumption, $jobdata)) return '';\n\n\t\tif (!isset($jobdata['backup_time'])) return '';\n\n\t\t$backupable_entities = $updraftplus->get_backupable_file_entities(true, true);\n\n\t\t$began_at = isset($jobdata['backup_time']) ? get_date_from_gmt(gmdate('Y-m-d H:i:s', (int) $jobdata['backup_time']), 'D, F j, Y H:i') : '?';\n\n\t\t$backup_label = !empty($jobdata['label']) ? $jobdata['label'] : '';\n\n\t\t$remote_sent = (!empty($jobdata['service']) && ((is_array($jobdata['service']) && in_array('remotesend', $jobdata['service'])) || 'remotesend' === $jobdata['service'])) ? true : false;\n\n\t\t$jobstatus = empty($jobdata['jobstatus']) ? 'unknown' : $jobdata['jobstatus'];\n\t\t$stage = 0;\n\t\tswitch ($jobstatus) {\n\t\t\t// Stage 0\n\t\t\tcase 'begun':\n\t\t\t$curstage = __('Backup begun', 'updraftplus');\n\t\t\t\tbreak;\n\t\t\t// Stage 1\n\t\t\tcase 'filescreating':\n\t\t\t$stage = 1;\n\t\t\t$curstage = __('Creating file backup zips', 'updraftplus');\n\t\t\tif (!empty($jobdata['filecreating_substatus']) && isset($backupable_entities[$jobdata['filecreating_substatus']['e']]['description'])) {\n\t\t\t\n\t\t\t\t$sdescrip = preg_replace('/ \\(.*\\)$/', '', $backupable_entities[$jobdata['filecreating_substatus']['e']]['description']);\n\t\t\t\tif (strlen($sdescrip) > 20 && isset($jobdata['filecreating_substatus']['e']) && is_array($jobdata['filecreating_substatus']['e']) && isset($backupable_entities[$jobdata['filecreating_substatus']['e']]['shortdescription'])) $sdescrip = $backupable_entities[$jobdata['filecreating_substatus']['e']]['shortdescription'];\n\t\t\t\t$curstage .= ' ('.$sdescrip.')';\n\t\t\t\tif (isset($jobdata['filecreating_substatus']['i']) && isset($jobdata['filecreating_substatus']['t'])) {\n\t\t\t\t\t$stage = min(2, 1 + ($jobdata['filecreating_substatus']['i']/max($jobdata['filecreating_substatus']['t'], 1)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'filescreated':\n\t\t\t$stage = 2;\n\t\t\t$curstage = __('Created file backup zips', 'updraftplus');\n\t\t\t\tbreak;\n\t\t\t// Stage 4\n\t\t\tcase 'clonepolling':\n\t\t\t\t$stage = 4;\n\t\t\t\t$curstage = __('Clone server being provisioned and booted (can take several minutes)', 'updraftplus');\n\t\t\t\tbreak;\n\t\t\tcase 'clouduploading':\n\t\t\t$stage = 4;\n\t\t\t$curstage = __('Uploading files to remote storage', 'updraftplus');\n\t\t\tif ($remote_sent) $curstage = __('Sending files to remote site', 'updraftplus');\n\t\t\tif (isset($jobdata['uploading_substatus']['t']) && isset($jobdata['uploading_substatus']['i'])) {\n\t\t\t\t$t = max((int) $jobdata['uploading_substatus']['t'], 1);\n\t\t\t\t$i = min($jobdata['uploading_substatus']['i']/$t, 1);\n\t\t\t\t$p = min($jobdata['uploading_substatus']['p'], 1);\n\t\t\t\t$pd = $i + $p/$t;\n\t\t\t\t$stage = 4 + $pd;\n\t\t\t\t$curstage .= ' '.sprintf(__('(%s%%, file %s of %s)', 'updraftplus'), floor(100*$pd), $jobdata['uploading_substatus']['i']+1, $t);\n\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'pruning':\n\t\t\t$stage = 5;\n\t\t\t$curstage = __('Pruning old backup sets', 'updraftplus');\n\t\t\t\tbreak;\n\t\t\tcase 'resumingforerrors':\n\t\t\t$stage = -1;\n\t\t\t$curstage = __('Waiting until scheduled time to retry because of errors', 'updraftplus');\n\t\t\t\tbreak;\n\t\t\t// Stage 6\n\t\t\tcase 'finished':\n\t\t\t$stage = 6;\n\t\t\t$curstage = __('Backup finished', 'updraftplus');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t// Database creation and encryption occupies the space from 2 to 4. Databases are created then encrypted, then the next database is created/encrypted, etc.\n\t\t\tif ('dbcreated' == substr($jobstatus, 0, 9)) {\n\t\t\t\t$jobstatus = 'dbcreated';\n\t\t\t\t$whichdb = substr($jobstatus, 9);\n\t\t\t\tif (!is_numeric($whichdb)) $whichdb = 0;\n\t\t\t\t$howmanydbs = max((empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']), 1);\n\t\t\t\t$perdbspace = 2/$howmanydbs;\n\n\t\t\t\t$stage = min(4, 2 + ($whichdb+2)*$perdbspace);\n\n\t\t\t\t$curstage = __('Created database backup', 'updraftplus');\n\n\t\t\t} elseif ('dbcreating' == substr($jobstatus, 0, 10)) {\n\t\t\t\t$whichdb = substr($jobstatus, 10);\n\t\t\t\tif (!is_numeric($whichdb)) $whichdb = 0;\n\t\t\t\t$howmanydbs = (empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']);\n\t\t\t\t$perdbspace = 2/$howmanydbs;\n\t\t\t\t$jobstatus = 'dbcreating';\n\n\t\t\t\t$stage = min(4, 2 + $whichdb*$perdbspace);\n\n\t\t\t\t$curstage = __('Creating database backup', 'updraftplus');\n\t\t\t\tif (!empty($jobdata['dbcreating_substatus']['t'])) {\n\t\t\t\t\t$curstage .= ' ('.sprintf(__('table: %s', 'updraftplus'), $jobdata['dbcreating_substatus']['t']).')';\n\t\t\t\t\tif (!empty($jobdata['dbcreating_substatus']['i']) && !empty($jobdata['dbcreating_substatus']['a'])) {\n\t\t\t\t\t\t$substage = max(0.001, ($jobdata['dbcreating_substatus']['i'] / max($jobdata['dbcreating_substatus']['a'], 1)));\n\t\t\t\t\t\t$stage += $substage * $perdbspace * 0.5;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ('dbencrypting' == substr($jobstatus, 0, 12)) {\n\t\t\t\t$whichdb = substr($jobstatus, 12);\n\t\t\t\tif (!is_numeric($whichdb)) $whichdb = 0;\n\t\t\t\t$howmanydbs = (empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']);\n\t\t\t\t$perdbspace = 2/$howmanydbs;\n\t\t\t\t$stage = min(4, 2 + $whichdb*$perdbspace + $perdbspace*0.5);\n\t\t\t\t$jobstatus = 'dbencrypting';\n\t\t\t\t$curstage = __('Encrypting database', 'updraftplus');\n\t\t\t} elseif ('dbencrypted' == substr($jobstatus, 0, 11)) {\n\t\t\t\t$whichdb = substr($jobstatus, 11);\n\t\t\t\tif (!is_numeric($whichdb)) $whichdb = 0;\n\t\t\t\t$howmanydbs = (empty($jobdata['backup_database']) || !is_array($jobdata['backup_database'])) ? 1 : count($jobdata['backup_database']);\n\t\t\t\t$jobstatus = 'dbencrypted';\n\t\t\t\t$perdbspace = 2/$howmanydbs;\n\t\t\t\t$stage = min(4, 2 + $whichdb*$perdbspace + $perdbspace);\n\t\t\t\t$curstage = __('Encrypted database', 'updraftplus');\n\t\t\t} else {\n\t\t\t\t$curstage = __('Unknown', 'updraftplus');\n\t\t\t}\n\t\t}\n\n\t\t$runs_started = empty($jobdata['runs_started']) ? array() : $jobdata['runs_started'];\n\t\t$time_passed = empty($jobdata['run_times']) ? array() : $jobdata['run_times'];\n\t\t$last_checkin_ago = -1;\n\t\tif (is_array($time_passed)) {\n\t\t\tforeach ($time_passed as $run => $passed) {\n\t\t\t\tif (isset($runs_started[$run])) {\n\t\t\t\t\t$time_ago = microtime(true) - ($runs_started[$run] + $time_passed[$run]);\n\t\t\t\t\tif ($time_ago < $last_checkin_ago || -1 == $last_checkin_ago) $last_checkin_ago = $time_ago;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$next_res_after = (int) $time-time();\n\t\t$next_res_txt = ($is_oneshot) ? '' : sprintf(__(\"next resumption: %d (after %ss)\", 'updraftplus'), $next_resumption, $next_res_after). ' ';\n\t\t$last_activity_txt = ($last_checkin_ago >= 0) ? sprintf(__('last activity: %ss ago', 'updraftplus'), floor($last_checkin_ago)).' ' : '';\n\n\t\tif (($last_checkin_ago < 50 && $next_res_after>30) || $is_oneshot) {\n\t\t\t$show_inline_info = $last_activity_txt;\n\t\t\t$title_info = $next_res_txt;\n\t\t} else {\n\t\t\t$show_inline_info = $next_res_txt;\n\t\t\t$title_info = $last_activity_txt;\n\t\t}\n\t\t\n\t\t$ret .= '<div class=\"updraft_row\">';\n\t\t\n\t\t$ret .= '<div class=\"updraft_col\"><div class=\"updraft_jobtimings next-resumption';\n\n\t\tif (!empty($jobdata['is_autobackup'])) $ret .= ' isautobackup';\n\n\t\t$is_clone = empty($jobdata['clone_job']) ? '0' : '1';\n\n\t\t$clone_url = empty($jobdata['clone_url']) ? false : true;\n\t\t\n\t\t$ret .= '\" data-jobid=\"'.$job_id.'\" data-lastactivity=\"'.(int) $last_checkin_ago.'\" data-nextresumption=\"'.$next_resumption.'\" data-nextresumptionafter=\"'.$next_res_after.'\" title=\"'.esc_attr(sprintf(__('Job ID: %s', 'updraftplus'), $job_id)).$title_info.'\">'.(!empty($backup_label) ? esc_html($backup_label) : $began_at).\n\t\t'</div></div>';\n\n\t\t$ret .= '<div class=\"updraft_col updraft_progress_container\">';\n\t\t\t// Existence of the 'updraft-jobid-(id)' id is checked for in other places, so do not modify this\n\t\t\t$ret .= '<div class=\"job-id\" data-isclone=\"'.$is_clone.'\" id=\"updraft-jobid-'.$job_id.'\">';\n\n\t\t\tif ($clone_url) $ret .= '<div class=\"updraft_clone_url\" data-clone_url=\"' . $jobdata['clone_url'] . '\"></div>';\n\t\n\t\t\t$ret .= apply_filters('updraft_printjob_beforewarnings', '', $jobdata, $job_id);\n\t\n\t\t\tif (!empty($jobdata['warnings']) && is_array($jobdata['warnings'])) {\n\t\t\t\t$ret .= '<ul class=\"disc\">';\n\t\t\t\tforeach ($jobdata['warnings'] as $warning) {\n\t\t\t\t\t$ret .= '<li>'.sprintf(__('Warning: %s', 'updraftplus'), make_clickable(htmlspecialchars($warning))).'</li>';\n\t\t\t\t}\n\t\t\t\t$ret .= '</ul>';\n\t\t\t}\n\t\n\t\t\t$ret .= '<div class=\"curstage\">';\n\t\t\t// $ret .= '<span class=\"curstage-info\">'.htmlspecialchars($curstage).'</span>';\n\t\t\t$ret .= htmlspecialchars($curstage);\n\t\t\t// we need to add this data-progress attribute in order to be able to update the progress bar in UDC\n\n\t\t\t$ret .= '<div class=\"updraft_percentage\" data-info=\"'.esc_attr($curstage).'\" data-progress=\"'.(($stage>0) ? (ceil((100/6)*$stage)) : '0').'\" style=\"height: 100%; width:'.(($stage>0) ? (ceil((100/6)*$stage)) : '0').'%\"></div>';\n\t\t\t$ret .= '</div></div>';\n\t\n\t\t\t$ret .= '<div class=\"updraft_last_activity\">';\n\t\t\t\n\t\t\t$ret .= $show_inline_info;\n\t\t\tif (!empty($show_inline_info)) $ret .= ' - ';\n\n\t\t\t$file_nonce = empty($jobdata['file_nonce']) ? $job_id : $jobdata['file_nonce'];\n\t\t\t\n\t\t\t$ret .= '<a data-fileid=\"'.$file_nonce.'\" data-jobid=\"'.$job_id.'\" href=\"'.UpdraftPlus_Options::admin_page_url().'?page=updraftplus&action=downloadlog&updraftplus_backup_nonce='.$file_nonce.'\" class=\"updraft-log-link\">'.__('show log', 'updraftplus').'</a>';\n\t\t\t\tif (!$is_oneshot) $ret .=' - <a href=\"#\" data-jobid=\"'.$job_id.'\" title=\"'.esc_attr(__('Note: the progress bar below is based on stages, NOT time. Do not stop the backup simply because it seems to have remained in the same place for a while - that is normal.', 'updraftplus')).'\" class=\"updraft_jobinfo_delete\">'.__('stop', 'updraftplus').'</a>';\n\t\t\t$ret .= '</div>';\n\t\t\n\t\t$ret .= '</div></div>';\n\n\t\treturn $ret;\n\n\t}", "public function printRefreshScript()\n {\n if (isset($_GET['post']) && is_numeric($_GET['post']) && isset($_GET['action']) && $_GET['action'] == \"edit\") {\n\n //Store post id to var\n $post_id = $_GET['post'];\n\n //Check if is published && url is valid\n if (get_post_status($post_id) == 'publish') {\n $url = get_permalink($post_id);\n\n if (!filter_var($url, FILTER_VALIDATE_URL) === false) {\n if (function_exists('curl_init')) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);\n curl_setopt($ch, CURLOPT_TIMEOUT_MS, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_exec($ch);\n curl_close($ch);\n echo '<!-- Cache redone for ' . $url . ' -->';\n }\n }\n }\n }\n }", "public function meta_box_html() {\r\n // Use nonce for verification\r\n wp_nonce_field( plugin_basename( __FILE__ ), self::NONCE_KEY );\r\n $old_meta_value = get_post_meta(get_the_ID(), self::URL_META_KEY, true);\r\n\r\n $key = self::URL_META_KEY;\r\n\r\n $html = <<<EOT\r\n<label for=\"$key\">The address of the downloadable resource</label>\r\n<input type=\"text\" id=\"$key\" name=\"$key\" placeholder=\"Paste it in or click the button below\" style=\"width:100%\" value=\"$old_meta_value\" />\r\n<a href=\"#\" id=\"ah-dl-res-upload\" class=\"button-primary\" style=\"margin-top:10px\">Upload or Select Resource</a>\r\nEOT;\r\n echo $html;\r\n }", "public static function meta_prefix() { return 'meta_'; }", "function top10_how_big_of_a_countdown() {\r\n add_meta_box( \r\n 'top10_howbigid',\r\n __( 'How many entries in your countdown?', 'top10_textdomain' ),\r\n 'top10_howmany_custombox',\r\n 'charts',\r\n 'side' \r\n );\r\n}", "function scbirs_add_theme_meta() {\r\n?>\r\n\t<meta name=\"theme-color\" content=\"#005fab\">\r\n<?php\r\n}", "function generer_webmaster_tools(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['webmaster_tools']['id'])\n\t\treturn '<meta name=\"google-site-verification\" content=\"' . $config['webmaster_tools']['id'] . '\" />\n\t\t';\n}", "public static function updateJob(array $job) {\n\t\t$job['uuid'] = self::$jobs[$job['name']]['uuid'];\n\t\t$job['running'] = false;\n\t\t$job['next'] = time();\n\t\t$job['period'] = (int)$job['period'];\n\t\t$job['laststart'] = 0;\n\t\t$job['lastend'] = 0;\n\t\t$job['lastruntime'] = 0;\n\t\t$job['runtime_count'] = (isset($job['runtime_count']))?$job['runtime_count']:0;\n\t\tself::loadJob ($job);\n\t\tself::$jobs[$job['name']] = $job;\n\t}", "function print_meta_tag() : void {\n\n\t$payment_pointer_id = get_payment_pointer();\n\t$payment_pointer_url = $payment_pointer_id;\n\n\t// check if url starts with $\n\tif ( $payment_pointer_url[0] === '$' ) {\n\t\t// replace $ with https://\n\t\t$payment_pointer_url = str_replace( '$', 'https://', $payment_pointer_url );\n\t\t// remove trailing slash\n\t\t$payment_pointer_url = rtrim( $payment_pointer_url, '/' );\n\t\t// check if url path exists\n\t\t$parsed_url = wp_parse_url( $payment_pointer_url, PHP_URL_PATH );\n\n\t\t// if no url path, append /.well-known/pay\n\t\tif ( empty( $parsed_url ) ) {\n\t\t\t$payment_pointer_url = $payment_pointer_url . '/.well-known/pay';\n\t\t}\n\t}\n\n\tif ( ! empty( $payment_pointer_id ) ) {\n\t\techo '<meta name=\"monetization\" content=\"' . esc_attr( $payment_pointer_id ) . '\" />' . PHP_EOL;\n\t\techo '<link rel=\"monetization\" href=\"' . esc_url( $payment_pointer_url ) . '\" />' . PHP_EOL;\n\t}\n}", "public static function redisKey($job, $suffix = null)\n {\n $id = $job instanceof Job ? $job->id : $job;\n return 'job:'.$id.($suffix ? ':'.$suffix : '');\n }", "protected function completeJob() {\n\t\t$this->isComplete = 1;\n\t\t$nextgeneration = new CheckExternalLinksJob();\n\t\tsingleton('QueuedJobService')->queueJob($nextgeneration,\n\t\t\tdate('Y-m-d H:i:s', time() + self::$regenerate_time));\n\t}", "public function getJobTitleSnippet()\n {\n return $this->job_title_snippet;\n }", "function get_tags_theme_color( $color = '' ) {\n if ( $color != '' ) {\n $color = trim($color);\n\n echo '<meta name=\"theme-color\" content=\"'. $color .'\">\n <meta name=\"msapplication-navbutton-color\" content=\"'. $color .'\">\n <meta name=\"msapplication-TileColor\" content=\"'. $color .'\">'; \n }\n}", "function mrl_header_stats() {\r\n echo '\r\n\t<meta name=\"my_reading_library-version\" content=\"' . MY_READING_LIBRARY_VERSION . '\" />\r\n\t';\r\n}", "function meta($name, $content=\"\") {\n\t\t$this->metas[] = array('name' => $name, 'content' => $content);\n\t}", "public function getRefreshToken(): string\n {\n return $this->refreshToken;\n }" ]
[ "0.5553795", "0.5495498", "0.5284777", "0.5073107", "0.5024384", "0.4948716", "0.484749", "0.47670558", "0.4755446", "0.4730493", "0.47303286", "0.4727941", "0.4685859", "0.46691576", "0.45979935", "0.45710647", "0.4550897", "0.4529667", "0.45258212", "0.45251584", "0.45077673", "0.4493146", "0.448349", "0.4468174", "0.44657966", "0.44575554", "0.44390872", "0.44292048", "0.4365275", "0.43532905", "0.43500602", "0.4342443", "0.43319687", "0.4330457", "0.43263203", "0.43263203", "0.43236896", "0.43158573", "0.43113968", "0.43099293", "0.43074015", "0.4303812", "0.42971087", "0.42935756", "0.42877638", "0.42872536", "0.42869738", "0.42827165", "0.4274551", "0.42592815", "0.42592815", "0.42585233", "0.42470875", "0.4241386", "0.42202258", "0.42188624", "0.4216525", "0.42161646", "0.4204194", "0.4190572", "0.41820672", "0.41792697", "0.41791168", "0.41522774", "0.41412106", "0.41392967", "0.41374862", "0.41295612", "0.41289854", "0.41271925", "0.4124685", "0.4123934", "0.41203487", "0.4118404", "0.41096708", "0.41036463", "0.40985695", "0.4093431", "0.40895513", "0.40848267", "0.40839893", "0.40811548", "0.40777", "0.4075205", "0.4072697", "0.40697986", "0.40659606", "0.40593567", "0.40555644", "0.4051361", "0.4050266", "0.40482113", "0.40461117", "0.4046049", "0.4045614", "0.40438962", "0.40428954", "0.40412578", "0.40374872", "0.40365148" ]
0.73170316
0
Ensure password validation is irrelevant
public function testIsVerificationCodeValidForUser() { $this->ensurePasswordValidationReturns(true); Craft::$app->getConfig()->getGeneral()->verificationCodeDuration = 172800; $this->updateUser([ // The past. 'verificationCodeIssuedDate' => '2018-06-06 20:00:00', ], ['id' => $this->activeUser->id]); $this->assertFalse( $this->users->isVerificationCodeValidForUser($this->activeUser, 'irrelevant_code') ); // Now the code should be present - within 2 day window $this->updateUser([ // The present. 'verificationCodeIssuedDate' => Db::prepareDateForDb(new DateTime('now')), ], ['id' => $this->activeUser->id]); $this->assertTrue( $this->users->isVerificationCodeValidForUser($this->activeUser, 'irrelevant_code') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInvalidLengthPassword()\n {\n $password = \"23d3\";\n $response = $this->user->isValidPassword($password);\n\n $this->assertFalse($response);\n }", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "public function authenticationWithValidAlphaCharClassPassword() {}", "function passwordValid($password) {\n\treturn true;\n}", "public function testInvalidConfirmPassword()\n\t{\n\t\t$this->validator->isPassword(self::USER1_PASSWORD, self::INVALID_PASSWORD);\n\t}", "function check_password($password)\n{\n if (strlen($password) < 8) {\n throw new Exception(\"password_short.\", 1);\n return false;\n }\n if (!preg_match(\"/[0-9]{1,}/\", $password) || !preg_match(\"/[A-Z]{1,}/\", $password)) {\n throw new Exception(\"password_bad\", 1);\n return false;\n }\n return true;\n}", "function sanitizePassword() {\n // If there is a password confirmation we put it to the checker, too\n $passCheckerInput = (strlen($this->passwordConf) > 0) ?\n array($this->password, $this->passwordConf) : $this->password;\n $passwordChecker = new PasswordChecker($passCheckerInput);\n if ($passwordChecker->getRelevance()) {\n $this->password = htmlspecialchars($this->password);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "function isValidPassword($password)\n{\n $len = strlen($password);\n if ($len < MIN_PASSWORD) {\n return false;\n }\n return true;\n}", "public function checkPassword($value);", "function isValidPassword2($password)\n{\n return checkLength($password) && specialChar($password) && containsUpperAndLower($password);\n}", "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function testValidLengthPassword()\n {\n $password = \"accepted\";\n\n $response = $this->user->isValidPassword($password);\n\n $this->assertTrue($response);\n }", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function isPasswordField() {}", "public function testRegistrationPasswordsDontMatch(): void { }", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function authenticationWithValidNumericCharClassPassword() {}", "public function setPasswordcheck($password)\n {\n // Do nothing\n }", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', 'Incorrect password.');\n }\n }", "public function testRegistrationPasswordOnlyLowerCase(): void { }", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "public function authenticationWithValidAsciiSpecialCharClassPassword() {}", "function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}", "function testPassword()\n {\n $this->f->_isSubmitted = true;\n $this->assertEquals(\"\", $this->f->password());\n $this->assertEquals(\"V\", $this->f->password(\"L\", \"H\", \"V\"));\n $val = &$this->f->password(\"L\", \"H\", \"V\");\n $this->f->error();\n $this->assertTrue($this->f->_hasErrors);\n $this->assertEquals(\"\", $val);\n }", "public function isPassword($password);", "function testPasswordErr($password) {\n if (empty($password)) {\n $passwordErr = 'Password required';\n } else {\n $password = test_input($password);\n //VALIDATE PASSWORD\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }\n return $passwordErr;\n }", "function password_security($tested_password){\r\n $isSecured = false;\r\n $contains_letter = preg_match('/[a-zA-Z]/', $tested_password);\r\n $contains_capital = preg_match('/[A-Z]/', $tested_password);\r\n $contains_digit = preg_match('/\\d/', $tested_password);\r\n $contains_special = preg_match('/[^a-zA-Z\\d]/', $tested_password);\r\n\r\n $contains_all = $contains_letter && $contains_capital && $contains_digit && $contains_special;\r\n\r\n if (strlen($tested_password) >= 8 && $contains_all == \"1\") {\r\n $isSecured = true;\r\n }\r\n return $isSecured;\r\n}", "function validate_password($field) {\n\t\tif ($field == \"\") return \"No Password was entered.<br>\";\n\t\telse if (strlen($field) < 6)\n\t\t\treturn \"Password must be at least 6 characters.<br>\";\n\t\telse if (!preg_match(\"/[a-z]/\",$field) || !preg_match(\"/[A-Z]/\",$field) || !preg_match(\"/[0-9]/\",$field) )\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.<br>\";\n\t\treturn \"\";\n\t}", "public function testPasswordIsValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n $user = $this->getUser();\n\n if (!$user || !$user->validatePassword($this->password)) {\n $this->addError('password', Yii::t('app','Falscher Benutzername oder falsches Passwort.'));\n }\n }\n }", "private function pre_defined_password(): string\r\n {\r\n $regx = \"/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[#$@!%&*?])[A-Za-z\\d#$@!%&*?]{6,30}$/\";\r\n if (!preg_match($regx, $this->field)) {\r\n return $this->message(\"must 1 uppercase, lowercase, number & special char\");\r\n }\r\n }", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "private function validate_password($password){\n\t\treturn TRUE;\n\t}", "public function testPasswordIsNotValid($data)\n {\n $pattern = \"/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/\";\n \n\n $this->assertDoesNotMatchRegularExpression($pattern,$data);\n\n }", "function is_valid_password($password)\n{\n if (is_null($password) || strlen($password) < 6 || strlen($password) > 40)\n {\n return false;\n }\n $pattern = \"/^[a-z0-9~`!@#\\$%\\^&\\*\\-_\\+=\\(\\)\\{\\}\\[\\]\\|:;\\\"\\'\\<\\>\\.,\\?\\/]{6,40}$/i\";\n\n return (preg_match($pattern, $password) == 1);\n}", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "function wp_validate_application_password($input_user)\n {\n }", "public function testValidatePassword()\n\t{\n\t\t$return = $this->auth->register($this->email, $this->password, $this->password . $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.password_nomatch\"));\n\n\t\t// using short password\n\t\t$return = $this->auth->register($this->email, $this->shortPassword, $this->shortPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_short'));\n\n\t\t// using weak password\n\t\t$return = $this->auth->register($this->email, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\t}", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "function sanitize_password(string $text = '')\n{\n return filter_var($text, FILTER_SANITIZE_STRING);\n}", "public function testRegistrationPasswordOnlyUpperCase(): void { }", "function valid_password($pwd) {\n\t\tif (!$pwd)\n\t\t\treturn FALSE;\n\t\tif (strlen($pwd) < 6)\n\t\t\treturn FALSE;\n\t\tif (!preg_match('/[a-zA-Z]+/', $pwd) || !preg_match('/[0-9]+/', $pwd))\n\t\t\treturn FALSE;\n\t\treturn TRUE;\n\t}", "public function check_password($password)\n {\n }", "function validate_password($password)\r\n\t{\r\n\t\tif($this->dont_allow_3_in_a_row($password) === FALSE)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\tif(preg_match(REGEX_PASSWORD, $password) !== 1)\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "public function testPlainPassword()\n {\n $user = new User();\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n $user->setPlainPassword('dd');\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n\n $user->setPlainPassword($this->createString(128));\n $constraintViolationList = $this->validator->validate($user, null, [User::VALIDATION_GROUP_PLAIN_PASSWORD]);\n Assert::assertEquals('plainPassword', $constraintViolationList->get(0)->getPropertyPath());\n\n }", "public function hasPassword() : bool;", "public function enforceRulePassword($data){\n if (strlen($data) >= 8){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t/*if (preg_match (\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-zA-Z]).*$/\", $data)){\n \t$validPassword= $data;\n \t} \n \telse{\n \t$validPassword= FALSE;\n\t\t\t}*/\n\t\t\t\n\t\t\treturn $validPassword;\n }", "function checkPassword($clientPassword)\n{\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\n return preg_match($pattern, $clientPassword);\n}", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "function validate_password($password)\n {\n $reg1='/[A-Z]/'; //Upper case Check\n $reg2='/[a-z]/'; //Lower case Check\n $reg3='/[^a-zA-Z\\d\\s]/'; // Special Character Check\n $reg4='/[0-9]/'; // Number Digit Check\n $reg5='/[\\s]/'; // Number Digit Check\n\n if(preg_match_all($reg1,$password, $out)<1) \n return \"There should be atleast one Upper Case Letter...\";\n\n if(preg_match_all($reg2,$password, $out)<1) \n return \"There should be atleast one Lower Case Letter...\";\n\n if(preg_match_all($reg3,$password, $out)<1) \n return \"There should be atleast one Special Character...\";\n\n if(preg_match_all($reg4,$password, $out)<1) \n return \"There should be atleast one numeric digit...\";\n \n if(preg_match_all($reg5,$password, $out)>=1) \n return \"Spaces are not allowed...\";\n\n if(strlen($password) <= 8 || strlen($password) >= 16 ) \n return \"Password Length should be between 8 and 16\";\n\n return \"OK\";\n }", "function testGeneratePassword() {\r\n $this->User = new User();\r\n \t\t$pass = $this->User->generatePassword(); \t\r\n \t$this->assertNotNull($pass);\r\n \t$this->assertPattern('#[a-zA-Z0-9]{6,15}#', $pass, 'Password is not between 6 and 15 chars long');\r\n }", "static function checkPasswords($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d!@#$%][\\W\\w\\d!@#$%]{8,20}$/', $input)) {\r\n return true;//Illegal Character found\r\n } else{\r\n echo PageBuilder::printError(\"Password should be between 8 to 20 characters long with alphabets, at the least one number and at the least one special characters from ! @ # $ %.\");\r\n return false;\r\n }\r\n }", "static function checkPasswords($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d!@#$%][\\W\\w\\d!@#$%]{8,20}$/', $input)) {\r\n return true;//Illegal Character found\r\n } else{\r\n echo PageBuilder::printError(\"Password should be between 8 to 20 characters long with alphabets, at the least one number and at the least one special characters from ! @ # $ %.\");\r\n return false;\r\n }\r\n }", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n if (!$this->user->validatePassword($this->old_password)) {\n $this->addError('old_password', 'Incorrect email or password.');\n }\n }\n }", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function authenticationWithValidLatin1UmlautCharClassPassword() {}", "public function validate_password($password){\nif(!preg_match('%\\A(?=[-_a-zA-Z0-9]*?[A-Z)(?=[-_a-zA-Z0-9]*?[a-z])(?=[-_a-zA-Z0-9]*?[0-9])\\S{6,}\\z%', $password)){\n\treturn false;\n\t}else{\n\t\treturn true;\n\t\t}\n}", "public function validatePassword($attribute, $params)\n\t{\n\t\tif ($this->password !== $this->repeatePassword) {\n\t\t\t$this->addError($attribute, 'Пароль не совпадает.');\n\t\t}\n\t}", "public function isPasswordValid(string $encoded, string $raw);", "public function testUpdatePasswordNotGiven(): void { }", "function password($pass)\n\t{\n\t\tif (strcmp($pass, AUCTION_PASSWORD))\n\t\t\texit(\"Wrong password\");\n\t}", "function passwordGood($pass) {\n\t// default encoding/encoding specified in php.ini for nginx's php fpm module\n\t// is 'UTF-8'\n\t$len = mb_strlen($pass);\n\t//$len = strlen($pass);\n\t// original code of ($len >= 8 && $len <= 24) doesn't seem to work since I think\n\t// when true these return 1, when false they seem to return nothing, when printed empty string\n\t// be careful, these seem to return nothing or they don't print properly\n\t// this does work though :P\n\tif ( ( $len < 8 ) || ( $len > 24 ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "public function testUpdatePasswordsDontMatch(): void { }", "public function validatePassword(User $user, $password);", "public function isValidPassword($uid, $password);", "function checkPassword($clientPassword){\r\n $pattern = '/^(?=.*[[:digit:]])(?=.*[[:punct:]])(?=.*[A-Z])(?=.*[a-z])([^\\s]){8,}$/';\r\n return preg_match($pattern, $clientPassword);\r\n }", "function validatePassword($pwd) {\r\n\t\treturn (strlen($pwd) >= 6 && preg_match_all(\"/[0-9]/\", $pwd) >= 2);\r\n\t}", "protected function validatePassword($password) \n {\n if (!empty($password)) {\n if (strlen($password) < '8') {\n $this->errors[] = PASSWORD_TOO_SHORT;\n }\n if (!preg_match(\"#[0-9]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_NUMBER;\n }\n if (!preg_match(\"#[A-Z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_UPPERCASE;\n }\n if (!preg_match(\"#[a-z]+#\", $password)) {\n $this->errors[] = PASSWORD_NEEDS_LOWERCASE;\n }\n } else {\n $this->errors[] = PASSWORD_MISSING;\n }\n }", "function validPassword($password){\t\r\n \tglobal $API;\r\n return $API->userValidatePassword($this->username,$password); \r\n }", "function isPasswordStrong($password){\r\n\t\tif(strlen($password) < 8)\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[0-9]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[A-Z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[a-z]+#\",$password))\r\n\t\treturn false;\r\n\t\tif(!preg_match(\"#[\\W_]+#\",$password))\r\n\t\treturn false;\r\n\r\n\t\treturn true;\r\n\t}", "public function testRegistrationPasswordOnlyNumbers(): void { }", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "public function authenticationWithValidLatin1SpecialCharClassPassword() {}", "function valid_pass($password)\n {\n $r2 = '/[A-z]/'; //lowercase\n $r3 = '/[0-9]/'; //numbers\n $r4 = '/[~!@#$%^&*()\\-_=+{};:<,.>?]/'; // special char\n\n /*if (preg_match_all($r1, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个大写字母,请返回修改!\";\n return FALSE;\n }*/\n if (preg_match_all($r2, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个字母,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n if (preg_match_all($r3, $password, $o) < 1) {\n $msg = \"密码必须包含至少一个数字,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n /*if (preg_match_all($r4, $candidate, $o) < 1) {\n $msg = \"密码必须包含至少一个特殊符号:[~!@#$%^&*()\\-_=+{};:<,.>?],请返回修改!\";\n return FALSE;\n }*/\n if (strlen($password) < 8) {\n $msg = \"密码必须包含至少含有8个字符,请返回修改!\";\n return ['code' => -1, 'msg' => $msg];\n }\n return ['code' => 0, 'msg' => 'success'];\n }", "function validatePassword($value){\n if (is_int($value)) throw new Exception (\"Password must consist of letters and, if needed, numbers\"); #PASS (Check the string to int if all are numbers)\n $passwordMinLength=7;\n $passwordMaxLength=18;\n if (strlen($value)<=$passwordMinLength || strlen($value)>=$passwordMaxLength){\n throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n //return;\n } else{\n //throw new Exception (\"Wrong password length. It must be >\".$passwordMinLength.\" and <\".$passwordMaxLength.\" in size\");\n }\n //return;\n}", "public function testUpdatePasswordOnlyLowerCase(): void { }", "function minimum_password_limit( & $errors ) {\r\n\t$min_length = 12;\r\n\tif ( !empty( $_POST['pass1'] ) && $_POST['pass1'] === $_POST['pass2'] && !preg_match('/^.*(?=.{12,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', $_POST['pass1']) ) {\r\n\t\t$errors->add( 'min_pass_length', sprintf( __( '<strong>Security advice</strong>: Your password must be at least %d characters long and have at least one capital letter and one number in it.' ), $min_length ), array( 'form-field' => 'pass1' ) );\r\n\t}\r\n}", "public function testLongPassword ()\n {\n // Function parameters\n $length = 20;\n $minPasswordRequirements = [];\n // Helper\n $securityHelper = new SecurityHelper(new Security()); // Empty security (it does not matter)\n // Check password correctness\n $ok = true;\n for ($i = 0; $i < self::ITERATIONS; $i++) {\n $password = $securityHelper->generatePassword($length, $minPasswordRequirements);\n $result = preg_match('/\\A[0-9a-zA-Z!#$%&*+,-.:;<=>?@_~]{20,}\\z/', $password);\n if ($result === 0) {\n $ok = false;\n break;\n }\n }\n $this->assertTrue($ok);\n }", "function validate($firstpw, $secondpw) {\n\tif(strcmp($firstpw, $secondpw) == 0) {\n\t\t// Booleans to check password complexity - if true, then firstpw is ok\n\t\t$uppercase = preg_match('@[A-Z]@', $firstpw);\n\t\t$lowercase = preg_match('@[a-z]@', $firstpw);\n\t\t$number = preg_match('@[0-9]@', $firstpw);\n\t\tif($uppercase && $lowercase && $number && strlen($firstpw) > 8) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "public function valida_password($password){\n\t\tif (preg_match(\"/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/\", $password)) \n\t\t\techo \"Su password es seguro.\"; \n\t\telse echo \"Su password no es seguro.\";\n\n\t}", "public function check_password_strength($password){\n // Validate password strength\n $uppercase = preg_match('@[A-Z]@', $password);\n $lowercase = preg_match('@[a-z]@', $password);\n $number = preg_match('@[0-9]@', $password);\n $specialChars = preg_match('@[^\\w]@', $password);\n\n if(!$uppercase || !$lowercase || !$number || !$specialChars || strlen($password) < 8) {\n $GLOBALS['error_message'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number, and one special character.';\n return false;\n }else{\n return true;\n }\n }", "static function valid_password($input) {\n return strlen($input) > 5 && trim($input) === $input;\n }", "public function validatePassword($password)\t{\n\t\treturn crypt($password,$this->password) === $this->password;\n\t}", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "function validatePassword($pass) {\n\t\t$l = getOption('min_password_lenght');\n\t\tif ($l > 0) {\n\t\t\tif (strlen($pass) < $l) return sprintf(gettext('Password must be at least %u characters'), $l);\n\t\t}\n\t\t$p = getOption('password_pattern');\n\t\tif (!empty($p)) {\n\t\t\t$strong = false;\n\t\t\t$p = str_replace('\\|', \"\\t\", $p);\n\t\t\t$patterns = explode('|', $p);\n\t\t\t$p2 = '';\n\t\t\tforeach ($patterns as $pat) {\n\t\t\t\t$pat = trim(str_replace(\"\\t\", '|', $pat));\n\t\t\t\tif (!empty($pat)) {\n\t\t\t\t\t$p2 .= '{<em>'.$pat.'</em>}, ';\n\n\t\t\t\t\t$patrn = '';\n\t\t\t\t\tforeach (array('0-9','a-z','A-Z') as $try) {\n\t\t\t\t\t\tif (preg_match('/['.$try.']-['.$try.']/', $pat, $r)) {\n\t\t\t\t\t\t\t$patrn .= $r[0];\n\t\t\t\t\t\t\t$pat = str_replace($r[0],'',$pat);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$patrn .= addcslashes($pat,'\\\\/.()[]^-');\n\t\t\t\t\tif (preg_match('/(['.$patrn.'])/', $pass)) {\n\t\t\t\t\t\t$strong = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$strong)\treturn sprintf(gettext('Password must contain at least one of %s'), substr($p2,0,-2));\n\t\t}\n\t\treturn false;\n\t}", "function checkPassword($password, $username = false) {\n $length = strlen($password);\n\n if ($length < 8) {\n return FALSE;\n } elseif ($length > 32) {\n return FALSE;\n } else {\n\n//check for a couple of bad passwords:\n if ($username && strtolower($password) == strtolower($username)) {\n return FALSE;\n } elseif (strtolower($password) == 'password') {\n return FALSE;\n } else {\n\n preg_match_all(\"/(.)\\1{2}/\", $password, $matches);\n $consecutives = count($matches[0]);\n\n preg_match_all(\"/\\d/i\", $password, $matches);\n $numbers = count($matches[0]);\n\n preg_match_all(\"/[A-Z]/\", $password, $matches);\n $uppers = count($matches[0]);\n\n preg_match_all(\"/[^A-z0-9]/\", $password, $matches);\n $others = count($matches[0]);\n\n//see if there are 3 consecutive chars (or more) and fail!\n if ($consecutives > 0) {\n return FALSE;\n } elseif ($others > 1 || ($uppers > 1 && $numbers > 1)) {\n//bulletproof\n return TRUE;\n } elseif (($uppers > 0 && $numbers > 0) || $length > 14) {\n//very strong\n return TRUE;\n } else if ($uppers > 0 || $numbers > 2 || $length > 9) {\n//strong\n return TRUE;\n } else if ($numbers > 1) {\n//fair\n return FALSE;\n } else {\n//weak\n return FALSE;\n }\n }\n }\n return $returns;\n}", "public function testRegisterShortPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMinStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 6, 'password_confirmation');\n }", "public function testIsValidLogIn_InCorrectPassword_ReturnsErrorMessage()\n {\n $user = new User();\n\n $user -> email = \"[email protected]\";\n $user -> password = \"secret\";\n\n $this->browse(function ($browser) use ($user) {\n $browser->visit('/login')\n ->pause(1000)\n ->type('@login-email-input', $user->email)\n ->type('@login-password-input', 'test')\n ->click('@login-button')\n ->assertSee('These credentials do not match our records.');\n });\n }", "public function passwordEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // also check if it matches confirmpassword\r\n // set the var equal to function call of getpassword\r\n $password = $this->getPassword();\r\n // If the fields empty\r\n if ( empty($password) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } \r\n // Calls the password function above and if its not equal to the orgincal password returns error\r\n else if ( $this->getConfirmpassword() !== $this->getPassword() ){\r\n // Message displayed to user\r\n $this->errors[\"password\"] = \"Password does not match confirmation password.\";\r\n }\r\n // Also goes test the password against the password is valid function in the validator class\r\n else if ( !Validator::passwordIsValid($this->getPassword()) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "protected function is_password_valid($not_strict = true , String $password = '') : bool\n {\n\n $password = $password ? $password : @$_POST['password'];\n\n if(!$password and $not_strict) return true;\n\n return preg_match(\"/([A-Z])+([a-z])+([0-9])/\",$password);\n\n }", "public function password($password);", "function nrua_check_password($pwd) {\n\t$errors = [];\n\t\n\tif (strlen($pwd) < 8) {\n\t$errors[] = \"Password too short!\";\n\t}\n\t\n\tif (!preg_match(\"#[0-9]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one number!\";\n\t}\n\t\n\tif (!preg_match(\"#[a-zA-Z]+#\", $pwd)) {\n\t$errors[] = \"Password must include at least one letter!\";\n\t}\n\t\n\treturn $errors;\n}", "public function testRegisterLongPassword() {\n $generic = new GenericValidationTests($this);\n $generic->testMaxStringAttribute('register', 'POST', self::$headers, self::$body, 'password', 30, 'password_confirmation');\n }" ]
[ "0.761173", "0.7591865", "0.7591865", "0.7591865", "0.7560198", "0.7541089", "0.7529831", "0.75256544", "0.738494", "0.7331837", "0.73286754", "0.73284465", "0.73233366", "0.73036295", "0.7293361", "0.7251106", "0.7245807", "0.7228457", "0.7228457", "0.7228457", "0.7226696", "0.72252417", "0.71955085", "0.7179748", "0.7179748", "0.7179748", "0.7174755", "0.71348107", "0.71289504", "0.7107137", "0.7103311", "0.70983213", "0.7070413", "0.7055377", "0.7049686", "0.70311147", "0.70189804", "0.7009791", "0.6997598", "0.699669", "0.6988306", "0.69881976", "0.69770145", "0.6963224", "0.6956587", "0.694824", "0.6946061", "0.6925642", "0.69145584", "0.69065744", "0.6905661", "0.69031674", "0.6884772", "0.6884553", "0.68791205", "0.6878827", "0.6878585", "0.6878585", "0.68750864", "0.68727404", "0.6872499", "0.6872499", "0.6872499", "0.6868933", "0.6863934", "0.6859338", "0.6857449", "0.68557084", "0.68306005", "0.68267685", "0.6815245", "0.68121433", "0.68051606", "0.6798524", "0.67857236", "0.6781902", "0.67764723", "0.6767412", "0.6759416", "0.6759416", "0.6759416", "0.6758918", "0.6756558", "0.675651", "0.6756348", "0.67420006", "0.67270297", "0.6723333", "0.6721493", "0.6715188", "0.671457", "0.6698258", "0.66977876", "0.66917694", "0.6688635", "0.6686323", "0.6683272", "0.6673485", "0.6670373", "0.6668398", "0.666026" ]
0.0
-1
Ensure we know what the unhashed code is so we can compare against it later.
public function testSendActivationEmail() { $this->tester->mockCraftMethods('security', [ 'generateRandomString' => $string = StringHelper::randomString(32) ]); // Test send activation email with password null $this->pendingUser->password = null; $this->users->sendActivationEmail($this->pendingUser); $this->testUsersEmailFunctions( 'account_activation', 'actions/users/set-password&code='.$string.'' ); $this->pendingUser->password = 'some_password'; $this->users->sendActivationEmail($this->pendingUser); $this->testUsersEmailFunctions( 'account_activation', 'actions/users/verify-email&code='.$string.'' ); $this->pendingUser->password = null; // Test send Email Verify $this->users->sendNewEmailVerifyEmail($this->pendingUser); $this->testUsersEmailFunctions( 'verify_new_email', 'actions/users/verify-email&code='.$string.'' ); // Test password reset email $this->users->sendPasswordResetEmail($this->pendingUser); $this->testUsersEmailFunctions( 'forgot_password', 'actions/users/set-password&code='.$string.'' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkContentHash() {}", "final public function getHash() {}", "public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }", "abstract protected static function getHashAlgorithm() : string;", "function testHash()\n {\n $this->assertEqual($this->referenceHash, auth::hashString($this->referenceClear), \"Testing hash consistency.\");\n }", "public function generateCodeVerifier() \n {\n return rtrim(base64_encode(md5(microtime())), \"=\");\n }", "public function testUnknownHash()\n {\n $this->setExpectedException(\n function_exists( 'password_hash' )\n ? 'PHPUnit_Framework_Error'\n : 'InvalidArgumentException'\n );\n\n Password::hash( $this->examplePassword, -1 );\n }", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "public function run_hash_check() {\n add_action('plugins_loaded', array($this, 'hash_check' ));\n }", "private function getHash()\n {\n if (isset($this->config['hash']) && $this->config['hash']) {\n return $this->config['hash'];\n } else {\n throw new Exception('Please make sure you have set a code with php artisan code:set ****');\n }\n }", "public function restore_code() {\n\t\t$serial = $this->plain_serial();\n\t\t$secret = pack('H*', $this->secret());\n\t\t// take the 10 last bytes of the digest of our data\n\t\t$data = substr(sha1($serial.$secret, true), -10);\n\t\treturn Authenticator_Crypto::restore_code_to_char($data);\n\t}", "public function getHash() {}", "function xss_hash()\n\t{\n\t\tif ($this->xss_hash == '')\n\t\t{\n\t\t\tif (phpversion() >= 4.2)\n\t\t\t\tmt_srand();\n\t\t\telse\n\t\t\t\tmt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);\n\n\t\t\t$this->xss_hash = md5(time() + mt_rand(0, 1999999999));\n\t\t}\n\n\t\treturn $this->xss_hash;\n\t}", "public function hashValidation(){\n\t\t$this->hash_validation = md5(uniqid(rand(), true).$this->email); \n\t\treturn $this->hash_validation;\n\t}", "final function getCode();", "public function verification_hash($code){\n return hash('sha512', $code . config_item('encryption_key'));\n }", "function generate_validation_code()\n {\r\n return hash_hmac($this->hash_function, $this->email,\r\n $this->created_at.hash($this->hash_function, $this->password));\r\n }", "protected function _getSharingRandomCode()\n {\n return Mage::helper('core')->uniqHash();\n }", "public function hash(): string;", "public function __construct()\n {\n //generate identifier only once, here a 64 characters length code\n $this->code = substr(hash('sha512', bin2hex(openssl_random_pseudo_bytes(64))), 0, 64);\n }", "protected function checkSomePhpOpcodeCacheIsLoaded() {}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function is_hashed()\n {\n return true;\n }", "private final function CheckMhash()\r\n\t\t{\r\n\t\t\tif (!function_exists(\"mhash\"))\r\n\t\t\t\tCore::ThrowException(\"Cannot call mhash(). Mhash extension not installed?\", E_ERROR);\r\n\t\t}", "public function hash();", "public function xss_hash() {\n\t\tif ($this->xss_hash == '') {\n\t\t\tif (phpversion() >= 4.2) mt_srand(); else\n\t\t\t\tmt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);\n\n\t\t\t$this->xss_hash = md5(time() + mt_rand(0, 1999999999));\n\t\t}\n\n\t\treturn $this->xss_hash;\n\t}", "public function getHash() /*: string*/ {\n if ($this->hash === null) {\n throw new \\Exception(\"Hash is not initialized\");\n }\n return $this->hash;\n }", "static function getNewCode()\n {\n $code = null;\n while (true) {\n $code = \\User::make_password(8, false);\n if (!self::codeExists($code)) break;\n }\n return $code;\n }", "public function checkHash()\n {\n $config = $this->getDI()->get('config');\n $connect_string = sprintf('http://%s:%s@%s:%s/', $config->eunod->user, $config->eunod->pass, $config->eunod->host, $config->eunod->port);\n $coind = new jsonRPCClient($connect_string);\n\n return $coind->verifymessage($this->masternode_address, $this->signed_msg, $this->telegram_username);\n }", "public function getProtectCode();", "private function hash_validation() { //check hash\n\n\t\t$testMode = getRequest('ik_pw_via');\n\n\t\tif(isset($testMode) && $testMode == 'test_interkassa_test_xts'){\n\t\t\t$secretKey = $this->object->test_key;\n\t\t} else {\n\t\t\t$secretKey = $this->object->secret_key;\n\t\t}\n\n\t\t$data = array();\n\n\t\tforeach ($_REQUEST as $key => $value) {\n if (!preg_match('/ik_/', $key)) continue;\n $data[$key] = $value;\n }\n\n\t\t$ik_sign = $data['ik_sign'];\n\t\t$sign = $this->createSign($data,$secretKey);\n\n\t\t$this->wrlog(\"hash: \".$sign);\n\t\t$this->wrlog(\"ik_sign: \".$ik_sign);\n\t\treturn $sign == $ik_sign ? true : false;\n\t}", "public function getHashIdentifier() : string;", "function calculate_app_version_hash($link, $data, $app_version_id) // Colorize: green\n { // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"SELECT\" // Colorize: green\n . \" hash\" // Colorize: green\n . \" FROM \" . DB_TABLE_APP_FILES // Colorize: green\n . \" WHERE app_version_id = '\" . $link->real_escape_string($app_version_id) . \"'\"; // 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 == 0) // Colorize: green\n { // Colorize: green\n $result->close(); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n $error_details = \"Version is empty\"; // Colorize: green\n error_log($error_details); // Colorize: green\n // Colorize: green\n db_disconnect($link); // Colorize: green\n // Colorize: green\n $data[\"message\"] = \"Internal 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 $res = pack(\"H*\", \"00000000000000000000000000000000\"); // Colorize: green\n // Colorize: green\n while ($row = $result->fetch_row()) // Colorize: green\n { // Colorize: green\n $res ^= pack(\"H*\", $row[0]); // Colorize: green\n } // Colorize: green\n // Colorize: green\n $result->close(); // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return bin2hex($res); // Colorize: green\n }", "public function testHashCode(): void\n {\n $object = new Run();\n $this->assertEquals(md5($object->getFont()->getHashCode() . get_class($object)), $object->getHashCode());\n }", "private static function generateUniqueCode()\n {\n do {\n $code = str_random(7);\n } while (static::checkCode($code));\n\n return $code;\n }", "function wp_hash($data, $scheme = 'auth')\n {\n }", "function protection_code_activation() {\n\t\n\t}", "protected function getHash(): string\n {\n return hash('crc32', md5((string) mt_rand()));\n }", "public function hasCode(){\n return $this->_has(3);\n }", "public function oauthGenerateVerificationCode()\n {\n return substr(md5(rand()), 0, 6);\n }", "function auth() {\r\n\t$code = \"\";\r\n\tfor ($i = 0; $i < 8; $i ++) {\r\n\t\t$code .= (rand(0, 1) ? chr(rand(65, 122)) : rand(0, 9));\r\n\t}\r\n\treturn sha1($code);\r\n}", "public function getHash();", "function getUnusedCode()\n{\n $newcode = createLuhnCheckedRandomString(10);\n\n// while the new string exists, get a new code\n while (file_exists('results/' . $newcode . '-response.json')) {\n $newcode = createLuhnCheckedRandomString(10);\n }\n\n return $newcode;\n}", "protected function getHashAlgo()\n {\n return self::INTERNAL_ALGORITHM;\n }", "function kernel_hash_handle($value) {\r\n\r\n return sprintf(\"%u\", crc32($value . HEX));\r\n\r\n}", "public function testThatEscapeDataWorksAsExpectedHashAlgoSha1() {\n // because \\RendererTest::$hash_algo_index will have a value of 3\n // see \\Rotexsoft\\FileRenderer::hash_algos() in ./tests/bootstrap.php\n \n $this->executeEscapeDataTests();\n }", "function hasher($raw_data, $hashed_data = false)\n{\n if ($hashed_data) {\n if (password_verify($raw_data, $hashed_data)) {\n return true;\n } else {\n return false;\n }\n } else {\n return password_hash($raw_data, PASSWORD_BCRYPT, ['cost' => 12]);\n }\n}", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "static function controlHash($mixed){\n\t\t$data = json_encode($mixed);\n\t\tif(json_last_error()!=JSON_ERROR_NONE) $data = $mixed;\n\t\treturn sha1(md5($data).APP_CONTROL_SECRET);\n\t}", "public function getCode() {}", "public function getHashUnused()\n\t{\n\t\tif (!$this->isUsed())\n\t\t{\n\t\t\t$this->unused = static::getByDomain($this->domain, $this->user);\n\t\t\treturn $this->unused->getHash();\n\t\t}\n\n\t\treturn $this->getHash();\n\t}", "public function testHash() {\n // Initialize variables\n $string = 'Hello World!';\n\n // Create salt\n $salt = security::hash( $string, 'test-method!' );\n\n // MD5 comes back with 32 characters if it worked\n $this->assertEquals( 32, strlen( $salt ) );\n }", "public function xss_hash()\n\t{\n\t\tif ($this->_xss_hash === NULL)\n\t\t{\n\t\t\t$rand = $this->get_random_bytes(16);\n\t\t\t$this->_xss_hash = ($rand === FALSE)\n\t\t\t\t? md5(uniqid(mt_rand(), TRUE))\n\t\t\t\t: bin2hex($rand);\n\t\t}\n\n\t\treturn $this->_xss_hash;\n\t}", "function verify_hash($hash) // Colorize: green\n { // Colorize: green\n return isset($hash) // Colorize: green\n && // Colorize: green\n is_string($hash) // Colorize: green\n && // Colorize: green\n preg_match(MD5_HASH_REGEXP, $hash); // Colorize: green\n }", "public function validationSha($code){\r\n\t\t//variables\r\n\t\t$error = '';\r\n\t\t$user_browser = $_SERVER['HTTP_USER_AGENT']; //navegador\r\n\t\t$ip = $_SERVER['REMOTE_ADDR']; //ip\r\n\t\r\n\t\t$this->where('macro_sha', $code);\r\n\t\tif($salida = $this->getOne('solicitudes_clave')){\r\n\t\t\t\r\n\t\t\tif($salida['navegador'] != $user_browser){\t$error = 'navegador no concide';\t}\r\n\t\t\tif($salida['ip'] != $ip){\t\t\t\t\t$error = 'remote ip no concide';\t}\r\n\t\t\t\r\n\t\t\tif($error != ''){\r\n\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t$nuevo_sha = hash('sha512', $salida['email'].$user_browser.$salida['telefono'].$ip);\r\n\t\t\t\tif($nuevo_sha != $salida['macro_sha']){\r\n\t\t\t\t\t$error = 'Shas no coinciden';\r\n\t\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//succes!!\r\n\t\t\t\t\t$_SESSION['email_val'] = $salida['email'];\r\n\t\t\t\t\t$_SESSION['corrector'] = $salida['salt'];\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t}else{\r\n\t\t\t$error = 'no hubo conexion a db';\r\n\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function get_hash($key = 0)\n {\n }", "public function hashCode() : string;", "public function __construct()\n\t{\n// \t\t$this->code = substr(md5(uniqid(rand(), true)), 0, 6);\n\t}", "public function getVarificationCode(){ \n $pw = $this->randomString(); \n return $varificat_key = password_hash($pw, PASSWORD_DEFAULT); \n }", "public function hash()\n\t{\n\t\t$components = $this->components;\n\t\t\n\t\t/*\n\t\t * Reconstruct the original signature with the data we have about the\n\t\t * source application to verify whether the apps are the same, and\n\t\t * should therefore be granted access.\n\t\t */\n\t\tswitch (strtolower($this->algo)) {\n\t\t\tcase 'sha512':\n\t\t\t\t$calculated = hash('sha512', implode(self::SEPARATOR, array_filter($components)));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Invalid algorithm', 400);\n\t\t}\n\t\t\n\t\treturn new Checksum($this->algo, $calculated);\n\t}", "function check_hash($n){\n\tif(!$n) return;\n\t$hashpos = strpos($n, \"#\");\n\n\tif($hashpos === false){\n\t\t$output = \"#\" . $n;\n\t}else if($hashpos == 0){\n\t\t$output = $n;\n\t}\n\treturn $output;\n}", "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}", "Public Function verifyResetCode($Code)\n\t{\n\t\t$Row = $this->_db->fetchRow('SELECT * FROM bevomedia_user_reset_password WHERE ID = ' . $this->id . ' AND Hash = \"' . $Code .'\"');\n\t\tif(!$Row || !sizeOf($Row))\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t\t\t\n\t}", "protected function checksum_code93($code) {\n\t\t$chars = array(\n\t\t\t'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n\t\t\t'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',\n\t\t\t'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',\n\t\t\t'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%',\n\t\t\t'<', '=', '>', '?');\n\t\t// translate special characters\n\t\t$code = strtr($code, chr(128).chr(131).chr(129).chr(130), '<=>?');\n\t\t$len = strlen($code);\n\t\t// calculate check digit C\n\t\t$p = 1;\n\t\t$check = 0;\n\t\tfor ($i = ($len - 1); $i >= 0; --$i) {\n\t\t\t// FIXME: use strpos() instead and check result\n\t\t\t$k = array_keys($chars, $code[$i]);\n\t\t\t$check += ( (int) $k[0] * $p);\n\t\t\t++$p;\n\t\t\tif ($p > 20) {\n\t\t\t\t$p = 1;\n\t\t\t}\n\t\t}\n\t\t$check %= 47;\n\t\t$c = $chars[$check];\n\t\t$code .= $c;\n\t\t// calculate check digit K\n\t\t$p = 1;\n\t\t$check = 0;\n\t\tfor ($i = $len; $i >= 0; --$i) {\n\t\t\t// FIXME: use strpos() instead and check result\n\t\t\t$k = array_keys($chars, $code[$i]);\n\t\t\t$check += ( (int) $k[0] * $p);\n\t\t\t++$p;\n\t\t\tif ($p > 15) {\n\t\t\t\t$p = 1;\n\t\t\t}\n\t\t}\n\t\t$check %= 47;\n\t\t$checksum = $c.$chars[$check];\n\t\t// restore special characters\n\t\t$checksum = strtr($checksum, '<=>?', chr(128).chr(131).chr(129).chr(130));\n\t\treturn $checksum;\n\t}", "protected function validateChecksum() {\n\t}", "public function xss_hash()\n {\n if ($this->_xss_hash == '')\n {\n mt_srand();\n $this->_xss_hash = md5(strval(time() + mt_rand(0, 1999999999)));\n }\n\n return $this->_xss_hash;\n }", "public function hash_check(){\n $this->read_hash_file();\n\n // read all files hashes\n $this->read_directory();\n\n // save updated md5 hashes\n $this->save_hash_file();\n \n // log changes\n if(!empty($this->md5_gen_old)){\n $this->save_log_file();\n\n // email changes\n if($this->email)\n $this->emailChanges(); \n }\n }", "public function hashCode() {\n raise('lang.MethodNotImplementedException', 'Not implemented', __METHOD__);\n }", "public function generateHash()\n {\n do {\n $hash = Security::randomString(8);\n } while ($this->exists(['hash' => $hash]));\n\n return $hash;\n }", "public function code() {\n\t\t// transform the secret key to binary data\n\t\t$secret = pack('H*', $this->secret());\n\t\t// compute the cycle number\n\t\t$time = (int) ($this->servertime() / $this->waitingtime());\n\t\t// convert the cycle to a 8 bytes unsigned long big endian order\n\t\t$cycle = pack('N*', 0, $time);\n\t\t// calculate HMAC-SHA1 from secret key and cycle\n\t\t$mac = hash_hmac('sha1', $cycle, $secret);\n\t\t// determine which 4 bytes of the MAC are taken as the current code\n\t\t// last 4 bit of the MAC points to the starting byte\n\t\t$start = hexdec($mac{39}) * 2;\n\t\t// select the byte at starting position and the following 3 bytes\n\t\t$mac_part = substr($mac, $start, 8);\n\t\t$code = hexdec($mac_part) & 0x7fffffff;\n\t\t// use the lowest 8 decimal digits from the selected integer as the\n\t\t// current authenticator code\n\t\treturn str_pad($code % 100000000, 8, '0', STR_PAD_LEFT);\n\t}", "function _obfuscate_lYeNkoeMlY2Ph5KGjY6VkIk’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}", "function return_md5_check()\n\t{\n\t\tif ( $this->member['id'] )\n\t\t{\n\t\t\treturn md5( $this->member['email'].'&'.$this->member['member_login_key'].'&'.$this->member['joined'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn md5(\"this is only here to prevent it breaking on guests\");\n\t\t}\n\t}", "function phpbb_email_hash($email)\n{\n\treturn sprintf('%u', crc32(strtolower($email))) . strlen($email);\n}", "static function makeConfirmationHash () {\n while (true) {\n $hash = Common::randHash();\n $result = Database::queryAsObject(\"select hash from t_confirm where hash = '$hash'\");\n if ($result == null)\n return $hash;\n }\n }", "public function getHashCode()\n {\n return $this->hash_code;\n }", "public function hashCode(): string;", "private function overflowProtection($hash): int\n {\n return $hash & 0xffffffff;\n }", "function getUniqueCode($length = \"\") // used in confirm-password.php\r\n\r\n{\t\r\n\r\n\t$code = md5(uniqid(rand(), true));\r\n\r\n\tif ($length != \"\") return substr($code, 0, $length);\r\n\r\n\telse return $code;\r\n\r\n}", "function newCode($var=null, $maxchar=6)\n{\n global $conn;\n\n //gera o código e verifica se ele já existe antes de continuar\n do {\n\n $_code = generateHash($var);\n $_code = justAlphanumeric($_code);\n $code = substr($_code, 0, $maxchar);\n\n if (strlen($code)!=$maxchar)\n $num=1;\n else {\n\n $sql = \"SELECT NULL FROM `\".TP.\"_generated_codes` WHERE `code`=\\\"$code\\\"\";\n $res = $conn->query($sql);\n $num = $res->num_rows;\n\n }\n\n } while ($num>0);\n\n\n return $code;\n}", "abstract public function nonce_check();", "function damm32Check($code) {\r\n\tglobal $base32;\r\n\treturn (damm32Encode($code) == $base32[0]) ? 1 : 0;\r\n\t}", "public function getNewAuthCode()\n {\n // TODO: Implement getNewAuthCode() method.\n }", "protected function _generateVerificationKey() {\n\t\treturn mt_rand(111111,999999);\n\t}", "function checksum_code39($code) {\n\n\t $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n\t 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',\n\t 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',\n\t 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%');\n\t $sum = 0;\n\t for ($i=0 ; $i<strlen($code); $i++) {\n\t $a = array_keys($chars, $code{$i});\n\t $sum += $a[0];\n\t }\n\t $r = $sum % 43;\n\t return $chars[$r];\n\t}", "public function testThatEscapeDataWorksAsExpectedHashAlgoSha256() {\n // because \\RendererTest::$hash_algo_index will have a value of 2\n // see \\Rotexsoft\\FileRenderer::hash_algos() in ./tests/bootstrap.php\n \n $this->executeEscapeDataTests();\n }", "private function getConfirmCode()\n {\n return md5(bin2hex(time()) . time());\n }", "public function createResetCode()\n {\n try {\n return base64_encode(random_bytes(16));\n } catch (Exception $e) {\n return false;\n }\n }", "function createCode() {\n\t\t/* New code. */\n\t\t$code = \"\";\n\t\t$codeAlphabet = \"1234567890\";\n\n\t\t$count = strlen($codeAlphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<5;$i++){\n\t\t\t$code .= $codeAlphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$commentCheck = $this->getCode($code);\n\t\t\n\t\tif($commentCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "protected function hashLockClause_getHashInt() {}", "public static function verifyCode(string $secretKey, string $code) : bool\n {\n $time = time();\n $result = 0;\n\n // Timing attack safe iteration and code comparison\n for ($i = -1; $i <= 1; $i++) {\n $timeSlice = floor($time / self::TIME_WINDOW + $i);\n $result = hash_equals(self::getCode($secretKey, $timeSlice), $code) ? $timeSlice : $result;\n }\n\n return ($result > 0);\n }", "function csrfCode(/*$forceNew*/ /*$ver_name*/){\n\tstatic $code='';\n\tif($_SESSION['ver']&&$code===$_SESSION['ver'])return $code;\n\t\n\treturn ($code=$_SESSION['ver']=genRandStr());\n}", "public function testUnknownSalt()\n {\n Password::salt( -1 );\n }", "function _obfuscate_kouLiIaPjJWUhoqLkYaQjIg’( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ = 1 )\r\n{\r\n $_obfuscate_iJGPjJWLj4uLkIqVjYiHh48’ = unpack( \"C*\", \"ViewZendSourceCodeIsInvalid!\" );\r\n do\r\n {\r\n $_obfuscate_iY2Oh5OGlIqQhpCJi5CMkog’ = ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’] << 4 ) + ( $_obfuscate_lZKViImJjo6UhouJj4aVi4Y’[$_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ + 1] >> 4 );\r\n $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ += 2;\r\n } while ( $_obfuscate_jpKPlJSUiZOHkYaPlIeOiY4’ < 28 );\r\n}", "function evhash( $data, ?string $secretkey = null, string $algo = 'sha256' ): string\n{\n if ( \\is_null( $secretkey ) ) {\n return hash_hmac( $algo, $data, env( 'SECURE_AUTH_KEY' ) );\n }\n\n return hash_hmac( $algo, $data, $secretkey );\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}", "function avoid_duplicate_version($link, $data, $app_id, $app_version_id, $hash) // Colorize: green\n { // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"SELECT\" // Colorize: green\n . \" hash\" // Colorize: green\n . \" FROM \" . DB_TABLE_APP_VERSIONS // Colorize: green\n . \" WHERE app_id = '\" . $link->real_escape_string($app_id) . \"'\" // Colorize: green\n . \" AND completed = '1'\" // Colorize: green\n . \" ORDER BY version DESC\" // Colorize: green\n . \" LIMIT 1\"; // 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 $version_hash = $result->fetch_row()[0]; // Colorize: green\n $result->close(); // Colorize: green\n // Colorize: green\n if ($version_hash == $hash) // Colorize: green\n { // Colorize: green\n // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"DELETE FROM \" . DB_TABLE_APP_FILES // Colorize: green\n . \" WHERE app_version_id = '\" . $link->real_escape_string($app_version_id) . \"'\"; // 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 // Ignore PhpAlignmentVerifier [BEGIN] // Colorize: green\n $sql = \"DELETE FROM \" . DB_TABLE_APP_VERSIONS // Colorize: green\n . \" WHERE id = '\" . $link->real_escape_string($app_version_id) . \"'\"; // 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 return false; // Colorize: green\n } // Colorize: green\n } // Colorize: green\n // Colorize: green\n // Colorize: green\n // Colorize: green\n return true; // Colorize: green\n }" ]
[ "0.60744375", "0.5901468", "0.5884651", "0.5847475", "0.5798677", "0.57696295", "0.5756638", "0.574813", "0.5746531", "0.57457346", "0.57141596", "0.568945", "0.566791", "0.56570923", "0.5657087", "0.56416196", "0.5636341", "0.56098944", "0.55934083", "0.5577099", "0.55754626", "0.55165666", "0.55165666", "0.55165666", "0.55165666", "0.55108035", "0.5481309", "0.547917", "0.547782", "0.5475744", "0.54680187", "0.5455741", "0.5453843", "0.5436828", "0.54345286", "0.54205304", "0.5411263", "0.5404212", "0.53696084", "0.53644717", "0.5361973", "0.53297055", "0.53085434", "0.53059196", "0.5301202", "0.5295948", "0.528914", "0.5283736", "0.5273298", "0.5265909", "0.52617574", "0.5261708", "0.5248593", "0.524137", "0.5235048", "0.5231882", "0.5228974", "0.5227951", "0.5226006", "0.522493", "0.5222201", "0.52210426", "0.5218552", "0.5216663", "0.52155125", "0.52106535", "0.52089447", "0.52023983", "0.51949936", "0.51709133", "0.5168269", "0.5166704", "0.51622885", "0.5161914", "0.5161493", "0.51582986", "0.5148535", "0.5147732", "0.51451206", "0.51390314", "0.51266426", "0.51231134", "0.5117845", "0.511625", "0.5114246", "0.5109769", "0.5108581", "0.5105177", "0.5104589", "0.5103022", "0.510224", "0.5100435", "0.5100435", "0.509588", "0.50900567", "0.5087527", "0.50856483", "0.50841653", "0.50802165", "0.5074952", "0.5072761" ]
0.0
-1
Index Page for this controller. Maps to the following URL or or Since this controller is set as the default controller in config/routes.php, it's displayed at So any other public methods not prefixed with an underscore will map to /index.php/welcome/
public function get_order() { $sql = "select * from `order` where status_pembayaran = 0 or status_pembayaran = 1 or status_pembayaran = 2 or status_pembayaran = 4 or status_pembayaran = 5 or status_pembayaran = 7"; $queryRec = $this->db->query($sql)->result_array(); return $queryRec; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function indexAction()\n\t{\n\t\t//echo 'Hello from the index action in the Home controller!';\n\t\t\n\t\t/*View::render('Home' . DS . 'index.php', [\n\t\t\t\"name\" => \"Laura\",\n\t\t\t\"colours\" => [\"red\", \"green\", \"blue\"]\n\t\t]);*/\n\t\t\n\t\t// View::renderTemplate('Home' . DS . 'index.html', [\n\t\t// \t\"name\" => \"Laura\",\n\t\t// \t\"colours\" => [\"red\", \"green\", \"blue\"]\n // ]);\n \n\t\t$this->showRouteParams();\n\t\t// echo \"Hello, World!\";\n }", "public function index()\n\t{\n\t\t//Default view\n\t\t$this->load->view('index.html');\n\t}", "function index() {\n\n // This page cannot be accessed without providing a page\n // the routes.php file will not allow the page to be accessed\n // $route['pages/(:any)'] = 'pages/view/$';\n redirect('/', 'refresh');\n\n }", "public function Index()\n\t{\n\t\t$this->views->SetTitle('Index Controller');\n\t\t$this->views->AddView('index/index.tpl.php', array(),'primary');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('default/index');\n\t}", "public function index() {\n\t\t$this->display('index');\n\t}", "public function index()\n\t{\t\n\n\t\t$this->load->view('welcome_message');\n\t}", "public function indexAction()\n {\n $arr = [\n 'title' => 'Welcome',\n 'data' => [\n 'name' => 'PHP FRAMEWORK',\n ]\n ];\n View::renderTemplate('Welcome/index.html', $arr);\n }", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n }", "public function show_index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function Index()\n {\n $this->standardView('Index');\n }", "public function index()\n {\n return view('main.welcome');\n }", "public function index()\n {\n // return view('welcome');\n }", "public function index()\n {\n $this->load->view('index');\n }", "public function index()\n {\n // return view('welcome');\n \n }", "public function index()\n\t{\n\t\t$this->load->view('home');\n\t}", "public function index()\n\t{\n\t\techo \"Nothing !\";\n\t}", "public function index() {\n \n return view('welcome');\n }", "public function index()\n {\n return view('pages.welcome');\n }", "public function Index()\n {\n \treturn view(\"index\");\n\t}", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n\t\t/*$this->layout->setTitle('Welcome to our Blog');\n\t\t$this->layout->showView('welcome/about.php');*/\n\t\techo 'hello I\\'m using codeigniter';\n }", "public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\treturn view('pages/home');\n\t}", "public function index()\n {\n return \"INDEX PAGE\";\n }", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "public function index()\n {\n SEOMeta::setTitle('Trusted Mortgage & Remortgage Solutions In UK - SmartMortgages UK');\n SEOMeta::setDescription('Home Page Description: For competitive mortgage and remortgage quotes around the UK at affordable rates, speak to one of our expert credit consultants and get a mortgage. For more visit us today.');\n\n return view('welcome');\n }", "function index() {\n \n parent::index();\n\n\t\t$data['user_id'] = $this->tank_auth->get_user_id();\n\t\t$data['username'] = $this->tank_auth->get_username();\n\t\t$data['main_content_view'] = $this->load->view('welcome', $data, true);\n $this->render_template($data);\n\t}", "public function index()\n\t{\n\t\t$this->title = 'My Index Action';\n\n\t\treturn new View('basic/index');\n\t}", "public function index()\n\t{\n\t\t$data['title'] = 'Home | Welcome to AEY';\n\t\t$data ['view_page'] = 'homepage';\n\n\t\t$this->load->view('site', $data);\n\t}", "public function index()\n {\n\n return view('welcome');\n\n }", "public function actionIndex(){ \n $this->view(\"index.php\");\n }", "public function index() {\n $this->registry->template->module = 'welcome';\n \n /*** load the index template ***/\n $this->registry->template->show('index');\n }", "public function actionIndex()\n\t{\n\t $this->pageTitle = 'Get Started';\n\t\t$this->render('index');\n\t}", "public function index()\n {\n return view('front.welcome');\n }", "public function index()\n\t{\n\t\treturn $this->traces();\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\t$this->loadViews(\"index\");\n\t}", "public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('home/home');\n\t}", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function index()\r\n\t{\r\n\t\techo \"index\";\r\n\t}", "public function index()\n\t{\n\t\t$this->twig->display('welcome/index.html', []);\n\t}", "public function Index() {\n $this->Display();\n }", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function index()\n {\n $title = 'Welcome Page';\n return view($this->view . '.home', compact('title'));\n }", "public function index()\n\t{\n\t\t//\n\t\techo'index';\n\t}", "public function index() {\n $this->getView('navigation', array('pagename' => 'Welcome'));\n $this->getView('welcome');\n $this->getView('footer');\n }", "public function index()\n {\n return view(\"home\");\n }", "public function home()\n\t{\n\t\t$this->load->view('index_view');\n\t}", "function index() {\n $this->renderView(\"index\");\n }", "public function index()\n\t{\n\t\treturn view('index');\n\t}", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n\n\n\n return view('welcome');\n }", "public function index() {\n\t\t$page = Page::getInstance();\n\t\t$session = Session::getInstance();\n\t\t$page->setPageTitle('Method index notfound');\n\t\t$session->setFlash('Chaque controller doit avoir une m&eacute;thode index', 'error');\n\t}", "public function index()\r\n\t{\r\n\t\t//\r\n\t}", "public function index() {\n\t\t// render the view (/view/main/index.php)\n\t\t$this->view->render(\"main\", \"index\");\n\t}", "public function index()\n {\n return View(\"pages.home\");\n }", "public function index()\n {\n // Nothing to do\n }", "public function index(){\n return view('welcome');\n }", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}" ]
[ "0.7655508", "0.74145436", "0.7396173", "0.7317418", "0.72283363", "0.72283363", "0.71903646", "0.7166857", "0.7151917", "0.7145717", "0.7108151", "0.70780236", "0.70754886", "0.70406276", "0.70306057", "0.70306057", "0.70306057", "0.70306057", "0.70306057", "0.69742966", "0.6968103", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69477713", "0.69316655", "0.6926416", "0.6911975", "0.6901835", "0.6894632", "0.6876047", "0.6858327", "0.68569815", "0.68399274", "0.6803998", "0.6802956", "0.6802956", "0.6796031", "0.6790225", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6767983", "0.6766831", "0.6764303", "0.6761992", "0.6761992", "0.67514986", "0.675126", "0.67485875", "0.67429", "0.67388356", "0.6729889", "0.6717446", "0.67143476", "0.6711851", "0.6704955", "0.6700333", "0.6693287", "0.66756153", "0.666292", "0.6661336", "0.6650874", "0.66305923", "0.6622069", "0.661396", "0.66047865", "0.6598352", "0.6595009", "0.65937525", "0.65860605", "0.65768355", "0.6576564", "0.657412", "0.65545326", "0.6547276", "0.6545392", "0.6544484", "0.65438914", "0.654184", "0.6517758", "0.65157586", "0.65157586", "0.65157586", "0.65157586" ]
0.0
-1
Instantiates the brush by identifier or alias.
public static function fromIdentifierOrAlias($identifierOrAlias);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function factory($adapter, $options = array())\n {\n // convert Zend_Config argument to plain string and separate options\n if ($adapter instanceof Zend_Config) {\n if (isset($adapter->options)) {\n $options = $adapter->options->toArray();\n } else {\n $options = array();\n }\n if (isset($adapter->adapter)) {\n $adapter = (string) $adapter->adapter;\n } else {\n $adapter = null;\n }\n }\n\n // verify that adapter parameters are in an array\n if (!is_array($options)) {\n require_once 'Zym/Highlight/Exception.php';\n $msg = 'Highlight options must be in an array or a Zend_Config object';\n throw new Zym_Highlight_Exception($msg);\n }\n\n // verify that an adapter name has been specified.\n if (!is_string($adapter) || empty($adapter)) {\n require_once 'Zym/Highlight/Exception.php';\n $msg = 'Adapter name must be specified in a string';\n throw new Zym_Highlight_Exception($msg);\n }\n\n // form full adapter class name\n $adapterNamespace = 'Zym_Highlight_Adapter';\n if (isset($options['adapterNamespace'])) {\n $adapterNamespace = $options['adapterNamespace'];\n unset($options['adapterNamespace']);\n }\n $adapterName = $adapterNamespace . '_' . $adapter;\n $adapterName = str_replace(' ', '_', ucwords(str_replace('_', ' ', $adapterName)));\n \n // load the adapter class (might throw an exception)\n Zend_Loader::loadClass($adapterName);\n\n // create an instance of the adapter class\n $handlerAdapter = new $adapterName($options);\n\n // verify that the object created is a descendent of adapter abstract\n if (! $handlerAdapter instanceof Zym_Highlight_Adapter_Abstract) {\n require_once 'Zym/Highlight/Exception.php';\n $msg = \"Adapter class '$adapterName' does not extend \";\n $msg .= 'Zym_Highlight_Adapter_Abstract';\n throw new Zym_Highlight_Exception($msg);\n }\n\n return $handlerAdapter;\n }", "public function create($alias = null);", "public static function from(string $identifier): Identifier\n {\n return new self($identifier);\n }", "public function createDiagramInstance();", "function getBrush() { return $this->_brush; }", "public function createElement($identifier)\n {\n if (array_key_exists($identifier, $this->tagDefinitions)) {\n return new $this->tagDefinitions[$identifier];\n }\n\n throw new Exception(\"Tag $identifier not found\");\n }", "public static function factory( $id );", "public static function instance(string $id);", "function getBrush() { return $this->_brush; }", "public function createAlias($distinct_id, $alias) {\n $this->_events->createAlias($distinct_id, $alias);\n }", "function __construct($aowner=null)\r\n {\r\n //Calls inherited constructor\r\n parent::__construct($aowner);\r\n\r\n $this->Width=65;\r\n $this->Height=65;\r\n $this->_pen=new Pen();\r\n $this->_pen->_control=$this;\r\n $this->_brush=new Brush();\r\n $this->_brush->_control=$this;\r\n\r\n }", "public function createSupplier($attributes);", "public function create(Draw $draw_id)\n {\n\n }", "public static function new_instance( $tag_name, $tag_color = null, $tag_bg = null ) {\n global $edb;\n\n $tag_name = _text( $tag_name, 32 );\n $tag_color = !empty($tag_color) ? _hexadec($tag_color) : 'ffffff';\n $tag_bg = !empty($tag_bg) ? _hexadec($tag_bg) : '777777';\n\n $edb->insert('tags', 'tag_name,tag_color,tag_bg', \"'$tag_name', '#$tag_color', '#$tag_bg'\" );\n }", "private function initializeWidgetIdentifier() {}", "public function factory($id) {\n if (isset($this->$id)) {\n return $this->$id;\n }\n }", "public function __construct(string $alias)\n\t{\n\t\t$this->alias = $alias;\n\t}", "public function createInstance($identifier)\r\n \t{\r\n \t\t$className = $this->getClassMapper($identifier);\r\n\r\n \t\t$params = array_slice(func_get_args(), 1);\r\n\r\n \t\t// We must use reflection in PHP < 5.6 See http://stackoverflow.com/questions/8734522/dynamically-call-class-with-variable-number-of-parameters-in-the-constructor\r\n \t\t$reflection = new \\ReflectionClass($className);\r\n\r\n return $reflection->newInstanceArgs($params);\r\n \t}", "public static function create($id = NULL) { return new self($id); }", "protected function __construct($a_id)\n\t{\n\t\t$this->id = $a_id;\n\t\t$this->data = array();\n\t\t\t\t\n\t\t$this->setShadow(2);\n\t}", "static protected function createInstance($id) {\n if (!strpos($id, self::ID_CLASS_NAME_SEPARATOR)) {\n throw new \\Exception(\"$id ist keine ID!\");\n }\n list($className, $rest) = explode(self::ID_CLASS_NAME_SEPARATOR, $id);\n $nameSpacedClassName = \"$className\";\n $instance = new $nameSpacedClassName($id);\n return $instance;\n }", "public function create(string $brand): NotebookInterface\n {\n $object = $this->createNotebook($brand);\n $object->setColor('#000');\n\n return $object;\n }", "public static function createInstance()\n {\n return new ComboBox('ISerializable', 'ISerializable');\n }", "function SvgMarker($id, $refX=\"\", $refY=\"\", $markerUnits=\"\", $markerWidth=\"\", $markerHeight=\"\", $orient=\"\")\r\n {\r\n $this->SvgElement();\r\n \r\n $this->mId = $id;\r\n $this->mRefX = $refX;\r\n $this->mRefY = $refY;\r\n $this->mMarkerUnits = $markerUnits;\r\n $this->mMarkerWidth = $markerWidth;\r\n $this->mMarkerHeight = $markerHeight;\r\n $this->mOrient = $orient;\r\n \r\n }", "public function create($alias, array $params = array()) {\n return $this->get($alias, $params);\n }", "public function __construct($identifier)\n {\n $this->identifier = $identifier;\n }", "public function __construct($identifier)\n {\n $this->identifier = $identifier;\n }", "public static function factory(RendererInterface $renderer, DataObject $object, $urlType, array $attributes = array());", "abstract public function register_style();", "static public function fromID($id)\n {\n // TODO: Implement fromID() method.\n }", "public function __construct(string $id);", "static function newStick($table_name = null, $id = null) {\n if ( is_null($table_name))\n throw new Exception(\"Cannot create null stick.\");\n\n\n if ( !is_null($id)) {\n $stick = new Stick($table_name);\n return $stick->_auto_get($id);\n }\n\n return new Stick($table_name);\n }", "public function registerGlyph($originGlyphId) {}", "public function set($identifier, $alias)\n {\n $this->aliases[$identifier] = $alias;\n }", "protected function getNotification_Type_BookmarkService()\n {\n $instance = new \\phpbb\\notification\\type\\bookmark(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});\n $instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});\n\n return $instance;\n }", "public function create($adapterAlias = null)\n {\n $this->adapterMap = array_merge($this->config->getAdapters(), $this->adapterMap);\n $adapterAlias = !empty($adapterAlias) ? $adapterAlias : $this->config->getAdapterAlias();\n if (empty($adapterAlias)) {\n throw new \\InvalidArgumentException('Image adapter is not selected.');\n }\n if (empty($this->adapterMap[$adapterAlias]['class'])) {\n throw new \\InvalidArgumentException(\"Image adapter for '{$adapterAlias}' is not setup.\");\n }\n $imageAdapter = $this->objectManager->create($this->adapterMap[$adapterAlias]['class']);\n if (!$imageAdapter instanceof Adapter\\AdapterInterface) {\n throw new \\InvalidArgumentException(\n $this->adapterMap[$adapterAlias]['class'] .\n ' is not instance of \\Magento\\Framework\\Image\\Adapter\\AdapterInterface'\n );\n }\n $imageAdapter->checkDependencies();\n return $imageAdapter;\n }", "public function __construct( $element_id, $chart = ChartTypes::LINE )\n {\n $this->element = $element_id;\n $this->__chart_type = $chart;\n }", "public function di($alias, $factory);", "public function identifier(string $identifier);", "public static function createItem(IndexInterface $index, $id, DatasourceInterface $datasource = NULL) {\n return new Item($index, $id, $datasource);\n }", "function __construct($aowner=null)\r\n {\r\n //Calls inherited constructor\r\n parent::__construct($aowner);\r\n\r\n $this->_pen=new Pen();\r\n $this->_pen->_control=$this;\r\n }", "public function __construct($id, $name, $weight, $base, $height, $width)\n {\n $this->id = $id;\n $this->name = $name;\n $this->weight = $weight;\n $this->base = $base;\n $this->height = $height;\n $this->width = $width;\n }", "protected function createItem($identifier, array $data)\n {\n return new Item($identifier, $data, $this->store);\n }", "public function getBrush() {\r\n if ($this->bBrush == null) {\r\n $this->bBrush = new ChartBrush($this->chart, Color::WHITE(), false);\r\n }\r\n return $this->bBrush;\r\n }", "public function bindAlias(string $alias, string $serviceId): static;", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "public static function create($width, $height, $image = null)\n {\n return new Adapter\\Gd($width, $height, $image);\n }", "public function alias($id, $alias);", "private function createBarcode()\n {\n $barcodeOptions = [\n 'text' => $this->barcodeValue,\n 'factor' => '1',\n 'drawText' => $this->barcodeSettings->includeNumber($this->storeId),\n 'backgroundColor' => $this->barcodeSettings->getBackgroundColor($this->storeId),\n 'foreColor' => $this->barcodeSettings->getFontColor($this->storeId),\n ];\n\n $type = $this->barcodeSettings->getType($this->storeId);\n // @codingStandardsIgnoreLine\n $imageResource = ZendBarcode::draw($type, 'image', $barcodeOptions, []);\n // @codingStandardsIgnoreLine\n imagejpeg($imageResource, $this->fileName, 100);\n // @codingStandardsIgnoreLine\n imagedestroy($imageResource);\n }", "public function createQueryBuilder($alias);", "public function __construct($id);", "public function __construct($id);", "abstract public function createQueryBuilder($alias);", "public function using($alias);", "public function extend(string $id): DefinitionInterface;", "abstract public static function create($graphic_report, $id, $rank, $title, $description, $width, $height);", "function create($dq=null){\n\t\tif($this->id)throw new APortalException(\"Object already have ID, cannot create again\",$this);\n\n\t\t// First we are going to create entry in obj table\n\t\t$dq_obj = $this->api->db->dsql();\n\t\t$dq_obj->set('type',$this->type);\n\t\t$dq_obj->set('name',$this->name);\n\t\t$dq_obj->table(\"obj\");\n\t\t$this->id = $dq_obj->do_insert();\n\n\t\t// Now we are creating entry in supplementary table\n\t\t$dq=$this->prepareSave($dq);\n\t\t$dq->set('id',$this->id);\n\t\ttry {\n\t\t\t$id=$dq->do_replace();\n\t\t} catch (SQLException $e){\n\t\t\t// Perhaps table does not exist. We will try to create it and repeat query.\n\t\t\t$this->createTable();\n\t\t\t$dq->do_replace();\n\t\t}\n\n\t\t$this->name='Object #'.$this->id;\n\t\t$this->short_name='obj_'.$this->id;\n\t\treturn $this;\n\t}", "public static function create($prefix = 'Horde')\n {\n return new self(\n null,\n '<' . strval(new Horde_Support_Guid(array('prefix' => $prefix))) . '>'\n );\n }", "public function create( &$object );", "public function newIdentifier(): string;", "public static function fromName($name)\n\t{\n\t\t$name = String::lower($name);\n\t\tif(!array_key_exists($name, self::$namedColorsMap))\n\t\t\tthrow new \\InvalidArgumentException(sprintf(\"Undefined color name '%s'\", $name));\n\t\tlist($r, $g, $b) = Arrays::get(self::$namedColorsMap, $name);\n\t\treturn new static($r, $g, $b);\n\t}", "public function getMarkerFactory();", "public static function create($rectangle) {}", "public function __construct()\n {\n $this->symbol = new Symbol;\n $this->instance = new Instance;\n }", "public static function set_instance( $tag_id, $tag_name = null, $tag_color = null, $tag_bg = null ) {\n global $edb;\n\n $tag_id = (int) $tag_id;\n\n $_tag = self::get_instance( $tag_id );\n\n $tag_name = !empty($tag_name) ? _text( $tag_name, 32 ) : $_tag->tag_name;\n $tag_color = !empty($tag_color) ? _hexadec($tag_color) : $_tag->tag_color;\n $tag_bg = !empty($tag_bg) ? _hexadec($tag_bg) : $_tag->tag_bg;\n\n $edb->update('tags', 'tag_name,tag_color,tag_bg', \"'$tag_name', '#$tag_color', '#$tag_bg'\", \"tag_id_PK = $tag_id\" );\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "public static function factory($adapter, $host=null, $params)\n {\n if (empty($host)) {\n /**\n * @see Asker\\Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception('You must be precize an host');\n }\n\n /**\n * Apply adapter config\n */\n $params = unserialize($params);\n $params['host'] = $host;\n\n /**\n * Verify that adapter parameters are in an array.\n */\n if (!is_array($params)) {\n /**\n * @see Asker\\Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception('Adapter parameters must be in an array');\n }\n\n /**\n * Verify that an adapter name has been specified.\n */\n if (empty($adapter)) {\n /**\n * @see Asker\\Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception('Adapter name must be specified');\n }\n\n /**\n * Create an instance of the adapter ask.\n * Pass the config to the adapter.\n */\n switch ($adapter) {\n\n case self::ADAPTER_SNMP:\n $askerAdapter = new Adapter\\Snmp($params);\n break;\n\n case self::ADAPTER_SSH:\n $askerAdapter = new Adapter\\Ssh($params);\n break;\n\n case self::ADAPTER_SSH_PUBKEY:\n $askerAdapter = new Adapter\\SshPubkey($params);\n break;\n\n case self::ADAPTER_HTTP:\n $askerAdapter = new Adapter\\Http($params);\n break;\n\n\n default:\n /**\n * @see Asker\\Adapter\\Exception\n */\n require_once 'Adapter/Exception.php';\n throw new Asker_Adapter_Exception(\"ERROR: Adapter not exist !\");\n }\n\n /**\n * Verify that the object created is a descendent of the abstract adapter type.\n */\n if (!$askerAdapter instanceof Adapter\\Base) {\n /**\n * @see Asker_Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception(\"Adapter class '$adapterName' does not extend Asker\\Adapter\\Base\");\n }\n\n return $askerAdapter;\n }", "public static function get_endpoint($id) {\n return new endpoint($id);\n }", "function getProductObjectFromId( $id, $productname ) {\r\n\treturn new Product ($id, $productname );\r\n}", "public static function find($id) { return new static($id); }", "public function createReference($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE);", "public function addAlias(string $alias, string $id) {\n\t\treturn $this->setEntry(\n\t\t\t$alias,\n\t\t\t$this->createObject(Entry\\AliasEntry::class, $id)\n\t\t);\n\t}", "protected function getInstanceIdentifier() {}", "static function alias(string $class, array $config = null)\n {\n return new self('alias', $class, $config);\n }", "public static function create($x, $y){\n\t return new Coordinate($x, $y);\n\t}", "public function __construct($name, $id = null);", "public static function fromIdentifier(mixed $identifier): ?static;", "public static function createInstance()\n {\n return new Button('ISerializable', 'ISerializable', 'ISerializable');\n }", "public function newInstance(string $name, array $params, UriInterface $uri)\n {\n if (!$this->exists($name)) {\n throw new BacklogClientException(\"Oops!! resource name:{$name} is undefined.\");\n }\n /** @var Factory $factory */\n $factory = $this->get($name);\n\n return $factory($params, $uri);\n }", "public function Create()\n {\n parent::Create();\n\n // 1. Verfügbarer HarmonySplitter wird verbunden oder neu erzeugt, wenn nicht vorhanden.\n $this->ConnectParent(\"{03B162DB-7A3A-41AE-A676-2444F16EBEDF}\");\n\t\t\n\t\t$this->RegisterPropertyString(\"Name\", \"\");\n\t\t$this->RegisterPropertyInteger(\"DeviceID\", 0);\n\t\t$this->RegisterPropertyBoolean(\"BluetoothDevice\", false);\t\t\n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public static function factory($id)\n {\n return static::$_instance->create($id);\n }", "public function createAddress()\n {\n $class = $this->getClass();\n\n return new $class;\n }", "public function __construct($name)\n {\n $this->name = $name;\n $this->image = imagecreatetruecolor($this->width, $this->height);\n $this->createRectangle();\n }", "public function newInstance(): object;", "public function __construct( Registry $registry, $id=0 )\n\t{\n\t\t$this->registry = $registry;\n\t}", "private function registerFill(Style $style)\n {\n $styleId = $style->getId();\n\n // Currently - only solid backgrounds are supported\n // so $backgroundColor is a scalar value (RGB Color)\n $backgroundColor = $style->getBackgroundColor();\n\n if ($backgroundColor) {\n $isBackgroundColorRegistered = isset($this->registeredFills[$backgroundColor]);\n\n // We need to track the already registered background definitions\n if ($isBackgroundColorRegistered) {\n $registeredStyleId = $this->registeredFills[$backgroundColor];\n $registeredFillId = $this->styleIdToFillMappingTable[$registeredStyleId];\n $this->styleIdToFillMappingTable[$styleId] = $registeredFillId;\n } else {\n $this->registeredFills[$backgroundColor] = $styleId;\n $this->styleIdToFillMappingTable[$styleId] = $this->fillIndex++;\n }\n } else {\n // The fillId maps a style to a fill declaration\n // When there is no background color definition - we default to 0\n $this->styleIdToFillMappingTable[$styleId] = 0;\n }\n }", "public function setBookmarkKey($bookmarkKey): self;", "static function create($width, $height, $bgColor = null) {\n\t\treturn self::_getLoader()->create($width, $height, $bgColor);\n\t}", "public static function loadFromString($data, $name = null)\n {\n $gd = new Adapter\\Gd();\n $gd->loadFromString($data, $name);\n return $gd;\n }", "public function createCustom()\n {\n $o = new ExtendSelector();\n $this->appendSelector($o);\n\n return $o;\n }", "public function alias(string $alias): ISchemaBuilder;", "public function create() {\n\t\t$implementationClassName = 'Imagine\\\\' . $this->settings['driver'] . '\\Imagine';\n\t\treturn new $implementationClassName();\n\t}", "public function createNewCoreObject($alias){\n $coreClasses = $this->coreClasses();\n $object = $coreClasses[$alias];\n return new $object($this);\n }", "protected function _construct()\n {\n $this->_init(QuotePickupLocation::class, QuotePickupLocationResource::class);\n }", "public function setIdentification(string $identification): Creator\n {\n $this->identification = $identification;\n return $this;\n }", "public static function create($name, $script)\n {\n $object = get_class(self::$driver);\n //\n return $object::create($name, $script);\n }", "public function useIdentifier($identifier)\n {\n switch ($this->howToProcess($identifier)) {\n case 'values':\n $this->takeData($identifier);\n break;\n case 'reuse':\n $this->takeData($identifier->getData());\n break;\n case 'name':\n $this->setDataValue($this->nameColumn, $identifier);\n break;\n case 'id':\n $this->setMyKey($identifier);\n break;\n default:\n break;\n }\n }", "public function new($id = '', $iso3) {\n\t\t$code = new TariffCodeCountry();\n\t\t$code->setId($id);\n\t\t$code->setCountry($iso3);\n\t\t$code->setDummy('P');\n\t\treturn $code;\n\t}", "function MicroBuilder_Theme_Factory () {}" ]
[ "0.50301826", "0.48500448", "0.479004", "0.44207785", "0.43961877", "0.43947396", "0.43927217", "0.43827385", "0.4336708", "0.43153545", "0.43076667", "0.42994577", "0.41919926", "0.4191618", "0.41521806", "0.41336113", "0.41273084", "0.4120942", "0.4102165", "0.4095266", "0.40716082", "0.40676898", "0.4061575", "0.4050454", "0.40486747", "0.40474793", "0.40474793", "0.40377295", "0.40133762", "0.40090048", "0.4004121", "0.40036377", "0.39949375", "0.39913157", "0.3983371", "0.3981091", "0.39632577", "0.39533663", "0.3950494", "0.39479873", "0.39345667", "0.39286464", "0.39240456", "0.39186192", "0.39184248", "0.39163873", "0.39122552", "0.39103436", "0.390892", "0.38988453", "0.38934302", "0.38934302", "0.38896856", "0.388661", "0.38836685", "0.38811377", "0.38802788", "0.38731462", "0.38701686", "0.3850394", "0.38487342", "0.3848078", "0.3836874", "0.38339925", "0.38284263", "0.38278884", "0.38192716", "0.38177276", "0.38176894", "0.38168257", "0.3802569", "0.37994283", "0.3796543", "0.37907147", "0.37888306", "0.37881133", "0.3782032", "0.37809333", "0.37783387", "0.3775991", "0.37578142", "0.37525713", "0.37522057", "0.3752166", "0.37497583", "0.37494037", "0.37487754", "0.3742454", "0.37411907", "0.37265804", "0.37196442", "0.37194648", "0.37148428", "0.37140313", "0.37117416", "0.37060335", "0.36982697", "0.369692", "0.36930832", "0.36899596" ]
0.49770072
1
Get a createaccount token
public function getCreateAccountToken() { $queryData = array(); $queryData['action'] = 'query'; $queryData['meta'] = 'tokens'; $queryData['type'] = 'createaccount'; $queryData['format'] = 'json'; $url = $this->apiUrl . "?" . http_build_query($queryData); try { $this->fetch($url, null, OAUTH_HTTP_METHOD_POST); } catch (Exception $e) { $msg = 'MediaWikiApiClient error getting createaccount token: ' . $e->getMessage(); if(Configure::read('debug')) { CakeLog::write('error', $msg); CakeLog::write('error', 'Query data was ' . print_r($queryData, true)); CakeLog::write('error', 'URL was ' . print_r($url, true)); } throw new MediaWikiApiClientException($msg, 1, $e); } $responseInfo = $this->getLastResponseInfo(); if ($responseInfo['http_code'] != 200 || !preg_match('/^application\/json/', $responseInfo['content_type'])) { $msg = "MediaWikiApiClient error getting createaccount token"; if(Configure::read('debug')) { CakeLog::write('error', $msg); CakeLog::write('error', 'MediaWikiApiClient response code was ' . $responseInfo['http_code']); CakeLog::write('error', 'MediaWikiApiClient content type was ' . $responseInfo['content_type']); } throw new MediaWikiApiClientException($msg, 1); } $response = json_decode($this->getLastResponse(), true); if (!isset($response['query']['tokens']['createaccounttoken'])) { $msg = "MediaWikiApiClient error getting createaccount token"; if(Configure::read('debug')) { CakeLog::write('error', $msg); CakeLog::write('error', 'MediaWikiApiClient response was ' . $print_r($response, true)); } throw new MediaWikiApiClientException($msg, 1); } $createAccountToken = $response['query']['tokens']['createaccounttoken']; return $createAccountToken; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createToken();", "public function createNewToken()\n {\n return $this->getBandrek()->generateToken();\n }", "function create_client_token(){\n \t$clientToken = Braintree_ClientToken::generate();\n \treturn $clientToken;\n }", "public function generateToken();", "public function createAdminToken();", "function createToken() {\n\treturn bin2hex(openssl_random_pseudo_bytes(32));\n}", "function __create_auth_token($email, $password, $account_type, $service) {\n\n return new AuthToken($email, $password, $account_type, $service);\n\n}", "public function generateToken()\n\t{\n\t\treturn Token::make();\n\t}", "public function generateToken()\n {\n $request = $this->call('v1/auth/token', Constants::METHOD_POST, [\n 'timestamp' => time(),\n 'nonce' => $this->generateNonce(),\n ]);\n\n return isset($request['token']) ? $request['token'] : false;\n }", "public function getCreationToken(array $params)\n\t{\n\t\treturn $this->post('access/getCreationToken', $params);\n\t}", "public function createToken()\n\t{\n\t\t$domain = $this->config->get('app.domain');\n\n\t\t$data = [\n\t\t\t'iss' => $domain,\n\t\t\t'aud' => $domain,\n\t\t\t'iat' => time(),\n\t\t\t'exp' => time () + $this->expiration,\n\t\t];\n\n\t\t$token = JWT::encode($data, $this->config->get('app.app_key'));\n\n\t\t$this->createAuth([\n\t\t\t'token' => $token,\n\t\t\t'expires_at' => date('Y-m-d h:i:s', $data['exp'])\n\t\t]);\n\n\t\treturn $token;\n\t}", "public function getToken()\n\t{\n\t\t$this->setCurlHeaders(false);\n\t\t\n\t\t$request_params = array\n\t\t(\n\t\t\t'client_key' => $this->client_key,\n\t\t\t'client_secret' => $this->client_secret\n\t\t);\n\t\t\n\t\treturn $this->makeCurlRequest($this->public_api_url . \"v1/token/generate\", false, \"POST\", $request_params);\n\t}", "public function generateToken()\n {\n if (empty($this->username) || empty($this->api_token)) {\n throw new \\Exception(\"Username and Api Token must be set\");\n }\n $time = time();\n return hash_hmac(\"sha256\", $this->username . \"::\" . $this->api_token . \"::\" . $time, $this->api_token);\n }", "protected function createToken()\n {\n if ($this->client->getRefreshToken()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n } else {\n // Request authorization from the user.\n $authUrl = $this->client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $this->client->fetchAccessTokenWithAuthCode($authCode);\n $this->client->setAccessToken($accessToken);\n\n // Check to see if there was an error.\n if (array_key_exists('error', $accessToken)) {\n throw new Exception(join(', ', $accessToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($this->token))) {\n mkdir(dirname($this->token), 0700, true);\n }\n file_put_contents($this->token, json_encode($this->client->getAccessToken()));\n }", "protected function createToken()\n {\n $currentServerIp = $this->request->server('SERVER_ADDR');\n\n $secretKey = $this->config['doublespark_contaobridge_secret_key'];\n\n return md5('phpbbbridge'.date('d/m/Y').$currentServerIp.$secretKey);\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function generateNewToken() : string\n {\n $token = \"\";\n try {\n $fullUrl = $this->_getFullUrl(Config::AUTH_URL);\n $result = $this->client->post($fullUrl, [\n \"client_id\" => Config::CLIENT_ID,\n \"email\" => Config::EMAIL,\n \"name\" => Config::NAME\n ]);\n $data = json_decode($result->getBody()->getContents());\n $token = $data->data->sl_token;\n\n } catch (Exception $e) {\n echo $this->responseService\n ->withStatus($e->getCode())\n ->single([], \"data\", null, $e->getMessage());\n }\n return $token;\n }", "public function generateToken()\n\t{\n\t\tif( empty( $this->myAccountID ) )\n\t\t\tthrow PasswordResetException::toss( $this, 'NO_ACCOUNT_ID' ) ;\n\t\tif( empty( $this->myAuthID ) )\n\t\t\tthrow PasswordResetException::toss( $this, 'NO_AUTH_ID' ) ;\n\t\t$this->myNewToken = AuthDB::generatePrefixedAuthToken( static::TOKEN_PREFIX ) ;\n\t\t$theSql = SqlBuilder::withModel($this->model)\n\t\t\t->startWith( 'INSERT INTO ' )->add( $this->model->tnAuthTokens )\n\t\t\t->add( 'SET ' )\n\t\t\t->mustAddParam('created_by', $_SERVER['REMOTE_ADDR'])\n\t\t\t->setParamPrefix( ', ' )\n\t\t\t->mustAddParam('created_ts', $this->model->utc_now())\n\t\t\t->mustAddParam( 'auth_id', $this->myAuthID )\n\t\t\t->mustAddParam( 'account_id', $this->myAccountID )\n\t\t\t->mustAddParam( 'token', $this->myNewToken )\n\t\t\t//->logSqlDebug(__METHOD__) //DEBUG\n\t\t\t;\n\t\ttry\n\t\t{\n\t\t\t//execDML() on parameterized queries ALWAYS returns true,\n\t\t\t// exceptions are the only means of detecting failure here.\n\t\t\t$theSql->execDML() ;\n\t\t\treturn $this ;\n\t\t}\n\t\tcatch( PDOException $pdoe )\n\t\t{\n\t\t\t$this->myNewToken = null ;\n\t\t\tthrow PasswordResetException::toss( $this, 'TOKEN_GENERATION_FAILED' ) ;\n\t\t}\n\t}", "public function createAuthToken() {\n $url = URIResource::Make($this->path, array($this->id, 'tokens'));\n $token = $this->client->post($url, null);\n return new EndpointsToken($token);\n }", "public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "public function createToken()\n {\n $key = base64_encode(getenv('JWT_SECRET'));\n $payload = array(\n \"jti\" => base64_encode(random_bytes(32)),\n \"iat\" => time(),\n \"iss\" => getenv('BASE_URL'),\n \"nbf\" => time() + 10,\n \"exp\" => time() + (3600 * 24 * 15),\n \"data\" => [\n \"user\" => [\n \"username\" => $this->username,\n \"uuid\" => $this->uuid\n ]\n ]\n );\n try {\n return $this->container->jwt::encode($payload, $key, 'HS256');\n } catch (Exception $e) {\n return false;\n }\n }", "public function generateToken($email);", "public function GetToken()\n {\n $args['method'] = 'getToken';\n $args['secretkey'] = $this->SecretKey;\n $response = $this->GetPublic('apiv1','payexpress',$args);\n\n return (!empty($response['token'])) ? $response['token'] : '';\n }", "public function getToken(): string\n {\n try {\n\n $response = $this->http::post(\n $this->config->api->domain . $this->config->api->register,\n (array)$this->config->user\n );\n\n if ($response) {\n\n return json_decode(\n (string)$response,\n true,\n 512,\n JSON_THROW_ON_ERROR\n )['data']['sl_token'];\n }\n\n throw new Exception;\n\n } catch (Exception) {\n\n throw new RuntimeException('Error get token from API.');\n }\n }", "function gen_token()\n\t{\n\t\t$ci = get_instance()->load->helper('myencrypt');\n\t\treturn create_token();\n\t}", "public function generateClientToken(){\n\n $gateway = $this->getGateway();\n $clientToken = $gateway->clientToken()->generate();\n\n return $clientToken;\n\n }", "protected function create_token()\n {\n do {\n $token = sha1(uniqid(\\Phalcon\\Text::random(\\Phalcon\\Text::RANDOM_ALNUM, 32), true));\n } while (Tokens::findFirst(array('token=:token:', 'bind' => array(':token' => $token))));\n\n return $token;\n }", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "function __get_auth_token() {\n\n if ($this->auth_token === null) {\n\n $this->auth_token =\n $this->__create_auth_token($this->email,\n $this->password,\n $this->auth_account_type,\n $this->auth_service);\n\n }\n\n return $this->auth_token;\n\n}", "public function generateToken()\n {\n $token = array(\n \"iss\" => $this->id,\n \"aud\" => $this->name,\n \"iat\" => $this->email,\n \"nbf\" => $this->phone\n );\n\n return JWT::encode($token, self::JWT_KEY);\n }", "public function generateAccountActivationToken()\n {\n $this->account_activation_token = Yii::$app->security->generateRandomString();\n }", "public function getMoipAccountToken() {\n return $this->getChaveValor('MOIP_ACCOUNT_TOKEN');\n }", "public function testCreateToken(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\t\n\t\t$parameters = PayUTestUtil::buildParametersCreateToken();\n\t\t\n\t\t$response = PayUTokens::create($parameters);\n\t\t\n\t\t$this->assertEquals(PayUResponseCode::SUCCESS, $response->code);\n\t\t$this->assertNotNull($response->creditCardToken);\n\t\t$this->assertNotNull($response->creditCardToken->creditCardTokenId);\n\t\t\t\t\n\t}", "public function generateToken() {\n\t\t$appConfig = $this->config;\n\t\t$token = $this->secureRandom->generate(32);\n\t\t$appConfig->setAppValue('owncollab_ganttchart', 'sharetoken', $token);\n\t\treturn $token;\n\t}", "public static function createAccessToken(){\r\n\t\t$token = new AccessToken(substr(sha1(microtime()), 0, 30));\r\n\t\treturn $token;\r\n\t}", "public function generateToken($accountId, $data)\n {\n $response = $this->iugu->client->post($this->getEndpoint('create_token'), $this->buildTokenData($accountId, $data));\n\n return new TokenResponse($response);\n }", "public static function create(): string\n {\n $payload = ['random' => base64_encode(random_bytes(32))];\n $tokenDecoded = new TokenDecoded([], $payload);\n\n $privateKey = @file_get_contents(self::PRIVATE_KEYFILE);\n if ($privateKey === false) {\n echo 'creating Keys..';\n self::createKeys();\n $privateKey = file_get_contents(self::PRIVATE_KEYFILE);\n }\n\n $tokenEncoded = $tokenDecoded->encode($privateKey, JWT::ALGORITHM_RS256);\n return $tokenEncoded;\n }", "public function generateToken()\n {\n $token = openssl_random_pseudo_bytes(16);\n \n $token = bin2hex($token);\n \n return $token;\n }", "function genera_token ($user, $profile)\r\n{\r\n\t$token = \"\";\r\n\r\n\t/* Aqui estaria el algoritmo para la generacion\r\n\tdel token */\r\n\r\n\treturn $token;\r\n}", "private function generateToken()\n {\n return hash('SHA256', uniqid((double) microtime() * 1000000, true));\n }", "public function createToken($email){\n\n $isToken = DB::table('password_resets')->where('email', $email)->first();\n\n if($isToken) {\n return $isToken->token;\n }\n $user = User::where('email','=',$email)->first();\n $userRole = $user->roles()->first();\n if ($userRole) {\n $this->scope = $userRole->title;\n }\n $tokenResult = $user->createToken($user->email.'-' .now(), [$this->scope]);\n $this->saveToken($tokenResult->accessToken, $email);\n return $tokenResult->accessToken;\n }", "private function generateResetPasswordToken()\n {\n $passwordReset = PasswordReset::create([\n 'user_id' => $this->id,\n 'token' => Str::random(150) . $this->id . time(),\n 'expires' => Carbon::now()->addDays(30)->format('Y-m-d H:i:s')\n ]);\n\n return $passwordReset;\n }", "public function getToken()\n {\n return bin2hex(random_bytes(20));\n }", "public function createAccount(string $code)\n {\n $request = $this->client->request(\"POST\", \"token\", [\n 'form_params' => [\n 'client_secret' => config('stripe.secret'),\n 'code' => $code,\n 'grant_type' => 'authorization_code'\n ]\n ]);\n return json_decode($request->getBody()->getContents());\n }", "public function getToken($options = array()) {\n $default_options = array(\n 'id' => (int)$this->get('id'),\n 'single_use' => !empty($options['single_use'])\n );\n $options = array_merge($default_options, $options);\n\n $options['expires'] = empty($options['expires']) ? 0 : Ak::getTimestamp()+((empty($options['expires']) ? '0' : ($options['expires'] === true ? 86400 : $options['expires'])));\n $options['single_use'] = $options['single_use'] ? 1 : 0;\n\n $options['hash'] = $this->getTokenHash($options);\n\n return self::encodeToken($options);\n }", "public function getToken(){\n\n if( $this->hasToken() )\n return $this->token;\n\n $token = $this->asObj('/authorize', self::POST);\n\n if( $token and isset($this->data) )\n return new Token($token);\n\n throw new ClientException(\"Could not retrieve token. Please check your credentials and try again.\");\n\n }", "public function create()\n {\n\t\t\n\t\t//this->authorize('create', Token::class);\n\t\t$jsvalidator = JsValidator::make([\n\t\t\t'user_id' => 'numeric|nullable|exits:users,id',\n\t\t\t'account' => 'numeric|required|exits:accounts,id',\n\t\t\t'name' => 'required|string|max:75',\n\t\t\t'slug' => 'nullable|string',\n\t\t\t'contract_address' => 'nullable|string|max:42',\n\t\t\t'contract_ABI_array' => 'nullable|string',\n\t\t\t'contract_Bin' => 'nullable|string',\n\t\t\t'token_price' => 'required|numeric',\n\t\t\t'symbol' => 'required|string',\n\t\t\t'decimals' => 'required|numeric',\n\t\t\t'logo' => 'required|file',\n\t\t\t'image' => 'required|file',\n\t\t\t'website' => 'required|string|url',\n\t\t\t'twitter' => 'required|string|url',\n\t\t\t'facebook' => 'required|string|url',\n\t\t\t'description' => 'required|string',\n\t\t\t'technology' => 'nullable|string',\n\t\t\t'features' => 'required|string',\n\t\t]);\n\t\t$accounts = auth()->user()->accounts;\n\t\t$page_title = \"title\";\n //$data['users'] = User::latest()->paginate(20);\n return view('admin.tokens.create',compact('jsvalidator','accounts','page_title'));\n }", "public function getAccountToken(): ?string\n {\n return $this->accountToken;\n }", "public function getToken()\n\t{\n\t\treturn static::createFormToken($this->target_form_id ? $this->target_form_id : $this->id);\n\t}", "function create_token()\n {\n $secretKey = \"B1sm1LLAH1rrohmaan1rroh11m\";\n\n // Generates a random string of ten digits\n $salt = mt_rand();\n\n // Computes the signature by hashing the salt with the secret key as the key\n $signature = hash_hmac('sha256', $salt, $secretKey, false);\n // $signature = hash('md5', $salt.$secretKey);\n\n // return $signature;\n return urlsafeB64Encode($signature);\n }", "private function generateToken() {\n $response = null;\n $args = [\n 'body' => $this->body,\n 'timeout' => '5',\n 'redirection' => '5',\n 'httpversion' => '1.0',\n 'blocking' => true,\n 'headers' => [],\n 'cookies' => [],\n ];\n \n $response = wp_remote_post($this->url, $args);\n \n if ($response instanceof WP_Error) {\n throw new Exception(\"Error trying to connect to instance\");\n } else {\n $responseBody = json_decode($response['body']);\n\n if (isset($responseBody->error)) {\n throw new Exception(\"Error with Salesforce login credentials\");\n } else {\n return $responseBody;\n }\n }\n }", "public function create(){\n\t\treturn view('_admin.tokens.create');\n\t}", "public function requestToken() {\n \n $result = $this->doRequest('v1.0/token?grant_type=1', 'GET');\n\n $this->_setToken($result->result->access_token);\n $this->_setRefreshToken($result->result->refresh_token);\n $this->_setExpireTime($result->result->expire_time);\n $this->_setUid($result->result->uid);\n\n }", "public static function get_token() {\n global $USER;\n $sid = session_id();\n return self::get_token_for_user($USER->id, $sid);\n }", "public function getToken()\n\t{\n\t\treturn $this->getOption('accesstoken');\n\t}", "public function get_request_token($callback);", "public function createPasswordCredentialsToken()\n {\n\n $authorization_token = base64_encode($this->getUsername() . ':' . $this->getPassword());\n\n $params = [\n 'headers' => [ 'Authorization' => 'Basic '. $authorization_token],\n 'form_params' => ['grant_type' => env('DW_GRANT_TYPE', 'client_credentials')]\n ];\n\n // Make the Request and process the response\n $response = $this->guzzle->request('POST', $this->getAuthUrl(), $params);\n $result = json_decode((string) $response->getBody());\n\n $this->setToken($result->access_token)\n ->setTokenExpiry(\n Carbon::now()\n ->addSeconds($result->expires_in)\n );\n\n return $this->token;\n }", "private function getToken()\n {\n return uniqid();\n }", "private function getAccessToken(): string\n {\n try {\n $token = Storage::disk('local')->get(self::ALIGO_ACCESS_TOKEN_FILE);\n } catch (\\Exception $exception) {\n $token = null;\n }\n\n if (empty($token)) {\n try {\n $response = $this->call('/akv10/token/create/10/y');\n $data = json_decode((string) $response->getBody(), false);\n } catch (\\Throwable $exception) {\n throw CouldNotSendNotification::serviceRespondedWithAnError($exception);\n }\n Storage::disk('local')->put(self::ALIGO_ACCESS_TOKEN_FILE, $data->token);\n\n return $data->token;\n }\n\n return $token;\n }", "function generateToken() {\n\t$token = openssl_random_pseudo_bytes(10);\n \n\t//Convert the binary data into hexadecimal representation.\n\t$token = bin2hex($token);\n\t\n\treturn $token;\n}", "static function generateToken() {\n $token = Cache::get(\"token\", false);\n if ($token) {\n return $token;\n } else {\n $time = floor(time() / 1000);\n $token = md5(bin2hex($time));\n new Cache(\"token\", $token);\n return $token;\n }\n }", "public function get_payment_token() {\n\n\t\tif ( 'credit_card' === $this->get_method_type() ) {\n\n\t\t\t$data = array(\n\t\t\t\t'type' => $this->get_method_type(),\n\t\t\t\t'card_type' => $this->cardType,\n\t\t\t\t'last_four' => ltrim( $this->number, 'x' ),\n\t\t\t\t'exp_month' => $this->expMonth,\n\t\t\t\t'exp_year' => $this->expYear,\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t$data = array(\n\t\t\t\t'type' => $this->get_method_type(),\n\t\t\t\t'last_four' => ltrim( $this->accountNumber, 'X' ),\n\t\t\t\t'account_type' => 'PERSONAL_SAVINGS' === $this->accountType ? 'savings' : 'checking',\n\t\t\t);\n\t\t}\n\n\t\treturn new Framework\\SV_WC_Payment_Gateway_Payment_Token( $this->get_method_id(), $data );\n\t}", "function generateToken($ownerID, $name, $date){\n // This is accomplished by hashing the concatenation of a few unique identifiers of the group, then returning\n // the last 20 characters.\n return substr(sha1($ownerID.$name.$date), 20);\n}", "public function getToken()\n {\n return $this->accessToken;\n }", "public function getToken()\r\n\t{\r\n\t\treturn $this->getTransaction()->getToken();\r\n\t}", "public function get_request_token($accid) {\n // Get a request token from the appliance\n $url = $this->appliance_url . \"/api/request_token.php\";\n $result = $this->call($url, array());\n // dbg(\"Received request token $result\");\n $req_token = array();\n parse_str($result,$req_token);\n\n if(!isset($req_token['oauth_token'])) {\n //error_log(\"Failed to retrieve request token from \".$url.\" result = \".$result);\n throw new Exception(\"Unable to retrieve request token\");\n }\n $token = new OAuthToken($req_token['oauth_token'], $req_token['oauth_token_secret']);\n return $token;\n }", "public function getToken() {\n return $this->accessToken;\n }", "public static function createToken($firstname, $lastname, $email, $secretKey)\n {\n $json = sprintf('{\"fn\":\"%s\",\"ln\":\"%s\",\"em\":\"%s\"}', $firstname, $lastname, $email);\n print($json . PHP_EOL);\n return WLTLoginToken::encode($json, $secretKey);\n }", "public function createPaymenttoken(\n Requestmodels\\Paymenttokencreate $requestModel\n ) {\n $chargeMapper = new Chargesmapper($requestModel);\n\n $requestPayload = array(\n 'authorization' => $this->apiSetting->getSecretKey(),\n 'mode' => $this->apiSetting->getMode(),\n 'postedParam' => $chargeMapper->requestPayloadConverter(),\n );\n\n $processCharge = Apihttpclient::postRequest(\n $this->apiUrl->getPaymenttokensApiUri(),\n $this->apiSetting->getSecretKey(), $requestPayload\n );\n\n return new Responsemodels\\Paymenttoken($processCharge);\n }", "public function getToken() : string {\n if (($this->token === null) || ($this->token->isExpired())) {\n $jwtBuilder = new Builder();\n $jwtBuilder->set('iss', $this->handlerPublicKey);\n $jwtBuilder->set('sub', $this->credentialPublicKey);\n\n $this->token = $jwtBuilder\n ->sign(new Sha256(), $this->handlerPrivateKey)\n ->getToken();\n }\n\n return (string) $this->token;\n }", "public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}", "public function getToken()\n {\n $parameters = array(\n 'Identifier' => $this->getIdentifier(),\n );\n\n $response = self::sendRequest(self::getModelName(), 'gettoken', $parameters);\n\n if (isset($response['status']) == false) {\n return false;\n }\n if ($response['status'] != 'success') {\n return false;\n }\n if (isset($response['domain']['AuthKey']) == false) {\n return false;\n }\n $this->setAuthKey($response['domain']['AuthKey']);\n return $response['domain']['AuthKey'];\n }", "public function getToken()\n {\n $tokenValidator = new \\Paggi\\SDK\\TokenValidation(); //self::$container->get('TokenValidation');\n if (!$tokenValidator->isValidToken(self::$token)) {\n return false;\n }\n return self::$token;\n }", "public function obtenerAuthToken()\n {\n $controller = new SignaBlockController;\n $response = $controller->auth();\n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->token;\n }\n }\n return response()->json($this->jsonError);\n }", "public function generateToken(): string\n {\n $token = bin2hex(random_bytes(16));\n $this->setTokens($this->limitTokens(\n array_merge($this->getTokens(), [$token])\n ));\n return $token;\n }", "protected function getToken()\n {\n // We have a stateless app without sessions, so we use the cache to\n // retrieve the temp credentials for man in the middle attack\n // protection\n $key = 'oauth_temp_'.$this->request->input('oauth_token');\n $temp = $this->cache->get($key, '');\n\n return $this->server->getTokenCredentials(\n $temp,\n $this->request->input('oauth_token'),\n $this->request->input('oauth_verifier')\n );\n }", "public function generateRandomToken():string;", "public static function generate(): Token\n {\n $token = bin2hex(random_bytes(256));\n return new Token($token);\n }", "function uploadApiGenerateToken($args)\n {\n return $this->uploadApi->generateToken($args);\n }", "public function createToken(CreateTokenRequest $request)\n {\n $this->apiData = $this->tokenService->createToken($request);\n\n return $this->success();\n }", "public function create_token()\n {\n $this->load->library('wsresponse');\n $this->load->library('wschecker');\n $this->wsresponse->setOptionsResponse();\n \n $this->load->model('rest_model');\n $remote_addr = $this->wschecker->getHTTPRealIPAddr();\n $user_agent = $this->wschecker->getHTTPUserAgent();\n $prepare_str = $remote_addr . \"@@\" . $user_agent . \"@@\" . time();\n $ws_token = hash(\"SHA256\", $this->wschecker->encrypt($prepare_str));\n\n $inser_arr['vWSToken'] = $ws_token;\n $inser_arr['vIPAddress'] = $remote_addr;\n $inser_arr['vUserAgent'] = $user_agent;\n $inser_arr['dLastAccess'] = date(\"Y-m-d H:i:s\");\n $res = $this->rest_model->insertToken($inser_arr);\n if ($res) {\n $settings_arr['success'] = 1;\n $settings_arr['message'] = \"Token generated successfully..!\";\n $data_arr['ws_token'] = $ws_token;\n } else {\n $settings_arr['success'] = 0;\n $settings_arr['message'] = \"Token generation failed..!\";\n $data_arr = array();\n }\n $responce_arr['settings'] = $settings_arr;\n $responce_arr['data'] = $data_arr;\n $this->wsresponse->sendWSResponse($responce_arr);\n }", "public function generateNewToken()\n {\n $this->token = uniqid(null, true);\n return ($this->token);\n }", "function createtoken()\n {\n $token = \"token-\" . mt_rand();\n // put in the token, created time\n $_SESSION[$token] = time();\n return $token;\n }", "public function generateUserTokenUrl(AccountInterface $account);", "public function generateAccessToken()\n {\n return Yii::$app->security->generateRandomString();\n }", "public function GetToken(\\Controle\\GetToken $parameters) {\n return $this->__soapCall(\n 'GetToken',\n array($parameters),\n array('uri'=>'http://api.nmbrs.nl/soap/v2.0/SingleSignOn')\n );\n\t}", "public function create()\n {\n return view('admin.tokens.create');\n }", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public function getAccessToken();", "public static function nextToken() {\n return bin2hex(openssl_random_pseudo_bytes(10));\n }", "public function generateToken(AdminRequest $request)\n {\n $uid = $request->input('uid');\n try\n {\n $user = $this->credentials->getUserCredentials($uid);\n if (!empty($user))\n {\n return $user->createToken('ops')->accessToken;\n }\n }\n catch (Exception $ex)\n {\n Log::error('Admin generate user token exception:' . $ex->getMessage());\n abort(500);\n }\n abort(404);\n }" ]
[ "0.7896145", "0.73755854", "0.72108203", "0.7087007", "0.7015328", "0.6858211", "0.6800441", "0.67598885", "0.67515516", "0.67281187", "0.66865164", "0.66535723", "0.6619007", "0.6607303", "0.64602524", "0.6437371", "0.6437371", "0.6437371", "0.6437371", "0.641774", "0.6407844", "0.64068365", "0.63955295", "0.6391053", "0.6357585", "0.6318867", "0.6310487", "0.6293972", "0.62881166", "0.6284988", "0.62787396", "0.62787396", "0.62787396", "0.62787396", "0.62690014", "0.6257526", "0.62536204", "0.6246208", "0.6245041", "0.62359995", "0.62296426", "0.62181246", "0.62105143", "0.6188738", "0.61798984", "0.61705756", "0.6155084", "0.61372304", "0.61323947", "0.6131911", "0.6104028", "0.60924405", "0.6089562", "0.6078311", "0.6077183", "0.60765827", "0.607323", "0.60677654", "0.6057426", "0.604732", "0.6045161", "0.6043657", "0.6035803", "0.6029455", "0.60292", "0.6019852", "0.6011291", "0.60055774", "0.600342", "0.59932065", "0.59908026", "0.5987505", "0.5971114", "0.59541357", "0.59401083", "0.5928718", "0.5927808", "0.59267825", "0.591745", "0.59050304", "0.5900191", "0.58983576", "0.5894859", "0.5893195", "0.58869153", "0.5886727", "0.58806103", "0.5879277", "0.58770025", "0.5876452", "0.58707476", "0.58686405", "0.5862182", "0.5861934", "0.5861934", "0.5861934", "0.5861934", "0.5861934", "0.5855369", "0.58522797" ]
0.82768536
0
Creates a new class instance.
public function __construct( TenderRepository $tenderRepo, UploadedFileRepository $uploadedFileRepo ) { $this->tenderRepository = $tenderRepo; $this->uploadedFileRepository = $uploadedFileRepo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "function createInstance(ClassDefinition $classDefinition);", "function new_instance($class)\n {\n }", "public function create(string $class);", "public function newInstance();", "public function newInstance();", "public function newInstance(): object;", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function create()\n {\n return new $this->class;\n }", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public static abstract function createInstance();", "public function new()\n\t{\n\t\t//\n\t}", "public function new()\n\t{\n\t\t//\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function createInstance()\n {\n return new self();\n }", "public function newInstance()\n {\n return new self();\n }", "function get_new($class, $params=NULL)\r\n\t{\r\n\t\t$obj = $this->singularize(ucwords($class));\r\n\t\treturn new $obj($params);\r\n\t}", "public static function create() {\n\t\treturn new self();\n\t}", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "function create($class, array $attributes = [])\n{\n return factory($class)->create($attributes);\n}", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public static function create()\n\t\t{\n\t\t\treturn new self();\n\t\t}", "public function new()\n {\n //\n }", "public function new()\n {\n //\n }", "public static function factory($className)\n {\n return new $className;\n }", "public static function create() {\n return new self();\n }", "public function make($class)\n {\n return Kant::createObject($class);\n }", "public function createClass()\n {\n return $this->addExcludesNameEntry($this->classes);\n }", "static function create(): self;", "public function create($class, $args = array()) {\n\n\t\t// load class\n\t\t$this->app->loader->register($class, 'classes:'.strtolower($class).'.php');\n\n\t\t// use reflection or new for object creation\n\t\tif (count($args) > 0) {\n\t\t\t$reflection = new ReflectionClass($class);\n\t\t\t$object = $reflection->newInstanceArgs($args);\n\t\t} else {\n\t\t\t$object = new $class();\n\t\t}\n\t\t\n\t\t// add reference to related app instance\n\t\tif (property_exists($object, 'app')) {\n\t\t\t$object->app = $this->app;\n\t\t}\n\t\t\n\t\treturn $object;\n\t}", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public function & create($class) {\n\t\t# Add namepsace to class\n\t\t$objectFactoryClass = $this->getFactoryClassName($this->getFactoryClass($class));\n\t\t# Creating Factory object\n\t\t$objectFactory = new $objectFactoryClass();\n\t\t# Creating orignal object\n\t\t$object = $objectFactory->getInstance($this);\n\t\t# Returning object\n\t\treturn $object;\n\t}", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "protected final static function createInstance($className, $arguments){\n\t\t// Some optimizations\n\t\tif (count($arguments) == 1) {\n\t\t\treturn new $className($arguments[0]);\n\t\t}\n\t\telse if (count($arguments) == 2) {\n\t\t\treturn new $className($arguments[0], $arguments[1]);\n\t\t}\n\t\telse if (count($arguments) == 3) {\n\t\t\treturn new $className($arguments[0], $arguments[1], $arguments[2]);\n\t\t}\n\t\telse if (count($arguments) == 4) {\n\t\t\treturn new $className($arguments[0], $arguments[1], $arguments[2], $arguments[3]);\n\t\t}\n\t\telse if (count($arguments) == 5) {\n\t\t\treturn new $className($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4]);\n\t\t}\n\t\t\n\t\t// For any constructor with more arguments we use eval.\n\t\t$args = array();\n\t\tfor ($i = 0; $i < count($arguments); $i++) {\n\t\t\t$args[] = '$arguments[' . $i . ']';\n\t\t}\n\t\t$instance = null;\n\t\teval('$instance = new ' . $className . '(' . implode(',', $args) . ');');\n\t\treturn $instance;\n\t}", "public static function createClass($class)\n\t{\n\t\tself::$classes[$class] = new $class;\n\t}", "public static function new()\n {\n return new static();\n }", "function _new() {\n\tglobal $__classes;\n\n\t$args = func_get_args();\n\t$class=$args[0];\n\tif($__classes[$class] != \"\" && $class != \"db\") {\n\t\t$res = $__classes[$class];\n\t} else {\n\t\tif(!class_exists($class)) {\n\t\t\t//init class\n\t\t\tif (file_exists(BACKEND.$class.\".class.php\"))\n\t\t\t\tinclude(BACKEND.$class.\".class.php\");\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n\t\tfor($i = 1; $i< count($args);$i++) $_args[] .= \"\\$args['\".$i.\"']\";\n\n\t\t$__args = \"\";\n\t\tif(@count($_args) > '0') {\n\t\t\t$__args = \"(\".implode(\",\",$_args).\")\";\n\t\t}\n\n\t\t$res = \"\";\n\t\teval(\"\\$res = new \".$class.$__args.\";\");\n\t\tdebuglog(\"neue Klasse\",\"Neue Klasse initiert:\".$class);\n\t\t$__classes[$class] = $res;\n\t}\n\treturn $res;\n }", "public static function factory($flags = null, $class_name = null) {}", "public static function factory($flags = null, $class_name = null) {}", "public static function make() {\n return new self();\n }", "public static final function of($class) {\n return self::typeOf($class)->newInstance();\n }", "public abstract function createInstance($parameters);", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public static function create($class)\n {\n $class = self::getClientClassName($class);\n if (!class_exists($class)) {\n throw new RuntimeException(\"Class '$class' not found\");\n }\n return new $class();\n }", "public static function factory()\n {\n return new self;\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "static public function create()\n {\n return new static();\n }", "private function __construct() {\n \n trace('***** Creating new '.__CLASS__.' object. *****');\n \n }", "protected function createObject($class, ...$args) {\n\t\treturn new $class(...$args);\n\t}", "public static function createInstance()\n {\n return new static();\n }", "public function create()\n\t{\n\t\t$scope = new \\ReflectionClass( $this -> className );\n\t\t$new_scope = $scope -> newInstanceArgs( $this -> arguments );\n\t\treturn $new_scope;\n\t}", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function new(){\n self::$instance = new self();\n return self::$instance;\n }", "static public function create()\n\t{\n\t\treturn new static;\n\t}", "public function regularNew() {}", "public function getNew()\n {\n $class = get_class($this);\n\n return new $class;\n }", "public function fn_construct_class() {\n\t}", "public static function make()\n {\n return new static();\n }", "public static function create(): self\n {\n return new static();\n }" ]
[ "0.8045186", "0.7730439", "0.7575917", "0.7553807", "0.7517733", "0.7517733", "0.74608153", "0.74295586", "0.74137187", "0.73178077", "0.71588844", "0.71373075", "0.71373075", "0.7119144", "0.7119144", "0.7119144", "0.7109181", "0.70463014", "0.6973363", "0.69717866", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.6945921", "0.693907", "0.6923449", "0.6911622", "0.6911622", "0.69021493", "0.68907964", "0.68907964", "0.68857235", "0.68674517", "0.68398", "0.6827863", "0.68110436", "0.6807947", "0.6802502", "0.68009925", "0.6793369", "0.67928433", "0.678004", "0.67719066", "0.67717147", "0.67501235", "0.67501235", "0.67468786", "0.6728182", "0.67070353", "0.6696351", "0.66854554", "0.66853607", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.6683771", "0.66778976", "0.6676559", "0.6661466", "0.6648876", "0.66416585", "0.66307104", "0.66307104", "0.66307104", "0.66307104", "0.6613707", "0.6593678", "0.6592441", "0.6573821", "0.65692806", "0.6554111", "0.6545166" ]
0.0
-1
Add the page title and hide the toolbar.
protected function addToolbar() { require_once JPATH_COMPONENT.'/helpers/wbty_payments.php'; $state = $this->get('State'); $canDo = Wbty_paymentsHelper::getActions($state->get('filter.category_id')); JToolBarHelper::title(JText::_('COM_WBTY_PAYMENTS_TITLE_CONTROLPANEL'), 'controlpanel.png'); if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_wbty_payments'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addToolbar()\n\t{\n\t\tJRequest::setVar('hidemainmenu', true);\n\t}", "public function loadPageTitle()\n \t\t{\n echo \"<title>Add Item</title>\";\n }", "protected function addToolBar()\n {\n $title = JText::_('COM_HELLOWORLD_MANAGER_HELLOWORLDS');\n\n if ($this->pagination->total)\n {\n $title .= \"<span style='font-size: 0.5em; vertical-align: middle;'>(\" . $this->pagination->total . \")</span>\";\n }\n }", "public function initPageHeaderToolbar()\n {\n if (empty($this->display)) {\n $this->page_header_toolbar_btn['new_reward'] = [\n 'href' => self::$currentIndex.'&addgamifications_reward&token='.$this->token,\n 'desc' => $this->l('Add new reward'),\n 'icon' => 'process-icon-new',\n ];\n }\n\n parent::initPageHeaderToolbar();\n }", "public function setPageTitle($title);", "function set_title() {\n \tglobal $pageTitle;\n \tif (isset($pageTitle))\n \t\techo 'Tanqeeb | ' . $pageTitle;\n \telse\n \t\techo 'Tanqeeb';\n}", "public function initPageHeaderToolbar()\n {\n if (empty($this->display)){\n $this->page_header_toolbar_btn = array(\n 'new' => array(\n 'href' => self::$currentIndex.'&addwpproductcarousels&token='.$this->token,\n 'desc' => $this->l('Add New Carousel', null, null, false),\n 'icon' => 'process-icon-new'\n ),\n 'options' => array(\n 'href' => $this->context->link->getAdminLink('AdminModules') . '&configure=wpproductcarousels',\n 'desc' => $this->l('Options'),\n 'icon' => 'process-icon-cogs'\n )\n );\n }\n\n parent::initPageHeaderToolbar();\n }", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "protected function regeneratePageTitle() {}", "protected function renderPageTitle() {}", "protected function page_title() {\n?>\n\t\t<h2>\n\t\t\t<?php echo __( 'Marketplace Add-ons', APP_TD ); ?>\n\t\t\t<a href=\"https://marketplace.appthemes.com/\" class=\"add-new-h2\"><?php _e( 'Browse Marketplace', APP_TD ); ?></a>\n\t\t\t<a href=\"https://www.appthemes.com/themes/\" class=\"add-new-h2\"><?php _e( 'Browse Themes', APP_TD ); ?></a>\n\t\t</h2>\n<?php\n\t}", "public function ShowTitle()\n {\n return true;\n }", "function shoestrap_empty_page_title() {}", "function vodi_toggle_page_site_content_page_title( $show ) {\n global $post;\n\n if ( is_page() && isset( $post->ID ) ) {\n $clean_page_meta_values = get_post_meta( $post->ID, '_vodi_page_metabox', true );\n $page_meta_values = maybe_unserialize( $clean_page_meta_values );\n\n if ( isset( $page_meta_values['hide_page_title'] ) && $page_meta_values['hide_page_title'] == '1' ) {\n $show = false;\n }\n }\n\n return $show;\n }", "protected function output_page_title( $page_title = '' ) {\n?>\n\t\t<h2>\n\t\t\t<?php echo $this->browser_args['page_title']; ?>\n\n\t\t\t<?php if ( ! empty( $this->browser_args['header_buttons'] ) && is_array( $this->browser_args['header_buttons'] ) ) foreach( $this->browser_args['header_buttons'] as $tab ): ?>\n\t\t\t\t<a href=\"<?php echo esc_url( $tab['url'] ); ?>\" class=\"add-new-h2\" target=\"_blank\" rel=\"nofollow\"><?php echo $tab['title']; ?></a>\n\t\t\t<?php endforeach; ?>\n\t\t</h2>\n<?php\n\t}", "protected function addToolbar()\n\t{\n\t\t// Set toolbar items for the page\n\t\tif ($this->copy)\n\t\t{\n\t\t\t$toolbarTitle=JText::_('COM_JOOMLEAGUE_ADMIN_PROJECT_COPY_PROJECT');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$toolbarTitle=(!$this->edit) ? JText::_('COM_JOOMLEAGUE_ADMIN_PROJECT_ADD_NEW') : JText::_('COM_JOOMLEAGUE_ADMIN_PROJECT_EDIT');\n\t\t\tJToolBarHelper::divider();\n\t\t}\n\t\tJToolBarHelper::title($toolbarTitle,'ProjectSettings');\n\t\t\n\t\tif (!$this->copy)\n\t\t{\n\t\t\tJLToolBarHelper::apply('project.apply');\n\t\t\tJLToolBarHelper::save('project.save');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJLToolBarHelper::save('project.copysave');\n\t\t}\n\t\tJToolBarHelper::divider();\n\t\tif ((!$this->edit) || ($this->copy))\n\t\t{\n\t\t\tJLToolBarHelper::cancel('project.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// for existing items the button is renamed `close`\n\t\t\tJLToolBarHelper::cancel('project.cancel',JText::_('COM_JOOMLEAGUE_GLOBAL_CLOSE'));\n\t\t}\n\t\tJLToolBarHelper::onlinehelp();\n\t}", "protected function setTitle()\n\t{\n\t\tglobal $APPLICATION;\n\n\t\tif ($this->arParams[\"SET_TITLE\"] == 'Y')\n\t\t\t$APPLICATION->SetTitle(Localization\\Loc::getMessage(\"SPOL_DEFAULT_TITLE\"));\n\t}", "public function admin_dashboard() {\n $this->set('title_for_layout', __('Panel'));\n }", "public function add_theme_title_tag() {\n\t\t\tif (!is_admin()) {\n\t\t\t\t// auto gen <title>\n\t\t\t\tif (!current_theme_supports('title-tag')) {\n\t\t\t\t\tadd_theme_support( 'title-tag' );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function setPageTitle($page_name);", "public function setPageTitle($page_name);", "public function title(){\r\n\r\n echo ISSET($this->pageSettings->page_title)?$this->pageSettings->page_title:'';\r\n\r\n }", "public function setPageTitle($title)\n\t{\n\t\t$this->_themeExtras['title'] = $title;\n\t}", "function udesign_page_title_before() {\r\n do_action('udesign_page_title_before');\r\n}", "function udesign_page_title_top() {\r\n do_action('udesign_page_title_top');\r\n}", "protected function addToolbar()\n\t{\n JToolbarHelper::preferences('com_jpetition');\n JToolbarHelper::title(JText::_('COM_JPETITION'), 'checkmark');\n }", "protected function addToolbar()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t\n\t\t$this->option = $app->input->get('option', 'com_' . EcConst::getPrefix());\n\t\t$this->canDo = EcHelperAdmin::getActionsEc($this->option);\n\t\t\n\t\tJToolbarHelper::title(Text::_(JString::strtoupper($this->option)), 'stack article');\n\t\t\n\t\tif ($this->canDo->get('core.admin')) {\n\t\t\tJToolbarHelper::divider();\n\t\t\tJToolbarHelper::preferences($this->option);\n\t\t}\n\t}", "function quasar_after_header_title_hook(){\n\t//Do Nothing\n}", "function udesign_page_title_after() {\r\n do_action('udesign_page_title_after');\r\n}", "public function addToolbar()\n\t{\n\t\tJToolBarHelper::title(JText::_('JBS_EI_TITLE'), 'folder');\n\t\tJToolBarHelper::help('jbsexportimport', true);\n\t}", "protected function addToolbar()\n\t{\n\t\t$acl = ProjectforkHelper::getActions();\n\t\t$user = JFactory::getUser();\n \n\t\tJToolBarHelper::title(JText::_('COM_CONTENT_ARTICLES_TITLE'), 'article.png');\n\n\t\tif ($acl->get('core.admin')) {\n\t\t\tJToolBarHelper::preferences('com_projectfork');\n\t\t\tJToolBarHelper::divider();\n\t\t}\n\n\t\tJToolBarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER');\n\t}", "protected function addToolbar()\n\t{\t\t\n\t\t// Set toolbar items for the page\n\t\t$edit=JRequest::getVar('edit',true);\n\t\t$text=!$edit ? JText::_('COM_JOOMLEAGUE_GLOBAL_NEW') : JText::_('COM_JOOMLEAGUE_GLOBAL_EDIT');\n\t\tJLToolBarHelper::save('playground.save');\n\t\tif (!$edit)\n\t\t{\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_PLAYGROUND_ADD_NEW'),'playground');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('playground.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// for existing items the button is renamed `close` and the apply button is showed\n\t\t\tJToolBarHelper::title(JText::_('COM_JOOMLEAGUE_ADMIN_PLAYGROUND_EDIT'),'playground');\n\t\t\tJLToolBarHelper::apply('playground.apply');\n\t\t\tJToolBarHelper::divider();\n\t\t\tJLToolBarHelper::cancel('playground.cancel','COM_JOOMLEAGUE_GLOBAL_CLOSE');\n\t\t}\n\t\tJToolBarHelper::divider();\n\t\tJLToolBarHelper::onlinehelp();\t\n\t}", "function setTitle() {\n global $pageTitle;\n\n $pageTitle = isset($pageTitle) ? $pageTitle : 'Default' ;\n echo $pageTitle;\n }", "public function init()\n {\n\t\t$this->view->headTitle(Zend_Registry::get('Default Page Title'));\n\t\t$this->view->headTitle()->prepend('Partners');\n }", "function udesign_page_title_bottom() {\r\n do_action('udesign_page_title_bottom');\r\n}", "public function showPageHeader() {\n\n\t\techo $this->getPageHeader();\n\t}", "function customPageHeader() {\n echo osc_apply_filter('custom_plugin_title', __('Plugins'));\n }", "public static function setPageTitle($title)\n\t{\n\t\tYii::app()->controller->pageTitle = $title;\n\t}", "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 od_set_page_title($orig_title) {\n\t\treturn \"Map | \"; // set the page title (could be improved, eg based on filters. Might be something the user wants to set\n\t}", "public function setPageTitle(array $config): void\n {\n foreach ($config as $item) {\n if (isset($item['active']) && $item['active']) {\n $this->_View->assign('title', $item['title']);\n break;\n }\n }\n }", "public function beforeRender(){\n\t\t$title_for_layout = __('エネルギー効率評価システム | 一般社団法人 日本工業炉協会');\n\t\t$this->set('title_for_layout', $title_for_layout);\t\t\n\t}", "protected function renderToolbar() {}", "function set_title($title) \r\n\t{\r\n\t\t//$this->title = $title;\r\n\t\t$this->data['title_for_layout'] = $title;\r\n\t\t$this;\r\n\t}", "function ajoute_le_titre()\n{\n if (!is_admin()) {\n add_theme_support(\"title-tag\");\n } \n}", "public function showAction()\n {\n if (! isset($this->showParameters['contentTitle'])) {\n $this->showParameters['contentTitle'] = $this->getShowTitle();\n }\n\n parent::showAction();\n }", "function hide_page_title( $post_id = false ) {\r\n global $post;\r\n\r\n if ( is_home() ) {\r\n return true;\r\n }\r\n\r\n if ( !$post_id ) {\r\n $post_id = $post->ID;\r\n }\r\n\r\n return get_post_meta( $post_id, 'hide_page_title', true ) == 'true' ? true : false;\r\n\r\n }", "function ind_after_setup_theme() {\r\n\tif ( ! is_admin() ) {\r\n\t\t// We're not on an admin page.\r\n\t\tshow_admin_bar( current_user_can( 'admin_toolbar' ) );\r\n\t}\r\n}", "function setPageTitle($pageTitle)\n\t{\n\t\t$this->pageTitle = $pageTitle;\n\t}", "function setup_title() {\n\t\tglobal $bp;\n\n\t\tif ( bp_is_messages_component() ) {\n\t\t\tif ( bp_is_my_profile() ) {\n\t\t\t\t$bp->bp_options_title = __( 'My Messages', 'buddypress' );\n\t\t\t} else {\n\t\t\t\t$bp->bp_options_avatar = bp_core_fetch_avatar( array(\n\t\t\t\t\t'item_id' => bp_displayed_user_id(),\n\t\t\t\t\t'type' => 'thumb',\n\t\t\t\t\t'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )\n\t\t\t\t) );\n\t\t\t\t$bp->bp_options_title = bp_get_displayed_user_fullname();\n\t\t\t}\n\t\t}\n\n\t\tparent::setup_title();\n\t}", "public function setPageTitle($title)\n {\n self::set('_title', $title);\n }", "function _block_template_render_title_tag()\n {\n }", "protected function setPageTitle($title) {\n\n $this->pageTitle = $title;\n\n $args = array('class' => 'title');\n $titleTag = \\MUtil_Html::create('h3', $title, $args);\n\n $this->html->append($titleTag);\n }", "protected function addToolBar()\r\n\t{\r\n\t\t$title = JText::_('COM_SMF_MANAGER');\r\n\t\tif ($this->pagination->total)\r\n\t\t{\r\n\t\t\t$title .= \"<span style='font-size: 0.5em; vertical-align: middle;'> (\" . $this->pagination->total . \")</span>\";\r\n\t\t}\r\n\r\n\t\tJToolBarHelper::title($title,'smf');\r\n\r\n\t\tJToolBarHelper::addNew('smf.add');\r\n\t\tJToolBarHelper::editList('smf.edit');\r\n\t\tJToolBarHelper::deleteList('', 'datalist.delete');\r\n\t}", "public function setTitle($title) {\n\t\tTemplate::setSiteTitle($title);\n\t}", "private function dashboard_title()\n {\n global $current_screen, $wp_version;\n\n $dashboard_title = '';\n if ($icon = $this->get_settings('dashboard_icon')) {\n $dashboard_title .= '<span id=\\\"wlcms_dashboard_logo\\\"><img src=\\\"' . $icon . '\\\" alt=\\\"\\\" /></span>';\n\n wlcms_set_css('.index-php #wlcms_dashboard_logo img', array('vertical-align' => 'middle', 'padding-right' => '10px'));\n }\n\n if ($title = $this->get_settings('dashboard_title')) {\n $dashboard_title .= '<span id=\\\"wlcms_dashboard_title\\\">' . $title . '</span>';\n }\n\n if (version_compare($wp_version, '3.8-beta', '>=')) {\n wlcms_add_js('jQuery(\".index-php #wpbody-content .wrap h1:eq(0)\").html(\"' . $dashboard_title . '\")');\n return;\n }\n\n wlcms_add_js('jQuery(\"#icon-index\").html(\"' . $dashboard_title . '\")');\n\n return;\n }", "protected function view_getPageTitle() {\n return 'HalloPizza';\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function opanda_change_menu_title( $title ) {\r\n if ( !BizPanda::isSinglePlugin() ) return $title;\r\n return __('Opt-In Panda', 'opanda');\r\n}", "protected function addToolbar() {\n JFactory::getApplication()->input->set('hidemainmenu', true);\n\n $user = JFactory::getUser();\n $isNew = ($this->item->id == 0);\n if (isset($this->item->checked_out)) {\n $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));\n } else {\n $checkedOut = false;\n }\n\n JToolBarHelper::title(JText::_('COM_CHARTIIB_TITLE_HIERARCHY'), 'generic');\n\n JToolBarHelper::custom('hierarchy.enregistrer', 'save.png', 'save.png', 'JTOOLBAR_SAVE', false);\n \n if (empty($this->item->id)) {\n JToolBarHelper::cancel('hierarchy.cancel', 'JTOOLBAR_CANCEL');\n } else {\n JToolBarHelper::cancel('hierarchy.cancel', 'JTOOLBAR_CLOSE');\n }\n }", "function show_title()\r\n{\r\n\tglobal $WebPagesList,$CurrentActivePage;\r\n\techo getTitle( $CurrentActivePage );\r\n}", "function wpvideocoach_toolbar_link_title()\r\n{\r\n\tglobal $wpvideocoach_toolbar_link_title;\r\n\tif(empty($wpvideocoach_toolbar_link_title)){\r\n\t\t$wpvideocoach_toolbar_link_title = __('How to Videos', 'wp-video-coach');\r\n\t}\r\n\treturn $wpvideocoach_toolbar_link_title;\r\n}", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "function addHeader($title)\n {\n $this->page .= <<<EOD\n<html>\n<head>\n<title>$title</title>\n</head>\n<body>\n<h1 align=\"center\">$title</h1>\nEOD;\n }", "public function setTitle($title = ''){\n $this->setVar('TITLE', $title);\n }", "public function ext_makeToolBar() {}", "function pageTitle(){\n\t\tglobal $pageTitle;\n\t\techo isset($pageTitle) ? $pageTitle : \"Default\";\n\t}", "function PageTitle ($set = false) {\n \tif (!$set) {\n \t\treturn $this->pagetitle;\n \t}\n \telse {\n \t\t$this->pagetitle = $set . ' | ' . $this->config->item('server_name');\n \t\treturn $this->pagetitle;\n \t}\n }", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "function edit_form_after_title()\n {\n }", "function edit_form_after_title()\n {\n }", "public function setTitle($title = '')\n {\n $this->title = $title;\n }", "protected function addToolbar(){\n\t\tJRequest::setVar('hidemainmenu', true);\n\t\t$isNew\t\t= ($this->item->id == 0);\n\t\tJToolBarHelper::title($isNew ? JText::_('ADD_coment') : JText::_('EDIT_coment'), 'coment.png');\n\t\tJToolBarHelper::apply('coment.apply');\n\t\tJToolBarHelper::save('coment.save');\n\t\tJToolBarHelper::save2new('coment.save2new');\n\t\t// If an existing item, can save to a copy.\n\t\tif (empty($this->item->id)) {\n\t\t\tJToolBarHelper::cancel('coment.cancel');\n\t\t}\n\t\telse {\n\t\t\tJToolBarHelper::cancel('coment.cancel', 'JTOOLBAR_CLOSE');\n\t\t}\n\t}", "function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "function displayHeader()\n\t{\n\t\t// output locator\n\t\t$this->displayLocator();\n\n\t\t// output message\n\t\tif($this->message)\n\t\t{\n\t\t\tilUtil::sendInfo($this->message);\n\t\t}\n\t\tilUtil::infoPanel();\n\n//\t\t$this->tpl->setTitleIcon(ilUtil::getImagePath(\"icon_pd_b.gif\"),\n//\t\t\t\"\");\n\t\t$this->tpl->setTitle($this->lng->txt(\"bookmarks\"));\n\t}", "function setElementToolbar()\n\t{\n\t\t$task = JRequest::getVar('task', '', 'method', 'string');\n\t\tJToolBarHelper::title($task == 'add' ? JText::_('ELEMENT') . ': <small><small>[ '. JText::_('NEW') .' ]</small></small>' : JText::_('ELEMENT') . ': <small><small>[ '. JText::_('EDIT') .' ]</small></small>', 'fabrik-element.png');\n\t\tJToolBarHelper::save();\n\t\tJToolBarHelper::apply();\n\t\tJToolBarHelper::cancel();\n\t}", "public static function showHeader() {\r\n\t\t$title = (array_key_exists('headertitle', $_SESSION))?\r\n\t\t\t$_SESSION['headertitle']:\"\";\r\n\t\t\r\n\t\techo \"<!DOCTYPE html>\\n\";\r\n\t\techo \"<html>\\n\";\r\n\t\techo \"<head>\\n\";\r\n\t\techo \"<title>$title</title>\\n\";\r\n\t\techo \"</head>\\n\\t<body>\\n\";\r\n }", "public function before_the_title() {\n\t\techo '<div class=\"fusion-events-before-title\">';\n\t}", "function display_title(){\n\techo \"Menu Page\";\n}", "public function add_page() {\n\t\tadd_theme_page(\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t'edit_theme_options',\n\t\t\t\t'ups_sidebars',\n\t\t\t\tarray( $this, 'admin_page' )\n\t\t\t);\n\t}", "private function appendMasterTitle(){\r\n\t\t$title = $this->head->GetTitle() != null ? $this->head->GetTitle() . \" | \" : \"\";\r\t\t$titleExtension = \"\";\r\t\tif(empty($this->langService) || $this->langService->IsDefaultSelected()){\r\t\t\t$titleExtension = $this->CI->config->item(\"zt_site_title\") . \" - \" . $this->CI->config->item(\"zt_site_slogan\");\t\r\t\t} else {\r\t\t\t$titleExtension = $this->CI->config->item(\"zt_site_title\") . \" - \" . $this->CI->config->item(\"zt_site_slogan_\" . $this->langService->GetLangCode());\r\t\t}\r\r\t\t$title .= $titleExtension;\r\n\t\treturn $this->head->SetTitle($title);\r\n\t}", "public function initToolbar()\n {\n }", "public function setPageTitle($pageTitle) {\n $this->pageTitle = $pageTitle;\n }", "function program_head($show_new = false){\n\techo'\n\t<div class=\"wrap\">\n\t\t<h1>Programm';\n\n\tif($show_new) {\n\t\techo '\n\t\t\t<a class=\"page-title-action\" href=\"' . menu_page_url( 'program', false ) . '&action=new\">Neu erstellen</a>\t\t\n\t\t</h1>';\n\t}else{\n\t\techo \"</h1>\";\n\t}\n}", "private function setTitle()\n {\n $this->title = $this->start_date;\n\n if ($this->start_date != $this->end_date) {\n $this->title .= ' - '.$this->end_date;\n }\n }", "function setTitle(string $title): void\n {\n $this->data['head']['title'] = $title;\n }", "function get_admin_page_title()\n {\n }", "protected function initTitles() {\n\t\t$title \t = \"\";\n\t\t\n\t\tif(isset($this->config['titles']['title']))\n\t\t \t$title = $this->config['titles']['title'];\n\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['title']))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['title'];\n\t\t \t\n\t\tif(isset($this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()]))\n\t\t \t$title .= $this->config['titles']['seperator'] . $this->config['titles'][$this->request->getControllerName()]['action'][$this->request->getActionName()];\n\t\t \t\n\t\t$this->layout->setTitle($title);\n\t}", "function showQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 1;\n\t}", "protected function setup_menu() {\n\t\t$nag = '';\n\n\t\tif ( $this->has_notices() ) {\n\t\t\t$nag = \" <span class='wp-shp-browser-info dashicons dashicons-info' style='line-height: 0.8em'></span>\";\n\t\t}\n\n\t\t$defaults = array(\n\t\t\t'menu_title' => __( 'Showcase', 'wp-shp-browser' ),\n\t\t\t'page_title' => $this->get_page_title(),\n\t\t\t'page_slug' => $this->page_slug,\n\t\t\t'action_link' => false,\n\t\t\t'admin_action_priority' => 99,\n\t\t);\n\t\t$this->args = wp_parse_args( $this->args, $defaults );\n\n\t\t$this->args['menu_title'] .= $nag;\n\t}", "protected function addToolbar()\n\t{\n\t\tJFactory::getApplication()->input->set('hidemainmenu', true);\n\n\t\t$canDo = JHelperContent::getActions('com_cooltouraman');\n\t\t$isNew = ($this->item->id == 0);\n\n\t\tJToolbarHelper::title(\n\t\t\tJText::_(\n\t\t\t\t$isNew ? 'COM_COOLTOURAMAN_VIEW_NEW_EXPERIENCE_TITLE' : 'COM_COOLTOURAMAN_VIEW_EDIT_EXPERIENCE_TITLE'\n\t\t\t),\n\t\t\t'experience_level ' . ($isNew ? 'experience_level-add' : 'experience_level-edit')\n\t\t);\n\n\t\tif ($canDo->get('core.edit') || $canDo->get('core.create'))\n\t\t{\n\t\t\tJToolbarHelper::apply('experience_level.apply');\n\t\t\tJToolbarHelper::save('experience_level.save');\n\t\t}\n\n\t\tif (empty($this->item->id))\n\t\t{\n\t\t\tJToolbarHelper::cancel('experience_level.cancel');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tJToolbarHelper::cancel('experience_level.cancel', 'JTOOLBAR_CLOSE');\n\t\t}\n\t}", "public function prePageHeader();", "function GetTitle() {\r\n global $PageTitle;\r\n if (isset($PageTitle)){echo $PageTitle;}else{echo 'BHM Accessories';}\r\n }", "function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title){\n $this->title = $title;\n }" ]
[ "0.68788826", "0.68296635", "0.664205", "0.66152674", "0.65442365", "0.6407383", "0.6387641", "0.63746333", "0.62909794", "0.6206377", "0.61938035", "0.6193256", "0.61750025", "0.6168997", "0.6158617", "0.613339", "0.61219007", "0.6096361", "0.6090319", "0.6084817", "0.6084817", "0.6084727", "0.60845715", "0.6059795", "0.6058229", "0.60532594", "0.60499275", "0.60445577", "0.6040681", "0.6010633", "0.5965111", "0.59225065", "0.59098506", "0.58909494", "0.58743477", "0.5863798", "0.5851046", "0.5827507", "0.5809815", "0.57529354", "0.5736805", "0.57234097", "0.57049644", "0.56992376", "0.5691631", "0.5675871", "0.5660606", "0.56524605", "0.5647465", "0.56421894", "0.56416667", "0.5635334", "0.56322396", "0.5629407", "0.56289995", "0.56263876", "0.5624045", "0.5620034", "0.5620034", "0.5620034", "0.5620034", "0.5620034", "0.5620034", "0.5620034", "0.5619612", "0.55546546", "0.5553999", "0.5552158", "0.5548331", "0.55480266", "0.55433464", "0.5534565", "0.5525971", "0.5524672", "0.5523462", "0.5523193", "0.5523193", "0.55183154", "0.55155873", "0.55150384", "0.5513596", "0.55117893", "0.55113876", "0.5500843", "0.5500148", "0.5499174", "0.54935646", "0.5492201", "0.54848564", "0.54842883", "0.54826707", "0.54825115", "0.5477943", "0.54770005", "0.547658", "0.54762924", "0.5472072", "0.54649913", "0.5461833", "0.54521376", "0.5451058" ]
0.0
-1
get pages by id
function get_pages($id_pages) { $query = $this->db->query("SELECT * FROM tbl_pages WHERE id_page = '$id_pages'"); return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPage($id);", "function fetchPageDetails($id) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT id, page, private FROM pages WHERE id = ?\",array($id));\n\t$row = $query->first();\n\treturn $row;\n}", "public function get_page_by_id($id)\n {\n $this->db->where('id',$id);\n // $this->db->join('subjects','subjects.id = pages.subject_id');\n $query = $this->db->get('pages');\n return $query->row();\n }", "public function _getById($id)\n {\n $resultDb = $this->database->table('page')->get($id);\n return $this->getPage($resultDb);\n }", "function getPage($id)\n\t{\n\t\t$query = $this->db->get_where('tbl_page', array('id' => $id));\n\t\t//$query = $query->result();\n\t\t$row = $query->row_array();\n\t\treturn $row;\n\t}", "public function getMenuPages($id)\n {\n $menu = $this->cache->tags('sm')->get('menus')->find($id) ?: abort(404);\n $pages = collect($menu->pages)\n ->sortBy('pivot_order')\n ->each(function ($item) {\n $item['from'] = 'pages';\n })->values()->all();\n\n $allPages = $this->cache->tags('sm')->get('pages')->diff($pages)->each(function ($item) {\n $item['from'] = 'allPages';\n });\n\n return response()->json(compact('pages', 'allPages'));\n }", "public function getPagesByLanguageIdAction(){\n\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $chapId = Zend_Auth::getInstance()->getIdentity()->id;\n $language = $this->_request->getParam('language');\n\n $menuModel = new Pbo_Model_WlPages();\n $pages = $menuModel->getPagesByLanguageId($chapId, $language);\n\n echo json_encode($pages->toArray());\n\n }", "function get_page($id)\r\n\t{\r\n\t\t$query = $this->db->select('id, title, content, icon, user_id, date, status, welcome_enable')\r\n\t\t ->from(\"custom_page\")\r\n\t\t ->where(array('id' => $id))\r\n\t\t ->get();\r\n\t\t \r\n\t\treturn $query->row();\r\n\t}", "function getPage($doc, $id){\n $page = false;\n $items = $doc->getElementsByTagName('page');\n foreach ($items as $item) {\n if( $item->getAttribute('id') == $_GET['id'] ){\n $page = $item;\n }\n }\n if( $page !== false ){\n return $page;\n }\n return false;\n}", "public function getPages();", "public function getPage($id) {\r\n\t\t$file = stream_resolve_include_path($this->name . '/pages/' . $id .'.' .\\app::$config['dev']['serialization']) ;\r\n\t\tif ($file) \r\n\t\t\t\treturn \\tools::unserialize(substr($file,0,-4));\r\n\t\telse\r\n\t\t\tthrow new \\Exception(t('Page doesn\\'t exist', FALSE) . ' ,' . $this->name . ' : ' . $id);\r\n }", "function get_all_sorted_page($id)\n\t{\n\t\t$query=$this->db->select('p.id,p.title,p.slug,nl.url')\n\t\t->from('pages as p')\n\t\t->join('navigation_link as nl','p.id=nl.page_id')\n\t\t->join('navigation_groups as ng','ng.id=nl.nav_group_id')\n\t\t->where('ng.id',$id)\n\t\t->get();\n\t\tif ($query->num_rows() == 0) {\n return FALSE;\n } else {\n return $query->result();\n }\n\t}", "function find_page_by_id($id) {\n\tglobal $connection;\n\t\n\t$page_id = $id;\n\t\n\t$query = \"SELECT * \";\n\t$query .= \"FROM pages \";\n\t$query .= \"WHERE id = {$page_id} \";\n\t$query .= \"LIMIT 1\";\n\t$sp = mysqli_query($connection, $query);\n\tconfirm_query($sp);\n\t\treturn $sp;\n}", "protected function findModelPages($id)\n {\n if (($model = Pages::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function getPages() {}", "public function getPage($id){\n\t\ttry {\n\t\t\t$sql = \"SELECT * FROM page WHERE id = :id LIMIT 1\";\n\t\t\t$stmt = $this->_db->prepare($sql);\n\t\t\t$stmt->execute(array( 'id' => $id));\n\t\t\tif($stmt->errorCode() != 0){\n\t\t\t\t$error = $stmt->errorInfo();\n\t\t\t\tthrow new SQLException($error[2], $error[0], $sql, \"Impossible d'obtenir une Page specifiee\");\n\t\t\t}\n\t\t\t$data = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\tif($data == null){\n\t\t\t\tthrow new NullObjectException();\n\t\t\t}\n\t\t\t$page = new Page($data);\n\t\t\treturn $page;\n\t\t}catch(PDOException $e){\n\t\t\tthrow new DatabaseException($e->getCode(), $e->getMessage(), \"Impossible d'obtenir une Page specifiee\");\n\t\t}\n\t}", "public function getTable_pages($id)\n {\n // Initializing:\n $out = '';\n $lang = $this->getLanguageService();\n // Select current page:\n if (!$id) {\n // The root has a pseudo record in pageinfo...\n $row = $this->getPageLayoutController()->pageinfo;\n } else {\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)\n ->getQueryBuilderForTable('pages');\n $queryBuilder->getRestrictions()\n ->removeAll()\n ->add(GeneralUtility::makeInstance(DeletedRestriction::class));\n $row = $queryBuilder\n ->select('*')\n ->from('pages')\n ->where(\n $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($id, \\PDO::PARAM_INT)),\n $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW)\n )\n ->execute()\n ->fetch();\n BackendUtility::workspaceOL('pages', $row);\n }\n // If there was found a page:\n if (is_array($row)) {\n // Getting select-depth:\n $depth = (int)$this->getPageLayoutController()->MOD_SETTINGS['pages_levels'];\n // Overriding a few things:\n $this->no_noWrap = 0;\n // Items\n $this->eCounter = $this->firstElementNumber;\n // Creating elements:\n list($flag, $code) = $this->fwd_rwd_nav();\n $out .= $code;\n $editUids = [];\n if ($flag) {\n // Getting children:\n $theRows = $this->getPageRecordsRecursive($row['uid'], $depth);\n if ($this->getBackendUser()->doesUserHaveAccess($row, 2) && $row['uid'] > 0) {\n $editUids[] = $row['uid'];\n }\n $out .= $this->pages_drawItem($row, $this->fieldArray);\n // Traverse all pages selected:\n foreach ($theRows as $sRow) {\n if ($this->getBackendUser()->doesUserHaveAccess($sRow, 2)) {\n $editUids[] = $sRow['uid'];\n }\n $out .= $this->pages_drawItem($sRow, $this->fieldArray);\n }\n $this->eCounter++;\n }\n // Header line is drawn\n $theData = [];\n $editIdList = implode(',', $editUids);\n // Traverse fields (as set above) in order to create header values:\n foreach ($this->fieldArray as $field) {\n if ($editIdList\n && isset($GLOBALS['TCA']['pages']['columns'][$field])\n && $field !== 'uid'\n && !$this->pages_noEditColumns\n ) {\n $iTitle = sprintf(\n $lang->getLL('editThisColumn'),\n rtrim(trim($lang->sL(BackendUtility::getItemLabel('pages', $field))), ':')\n );\n $urlParameters = [\n 'edit' => [\n 'pages' => [\n $editIdList => 'edit'\n ]\n ],\n 'columnsOnly' => $field,\n 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')\n ];\n $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);\n $url = (string)$uriBuilder->buildUriFromRoute('record_edit', $urlParameters);\n $eI = '<a class=\"btn btn-default\" href=\"' . htmlspecialchars($url)\n . '\" title=\"' . htmlspecialchars($iTitle) . '\">'\n . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';\n } else {\n $eI = '';\n }\n switch ($field) {\n case 'title':\n $theData[$field] = $eI . '&nbsp;<strong>'\n . $lang->sL($GLOBALS['TCA']['pages']['columns'][$field]['label'])\n . '</strong>';\n break;\n case 'uid':\n $theData[$field] = '';\n break;\n default:\n if (strpos($field, 'table_') === 0) {\n $f2 = substr($field, 6);\n if ($GLOBALS['TCA'][$f2]) {\n $theData[$field] = '&nbsp;' .\n '<span title=\"' .\n htmlspecialchars($lang->sL($GLOBALS['TCA'][$f2]['ctrl']['title'])) .\n '\">' .\n $this->iconFactory->getIconForRecord($f2, [], Icon::SIZE_SMALL)->render() .\n '</span>';\n }\n } else {\n $theData[$field] = $eI . '&nbsp;<strong>'\n . htmlspecialchars($lang->sL($GLOBALS['TCA']['pages']['columns'][$field]['label']))\n . '</strong>';\n }\n }\n }\n $out = '<div class=\"table-fit\">'\n . '<table class=\"table table-striped table-hover typo3-page-pages\">'\n . '<thead>'\n . $this->addElement(1, '', $theData)\n . '</thead>'\n . '<tbody>'\n . $out\n . '</tbody>'\n . '</table>'\n . '</div>';\n }\n return $out;\n }", "public function getPage();", "function get_child_pages($id = NULL) {\n\n\tif ( empty($id) ) {\n\t\t$id = get_the_ID();\n\t}\n\n\treturn new WP_Query(\n\t\tarray(\n\t\t\t'post_type'\t\t\t=> 'page',\n\t\t\t'post_parent'\t\t=> $id,\n\t\t\t'posts_per_page'\t=> -1\n\t\t)\n\t);\n\n}", "function getPage($id) {\n $this->db->select(\"*\");\n $this->db->where(\"page_attributes.pageID\", $id);\n $this->db->join('page_content', 'page_content.pageID = page_attributes.pageID');\n $this->db->join('page_meta', 'page_meta.pageID = page_attributes.pageID');\n\t\t$query = $this->db->get('page_attributes');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "public function getPagesForManuscript($xmlid) {\n $manuscript = new stdClass;\n $manuscript->filename = 'placeholder.jpg';\n $manuscript->pagelabel = 'No pages found for this manuscript';\n $this->db->where('manuscripts_xmlid', $xmlid);\n $query = $this->db->get('manuscript_pages');\n return $query->num_rows > 0 ? $query->result() : $manuscript;\n }", "public function getList($id=\"\",$pg){\n\t\t $purl = array();\n\t\tif(isset($_GET['url'])){\n\t\t\t\n\t\t\t$purl\t=\t$_GET['url'];\n\t\t\t$purl\t=\trtrim($purl);\n\t\t\t$purl\t=\texplode('/',$_GET['url']);\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$purl =null;\t\n\t\t}\n\t\tif(!isset($purl['2'])){\n\t\t\t$pn = 1;\n\t\t}else{\n\t\t$pn = $purl['2'];\n\t\t}\n\t\tglobal $database;\n\t\t$resultEmployee = $database->db_query(\"SELECT * FROM items\");\n\t\t$pagin = new Pagination();//create the pagination object;\n\t\t$pagin->nr = $database->dbNumRows($resultEmployee);\n\t\t$pagin->itemsPerPage = 20;\n\t\t\n\t\t$myitems = Items::find_by_sql(\"SELECT * FROM items \".$pagin->pgLimit($pn));\n\t\t\n\t\t\t$index_array =array( \"items\"=>$myitems,\n\t\t\t\t\t\t\t\"mypagin\"=>$pagin->render($pg));\n\t\t\t\t\t\t\treturn $index_array;\n\t\t\n\t\treturn $index_array;\n\t}", "function get_all_page_ids()\n {\n }", "public function index($id)\n {\n $page = Page::find($id);\n foreach($page->blocs as $bloc){\n switch ($bloc->type){\n case 'file':\n case 'image':\n case 'video':\n\n\n $bloc->link = 'storage/bloc/'.$page->id.'/'.$bloc->type.'/'.$bloc->content;\n\n break;\n }\n }\n return response()->json($page);\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM conta_a_pagar WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function get_by_id(int $id)\r\n {\r\n $data = array(\r\n 'pageTitle' => 'Document',\r\n 'document' => $this->StaticPage_model->get_document($id),\r\n 'docs' => $this->StaticPage_model->get_document(),\r\n 'session' => $this->session->userdata('username', 'role')\r\n\t\t);\r\n\r\n $this->load->view('templates/header', $data);\r\n $this->load->view('staticPage/get_by_id_staticPage', $data);\r\n $this->load->view('templates/footer');\r\n\r\n }", "static function get_pages(){\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish'\";\n\t\t\n\t\treturn $wpdb->get_results($sql);\n\t}", "public function get($id)\n {\n return $this->sendRequest(\"tipos-pagamentos\");\n }", "public function show($id)\n {\n $pages = PageContents::where('id',$id)->first();\n if (isset($pages->id)) {\n $returnHTML = Theme::view('default::core.pages_contents.opr.read', [\n 'page' => $pages,\n ])->render();\n\n return response()->json([\n 'success' => true,\n 'msg' => $pages,\n 'html' => $returnHTML,\n ]);\n } else {\n return response()->json([\n 'success' => false,\n 'msg' => 'Single Data',\n 'html' => '',\n ]);\n }\n }", "function find_page($id)\n {\n //$this->db->select('page');\n $this->db->where('page',$id);\n $result = $this->db->get('hits');\n return $result->result();\n }", "public function getPageById($page_id) {\n $sql = \"SELECT p.id, p.tag, p.title, p.time, p.body, p.owner, p.user, p.latest, p.note\n FROM \".$this->settings['db']['prefix'].\"pages p\n where p.id = :page_id\";\n $stmt = $this->db->prepare($sql);\n $stmt->execute([\"page_id\" => (int)$page_id]);\n $results = $stmt->fetch(PDO::FETCH_OBJ);\n $results->body = base64_encode($results->body);\n return $results;\n }", "public function page($id) {\n\n $subject = Subject::get($id);\n $connected_resources = Subject::connectedResourcesQuery($subject);\n $sub_subjects = Subject::getSubSubjects($id);\n //$spatial_items = self::getSpatialItems($connected_resources);\n \n debug($connected_resources);\n \n $similar_subjects = Subject::similarSubjectsQuery($subject);\n \n if (Request::wantsJson()) {\n return response()\n ->json($subject)\n ->header(\"Vary\", \"Accept\");\n }else{\n $pref_labels = [];\n foreach($subject['_source']['prefLabels'] as $prefLabel){\n $pref_labels[$prefLabel['lang']][] = $prefLabel['label'];\n }\n ksort($pref_labels);\n return view('subject.page', [\n 'subject' => $subject,\n 'resources' => $connected_resources,\n 'similar_subjects' => $similar_subjects,\n 'pref_labels' => $pref_labels,\n 'sub_subjects' => $sub_subjects\n ]);\n }\n }", "public static function page_url_get($id) {\n\n\t\t\t\t// $k = 0;\n\t\t\t\t// $pageUrl = '/';\n\t\t\t\t//\n\t\t\t\t// do {\n\t\t\t\t//\n\t\t\t\t// \t$sql = 'SELECT\n\t\t\t\t// \t\t\t\tparent_id,\n\t\t\t\t// \t\t\t\tref\n\t\t\t\t// \t\t\tFROM\n\t\t\t\t// \t\t\t\t' . DB_T_PREFIX . 'page\n\t\t\t\t// \t\t\tWHERE\n\t\t\t\t// \t\t\t\tid = ? AND\n\t\t\t\t// \t\t\t\tdeleted = \"0000-00-00 00:00:00\"';\n\t\t\t\t//\n\t\t\t\t// \t$parameters = [];\n\t\t\t\t// \t$parameters[] = intval($pageId);\n\t\t\t\t//\n\t\t\t\t// \tif ($row = $db->fetch_row($sql, $parameters)) {\n\t\t\t\t// \t\t$pageId = $row['parent_id'];\n\t\t\t\t// \t\t$pageUrl = '/' . $row['ref'] . $pageUrl;\n\t\t\t\t// \t} else {\n\t\t\t\t// \t\treturn NULL;\n\t\t\t\t// \t}\n\t\t\t\t//\n\t\t\t\t// } while ($pageId > 0 && $k++ < 10);\n\t\t\t\t//\n\t\t\t\t// if ($pageUrl == '/home/') {\n\t\t\t\t// \treturn '/';\n\t\t\t\t// } else {\n\t\t\t\t// \treturn $pageUrl;\n\t\t\t\t// }\n\n\t\t\t}", "public function allpagesActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla pages i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n CASE \n WHEN (deleted <= NOW()) THEN \"isDeleted\"\n WHEN (published <= NOW()) THEN \"isPublished\"\n ELSE \"notPublished\"\n END AS status\nFROM content\nWHERE type=?\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"page\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allpages\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "function getPageBanners($id) {\n $this->db->select(\"*\");\n $this->db->where(\"pageID\", $id);\n $this->db->order_by(\"slideOrder ASC\");\n \t$query = $this->db->get('banner');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "function fetchPermissionPages($permission_id) {\n\t$db = DB::getInstance();\n\n\t$query = $db->query(\n\t\"SELECT m.id as id, m.page_id as page_id, p.page as page, p.private as private\n\tFROM permission_page_matches AS m\n\tINNER JOIN pages AS p ON m.page_id = p.id\n\tWHERE m.permission_id = ?\",[$permission_id]);\n\t$results = $query->results();\n\treturn ($results);\n}", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "function fetchPageDetails($id) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT \n\t\tid,\n\t\tpage,\n\t\tprivate\n\t\tFROM \" . $db_table_prefix . \"pages\n\t\tWHERE\n\t\tid = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $stmt->bind_result($id, $page, $private);\n while ($stmt->fetch()) {\n $row = array('id' => $id, 'page' => $page, 'private' => $private);\n }\n $stmt->close();\n return ($row);\n}", "function find_page_by_id($selected_page_id, $public = true) {\r\n\t\tglobal $db;\r\n\t\t// b/c we are receiving the subject id from the query string, we need to make sure it is safe to use.\r\n\t\t$safe_page_id = mysqli_real_escape_string($db, $selected_page_id);\r\n\t\t\r\n\t\t$query = \"SELECT * \";\r\n\t\t$query .= \"FROM pages \";\r\n\t//\t$query .= \"WHERE visible = 1 \";\r\n\t\t$query .= \"WHERE id = {$safe_page_id} \";\r\n\t\tif($public) {\r\n\t\t\t$query .= \"AND visible = 1 \";\r\n\t\t}\r\n\t\t$query .= \"LIMIT 1\";\r\n\t\t\r\n\t\t$page_set = mysqli_query($db, $query);\r\n\t\tconfirm_query($page_set);\r\n\t\t\r\n\t\t// Since we are returning only one specific row, we can perform the mysqli_fetch on the function side\r\n\t\t// and just return the associative array itself within $page\r\n\t\tif($page = mysqli_fetch_assoc($page_set)) {\r\n\t\t\treturn $page;\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "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}", "function get_pagina($idioma_id)\r\n {\r\n $pagina_web = $this->db->query(\"\r\n SELECT * FROM pagina_web p, empresa_pagina x, empresa e\r\n WHERE p.idioma_id = \".$idioma_id.\" and p.pagina_id = x.pagina_id and \r\n x.empresa_id = e.empresa_id \r\n ORDER BY p.pagina_id DESC\" )->result_array();\r\n\r\n return $pagina_web;\r\n }", "public function index($id)\n {\n return TypeOfProjectResourceCollection::collection(projectDetail::where('typeOfProjectId', $id)->paginate(5));\n }", "public function get( $id );", "function PageSummaries_getContainedPages($id, $containedpages=array()) {\n\t$rs=dbAll(\n\t\t'select id,type,special,category from pages where parent=\"'.$id\n\t\t.'\" and !(special&4)'\n\t);\n\tforeach ($rs as $r) {\n\t\tswitch($r['type']) {\n\t\t\tcase 0: {\n\t\t\t\t$containedpages[]=$r['id'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$containedpages=PageSummaries_getContainedPages($r['id'], $containedpages);\n\t}\n\treturn $containedpages;\n}", "public function getPagesAction() {\n\n //FETCH\n $paramss = array();\n $paramss['title'] = $this->_getParam('text');\n $paramss['viewer_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n $paramss['limit'] = $this->_getParam('limit', 40);\n $paramss['orderby'] = 'title ASC';\n $usersitepages = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n $data = array();\n $mode = $this->_getParam('struct');\n if ($mode == 'text') {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n }\n return $this->_helper->json($data);\n }", "function GetWPContentByid($id,&$wpHeader,&$nWP) { // id, wp_Name, get1, get2, get3, lang\n\t\t$SQLStrQuery=\"CALL GetWPContentByid($id)\";// \"SELECT * FROM WPSContent WHERE id_wpc=\".$id.\"\";\n\t\tSQLQuery($rPointer,$nWP,$SQLStrQuery,true);\n\t\tConvertPointerToArray($rPointer,$wpHeader,$nWP,6);\n\t}", "public function get_page();", "public function get( $id ){}", "public function getPageId() {}", "public function getPageId() {}", "public function get( $id = null){\n\n // Si llega un $id por parametro\n if( !is_null( $id ) ){\n\n $query = $this->db->select( '*' )->from( 'pagina' )->where( 'idPagina', $id )->get();\n\n // Si nos regresa un elemento\n if( $query->num_rows() == 1 ){\n return $query->row_array();\n }\n\n return null;\n }\n\n // No ha llegado un id\n $query = $this->db->select( '*' )->from( 'pagina' )->get();\n\n // Comprobar si regresa elementos\n if( $query->num_rows() > 0 ){\n return $query->result_array();\n }\n\n return null;\n }", "public function getList($page);", "function view($id){\n if($id == NULL){\n $this->e404('Page Introuvable');\n }\n $this->loadModel('Post');\n $d['page'] = $this->Post->findFirst(array(\n 'conditions' => array('online' => 1,'id' => $id,'type' => 'page')\n ));\n if(empty($d['page'])){\n $this->e404('Page Introuvable');\n }\n $this->set($d);\n }", "function get_page_children($page_id, $pages)\n {\n }", "public function show($id)\n {\n $page_obj = new Pages();\n $sliders = Slider::where('page_id', $id)->orderBy('id', 'DESC')->get();\n $page_obj->slider = $sliders;\n $page_obj->id = $id;\n $page_data = collect([$page_obj]);\n return response()->json(view('admin.tables.slider', compact('page_data'))->render());\n }", "public function getPage() {}", "public function getPage() {}", "function getPages($page_category_id=null){\r\n\t\tif($page_category_id==null) return array();\t\t\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('page_categories_id'=>$page_category_id));\r\n\t\t$recordSet = $this->db->get(TBL_PAGE_CATEGORY_HAS_PAGES);\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public function setPage($id)\n {\n return $this->setArgs(['page' => $id]);\n }", "public function show($id)\n {\n // $page = page::findOrFail($id);\n // $data = ['judul' => $page->judul , 'semua_meta' => $page->semua_meta , 'type' => $page->type , 'status' => $page->status, 'konten' => $page->konten];\n $data = page::findOrFail($id);\n return response()->json($data);\n }", "function pagina($id){\n $pg = consulta(sprintf(\"SELECT `contenido` FROM `contenidos` WHERE `id` = %s LIMIT 1\",varSQL($id)),true);\n return $pg['resultado'][0]['contenido'];\n}", "public function index($id)\n {\n return $this->repository->findWhere(['projeto_id' => $id]);\n }", "public function get($id) {\n\t}", "public function actionViewPages($id)\n {\n return $this->render('pages/view', [\n 'model' => $this->findModelPages($id),\n ]);\n }", "public static function getPagesInFolder($strFolderid = \"\") {\n if(!validateSystemid($strFolderid)) {\n $strFolderid = class_module_system_module::getModuleByName(\"pages\")->getSystemid();\n }\n\n $strQuery = \"SELECT system_id\n\t\t\t\t\t\tFROM \" . _dbprefix_ . \"page as page,\n\t\t\t\t\t\t\t \" . _dbprefix_ . \"system as system\n\t\t\t\t\t\tWHERE system.system_prev_id=?\n\t\t\t\t\t\t\tAND system.system_module_nr=?\n\t\t\t\t\t\t\tAND system.system_id = page.page_id\n\t\t\t\t\t\tORDER BY system.system_sort ASC \";\n\n $arrIds = class_carrier::getInstance()->getObjDB()->getPArray($strQuery, array($strFolderid, _pages_modul_id_));\n $arrReturn = array();\n foreach($arrIds as $arrOneId) {\n $arrReturn[] = new class_module_pages_page($arrOneId[\"system_id\"]);\n }\n\n return $arrReturn;\n }", "public function getContent($id);", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function get($id){\n }", "function fetchPageDetails($id)\r\n{\r\n\tglobal $mysqli,$db_table_prefix; \r\n\t$stmt = $mysqli->prepare(\"SELECT \r\n\t\tid,\r\n\t\tpage,\r\n\t\tprivate\r\n\t\tFROM \".$db_table_prefix.\"pages\r\n\t\tWHERE\r\n\t\tid = ?\r\n\t\tLIMIT 1\");\r\n\t$stmt->bind_param(\"i\", $id);\r\n\t$stmt->execute();\r\n\t$stmt->bind_result($id, $page, $private);\r\n\twhile ($stmt->fetch()){\r\n\t\t$row = array('id' => $id, 'page' => $page, 'private' => $private);\r\n\t}\r\n\t$stmt->close();\r\n\treturn ($row);\r\n}", "protected function findPageById($id = null)\n {\n return ContainerPage::find()->contentContainer($this->contentContainer)->where(['custom_pages_container_page.id' => $id])->one();\n }", "public function get($id)\n {\n }", "public function get($id)\n {\n }", "public function getById($id)\n {\n return $this->loadRelations(Content::find($id));\n }", "protected function getPage() {}", "protected function getPage() {}", "public function get(string $id);", "public function public_documents_get($id = \"0\")\n {\n $cutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n \n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n \n \n $result = array();\n if(is_null($search))\n $result = $cutil->getPublicDocument($id);\n else\n $result = $cutil->searchPublicDocument ($search, $from, $size);\n \n $this->response($result);\n }", "function getPages() {\r\n\tglobal $S;\r\n\tif (!is_array($S->arbo)) {\r\n\t\trequire_once('../lib/class/class_arbo.php');\r\n\t\t$S =& new ARBO();\r\n\t\t$S->fields = array('id', 'pid', 'type_id', 'titre_fr');\r\n\t\t$S->buildArbo();\r\n\t}\r\n\t$options = array();\r\n\tforeach($S->arbo as $rid=>$tmp) {\r\n\t\t$options[urlencode($S->arbo[$rid]['url'])] = $S->arbo[$rid]['titre_fr'].' (#'.$rid.')';\r\n\t}\r\n\treturn $options;\r\n}", "public function find(int $id = null) {\n $this->method = \"GET\";\n if(null == $id) {\n $this->path = $this->objectName;\n } else {\n $this->path = $this->objectName . '/' . $id;\n $this->currentId = $id;\n }\n $output = $this->get();\n return $output;\n }" ]
[ "0.88060117", "0.7224103", "0.71049887", "0.70457196", "0.7034544", "0.6994354", "0.6894285", "0.6880466", "0.6866752", "0.6831076", "0.67608666", "0.67437863", "0.66369194", "0.6629646", "0.662551", "0.6538316", "0.65366155", "0.652736", "0.65179795", "0.6511874", "0.6505666", "0.6495995", "0.64344364", "0.6400257", "0.63958645", "0.63565624", "0.6354604", "0.63478404", "0.63458836", "0.62701875", "0.6264901", "0.62535286", "0.623596", "0.6233578", "0.6220129", "0.62065375", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.61975527", "0.6167252", "0.6161022", "0.613148", "0.6129292", "0.6123372", "0.6114794", "0.61006105", "0.6094693", "0.60923", "0.60819775", "0.6073099", "0.60728407", "0.60711783", "0.6047521", "0.60419863", "0.6031708", "0.6026033", "0.6024786", "0.60189104", "0.60189104", "0.60039556", "0.5987401", "0.5986595", "0.59838235", "0.5982363", "0.5969962", "0.5963166", "0.5947249", "0.5944964", "0.5935206", "0.5935206", "0.5935206", "0.59337604", "0.5932457", "0.5930978", "0.5924889", "0.5924889", "0.5917685", "0.5911372", "0.5911169", "0.5903982", "0.5899518", "0.58977574", "0.5897146" ]
0.74195457
1
Call the parent construct
public function __construct() { parent::__construct(); $this->model = new MembersModel(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function construct()\n\t\t{\n\t\t}", "protected function construct(){\n\n }", "public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}", "public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}", "public function construct() {\n\n }", "protected abstract function __construct();", "public function _construct()\n {\n parent::_construct();\n }", "function _construct() {\n\t\tparent::_construct();\n\t}", "function __construct() {\r\n parent ::__construct();\r\n }", "function _construct() {\n \t\n\t\t\n\t}", "function __construct(){parent::__construct();}", "public function __construct($parent) {\r\n parent::__construct($parent, 'invoke');\r\n }", "function construct()\n {//construct\n parent::construct();\n }", "function __construct(){\n\t\t// Call parent constructor\n\t\tparent::__construct();\n\t}", "public function _construct(){\n parent::_construct();\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t// Other code to run when object is instantiated\n\t}", "abstract protected function __construct();", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "public function __construct()\r\n\t{\r\n\t\t// Call the parent class constructor\r\n\t\tparent::__construct();\r\n\t}", "function __Construct()\n {\n parent::__Construct();\n }", "function __construct(){\n\t\t// nowt much...\n\t}", "protected function __construct() {\n // contain shared code in its constructor\n parent::__construct();\n }", "function _construct(){ }", "abstract protected function construct($params);", "protected function __construct(){\n\t\t\tparent::__construct();\n\t\t}", "public function __contruct(){\r\n parent::__contruct();\r\n }", "public function __construct()\n {\n $this->extendableConstruct();\n }", "protected function _construct($arguments){\n\t\treturn parent::_construct($arguments);\n\t}", "public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}", "public function __construct() {\n\t\t\tparent::__construct();\n\t\t}", "public function __construct() {\n\t\t\tparent::__construct();\n\t\t}", "public function __construct() {\n\t\t\tparent::__construct();\n\t\t}", "public function __construct() {\n\t\t\tparent::__construct();\n\t\t}", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t}", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t}", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t}", "public function __construct() {\n\n\t\tparent::__construct();\n\t\t\n\t}", "public function __construct(){parent::__construct();}", "protected function _construct()\n\t{\n\t\t$this->resetParams();\n\t\treturn parent::_construct();\n\t}", "public function __construct()\n\t {\n\t parent::__construct();\n\t }", "protected function __construct()\n\t{\n\t\tparent::__construct();\n\t}", "protected function __construct() {\r\r\n // contain shared code in its constructor\r\r\n parent::__construct();\t\r\r\n\t}", "function __construct() {\n\t\t\tparent::__construct();\n\t\t}", "function __construct() {\n\t\t\tparent::__construct();\n\t\t}", "function __construct() \n\t\t{\n\t\t\tparent::__construct();\n\t\t}", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n }", "function __construct() {\n\t\t\tparent::__construct();\n\t\t\t\n\t\t}", "public function _construct()\n\t{\n\n\t}", "protected function __construct()\r\n\t\t{\r\n\t\t}", "function __construct() {\n\t\tparent::__construct();\n\t\t\n\t}", "function __construct() {\n\t\tparent::__construct();\n\t\t\t\n\t\t}", "public function __construct () {\n\t\tparent::__construct();\n\t}", "public function __contruct()\n {\n parent::__construct();\n }", "public function __construct()\n\t {\n\t\t parent::__construct();\n\t }", "public function __construct(){\n\t\t\tparent::__construct(); \n\t\t}", "protected function __construct() {\n parent::__construct();\n\t\t\n }", "protected function __construct() {\n parent::__construct();\n\t\t\n }", "function __construct(){\n\t\t\n\t\tparent::__construct();\n\t\t\n\t}", "public function __construct() { \n\t\t\n\n\t\t}", "abstract function __construct();", "public function __construct(){\n\t\t\tparent::__construct();\n\t\t}", "public function __construct(){\n\t\t\tparent::__construct();\n\t\t}", "public function __construct()\n {\n //to be extended by children\n }", "protected function __construct() {\n\t\t\n\t}", "protected function __construct() {\n\t\t\n\t}", "public function __construct()\n\t{\n\t parent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "function __construct()\n\t\t {\n\t\t\t parent::__construct();\n\t\t }", "function __construct()\n\t\t {\n\t\t\t parent::__construct();\n\t\t }", "public function __construct()\n\t{\n\t\t// DO NOT! call parent::__construct(); as otherwise we will end up having references in this class.\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t}" ]
[ "0.82095665", "0.8032105", "0.7893719", "0.7893719", "0.7797032", "0.7782906", "0.7747505", "0.7744005", "0.77198184", "0.75882006", "0.75775266", "0.75614566", "0.75608253", "0.7556861", "0.7546035", "0.7495045", "0.7455", "0.7449761", "0.7439282", "0.74370944", "0.7435508", "0.742603", "0.7412925", "0.7399197", "0.73782295", "0.737559", "0.7368107", "0.73626393", "0.7328937", "0.7324426", "0.7324426", "0.7324426", "0.7324426", "0.7321574", "0.7321574", "0.7321574", "0.7321148", "0.7312946", "0.7308625", "0.73057383", "0.7304753", "0.7303419", "0.72956413", "0.72956413", "0.7290658", "0.72853327", "0.72819835", "0.7269205", "0.72491246", "0.72311115", "0.7231049", "0.72187483", "0.7217033", "0.72164404", "0.7214709", "0.7208966", "0.7208966", "0.72042316", "0.7202793", "0.7197995", "0.71963143", "0.71963143", "0.71958333", "0.7190809", "0.7190809", "0.71846145", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.718112", "0.7171703", "0.7171703", "0.71691334", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776", "0.716776" ]
0.0
-1
Leave to parent's method the Flight decisions.
protected function beforeFlight() { return parent::beforeFlight(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function afterFlight($result)\n {\n\n // Leave to parent's method the Flight decisions.\n return parent::afterFlight($result);\n }", "abstract public function deactivate();", "protected function deactivateSelf() {}", "public function stop() {\n if($this->combatantA->hp > 0) {\n $this->winnerType = \"player\";\n $this->winnerID = $this->combatantAID;\n } elseif ($this->combatantB->hp > 0) {\n $this->winnerType = ($this->type == \"pvp\" ? \"player\" : \"monster\");\n $this->winnerID = $this->combatantBID;\n } else {\n $this->winnerType = \"draw\";\n }\n\n // Bounty + XP\n if($this->type == \"monster\" && $this->combatantB->hp <= 0) {\n $loot = $this->combatantB->dropItems($this->combatantA->getDropItemPerc());\n $this->combatantA->gainItems($loot);\n \n $contact = $this->combatantB->dropContact($this->combatantA->getDropContactPerc());\n $this->combatantA->gainContact($contact, \"battle\");\n\n /**\n * monster->xp can be defined to deviate from the standard\n * attack / 2 xp reward\n */\n if(isset($this->combatantB->xp)) {\n $this->combatantA->gainXp($this->combatantB->xp, \"battle\");\n } else {\n $this->combatantA->gainXp($this->combatantB->attack / 4, \"battle\");\n }\n }\n\n $this->combatantA->ongoingBattleID = null;\n if($this->type == \"pvp\") {\n // @todo Message to PVP enemy\n $this->combatantB->ongoingBattleID = null;\n }\n\n $this->state = \"resolved\";\n $this->objectState = \"\";\n\n /**\n * ToDo: why does backupbehavior think that no attribute changed\n * if we set ongoingBattleID to null?\n */\n // $this->combatantA->save();\n $this->combatantA->update();\n if($this->type == \"pvp\") {\n $this->combatantB->save();\n }\n\n $this->update();\n $this->reconstructCombatants();\n \n // Notify the world about this result\n $event = new BattleEvent($this);\n $this->combatantA->onFinishedBattle($event);\n if($this->type == \"pvp\") {\n $this->combatantB->onFinishedBattle($event);\n }\n }", "public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}", "abstract public function revert();", "protected function relationFieldUpdateExit(){\n return true;\n }", "protected function _processRevertToDefault()\n {\n }", "public function stopPropagation(){\n\t\t$this->setPropagate(false);\n\t}", "protected function afterFlight($result)\n {\n return parent::afterFlight($result);\n }", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "function decline() {\n $this->setStatus(UserpointsTransaction::STATUS_DECLINED);\n return $this;\n }", "public function revert(){\n\t}", "protected function doRefundPayment() {\n throw new \\Exception('Child classes must override this method to support payment refund.');\n }", "function postflight ($type, $parent)\n\t{\n\t}", "protected abstract function do_down();", "public function undoFinalAdmit()\n {\n if (!is_null($this->acceptOffer) and !is_null($this->declineOffer)) {\n throw new \\Jazzee\\Exception('Cannot undo admit for an applicant with a offer response.');\n }\n $this->finalAdmit = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }", "public function fly()\n\t {\n\t }", "public function fulfill()\n {\n }", "function off() {\n return $this;\n }", "abstract protected function after();", "public function dead();", "public function unknown() {\n\t\t$this->location = -1;\n\t\t$this->beer = -1;\n\t\t$this->status = -1;\n\t\t$this->update();\n\t}", "function end()\n\t{\n\t\t$this->over = true;\n\t}", "final public function onOutOfBand (): void {\n // do nothing\n }", "protected function finish() {}", "protected function parentCleanup() {\n }", "public function finish()\n {\n parent::finish();\n \n // only allow higher than first tier roles to make direct calls\n $this->set_variable( 'allow_connect',\n 1 < lib::create( 'business\\session' )->get_role()->tier );\n $this->set_variable( 'sip_enabled',\n lib::create( 'business\\voip_manager' )->get_sip_enabled() );\n\n foreach( $this->get_record_list() as $record )\n {\n $this->add_row( $record->id,\n array( 'active' => $record->active,\n 'rank' => $record->rank,\n 'type' => $record->type,\n 'number' => $record->number ) );\n }\n\n $this->finish_setting_rows();\n }", "public function postflight($type, $parent)\n {\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "public function blockTaxChange()\n {\n $this->_forward();\n return false;\n }", "public function branching()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "public function undoFinalDeny()\n {\n $this->finalDeny = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }", "public function refundTransaction() {\n //not implemented\n }", "abstract protected function doEvil();", "public function postflight(string $type, object $parent): void\n {\n }", "public function onOutOfBand (): void;", "public function end_trace()\n {\n }", "function erase_response() {\n $this->performed = FALSE;\n $this->response = new Trails_Response();\n }", "function _deactivate() {}", "public function otherAction() {\n\t}", "public function deactivate();", "public function deactivate(): void;", "function no_harm_no_foul($parameters) \n\t{\n\t\t//Cycle through schedule and fail principal cancellations & Internal adjustments\n\t\tforeach ($parameters->schedule as $e) \n\t\t{\n\t\t\tif (\n\t\t\t\tin_array($e->type, array('adjustment_internal','adjustment_internal_fees'))\n\t\t\t\t&& in_array($e->context, array('cancel','payout'))\n\t\t\t\t&& $e->status != 'failed'\n\t\t\t)\n\t\t\t{\n\t\t\t\tRecord_Event_Failure($parameters->application_id, $e->event_schedule_id);\n\t\t\t}\n\t\t}\n\t\t//Now we're actually going to determine whether or not the applicatiion's inactive paid by what the application's current\n\t\t//status is, rather than what it was when the DFA started. This will prevent inaccuracies due to the status changing\n\t\t//within the DFA, like in #22508 [W!-01-08-2009][#22508]\n\t\t$asf = ECash::getFactory()->getReferenceList('ApplicationStatusFlat');\n\t\t$application = ECash::getApplicationByID($parameters->application_id);\n\n\t\t//If status is Inactive(Paid), rollback to the previous status\n\t\tif($application->application_status_id == $asf->toId('paid::customer::*root')\n ||\n //$application->application_status_id == $asf->toId('canceled::servicing::customer::*root')\n $application->application_status_id == $asf->toId('canceled::applicant::*root')\n )\n\t\t{\n\t\t\tif($prev_status = Get_Previous_Status($parameters->application_id))\n\t\t\t{\n\t\t\t\tUpdate_Status(NULL, $parameters->application_id, $prev_status);\n\t\t\t}\n\t\t}\n\t\t\n\t\tComplete_Schedule($parameters->application_id);\n\t}", "public function postDown()\n {\n }", "public function completeFlow();", "private function function_die(){\n\t\tunset($this->attributes);\n\t}", "protected function childScopeClosed()\n {\n }", "public function deactivate() {\n\n }", "public function deactivate() {\n\n }", "public function refund();", "public function restored(Partner $partner)\n {\n //\n }", "public function deactivate() {\n\t\t\t// just in case I want to do anyting on deactivate\n\t\t}", "public function endPeriod() {\n $this->checkStopLoss();\n //Handle Trailing Stop\n $this->checkTrailingStop();\n $this->checkMarketIfTouched();\n //Check to see if take profit was hit\n $this->checkTakeProfit();\n }", "public function stopPropagation(): void {\n $this->isStopped = true;\n }", "protected function afterAction () {\n\t}", "public abstract function preTrip();", "public function isVisitante(){ return false; }", "public function finish() {\r\n\t}", "public function stopPropagation(): void;", "public function fly()\n {\n }", "public function finish()\n\t{\n\t\t\n\t}", "abstract function after();", "public function trasnaction(){\n\n\t}", "function unextend() {\n if ($this->observation) {\n $this->observation->cancel();\n $this->observation = NULL;\n }\n }", "public function end_field_resolver_trace()\n {\n }", "public function testSettlement()\n {\n print \"testRefund()\\n\";\n\n // TODO: Impl\n\n $this->fail();\n }", "public function partirAuTravail(): void\n\t{\n\t}", "public function shutDoor()\n {\n return false;\n }", "public function fly() {\n }", "protected function _after()\n\t{\n\t\t\n\t}", "protected function _after()\n\t{\n\t\t\n\t}", "public function halt();", "protected function after(){}", "protected function after(){}", "protected function after(){}", "public function headlights_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights off\");\r\n $this->lights_on = FALSE;\r\n $this->action(\"headlights are off\");\r\n\r\n }", "public static function deactivate(){\n }", "public static function deactivate(){\n }", "abstract public function change();", "public function proceed()\n {\n }", "final function resetDpLiving()\n {\n $this->resetDpNpc();\n }", "abstract public function ForgetStep( $name );", "protected function complete()\n {\n parent::complete();\n }", "public static function deactivate()\n\t{\n\n\t}", "public function revert();", "function onProcess () {\n switch (parent::getAction()) {\n case \"save\":\n if (Context::hasRole(\"user.friendRequest.edit\")) {\n }\n parent::blur();\n parent::redirect();\n break;\n case \"edit\":\n if (Context::hasRole(\"user.friendRequest.edit\")) {\n parent::focus();\n }\n break;\n case \"accept\":\n if (Context::hasRole(\"user.friendRequest.view\")) {\n $friendRequest = UserFriendModel::getFriendRequest(parent::get(\"id\"));\n if (!empty($friendRequest) && $friendRequest->dstuserid == Context::getUserId()) {\n UserFriendModel::confirmUserFriendRequest($friendRequest->id);\n SocialController::notifyFriendAccepted($friendRequest->id);\n }\n }\n break;\n case \"decline\":\n if (Context::hasRole(\"user.friendRequest.view\")) {\n $friendRequest = UserFriendModel::getFriendRequest(parent::get(\"id\"));\n if (!empty($friendRequest) && $friendRequest->dstuserid == Context::getUserId()) {\n UserFriendModel::declineUserFriendRequest($friendRequest->id);\n }\n }\n break;\n default:\n if (parent::get(\"userId\")) {\n Context::setSelectedUser(parent::get(\"userId\"));\n } else if (parent::param(\"mode\") == self::modeCurrentUser) {\n Context::setSelectedUser(Context::getUserId());\n }\n }\n }", "public function stopPropagation();", "public static function deactivate ()\n\t{\n\t}", "protected function childCleanup() {\n }", "public function ended();", "public static function end_block()\n\t{\n\t\tself::$nivel_cabecalho -= 1;\n\t}", "public function exit_recovery_mode()\n {\n }", "public function implementation_pending()\n {\n }" ]
[ "0.60863423", "0.5713309", "0.5673435", "0.559305", "0.54620236", "0.5452898", "0.54431736", "0.5413252", "0.54070884", "0.5405124", "0.5369711", "0.5369711", "0.5359052", "0.53490424", "0.5325459", "0.53216636", "0.5297709", "0.5284925", "0.5268049", "0.525825", "0.5256349", "0.5246574", "0.5228119", "0.52239597", "0.52185357", "0.52141446", "0.51913005", "0.51906", "0.51667345", "0.51666284", "0.51665634", "0.51665634", "0.51537263", "0.51411724", "0.5117511", "0.5117511", "0.5117511", "0.51137865", "0.50966096", "0.508778", "0.50654864", "0.5054532", "0.504803", "0.50472903", "0.50378096", "0.5025823", "0.50198007", "0.50121474", "0.50119644", "0.5009337", "0.5009168", "0.5009082", "0.50031686", "0.500182", "0.49913272", "0.49913272", "0.4988851", "0.49888435", "0.49815968", "0.49784577", "0.4978029", "0.49712658", "0.4970719", "0.49684387", "0.496382", "0.4962598", "0.49553645", "0.49552763", "0.49502867", "0.4939577", "0.49357602", "0.49255797", "0.4923687", "0.49077258", "0.49063188", "0.4901844", "0.49006638", "0.49006638", "0.48977798", "0.48948732", "0.48948732", "0.48948732", "0.48910403", "0.4885608", "0.4885608", "0.48853964", "0.48842293", "0.48821205", "0.48800004", "0.48788166", "0.4875124", "0.48618066", "0.486041", "0.48599035", "0.48567724", "0.48485", "0.48472863", "0.48446792", "0.48431197", "0.48400506" ]
0.59340906
1
Do some processing there, even deciding to stop the Flight, if case.
protected function afterFlight($result) { // Leave to parent's method the Flight decisions. return parent::afterFlight($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _loop():void\n\t{\n\t\twhile( true )\n\t\t\tif( $this->_status === self::STATUSES['PAUSED'] )\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\tif( $this->_queue )\n\t\t\t\t$this->_step();\n\t\t\telse\n\t\t\tif( $this->_timeout_queue )\n\t\t\t\t$this->_stepTimeout();\n\t\t\telse\n\t\t\t\tbreak;\n\t}", "private function handleStop(): void\n {\n for ($i = 0; $i < count($this->drivers); $i++) {\n for ($j = $i + 1; $j < count($this->drivers); $j++) {\n if ($this->drivers[$i]->getCurrentStop() === $this->drivers[$j]->getCurrentStop()) {\n $this->exchangeGossips($this->drivers[$i], $this->drivers[$j]);\n }\n }\n }\n }", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "private function processStatus(){\n\t\t$this->facilityData = $this->getFacilityStatus();\n\n\t\t/** Set the date if it's not set for the proved facility */\n\t\t$this->setFacilityStatus();\n\t}", "public function process()\n {\n $this->send_status();\n $this->send_headers();\n $this->send_content();\n exit(0);\n }", "protected function process()\n {}", "public function _break()\n {\n //set the internal execution flag to false, stopping execution\n $this->executing = false;\n }", "public function process()\n {\n // do nothing here\n }", "public function process() {\n\t\treturn false;\n\t}", "public function process()\n {\n // Get all orders not yet sent to Flow within the valid time period\n $orders = Order::get()\n ->filter([\n 'Scheduled' => 0,\n 'IsCart' => 0\n ]);\n\n // run through and schedule\n /** @var Order|\\Isobar\\Flow\\Extensions\\OrderExtension $order */\n foreach ($orders as $order) {\n if ($order->UnpaidTotal()->getDecimalValue() <= 0) {\n echo 'Order #' . $order->ID . ' to be scheduled' . \"\\n\";\n\n $order->scheduleOrder();\n }\n }\n }", "public function doProcessing()\n\t{\n\t\tglobal $NTvNTlevel1,$NTvNTlevel2,$NTvNTlevel3,$NTvNTlevel4,$NTvNTlevel5,$NTvNTlevel6;\n\n\t\t$maxLimit=configVariables::$maxLimit;\n\t\t$queryLimit=$maxLimit;\n\t\t$loginDtRelax1=configVariables::$loginDtRelax1;\n\t\t$loginDtRelax2=configVariables::$loginDtRelax2;\n\t\t$dayOfRelaxation=configVariables::$use60DaysRelaxOnDay;\n\n\t\tif($this->receiverObj->getSwitchToDpp()==1)\n\t\t{\n\t\t\t$canUseRelaxation=0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$relaxlheight=$this->filterBean->getLheightRelax();\n\t\t\t$relaxhheight=$this->filterBean->getHheightRelax();\n\t\t\t$relaxlage=$this->filterBean->getLageRelax();\n\t\t\t$relaxhage=$this->filterBean->getHageRelax();\n\t\t\t$canUseRelaxation=$this->filterBean->getCanUseRelaxation();\n\t\t}\n\t\t$dppCasteVal = $this->filterBean->getCaste();\n\n\t\t$NTvNTlevel1++;\n\t\t$levelCount=0;//----------\n\t\t$this->profileSetTemp=$this->runDBQuery($this->receiverObj,$this->filterBean,$this->profileSet,$this->db,$this->isMatchesTrending,$loginDtRelax1,'','',$queryLimit,'ENTRY_DT DESC','','','','',$this->communityModelLogic);\n\t\t\n\t\tif($this->profileSetTemp)\n\t\t{\n\t\t\t//-----------\n\t\t\t$levelCount=count($this->profileSetTemp);\n\t\t\twhile($levelCount>0)\n\t\t\t{\n\t\t\t\tif($this->communityModelLogic)\n\t\t\t\t\t$this->logicLevel[]='111';\n\t\t\t\telse\n\t\t\t\t\t$this->logicLevel[]='11';\n\t\t\t\t$levelCount--;\n\t\t\t}\n\t\t\t//-----------\n $this->profileSet=array_merge($this->profileSet,$this->profileSetTemp);\n\t\t}\n\n\t\tif(count($this->profileSet) <$maxLimit)//Relaxed forward only 15 days\n\t\t{\n\t\t\t$NTvNTlevel4++;\n\t\t\t$queryLimit=$maxLimit-count($this->profileSet);\n\n\t\t\tif($canUseRelaxation)\n\t\t\t{\n\t\t\t\t$this->filterBean->setLheight(intval($this->filterBean->getLheight())-$relaxlheight);\n\t\t\t\t$this->filterBean->setHheight(intval($this->filterBean->getHheight())+$relaxhheight);\n\t\t\t\t$this->filterBean->setLage(intval($this->filterBean->getLAge())-$relaxlage);\n\t\t\t\t$this->filterBean->setHage(intval($this->filterBean->getHAge())+$relaxhage);\n\t\t\t\t$this->setCasteRelaxation($this->receiverObj->getRecCaste(),$this->filterBean); \n\t\t\t}\n\n\t\t\t$this->profileSetTemp=$this->runDBQuery($this->receiverObj,$this->filterBean,$this->profileSet,$this->db,$this->isMatchesTrending,$loginDtRelax1,1,1,$queryLimit,'ENTRY_DT DESC','','','','',$this->communityModelLogic);\n\t\t\tif($this->profileSetTemp)\n\t\t\t{\n\t\t\t\t//-----------\n\t\t\t\t$levelCount=count($this->profileSetTemp);\n\t\t\t\twhile($levelCount>0)\n\t\t\t\t{\n\t\t\t\t\tif($this->communityModelLogic)\n\t\t\t\t\t\t$this->logicLevel[]='121';\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->logicLevel[]='12';\n\t\t\t\t\t$levelCount--;\n\t\t\t\t}\n\t\t\t\t//-----------\n $this->profileSet=array_merge($this->profileSet,$this->profileSetTemp);\n\t\t\t}\n\t\t}\n\n\t\tif(count($this->profileSet) <$maxLimit)//Relaxed forward only 60 days\n {\n\t\t\t$NTvNTlevel6++;\n $queryLimit=$maxLimit-count($this->profileSet);\n\t\t\tif($canUseRelaxation)\t\t\t\n\t\t\t{\n\t\t\t\t$this->filterBean->setLheight(intval($this->filterBean->getLheight())-$relaxlheight);\n\t\t\t\t$this->filterBean->setHheight(intval($this->filterBean->getHheight())+$relaxhheight);\n\t\t\t\t$this->filterBean->setLage(intval($this->filterBean->getLAge())-$relaxlage);\n\t\t\t\t$this->filterBean->setHage(intval($this->filterBean->getHAge())+$relaxhage);\n\t\t\t\t$this->setCasteRelaxation($this->receiverObj->getRecCaste(),$this->filterBean); \n\t\t\t}\n\n\t\t\t$this->profileSetTemp=$this->runDBQuery($this->receiverObj,$this->filterBean,$this->profileSet,$this->db,$this->isMatchesTrending,$loginDtRelax2,1,1,$queryLimit,'LAST_LOGIN_DT DESC','','','','',$this->communityModelLogic);\n\t\t\tif($this->profileSetTemp)\n\t\t\t{\n\t\t\t\t//-----------\n\t\t\t\t$levelCount=count($this->profileSetTemp);\n\t\t\t\twhile($levelCount>0)\n\t\t\t\t{\n\t\t\t\t\tif($this->communityModelLogic)\n\t\t\t\t\t\t$this->logicLevel[]='131';\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->logicLevel[]='13';\n\t\t\t\t\t$levelCount--;\n\t\t\t\t}\n\t\t\t\t//-----------\n $this->profileSet=array_merge($this->profileSet,$this->profileSetTemp);\n\t\t\t}\t\n }\n\n\t\t$gap=configVariables::getNoOfDays();\n\t\tif($gap%7==$dayOfRelaxation)\n\t\t{\n if(count($this->profileSet) <$maxLimit)//Relaxed Forward only + no_login_dt\n {\n $NTvNTlevel6++;\n $queryLimit=$maxLimit-count($this->profileSet);\n \n\t\t\t\tif($canUseRelaxation)\t\t\t\n\t\t\t\t{\n\t $this->filterBean->setLheight(intval($this->filterBean->getLheight())-$relaxlheight);\n \t $this->filterBean->setHheight(intval($this->filterBean->getHheight())+$relaxhheight);\n \t $this->filterBean->setLage(intval($this->filterBean->getLAge())-$relaxlage);\n \t $this->filterBean->setHage(intval($this->filterBean->getHAge())+$relaxhage);\n\t\t\t\t\t$this->setCasteRelaxation($this->receiverObj->getRecCaste(),$this->filterBean); \n\t\t\t\t}\n\n $this->profileSetTemp=$this->runDBQuery($this->receiverObj,$this->filterBean,$this->profileSet,$this->db,$this->isMatchesTrending,'',1,1,$queryLimit,'LAST_LOGIN_DT DESC','','','','',$this->communityModelLogic);\n if($this->profileSetTemp)\n {\n $levelCount=count($this->profileSetTemp);\n while($levelCount>0)\n {\n\t\t\t\t\t\tif($this->communityModelLogic)\n \t$this->logicLevel[]='141';\n\t\t\t\t\t\telse\n \t$this->logicLevel[]='14';\n $levelCount--;\n }\n $this->profileSet=array_merge($this->profileSet,$this->profileSetTemp);\n }\n }\n\n }\n\t\t\n if(count($this->profileSet) <$maxLimit)\n\t\t{\n\t\t\t//Some Tracking Code\n\t\t}\n\t\tif(count($this->profileSet))\n\t\t{\n\t\t\t$this->logRecords($this->profileSet,$this->receiverObj->getPartnerProfile()->getProfileId(),$this->db,configVariables::$strategyNtVsNtLogic,$this->logicLevel,$this->frequency);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$levelreached=8;\n\t\t\t$gap=configVariables::getNoOfDays();\n\t\t\t$zeropid=$this->receiverObj->getPartnerProfile()->getProfileId();\n\t\t\t$sql_y=\"INSERT INTO matchalerts.ZERONTvNT(PROFILEID,DATE) VALUES($zeropid,$gap)\";\n mysql_query($sql_y,$this->db) or logerror1(\"In matchalert_mailer.php\",$sql_y);\n\t\t}\n\t}", "protected function runLogic()\n {\n Logic::run($this->request); /* The logic to attempt to parse the request */\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 step():void\n\t{\n\t\t$this->ensureUnclosed();\n\t\t\n\t\tif( $this->_queue )\n\t\t{\n\t\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\t\n\t\t\t$this->_step();\n\t\t}\n\t\telse\n\t\tif( $this->_timeout_queue )\n\t\t{\n\t\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\t\n\t\t\t$this->_stepTimeout();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_status= self::STATUSES['DONE'];\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( $this->_queue || $this->_timeout_queue )\n\t\t\t$this->_status= self::STATUSES['PAUSED'];\n\t\telse\n\t\t\t$this->_status= self::STATUSES['DONE'];\n\t}", "public function startCheck($flight);", "public function _handleTerm()\n\t{\n\t\t$this->_should_stop = true;\n\t}", "public function proceed()\n {\n }", "protected function executeSpecificStep() {}", "protected abstract function process();", "function run()\n {\n $this->_loadState();\n $start_time = microtime_float();\n while ((microtime_float() - $start_time) < DC_WORKER_TIME_OUT)\n {\n if($this->_process_info['status']=='INITED' or $this->_process_info['status']=='PROCESSING')\n {\n $this->_doWork();\n };\n\n if($this->_process_info['status']=='PRE_COMPLETED')\n {\n $this->_finishWork();\n break;\n };\n\n if($this->_process_info['status']=='ERRORS_HAPPENED')\n {\n $this->_breakWork();\n break;\n };\n }\n\n $this->_saveState();\n return;\n }", "public function start()\n {\n foreach ($this->routes as $route) {\n if ($route->match()) {\n $this->applyRoute($route); \n }\n\n if (!$route->continue) {\n break;\n }\n }\n }", "public function process()\n\t{\n\t\t$this->status = 1;\n\t\tif (($ip = \\App\\RequestUtil::getRemoteIP(true)) && ($blackList = \\App\\Mail\\Rbl::findIp($ip))) {\n\t\t\tforeach ($blackList as $row) {\n\t\t\t\tif (1 !== (int) $row['status'] && (\\App\\Mail\\Rbl::LIST_TYPE_BLACK_LIST === (int) $row['type']) || (\\App\\Mail\\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST === (int) $row['type'])) {\n\t\t\t\t\t$this->status = 0;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!$this->status) {\n\t\t\t\t$this->description = \\App\\Language::translate('LBL_BLACK_LIST_ALERT', 'OSSMail');\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n while (($payload = array_shift($this->payloads)) !== null) {\n list($ttr, $message) = $payload;\n $this->startedId = $this->finishedId + 1;\n $this->handleMessage($this->startedId, $message, $ttr, 1);\n $this->finishedId = $this->startedId;\n $this->startedId = 0;\n }\n }", "abstract protected function _process();", "abstract protected function _process();", "public function run() {\n\t\tif ($this->schedule->isRun()) {\n\t\t\t$this->excuteHandle->excute();\n\t\t}\n\t}", "public function process() {}", "public function process() {}", "public function process() {}", "public function process() {}", "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 }", "protected abstract function run();", "abstract protected function _run();", "abstract protected function _run();", "function process() ;", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "public function postFlightCheck($direction = null)\r\n {\r\n }", "abstract public function stop();", "public function run()\n {\n //\n $this->grabData();\n }", "public function process()\n {\n if ($this->isNeedToSkip()) {\n return;\n }\n\n $this->saveWizardNecessaryData();\n $this->backupTables();\n\n $this->processListingProduct();\n\n $this->processGeneralTemplates();\n $this->processEbayTemplates();\n $this->processAmazonTemplates();\n }", "public function run():void\n\t{\n\t\t$this->ensureUnclosed();\n\t\t\n\t\tif( $this->_status === self::STATUSES['RUNNING'] )\n\t\t\treturn;\n\t\t\n\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\n\t\t$this->_loop();\n\t\t\n\t\t$this->_status= self::STATUSES['DONE'];\n\t}", "public function perTransfer()\n\t{\n\t\t$this->restart( 'shop/finish' );\n\t}", "protected function afterFlight($result)\n {\n return parent::afterFlight($result);\n }", "abstract public function process();", "abstract public function process();", "abstract public function process();", "public function postFlightCheck($direction = null);", "function finish_fight()\n {\n //log_error(\"Client: $_SESSION[userid]\\nTerminating fight\\nTeam:$_SESSION[teamid]\",100);\n\n /*\n //If the fight is not in session then bail;\n if(!isset($_SESSION['prefight']))\n {\n log_error(\"HACK:\\nAttempt to terminate a fight while not part of a fight\\nClient: $_SESSION[userid]\\nTerminating fight\\nTeam:$_SESSION[teamid]\",100);\n return;\n }\n\n //Create a variable shortcuts.\n $fight=$_SESSION['fight'];\n $player_party=$_SESSION['player_party'];\n */\n $fight_store=new FIGHT_STORE();\n $result=$fight_store->get_fight($GLOBALS['userid'],$_SESSION['fightid']);\n //If there is no active fight then bail;\n if($result==false)\n {\n log_error(\"Attempt to terminate a fight while not part of a fight\\nClient: $_SESSION[userid]\\nProcessing fight commands\\nTeam:$_SESSION[teamid]\",100);\n queue_response('fight_terminate','pick_team.php');\n unset($_SESSION['fightid']);\n return;\n }\n extract($result);\n\n //If both parties are alive, then instruct the client to reload the data\n $imdead=$fight->test_own_party_dead($player_party);\n $theyredead=$fight->test_other_parties_dead($player_party);\n if ($imdead==false&&$theyredead==false)\n {\n log_error(\"Client: $_SESSION[userid]\\nCan't terminate fight- both parties are still alive\\nTeam:$_SESSION[teamid]\",100);\n queue_response('request_fight_data');\n return;\n }\n\n /*\n //Purge fight data (except $fight, for now. That is how PXP is calculated.\n unset($_SESSION['prefight']);\n unset($_SESSION['combat_playback']);\n unset($_SESSION['sequence']);\n unset($_SESSION['js_stack']);\n */\n //Direct client to switch to the map (temp hack- js will change pages)\n //queue_response('switch_to_map');\n queue_response('fight_terminate','proc_fight.php');\n }", "private function fight() {\n while(!$this->winner) {\n // Check current field conditions\n // Check abilities\n $this->playTurn();\n // End turn\n if($this->getNextFighter()->health <= 0) {\n $this->winner_fighter = $this->fighter_current;\n $this->winner = true;\n break;\n }\n $this->nextFighter();\n\n // $this->winner_fighter = $this->fighter_current;\n // $this->winner = true;\n }\n }", "private function _step():void\n\t{\n\t\t$task= array_shift( $this->_queue );\n\t\t\n\t\t$this->_runTask( $task );\n\t}", "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 static function post_process() {}", "protected function beforeFlight()\n {\n return parent::beforeFlight();\n }", "public function halt();", "public function process()\n {\n //If they don't order 7 days after sign up, the points disappear\n //send sms before 1-2days if not order placed\n $orderTable = $this->getServiceLocator()->get('Api\\Table\\LoyaltyPointTable');\n $accounts = $orderTable->getAccountsForCreditExpiry();\n if (!$accounts) {\n echo $msg = 'CreditsExpiryController: Not orders available, skipping '. $this->orderId .\"\\n\";\n $this->logger->debug($msg);\n return;\n }\n \n foreach ($accounts['list'] as $account) {\n if ($account['no_order_days_since_signup'] == 5) {\n $this->sendSms($account['contact_no']);\n } else if ($account['no_order_days_since_signup'] >= 7) {\n $this->removeCredits($account['account_id'], $account['points']);\n } \n }\n }", "function process() {\r\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}", "function stop(){\n\t\tif($this->time_end==0){\n\t\t\t $this->time_end = $this->microtime_float();\n\t\t\t $this->time_spend = $this->time_end - $this->time_start;\n\t\t}\n\t}", "public function process() {\n }", "public function process() {\n }", "public function process() {\n }", "public function preFlightCheck($direction = null);", "public abstract function process();", "abstract function run();", "public function proceed();", "public function doProcessData() {}", "protected function finish() {}", "public function preFlightCheck($direction = null)\r\n {\r\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(FB_api_mode::class);\n $this->call(FB_page_edge::class);\n $this->call(FB_field::class);\n $this->call(FB_page_edge_node::class);\n $this->call(FB_edge_edgeNode::class);\n $this->call(FB_field_followingrequest::class);\n $this->call(FB_parent_field::class);\n $this->call(Provider::class);\n $this->call(User::class);\n $this->call(News::class);\n $this->call(InfoApiCost::class);\n $this->call(MediaApiCost::class);\n $this->call(ForumSection::class);\n $this->call(CheckoutFlow::class);\n $this->call(ApiDiscount::class);\n $this->call(UserPayment::class);\n $this->call(FB_api_group_full_mode_and_statistics::class);\n\n Model::reguard();\n }", "public static function process() {}", "public function run()\n {\n $this->_fnameFlagStop = dirname(__FILE__) . '/' . $this->getIndividualFilenameAsFlag();\n $this->checkIfShouldStopWork();\n\n $worker = Mage::getModel('myproject_gearman/worker'); // just a wrapper around PHP Gearman class\n\n $worker->addFunction($this->getJobName(), function (GearmanJob $job) {\n $this->_curJobObject = $job;\n $data = unserialize($job->workload());\n $this->processDataWrapper($data, $job);\n });\n\n $worker->addFunction($this->getIndividualFilenameAsFlag(), function (GearmanJob $job) {\n $this->log('Got job to exit. Job name: ' . $this->getIndividualFilenameAsFlag());\n $job->sendComplete('ok'); // without this line queue not cleans and task stay in this queue\n exit;\n });\n\n $worker->work();\n }", "function fileNeedsProcessing() ;", "public function run() {\n\t\t$this->residentEvals();\n\t\t$this->fellowEvals();\n }", "public function process() {\n\t\t$service = $this->getService();\n\t\t$service->hsts = HTTP_Helper::retrievePost( 'hsts_preload' );\n\t\t$service->include_subdomain = HTTP_Helper::retrievePost( 'include_subdomain' );\n\t\t$service->hsts_cache_duration = HTTP_Helper::retrievePost( 'hsts_cache_duration' );\n\t\t$service->scenario = HTTP_Helper::retrievePost( 'scenario' );\n\t\t$ret = $service->process();\n\t\tif ( is_wp_error( $ret ) ) {\n\t\t\twp_send_json_error( [\n\t\t\t\t'message' => $ret->get_error_message()\n\t\t\t] );\n\t\t} else {\n\t\t\tSettings::instance()->addToResolved( Sh_Strict_Transport::$slug );\n\t\t}\n\t}", "public function run()\n\t{\n\t\t//\n\t}", "public function front_action() {\n\n\t\tif ( $this->is_request_to_forget() ) {\n\t\t\t$this->process_request_to_forget();\n\t\t}\n\n\t\tif ( $this->is_request_confirmation() ) {\n\t\t\t$this->process_confirm_request();\n\t\t}\n\t}", "public static function SfwUpdate_DoFinisnAction()\n {\n // EXAMPLE\n // global $apbct;\n // $apbct->data['last_firewall_updated'] = current_time('timestamp');\n // $apbct->save('data');\n // $apbct->stats['sfw']['entries'] = $wpdb->get_var('SELECT COUNT(*) FROM ' . APBCT_TBL_FIREWALL_DATA );\n // $apbct->stats['sfw']['last_update_time'] = time();\n // $apbct->save('stats');\n }", "public function runFilter( array $context )\n {\n foreach ( $context as $element )\n {\n if ( $element->status == ezcTranslationData::UNFINISHED )\n {\n $element->translation = $element->original;\n }\n }\n }", "function processData() ;", "public function run_service()\n\t{\n\t\t// Check the request is allowed\n\t\tif ($this->_is_api_request_allowed())\n\t\t{\n\t\t\t// Route the API task\n\t\t\t$this->_route_api_task();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Set the response to \"ACCESS DENIED\"\n\t\t\t$this->set_response($this->get_error_msg(006));\n\n\t\t\t// Terminate execution\n\t\t\treturn;\n\t\t}\n\t}", "public function pauseWorking(){\r\n\r\n }", "function stop() { \n\n\t\tif ($this->XBMCCmd(\"Stop\")!=\"OK\") { return false; }\n return true;\n\n\t}", "public function fileNeedsProcessing() {}", "public function run()\n {\n $fakeMissions = [];\n for ($i = 0; $i < 10; $i++) {\n $fakeMissions[] = $this->getFakeMission();\n }\n\n $this->insert('filegame_booth_missions', $fakeMissions);\n }", "public function handleStopScanRFXCode() // vytvorit fci vypne odchytavaci priznak pro funkci serveRFXsignal\n\t{\n\t\tDebugger::barDump($this->config->scanCodes, 'this->config->scanCodes');\n\t\t$selectCode='';\n\t\t$maxCount=0;\n\t\tforeach($this->config->scanCodes as $code)\n\t\t{\n\t\t\t$count=0;\n\t\t\tforeach($this->config->scanCodes as $item)\n\t\t\t{\n\t\t\t\tif ($item==$code) $count=$count+1;\n\t\t\t}\n\t\t\tif ($count>$maxCount) \n\t\t\t{\n\t\t\t\t$selectCode=$code;\n\t\t\t\t$maxCount=$count;\n\t\t\t}\n\t\t}\n\t\tDebugger::barDump($selectCode, 'selectCode');\n\t\tif ($selectCode!='')\n\t\t{\n\t\t\tif ($this->config->scanning==\"RUN\") $this->config->code=$selectCode;\n\t\t}\n\t\tDebugger::barDump($this->config, 'this->config');\n\t\t$this->config->scanning=\"\";\n\t\t$this->config->scanCodes=array();\n\t\t$this->saveConfig(); \n\t}", "public function process();", "public function process();", "public function process();", "public function process();", "public function endProcess() {\n if ($this->previousErrorHandler) {\n set_error_handler($this->previousErrorHandler);\n $this->previousErrorHandler = NULL;\n }\n if ($this->processing) {\n $this->status = MigrationBase::STATUS_IDLE;\n $fields = array('class_name' => get_class($this), 'status' => MigrationBase::STATUS_IDLE);\n db_merge('migrate_status')\n ->key(array('machine_name' => $this->machineName))\n ->fields($fields)\n ->execute();\n\n // Complete the log record\n if ($this->logHistory) {\n db_merge('migrate_log')\n ->key(array('mlid' => $this->logID))\n ->fields(array(\n 'endtime' => microtime(TRUE) * 1000,\n 'finalhighwater' => $this->getHighwater(),\n 'numprocessed' => $this->total_processed,\n ))\n ->execute();\n }\n\n $this->processing = FALSE;\n }\n self::$currentMigration = NULL;\n }", "public function process()\n {\n // check order configurations for funny PT case\n foreach ($this->order_configurations as $config) {\n $products = $config->getProductArray(true);\n $hasPreceptorTraining = in_array(\"9\", $products);\n\n // we found preceptor training and other products\n //(we need an addtional serial number, therefor an additional config)\n if (count($products) > 1 && $hasPreceptorTraining && !$this->upgrade_purchase) {\n $this->addPreceptorTrainingConfig($config->quantity);\n }\n }\n\n //Mark order as completed\n $this->completed = true;\n $this->order_date = new \\DateTime();\n\n //Either apply upgrades or generate new serial numbers\n if ($this->upgrade_purchase) {\n $this->applyUpgradesAndDowngrades();\n } else {\n $this->generateSerialNumbers();\n }\n\n //Send email to interested parties, unless this is an instant order by Staff\n if ($this->order_type->id != 3) {\n $this->emailSerialNumbers();\n }\n\n //Generate invoice number and email the invoice if appropriate\n if ($this->payment_method->id == 1 && !$this->isFreeOrder()) {\n $this->generateInvoiceNumber();\n $this->emailInvoicePdf();\n }\n \n $session = new \\Zend_Session_Namespace(\"OrdersController\");\n $session->unsetAll();\n }", "public function process(): void\n\t{\n\t\tforeach ($this->getActions() as $action) {\n\t\t\t$class = \"App\\\\Mail\\\\ScannerAction\\\\{$action}\";\n\t\t\t(new $class($this))->process();\n\t\t}\n\t}", "public function processData() {}", "function process() {\n return 0;\n }" ]
[ "0.5996911", "0.5802476", "0.5742465", "0.5742465", "0.5742465", "0.5742465", "0.57060814", "0.5635834", "0.5612407", "0.55937105", "0.5570291", "0.54935765", "0.5492297", "0.54619366", "0.5429191", "0.54272854", "0.5419379", "0.5406372", "0.54003394", "0.5393653", "0.53728354", "0.5362709", "0.53573614", "0.5336125", "0.5332833", "0.5307964", "0.53070533", "0.53070533", "0.53050804", "0.5285086", "0.5284434", "0.5284434", "0.5284434", "0.52817184", "0.5264054", "0.5262681", "0.5262681", "0.5255003", "0.5251218", "0.5251218", "0.5251218", "0.5251218", "0.52377146", "0.5235282", "0.5222473", "0.5213135", "0.5199639", "0.5196055", "0.51812994", "0.5180298", "0.5180298", "0.5180298", "0.51709694", "0.51675314", "0.51641566", "0.5161781", "0.51575", "0.51527065", "0.5145142", "0.51413244", "0.5132439", "0.51316863", "0.5123447", "0.5093909", "0.50892454", "0.50892454", "0.50892454", "0.508352", "0.5083248", "0.5075972", "0.5068253", "0.50682527", "0.5062975", "0.506047", "0.50577456", "0.5055251", "0.5050556", "0.5044536", "0.50409615", "0.503839", "0.503834", "0.5025609", "0.50085545", "0.5007391", "0.49976853", "0.49970084", "0.49950367", "0.4994293", "0.49915096", "0.49812353", "0.49756187", "0.49754012", "0.49754012", "0.49754012", "0.49754012", "0.49575254", "0.49573505", "0.4949739", "0.4949354", "0.4948656" ]
0.56515926
7
CakePHP style Define Welcome page message and set the Controller's variables.
public function index() { $message = ''; // $result = $this->model->countBy('username !=', 'admin'); $message .= '<b>$this->model->countBy(\'username !=\', \'admin\');</b>'; $message .= '<pre>'.var_export($result, true).'</pre><br>'; // $members = $this->model->limit(2, 0)->findAll(); $message .= '<b>$this->model->limit(2, 0)->findAll();</b>'; $message .= '<pre>'.var_export($members, true).'</pre><br>'; // $userInfo = array( 'username' => 'virgil', 'password' => 'test', 'email' => '[email protected]' ); $message .= '<b>$userInfo</b>'; $message .= '<pre>'.var_export($userInfo, true).'</pre><br>'; // $retval = $this->model->insert($userInfo); $message .= '<b>$this->model->insert($userInfo);</b>'; $message .= '<pre>'.var_export($retval, true).'</pre><br>'; // $members = $this->model->findAll(); $message .= '<b>$this->model->findAll();</b>'; $message .= '<pre>'.var_export($members, true).'</pre><br>'; // $userInfo = array( 'password' => 'testing', 'email' => '[email protected]' ); $message .= '<b>$userInfo</b>'; $message .= '<pre>'.var_export($userInfo, true).'</pre><br>'; // $retval = $this->model->updateBy('username', 'virgil', $userInfo); $message .= '<b>$this->model->updateBy(\'username\', \'virgil\', $userInfo);</b>'; $message .= '<pre>'.var_export($retval, true).'</pre><br>'; // $members = $this->model->findAll(); $message .= '<b>$this->model->findAll();</b>'; $message .= '<pre>'.var_export($members, true).'</pre><br>'; // $retval = $this->model->deleteBy('username', 'virgil'); $message .= '<b>$this->model->deleteBy(\'username\', \'virgil\');</b>'; $message .= '<pre>'.var_export($retval, true).'</pre><br>'; // $members = $this->model->order('desc')->findAll(); $message .= '<b>$this->model->order(\'desc\')->findAll();</b>'; $message .= '<pre>'.var_export($members, true).'</pre><br>'; // $members = $this->model->orderBy('username', 'desc')->limit(2, 0)->findAll(); $message .= '<b>$this->model->orderBy(\'username\', \'desc\')->limit(2, 0)->findAll();</b>'; $message .= '<pre>'.var_export($members, true).'</pre><br>'; // $result = $this->model->findBy('username', 'marcus'); $message .= '<b>$this->model->findBy(\'username\', \'marcus\');</b>'; $message .= '<pre>'.var_export($result, true).'</pre><br>'; // $result = $this->model->find(3); $message .= '<b>$this->model->find(3);</b><pre>'.var_export($result, true).'</pre><br>'; // $members = $this->model->orderBy('username', 'desc')->findMany(array(1, 3)); $message .= '<b>$this->model->orderBy(\'username\', \'desc\')->findMany(array(1, 3));</b>'; $message .= '<pre>'.var_export($members, true).'</pre><br>'; // Setup the View variables. $this->title(__d('demo', 'Base Model Demo')); $this->set('message', $message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n\t{\t\n\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function welcomeMessage()\n {\n $this->info('');\n $this->info('Welcome to Nigels Coffee Shop Robot Controller Simulator!');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function sendWelcomeMsg()\n\t{\n\t}", "function welcome() {\r\n\r\n return $this->render('welcome', array());\r\n }", "protected function _welcome(){\n\t}", "public function showWelcome()\n\t{\n\t\t$this->layout->content = View::make('home');\n\t}", "public function indexAction()\n\t{\n\t\t$this->view->helloWorld = \"Howdy All!\";\n\t}", "public function indexAction() {\r\n $this->view->title = 'Hello World !';\r\n $this->view->headTitle('Hello World !');\r\n }", "public function indexAction()\n {\n $arr = [\n 'title' => 'Welcome',\n 'data' => [\n 'name' => 'PHP FRAMEWORK',\n ]\n ];\n View::renderTemplate('Welcome/index.html', $arr);\n }", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function thankYouSeattle() {\n\t\t$pageTitle = 'Thank you';\n\t\t$this->viewBuilder()->setLayout('homelayout');\n\t\t$this->set(compact('pageTitle'));\n\t}", "protected function _welcome() {\n\n }", "public function indexAction() {\n $this->view->title = 'Hello World !';\n $this->view->headTitle('Hello World !');\n }", "public function index() {\n\t\t$adm_uid = $this->session->userdata('adm_uid') ?: 0;\n\t\tif ($adm_uid) {\n\t\t\t$this->load->view('header');\n\t\t\t$this->load->view('welcome_message');\n\t\t\t$this->load->view('footer');\n\n\t\t} else {\n\t\t\tredirect(HOSTDOMAIN . '/welcome/login');\n\n\t\t}\n\n\t}", "function index() {\n \n parent::index();\n\n\t\t$data['user_id'] = $this->tank_auth->get_user_id();\n\t\t$data['username'] = $this->tank_auth->get_username();\n\t\t$data['main_content_view'] = $this->load->view('welcome', $data, true);\n $this->render_template($data);\n\t}", "public function index() {\n\t\t$data = [];\n\n\t\t//get messages from the session\n\t\tif($this->session->userdata('success_msg')){\n\t\t\t$data['success_msg'] = $this->session->userdata('success_msg');\n\t\t\t$this->session->unset_userdata('success_msg');\n\t\t}\n\n\t\tif($this->session->userdata('error_msg')){\n\t\t\t$data['error_msg'] = $this->session->userdata('error_msg');\n\t\t\t$this->session->unset_userdata('error_msg');\n\t\t}\n\n\t\t// set page title.\n\t\t$data['pageTitle'] = \"WELCOME DASHBOARD\";\n\n\t\t// Load view components for this controller.\n\t\t$this->load->view('components/header', header_component());\n\t\t$this->load->view('welcome_dashboard', $data);\n\t\t$this->load->view('components/footer');\n\t}", "public function welcome()\n {\n return view(\"Participant::welcome\");\n }", "public function welcome(){\n return view ('pages.welcome');\n }", "public static function welcome() {\n\t}", "public function showWelcome()\n\t{\n\n\t\t$mensaje = Session::get('message', null);\n\n\t\t$tipos = $this->getTipos();\n\t\t$estados = $this->getEstados();\n\n\t\treturn View::make('index', array('tipos' => $tipos, 'estados' => $estados, 'mensaje' => $mensaje));\n\t}", "public function index()\n\t{\n\t\t$data['items'] = $this->items->get_items();\n\t\t$this->load->view('welcome_message',$data);\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}", "public function index()\n\t{\n $this->cekLogin();\n $data['judul']=\"Dashboard\";\n\t\t$this->template->load('template/dash','welcome_message',$data);\n\t}", "static function welcome()\n\t{\n\t\techo 'wellcome to our project';\n\t}", "protected function _welcome()\n {\n $this->out('\n __ ____ _ _______ __\n / |/ (_)_________(_)___ ____ _ / ____(_) /__ _____\n / /|_/ / / ___/ ___/ / __ \\/ __ `/ / /_ / / / _ \\/ ___/\n / / / / (__ |__ ) / / / / /_/ / / __/ / / / __(__ )\n/_/ /_/_/____/____/_/_/ /_/\\__, / /_/ /_/_/\\___/____/\n /____/ ');\n }", "public function indexAction() \n {\n $this->loadLibrary('Time', 'time'); \n\n $this->assign('nowtime', $this->time->printTime());\n $this->assign('title', 'Start page');\n $this->assign('text1', 'It is text 1');\n $this->assign('text2', 'It is text 2'); //$this->text2 = 'It is text 2'; \n }", "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function actionError() {\n\t\t$controller = new \\controllers\\WelcomeController;\n\t\t$controller->actionStart();\n\t\texit;\n\t}", "public function thankYouDenver() {\n\t\t$pageTitle = 'Thank you';\n\t\t$this->viewBuilder()->setLayout('homelayout');\n\t\t$this->set(compact('pageTitle'));\n\t}", "public function welcome()\n {\n return view(\"PlayerMatch::welcome\");\n }", "public function indexAction() {\n\t\t$this->view->data = \"OK\"; \t\t\t\t\t\n\t\t\t\n\t}", "public function welcomeAction() {\n $user_session = new Container('user');\n $username = $user_session->username; // $username now contains 'Andy0708'\n }", "public function index()\n\t{\n \t$this->data['pagetitle'] = 'Path of Exile - About';\n\t\t$this->data['pagebody'] = 'about';\n $role = $this->session->userdata('userrole');\n if ($role == \"\")\n $role = \"User Role\";\n $this->data['userrole'] = $role;\n\n\t\t$this->render(); \n\t}", "public function action_hello()\r\n\t{\r\n\t\treturn Response::forge(Presenter::forge('welcome/hello'));\r\n\t}", "public function mainAction(){\n \n $site = new model\\siteModel();\n $site->set_headerTitle(\"Levi DeHaan\");\n \n $site->set_menu(array(\"Home\"=>\"#/home\", \"Projects\"=>\"#/projects\"));\n $site->set_leftTitle(\"Programmer/Sys Admin\");\n $site->set_leftBody(\"Self taught, motivated, leader of silent ninja code assasins and cats.\");\n $site->set_rightTitle(\"Ninjas and Dragons\");\n $site->set_rightBody(\"The Awesome Starts Here\");\n $site->set_body(\"There are words here\");\n $site->set_footer(\"Levi DeHaan\");\n \n \n $this->headerTitle = $site->get_headerTitle();\n $this->menu = $site->get_menu();\n $this->leftTitle = $site->get_leftTitle();\n $this->leftBody = $site->get_leftBody();\n $this->rightTitle = $site->get_rightTitle();\n $this->rightBody = $site->get_rightBody();\n $this->body = $site->get_body();\n $this->footer = $site->get_footer();\n }", "public function index()\n {\n require_once 'view/welcome.php';\n }", "public function action_hello()\n\t{\n\t\treturn Response::forge(Presenter::forge('welcome/hello'));\n\t}", "public function index()\n\t{\n // If they aren't logged in\n if (! Auth::logged_in() AND 1 == 2) :\n $this->load->view('shared/header');\n \t\t// $this->load->view('homepage/public');\n \t\t$this->load->view('shared/footer');\n \t\t\n \t\treturn;\n endif;\n \n show_error('Welcome!', 200);\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('welcome.form');\n\t}", "public function index()\n {\n $this->request->getSession()->write('DialogTitle', 'Yeah Man!!');\n\n // Set the layout\n $this->viewBuilder()->setLayout('empty');\n\n $this->set('csrfToken', $this->request->getAttribute('csrfToken'));\n\n $this->set('jaxonCss', $this->Jaxon->css());\n $this->set('jaxonJs', $this->Jaxon->js());\n $this->set('jaxonScript', $this->Jaxon->script());\n $this->set('pageTitle', \"Cake Framework\");\n $this->set('menuEntries', []);\n $this->set('menuSubdir', '');\n // Jaxon request to the Jaxon\\App\\Test\\Bts controller\n $this->set('bts', $this->Jaxon->request(\\Jaxon\\App\\Test\\Bts::class));\n // Jaxon request to the Jaxon\\App\\Test\\Pgw controller\n $this->set('pgw', $this->Jaxon->request(\\Jaxon\\App\\Test\\Pgw::class));\n $this->render('demo');\n }", "public function index()\n {\n $this->layout->title = \"Home page\";\n }", "public function introductionAction()\n {\n if (! isset($this->dictionary['introduction'])) {\n $this->homeAction();\n\n } else if (strpos($this->dictionary['introduction'], 'http') !== false) {\n $this->view->externalDict = $this->dictionary['introduction'];\n\n } else {\n $this->view->introduction = 'introduction/' . $this->dictionary['introduction'];\n }\n }", "public function parallax_one_welcome_admin_notice() {\n\t\t?>\n\t\t\t<div class=\"updated notice is-dismissible\">\n\t\t\t\t<p><?php echo sprintf( esc_html__( 'Welcome! Thank you for choosing Parallax One! To fully take advantage of the best our theme can offer please make sure you visit our %swelcome page%s.', 'parallax-one' ), '<a href=\"' . esc_url( admin_url( 'themes.php?page=parallax-one-welcome' ) ) . '\">', '</a>' ); ?></p>\n\t\t\t\t<p><a href=\"<?php echo esc_url( admin_url( 'themes.php?page=parallax-one-welcome' ) ); ?>\" class=\"button\" style=\"text-decoration: none;\"><?php _e( 'Get started with Parallax One', 'parallax-one' ); ?></a></p>\n\t\t\t</div>\n\t\t<?php\n\t}", "public function index()\n\t{\n\t\t//load our Nativesession library\n $this->load->library( 'nativesession' );\n $this->load->helper('url');\t\t\n\n //Read the username from session\n \n $userid = $this->nativesession->get( 'userid' );\n $userLevel = $this->nativesession->get( 'userLevel' );\n\n //Update session data\n //$this->nativesession->set( 'cart', $cart );\n\n //delete session data\n //$this->nativesession->delete('userid');\n\n\t\t$data = array(\n\t\t 'userid' => $userid,\n\t\t 'userLevel' => $userLevel,\n\t\t 'message' => 'My Message'\n\t\t);\n\n\t\t$this->load->view('welcome_message', $data);\n\t}", "public function index()\n\n\t{\n\t\t\n\n\t\t$success = Session::has('success') ? Session::get('success') : '';\n\n\t\treturn app('App\\Http\\Controllers\\UtilsController')->render_page( \"home\",\"welcome\",array('success'=>$success) );\n\n\t}", "public function welcome()\n {\n return view('welcome', ['check' => Auth::check()]);\n }", "public function welcome()\n {\n return view('pages.welcome');\n }", "public function showWelcome()\n\t{\n \n\t\treturn View::make('home');\n\t}", "function index()\n {\n $data['$option'] = \"doc/welcome\";\n $this->loadContent('doc/home', $data);\n }", "public function welcome() {\n //$response->setStatusCode(500, 'The resource is created successfully!');\n //abort(500, 'Unauthorized action.');\n // return view('welcome');\n \n }", "public function thankYouAustin() {\n\t\t$pageTitle = 'Thank you';\n\t\t$this->viewBuilder()->setLayout('homelayout');\n\t\t$this->set(compact('pageTitle'));\n\t}", "public function welcome_apply_message() {\n global $OUTPUT;\n\n $a = new \\stdClass();\n $a->uploadpage = get_string('tabutemplatepage3', 'mod_surveypro');\n $a->savepage = get_string('tabutemplatepage2', 'mod_surveypro');\n $message = get_string('welcome_utemplateapply', 'mod_surveypro', $a);\n echo $OUTPUT->notification($message, 'notifymessage');\n }", "public function index() {\n\t\t$data['message'] = 'Welcome to MyJamia Portal!';\n\t\t$data['messageType'] = 'I';\n\t\t$this->load->view('/public/user_login',$data);\n\t}", "public function actionIndex() {\n /** @var User $identity */\n $identity = UShort::user()->identity;\n UShort::session()->setFlash('info', UTranslate::t('Welcome, {username}!', UTranslate::TYPE_LABEL , [\n '{username}' => ($identity) ? $identity->username : 'No Authorise'\n ]));\n return $this->render('index');\n }", "public function index()\n\t{\n\t\t$data['get_all_vendor_type'] = $this->vendor_model->get_all_vendor_type();\n\t\t$data['get_all_city'] = $this->vendor_model->get_all_city();\n\t\t$this->load->helper('url');\n\t\t$this->load->view('welcome_message.php',$data);\n\t}", "public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}", "public function init() {\n\t\tadd_action( 'admin_notices', [ $this, 'showWelcomeMessage' ] );\n\t}", "public function actionIndex($message = 'hello world')\n {\n echo $message . \"\\n\";\n }", "public function actionIndex($message = 'hello world')\n {\n echo $message . \"\\n\";\n }", "public function actionIndex($message = 'hello world')\n {\n echo $message . \"\\n\";\n }", "public function actionIndex($message = 'hello world')\n {\n echo $message . \"\\n\";\n }", "public function actionIndex($message = 'hello world')\n {\n echo $message . \"\\n\";\n }", "public function actionIndex($message = 'hello world')\n {\n echo $message . \"\\n\";\n }", "public function index()\n {\n $this->global['pageTitle'] = 'Manage Contacts';\n }", "public function indexAction()\n\t\t{\n//\t\t\techo 'first leg';\n\t\t\t//$this->view->layout =''\n\t\t}", "public function aloAction()\n\t{\n\t\t$this->flashMessenger()->addInfoMessage('You are now logged in.');\n// \t $this->redirect()->toRoute('imessage');\n\t\t$this->redirect()->toRoute(null, array(\n\t\t\t\t'controller' => 'index',\n\t\t\t\t'action' => 'message',\n\t\t));\n\t}", "public function indexAction ()\n {\n $this->_pageTitle = ['Admin Console'];\n }", "public function indexAction() {\n\t\t\n\t\t// plain assign\n\t\t$this->view->assign('helloworld1', 'Hello World 1!');\n\t\t\n\t\t// normal array assign\n\t\t$array = array('Hello','World','2!');\n\t\t$this->view->assign('helloworld2', $array);\n\t\t\n\t\t// assoziative array assign\n\t\t$array = array('first' => 'Hello', 'middle' => 'World', 'last' => '3!');\n\t\t$this->view->assign('helloworld3', $array);\n\t\t\n\t\t// object assign\n\t\t$start = new Tx_Efempty_Domain_Model_Start;\n \t$start->setTitle(\"Hello World 4!\");\n \t$this->view->assign('helloworld4', $start);\n\n\t}", "public function mainPage()\n {\n return view('welcome');\n }", "public function frontpage() {\n\t\t\n\t\t$this->set('page_title', 'Welcome'); // this is hardcoded for index page\n\t\t$this->render('index');\n\t}", "public function index()\n\t{\n\n $page_data = array(\n 'title' => SITE_NAME . \" - digital technology specialist\",\n 'meta_description' => \"Dafydd Vaughan - digital teachnology specialist. I advise organisations on replacement of legacy technology, adoption of public cloud services, and how to build strong digital teams.\",\n \"site_section\" => \"home\",\n \"page_title\" => \"Hello, I'm Dafydd Vaughan\"\n );\n\n $this->load->view('templates/header', $page_data);\n\t\t$this->load->view('welcome');\n $this->load->view('templates/footer');\n\t}", "public static function welcomeMessage() : void\n {\n if (!file_exists(__DIR__ . '/../../.env.php')) {\n echo \"Heya, we think you are new. Let us spin up the frame work for you!..\";\n $request = self::requestInput('Do you want to continue?', ['(Y)es', '(N)o']);\n if ($request == 'yes' || $request == 'y') {\n $start = new \\Framework\\Commands\\Start\\Start;\n $start->start();\n exit();\n }\n echo \"=====================================\\n\";\n }\n echo \"Welcome to the command environment. Choose what you want to do, you have the following options: \\n\";\n foreach (self::$options as $option) {\n echo \"- $option \\n\";\n }\n }", "public function showWelcome(){\n\t\treturn View::make('hello');\n\t}", "public function actionIndex($message = 'hello world') {\n\t\techo $message . \"\\n\";\n\t}", "public function indexAction() \t{\n $this->view->params = $this->_getAllParams();\n $this->view->messages = $this->_messages->getMessages($this->_getAllParams());\n }", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "function welcome() \n { \n if($this->session->userdata('admin_id')==NULL || $this->session->userdata('admin_id')==FALSE) \n\t {\n\t redirect('admin_login/login'); \n\t } \n\t else\n\t {\n\t $data['admin_info'] = $this->admin_model->admin_profile_detail(); \n\t $this->load->view('admin/welcome',$data); \n\t } \t \n }" ]
[ "0.7186115", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7185689", "0.7179201", "0.7140138", "0.7140138", "0.68477726", "0.6808638", "0.6657547", "0.660066", "0.65506655", "0.6462703", "0.6460967", "0.64599717", "0.6446198", "0.64403814", "0.6436126", "0.64357007", "0.64062274", "0.6381961", "0.63811576", "0.6359873", "0.63563573", "0.6346211", "0.6337729", "0.6330781", "0.62663436", "0.62532", "0.62341696", "0.62178683", "0.6195274", "0.61929035", "0.61887383", "0.6176035", "0.61719483", "0.6164367", "0.6142334", "0.61192304", "0.61165243", "0.61132973", "0.6112275", "0.6090928", "0.6086053", "0.6073428", "0.60707086", "0.6011195", "0.5999931", "0.5991811", "0.59843564", "0.5981494", "0.5973704", "0.5967198", "0.5949592", "0.5946469", "0.5939069", "0.59389436", "0.593811", "0.59355825", "0.5932955", "0.5928526", "0.5926149", "0.5917999", "0.5917999", "0.5917999", "0.5917999", "0.5917999", "0.5917999", "0.5916225", "0.59098023", "0.59036076", "0.58932465", "0.5892878", "0.5891465", "0.58896255", "0.58869827", "0.5883818", "0.58800066", "0.5877949", "0.586955", "0.58643365", "0.58643365", "0.58643365", "0.58643365", "0.58643365", "0.58643365", "0.58643365", "0.58643365", "0.58643365", "0.58643365", "0.5863272" ]
0.0
-1
Called before actually calling any action of controller In fact we can execute some methods and checks that are used by any action
public function postDispatch() { parent::postDispatch(); $this->getRequestData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function beforeAction () {\n\t}", "public function preAction()\n {\n // Nothing to do\n }", "protected function beforeAction() {\n\n }", "public function before()\n {\n parent::before();\n\n // Get the HTTP status code\n $action = $this->request->action();\n\n if ($this->request->is_initial())\n {\n // This controller happens to exist, but lets pretent it does not\n $this->request->action($action = 404);\n }\n else if ( ! method_exists($this, 'action_'.$action))\n {\n // Return headers only\n $this->request->action('empty');\n }\n\n // Set the HTTP status code\n $this->response->status($action);\n }", "protected function preRunController()\n {\n $annotations = $this->controller->getControllerAnnotationParser()->getAnnotationsForMethod($this->action);\n\n if ($annotations->has(\"AuthRequired\")) {\n if (!$this->getApplicationSession()->isSessionActive()) {\n $this->reRouteTo(\"login\", \"prompt\");\n }\n }\n\n if ($annotations->has(\"LogInNotPermitted\")) {\n if ($this->getApplicationSession()->isSessionActive()) {\n $this->redirectTo(\"main\");\n }\n }\n }", "public function preExecute()\n {\n $this->getContext()->getConfiguration()->loadHelpers(array('Url', 'sfsCurrency'));\n \n if ($this->getActionName() == 'index') {\n $this->checkOrderStatus();\n }\n }", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n }\n }", "public function preAction()\n {\n }", "public function preExecute()\n {\n if (clsCommon::permissionCheck($this->getModuleName().\"/\".$this->getActionName()) == false){\n $this->getUser()->setFlash(\"errMsg\",sfConfig::get('app_Permission_Message'));\n $this->redirect('default/index');\n } \n }", "public static function before() {\n\t\t// Return true for the actions below to execute\n\t\treturn true;\n\t}", "public function before_run(){}", "public function before()\n\t{\n\t\t// Check method Support\n\t\tif ( ! isset($this->_method_map[$this->request->method()]))\n\t\t\tthrow HTTP_Exception::factory(405)->allowed($this->_method_map);\n\n\t\t// Generate the action name based on the HTTP Method of the request, and a supplied action\n\t\t$action_name = ($this->request->action() === 'index')\n\t\t\t? Arr::get($this->_method_map, $this->request->method())\n\t\t\t: Arr::get($this->_method_map, $this->request->method()).'_'.$this->request->action();\n\n\n\t\t$this->request->action($action_name);\n\t}", "public function preAction() {\n\n }", "public function before()\n\t{\n\t\tif ($this->request->action === 'login' OR $this->request->action === 'logout')\n\t\t{\n\t\t\t$this->requires_login = FALSE;\n\t\t}\n\t}", "public function preDispatch() { }", "public function beforeAction()\n {\n // do nothing, just disable the login check in parent::beforeAction;\n //\n }", "public function pre_action()\n\t{\n\t\tparent::pre_action();\n\t}", "protected function before(){}", "public function preDispatch();", "public function preDispatch() {\n\t\t\n\t\t}", "public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }", "public function preDispatch()\n\t{\n\n\t\t\n\t\t\n\t}", "public function before_run() {}", "public function before()\n\t{\n\t\tif ($this->request->is_initial())\n\t\t{\n\t\t\t$this->request->action(404);\n\t\t}\n\t\t\n\t\treturn parent::before();\n\t}", "public function preDispatch()\n {\n\n }", "public function preDispatch()\n {\n //...\n }", "public function before()\n\t{\n\t\tif (User::is_guest())\n\t\t{\n\t\t\tthrow HTTP_Exception::factory(403, 'Permission denied! You must login!');\n\t\t}\n\n\t\t$id = $this->request->param('id', FALSE);\n\n\t\tif ($id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('view');\n\t\t}\n\t\tif ( ! $id AND 'index' == $this->request->action())\n\t\t{\n\t\t\t$this->request->action('inbox');\n\t\t}\n\n\t\tAssets::css('user', 'media/css/user.css', array('theme'), array('weight' => 60));\n\n\t\tparent::before();\n\t}", "public function beforeFilter(){\n\t\tparent::beforeFilter();\n// debug('test');\n\t\tif (isset($this->Auth)) {\n\t\t\t$this->Auth->allow('process');\n\t\t}\n\t\tif (isset($this->Security) && $this->action == 'process') {\n\t\t $this->Security->validatePost = false;\n\t\t}\n\t}", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "private function before_execute()\n {\n }", "public function beforeAction( $request )\r\n\t\t{\r\n\r\n\t\t}", "public function preExecute(){\n\n\t\n\t}", "public function before()\n\t{\n\t}", "protected function before_filter() {\n\t}", "protected function _before()\n\t{\n\t\t\n\t}", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\tif ($this->Components->enabled('Auth')) {\n\t\t\t$this->Auth->allow('process');\n\t\t}\n\t\tif (isset($this->Security) && $this->action === 'process') {\n\t\t\t$this->Security->validatePost = false;\n\t\t}\n\t}", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "public function before() {}", "public function before() {}", "protected function before()\n {\n }", "public function preDispatch()\r\n {\r\n $this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);\r\n\r\n $this->View()->sUserLoggedIn = $this->admin->sCheckUser();\r\n $this->View()->sUserData = $this->getUserData();\r\n }", "protected function beforeMethod()\n {\n }", "protected function beforeDoAction() {\n return true;\n }", "public function preDispatch()\n {\n if ( !Auth_UserAdapter::hasIdentity() )\n {\n $this->_helper->redirector( 'index', 'index' );\n }\n }", "public function before()\n {\n\tparent::before();\n\n // 管理者グループのみ許可\n\tif (!Controller_Auth::is_admin())\n {\n\t Response::redirect('auth/invalid');\n }\n }", "public function beforeFilter(){ \n\t\t$this->check_session();\n\t\t$this->check_role_access(2);\n\t}", "public function beforeFilter()\n\t{\n\n\t}", "protected abstract function before();", "protected function _before()\n {\n }", "public function preDispatch()\n {\n $config = Mage::getModel('emailchef/config');\n /* @var $config EMailChef_EMailChefSync_Model_Config */\n\n if (!$config->isTestMode()) {\n die('Access Denied.');\n }\n\n return parent::preDispatch();\n }", "public function beforeFilter() {\n\t}", "public function beforeExecuteRoute()\n {\n if (method_exists($this, 'initialize')) {\n $this->initialize();\n }\n\n $this->middlewareHandler();\n }", "public function preDispatch()\n {\n \t$auth\t= Zend_Auth::getInstance();\n \t\n// \t$this->view->loginIn = $auth->hasIdentity();\n \t$this->_loggedIn\t = $auth->hasIdentity();\n \n \t/* Check if loging in is neccessary ! */\n \tif (!$auth->hasIdentity())\n \t{\n \t\t/* If required: force log-in */\n \t}\n \t\n }", "public function preDispatch()\n\t{\n\t\t$this->_actionController->initView();\n\t\t\n\t\t// We have to store the values here, because forwarding overwrites\n\t\t// the request settings.\n\t\t$request = $this->getRequest();\n\t\t$this->_lastAction = $request->getActionName();\n\t\t$this->_lastController = $request->getControllerName();\n\t}", "public function preDispatch()\n {\n parent::preDispatch();\n \n if (!Mage::helper('clarion_reviewreminder')->isExtensionEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n } \n }", "public function beforeFilter()\r\n {\r\n\t\t$this->Security->csrfCheck = true;\r\n $this->Security->disabledFields = array(\r\n\t\t\t'Hall.user_id',\r\n );\r\n\t\tif ((!empty($this->request->params['action']) and ($this->request->params['action'] == 'index'))) {\r\n $this->Security->validatePost = false;\r\n }\r\n parent::beforeFilter();\r\n }", "public function _before()\n {\n }", "public function before()\n {\n }", "public function before()\n {\n }", "public function before()\n {\n }", "function beforeFilter()\r\n\r\n\t {\r\n\r\n\t\tif( Configure::read() == 0 )\r\n\r\n\t\t{\r\n\r\n\t\t\t$this->cakeError('error404');\r\n\r\n\t\t}\t \t\r\n\r\n \t\tApp::import('Vendor', 'Cpamf.amfphp' . DS . 'core' . DS . 'cakeamf' . DS . 'util', array( 'file' => 'CakeMethodTable.php' ) );\r\n\r\n\t }", "function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n $module = $request->getModuleName();\n $controller = $request->getControllerName();\n $action = $request->getActionName();\n \n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $session_admin=new Zend_Session_Namespace('session_admin');\n \n Zend_Registry::set('session_admin',$session_admin);\n \n \n\t if( $this->_request->getControllerName() != 'index'\n\t\t && $this->_request->getControllerName() != 'register'\n\t\t && $this->_request->getControllerName() != 'api'\n\t\t && $this->_request->getControllerName() != 'veritrans')\n\t\t{\n\t\t\t\tif($module=='admin'){/* @var $redirector Zend_Controller_Action_Helper_Redirector */\n\t\t \t \tif(!isset($session_admin->user_id) || $session_admin->user_id == ''){\n\t\t \t \t\treturn $redirector->gotoSimple('index', 'loginadmin', 'admin', array());\n\t\t \t \t}\n\t\t \t }\n\t } \n \t\n }", "function beforeFilter(){\n\t\t\n\t\t$this->Auth->allowedActions = array(\n\t\t\t//allow cron to happen with no authentication, we don't need to.\n\t\t\t'cron',\n\t\t\t//allow add_memebers_status to happen with no authentication, to speed it up.\n\t\t\t//it is used by admin_add_members for the progress indicator.\n\t\t\t'admin_add_members_status'\n\t\t);\n\t}", "protected function before() {\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n // The parent may block the dispatch\n $this->setFlag('', 'no-dispatch', false);\n\n if (!$this->getRequest()->isDispatched()) {\n return;\n }\n\n $action = $this->getRequest()->getActionName();\n $openActions = array(\n 'create',\n 'login',\n 'existing',\n 'confirmation'\n );\n $pattern = '/^(' . implode('|', $openActions) . ')/i';\n\n if (!preg_match($pattern, $action)) {\n if (!$this->_getSession()->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n } else {\n $this->_getSession()->setNoReferer(true);\n }\n }", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow(array('explore','get_map_init','get_map','get_experiences','search')); //actions that anyone is allowed to call\n }", "public function preExecute() {\n }", "public function _checkControllerAccess() \n {\n static $_unprotectedControllersHookDone = false;\n static $_hookCalled = false;\n \n if ($_hookCalled || !$controller = Yii::app()->getController()) {\n return;\n }\n \n $_hookCalled = true;\n $unprotectedControllers = (array)Yii::app()->params->itemAt('unprotectedControllers');\n\n if (!$_unprotectedControllersHookDone) {\n Yii::app()->params->add('unprotectedControllers', $unprotectedControllers);\n $_unprotectedControllersHookDone = true;\n }\n\n if (!in_array($controller->id, $unprotectedControllers) && !Yii::app()->user->getId()) {\n // make sure we set a return url to the previous page that required the user to be logged in.\n Yii::app()->user->setReturnUrl(Yii::app()->request->requestUri);\n // and redirect to the login url.\n $controller->redirect(Yii::app()->user->loginUrl);\n }\n \n // since 1.3.5, user permission to controller action, aka route\n if (!in_array($controller->id, $unprotectedControllers) && Yii::app()->user->getId()) {\n $controller->onBeforeAction = array($this, '_checkRouteAccess');\n }\n \n // check version update right before executing the action!\n $controller->onBeforeAction = array($this, '_checkUpdateVersion');\n \n // check app wide messages\n $controller->onBeforeAction = array($this, '_checkAppWideMessages');\n }", "function beforeFilter() {\n\t\t// only for snaphappi user login, not rpxnow\n\t\tparent::beforeFilter();\n\t\t/*\n\t\t *\tThese actions are allowed for all users\n\t\t */\n\t\t$this->Auth->allow(\n\t\t/*\n\t\t * main\n\t\t */\n\t\t'home', 'groups', 'discussion', 'trends', 'hiddenShots', 'substitutes', 'neighbors', 'search', \n\t\t/*\n\t\t * all\n\t\t */'index', 'all', 'most_active', 'most_views', 'most_recent', 'top_rated', \n\t\t/*\n\t\t * actions\n\t\t */'get_asset_info', 'shot',\n\t\t/*\n\t\t * experimental\n\t\t */\n\t\t 'stories', // TODO: move to ACL\n\t\t 'test', 'addACL', 'updateExif'\n\t\t);\n\t\tAppController::$writeOk = $this->Asset->hasPermission('write', AppController::$uuid);\n\t}", "protected function before(): void\n {\n }", "public function before()\n {\n }", "public function beforeExecute() {\n $instance = \\UserAuth::getInstance();\n if ( $instance->isAuthenticated() === false) {\n $this->redirect(Main::getHomeRouter()->createUrl('login/login'));\n }\n }", "public function beforeFilter()\r\n\t {\r\n\t parent::beforeFilter();\r\n\t }", "public function beforeStart()\n {\n }", "public function preDispatch() {\r\n\t\t$this->_auth = Zend_Auth::getInstance();\r\n\t\t$this->_auth->setStorage(new Zend_Auth_Storage_Session('Fancrank_App'));\r\n\t\t//\r\n\t\tif(!$this->_auth->hasIdentity()) {\r\n\t\t\t$this->_helper->json(array('message'=>'authentication failed','code'=>400));\r\n\t\t\t//set the proper navbar\r\n\t\t}\r\n\t\t$this->_helper->layout()->disableLayout();\r\n\t\t$this->_helper->viewRenderer->setNoRender();\r\n\t\t$this->_user = $this->_auth->getIdentity();\r\n\t\t\r\n\t\tif ($this->_getParam('id') != $this->_user->facebook_user_id){\r\n\t\t\techo \"IDENTITY AND PARAMETER ID DOES NOT MATCH\"\t;\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function preDispatch()\n {\n parent::preDispatch();\n $action = $this->getRequest()->getActionName();\n $loginUrl = Mage::helper('customer')->getLoginUrl();\n if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {\n $this->setFlag('', self::FLAG_NO_DISPATCH, true);\n }\n }", "public function beforeFilter() {\n\t\t// This is for non-login actions\n\t\t$this->Auth->allow('index', 'view');\n\t\t$this->set('logged_in', $this->Auth->loggedIn());\n\t\t$this->set('current_user', $this->Auth->user());\n\t}", "public function preDispatch()\n {\n if (!in_array($this->Request()->getActionName(), ['index', 'load'])) {\n $this->Front()->Plugins()->Json()->setRenderer(true);\n }\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n }", "public function preExecute() {\n // initialise the facebook api variables\n $app_id = sfConfig::get('app_facebook_app_id');\n $secret = sfConfig::get('app_facebook_secret');\n\n // initialise the facebook SDK object and make it available for all\n // other actions\n $this->facebook = new Facebook(array('appId' => $app_id,\n 'secret' => $secret,\n 'cookie' => true));\n\n // define the current action\n $this->action_name = $this->getActionName();\n }", "public function _before_init(){}", "public function setup_actions() {}", "protected function beforeProcess() {\n }", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::helper('ab_adverboard')->isEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n }\n }", "protected function before()\n {\n $this->requireLogin();\n }", "protected function before()\n {\n $this->requireLogin();\n }", "protected function before(){\n\n }", "function preDispatch()\n {\n\n }", "public function beforeFilter(){\n\t\t$this->check_admin_session();\t\t\n\t}", "public function preDispatch()\n {\n parent::preDispatch();\n \n if (!Mage::helper('archana_storelocator')->isEnabled()) {\n $this->setFlag('', 'no-dispatch', true);\n $this->_redirect('noRoute');\n } \n }", "public function beforeRequest($method, array $args = array()) {}", "public function beforeFilter() \n\t{\n\t\tparent::BeforeFilter();\n\t\t$this->Auth->allowedActions = array('index', 'view');\n\t}", "public function preExecute()\n {\n // store current URI incase we need to be redirected back to this page\n $request = $this->getRequest();\n if($request->getPathInfo() != '/getEbayResults')\n {\n $this->getUser()->setAttribute('lastPageUri', $request->getPathInfo());\n }\n }", "public function preDispatch()\n\t{\n\t\tparent::preDispatch();\n\t\tif ($this->getRequest()->getActionName() == 'view'){\n\t\t\t$this->getRequest()->setRouteName('icecatimport');\n\t\t}\n\t}", "public function beforeStart () {\n }", "public function preDispatch()\n {\n parent::preDispatch();\n $this->getDi()->plugins_payment->loadEnabled()->getAllEnabled();\n }", "public function beforeFilter() {\n\t\t\n\t\tif($this->Auth->user('professor')==true) {\n\t\t\t$this->Ressource->Behaviors->attach('LightAuthFiltered', array('match_field'=>'creator'));\n\t\t} else {\n\t\t\t$this->Ressource->Behaviors->attach('LightAuthFiltered', array('match_field'=>'cours_id', 'auth_field'=>'cours_id'));\n\t\t}\n\t\t\n\t\tparent::beforeFilter();\n\t\t$this->Auth->authorize = 'Controller';\n\n if (isset($this->Security) && in_array($this->action, array('display'))) {\n\t\t$this->Security->validatePost = false;\n\t\t$this->Security->csrfCheck = false;\n\t}\n\n // Controller specific beforeFilter \n }", "function test_init_action_is_run() {\n\t}", "public static function _before() : void {\n\t}", "public function before()\n\t{\n\t\t// Inform tht we're in admin section for themers/developers\n\t\tTheme::$is_admin = TRUE;\n\n\t\tif($this->request->action() != 'login')\n\t\t{\n\t\t\tACL::redirect('administer site', 'admin/login');\n\t\t}\n\n\t\tparent::before();\n\t}" ]
[ "0.7983427", "0.78056985", "0.7705107", "0.76815736", "0.7648816", "0.75770396", "0.75691175", "0.7530844", "0.75281966", "0.7519544", "0.7510709", "0.7455143", "0.7427178", "0.7385185", "0.73651505", "0.7354207", "0.731259", "0.7308509", "0.72881836", "0.72778815", "0.72744286", "0.7253307", "0.7249066", "0.72475886", "0.7241499", "0.7213956", "0.71988684", "0.7169785", "0.7158641", "0.7071306", "0.7065744", "0.69970906", "0.6994808", "0.69816357", "0.69351906", "0.69295955", "0.6922819", "0.6902281", "0.6902281", "0.68890756", "0.68629795", "0.6841371", "0.6819963", "0.68105185", "0.6810385", "0.67887795", "0.6783205", "0.6781189", "0.6775646", "0.677563", "0.6769192", "0.6757499", "0.67574686", "0.67534053", "0.6748323", "0.6745381", "0.67413145", "0.6740062", "0.6739742", "0.67395985", "0.6733305", "0.6726626", "0.67232215", "0.6713058", "0.67113525", "0.6709639", "0.6689698", "0.66790706", "0.66771555", "0.6670427", "0.6663593", "0.6660638", "0.66541356", "0.6648845", "0.66476786", "0.66460186", "0.66413593", "0.66260624", "0.6614892", "0.6614892", "0.661484", "0.6603386", "0.6590275", "0.65897334", "0.65860087", "0.65836656", "0.65836656", "0.65802443", "0.6569999", "0.6567313", "0.65665334", "0.6564963", "0.6561649", "0.6554555", "0.6549212", "0.6546968", "0.65424544", "0.65421075", "0.6537814", "0.65368885", "0.65221584" ]
0.0
-1
Parses data from payload If you want to change source of data or add some debug parameters this is the best place to
protected function getRequestData() { if ($this->requestData) { return $this->requestData; } $body = $this->getRequest()->getRawBody(); try { $data = Zend_Json::decode($body); } catch (Zend_Exception $e) { $this->setErrorResponse('Broken JSON provided with request'); } $this->requestData = $data; return $this->requestData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parsePayload()\n { \n return $this->_payload;\n }", "public function parseData()\n {\n $jsonMessage = json_decode($this->payload);\n // :: Check if handler contains fully qualified namespace\n if (strpos($jsonMessage->handler, '\\\\') !== false) {\n $parts = explode('\\\\', $jsonMessage->handler);\n $jsonMessage->handler = $parts[count($parts) - 1];\n }\n $exploded = explode('@', $jsonMessage->handler);\n $obj = new StdClass();\n $obj->class = 'Ktbots\\\\Core\\\\Handlers\\\\' . $exploded[0];\n $obj->method = $exploded[1];\n $obj->value = $jsonMessage->value;\n return $obj;\n }", "public function ParsePostData() {}", "public function parsePostData()\n {\n }", "abstract protected function parse($data);", "public function parse($data);", "public function parse($data);", "public function parse($data);", "public function get_payload();", "public function parsePayload()\n {\n return($this->_payload);\n }", "private function parseData($data) : void\n {\n $this->description = $data['description'];\n $this->postcode = $data['postcode'];\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public static function mutate_and_get_payload()\n {\n }", "public function parse($payload)\n {\n return json_decode($payload, true);\n }", "protected function parse() {}", "protected abstract function _body_from_payload ($payload);", "public function payload();", "public function payload();", "public function parsePayload()\n {\n $_MTI_url = 'http://ii.nlm.nih.gov/cgi-bin/II/Interactive/interactiveMTI.pl'; \n $dom = new DOMDocument;\n $fields = array('InputText' => urlencode($this->_payload));\n\n $curl_ressource = curl_init();\n \n curl_setopt($curl_ressource,CURLOPT_URL, $_MTI_url);\n curl_setopt($curl_ressource,CURLOPT_POST, count($fields));\n curl_setopt($curl_ressource,CURLOPT_POSTFIELDS, $fields);\n curl_setopt($curl_ressource, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($curl_ressource, CURLOPT_TIMEOUT, 40);\n \n // Parses result html to extract MTI semantical parser results\n $dom->loadHTML(curl_exec($curl_ressource));\n $pres = $dom->getElementsByTagName('pre');\n \n foreach($pres as $pre)\n if(strstr($pre->nodeValue,\"Command: MTI\"))\n {\n $array = explode(\"\\n\", $pre->nodeValue);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n array_shift($array);\n $result = implode(\"\\n\", $array); \n $this->_parsed_payload = $result; \n }\n \n curl_close($curl_ressource);\n \n return $result;\n }", "private function parseData($data) : void\n {\n $this->id = $data['id'];\n $this->addressLine1 = $data['line1'];\n $this->addressLine2 = $data['line2'];\n $this->addressLine3 = $data['line3'];\n $this->addressLine4 = $data['line4'];\n $this->locality = $data['locality'];\n $this->townOrCity = $data['townOrcity']; // I wish they would correct this parameter...\n $this->county = $data['county'];\n }", "function getPayload();", "abstract public function parse($data, $type);", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "protected function parseData($data){\r\n $d = array();\r\n if(is_string($data)){\r\n try{\r\n parse_str($data,$arr);\r\n $d = $arr;\r\n }catch(Exception $e){\r\n //del lam gi ca\r\n }\r\n }elseif(is_array($data)){\r\n $d = $data;\r\n }\r\n if(!$d) return null;\r\n unset($d[$this->idField]);\r\n $r = array();\r\n foreach($d as $f => $v){\r\n if(in_array($f, $this->fields)) $r[$f] = $v;\r\n }\r\n return $r;\r\n }", "function parseData(){\r\n\t\t$content = array();\r\n\t\t$this->page_id = $this->CFG->PostVars['pageid'];\r\n\t\tforeach($this->CFG->PostVars as $key=>$value){\r\n\t\t\tif(preg_match(\"/content_(.*)_(.*)/\", $key, $arr)){\r\n\t\t\t\t$field\t= $arr[1];\r\n\t\t\t\t$lang \t= $arr[2];\r\n\t\t\t\tif(is_array($content[$lang])){\r\n\t\t\t\t\t$content[$lang][$field] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse $content[$lang] = array($field => $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->content = $content;\r\n\t}", "private function __parseRequestData() {\n\t\t$data = $this->data;\n\t\tif ($data['Block']['public_type'] === Block::TYPE_LIMITED) {\n\t\t\t//$data['Block']['from'] = implode('-', $data['Block']['from']);\n\t\t\t//$data['Block']['to'] = implode('-', $data['Block']['to']);\n\t\t} else {\n\t\t\tunset($data['Block']['from'], $data['Block']['to']);\n\t\t}\n\n\t\treturn $data;\n\t}", "abstract public function parsePostData() : array;", "protected function preprocessData() {}", "public function parseData(array $data) {\n if (!$this->exists('id', $data)) {\n $this->createdBy = $this->exists('user', $data) ? filter_var($data['user'], FILTER_SANITIZE_NUMBER_INT) : null;\n }\n // is later overwritten with db value (if exists)\n $this->changedBy = $this->exists('user', $data) ? filter_var($data['user'], FILTER_SANITIZE_NUMBER_INT) : null;\n\n $this->project = $this->exists('project', $data) ? filter_var($data['project'], FILTER_SANITIZE_NUMBER_INT) : null;\n\n $this->start = $this->exists('start', $data) ? filter_var($data['start'], FILTER_SANITIZE_STRING) : null;\n $this->end = $this->exists('end', $data) ? filter_var($data['end'], FILTER_SANITIZE_STRING) : null;\n $this->duration = $this->exists('duration', $data) ? filter_var($data['duration'], FILTER_SANITIZE_NUMBER_INT) : null;\n $this->duration_modified = $this->exists('duration_modified', $data) ? filter_var($data['duration_modified'], FILTER_SANITIZE_NUMBER_INT) : null;\n\n $set_duration_modified = $this->exists('set_duration_modified', $data) ? filter_var($data['set_duration_modified'], FILTER_SANITIZE_STRING) : null;\n if (!is_null($set_duration_modified)) {\n $this->duration_modified = DateUtility::getSecondsFromDuration($set_duration_modified);\n }\n\n $this->start_lat = $this->exists('start_lat', $data) ? filter_var($data['start_lat'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : null;\n $this->start_lng = $this->exists('start_lng', $data) ? filter_var($data['start_lng'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : null;\n $this->start_acc = $this->exists('start_acc', $data) ? filter_var($data['start_acc'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : null;\n\n $this->end_lat = $this->exists('end_lat', $data) ? filter_var($data['end_lat'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : null;\n $this->end_lng = $this->exists('end_lng', $data) ? filter_var($data['end_lng'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : null;\n $this->end_acc = $this->exists('end_acc', $data) ? filter_var($data['end_acc'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION) : null;\n\n\n $this->categories = $this->exists('categories', $data) ? filter_var($data['categories'], FILTER_SANITIZE_STRING) : null;\n\n $this->is_billed = $this->exists('is_billed', $data) ? filter_var($data['is_billed'], FILTER_SANITIZE_NUMBER_INT) : 0;\n $this->is_payed = $this->exists('is_payed', $data) ? filter_var($data['is_payed'], FILTER_SANITIZE_NUMBER_INT) : 0;\n\n $this->customer = $this->exists('customer', $data) ? filter_var($data['customer'], FILTER_SANITIZE_NUMBER_INT) : null;\n $this->customerName = $this->exists('customerName', $data) ? filter_var($data['customerName'], FILTER_SANITIZE_STRING) : null;\n\n /* if (empty($this->name) && $this->settleup == 0) {\n $this->parsing_errors[] = \"NAME_CANNOT_BE_EMPTY\";\n } */\n }", "function parseIncomingData($origArr = array()) {\n\t\tglobal $TYPO3_DB;\n\n\t\tstatic $adodbTime = null;\n\n\t\t$parsedArr = array();\n\t\t$parsedArr = $origArr;\n\t\tif (is_array($this->conf['parseFromDBValues.'])) {\n\t\t\treset($this->conf['parseFromDBValues.']);\n\t\t\twhile (list($theField, $theValue) = each($this->conf['parseFromDBValues.'])) {\n\t\t\t\t$listOfCommands = t3lib_div::trimExplode(',', $theValue, 1);\n\t\t\t\tforeach($listOfCommands as $k2 => $cmd) {\n\t\t\t\t\t$cmdParts = split(\"\\[|\\]\", $cmd); // Point is to enable parameters after each command enclosed in brackets [..]. These will be in position 1 in the array.\n\t\t\t\t\t$theCmd = trim($cmdParts[0]);\n\t\t\t\t\tswitch($theCmd) {\n\t\t\t\t\t\tcase 'date':\n\t\t\t\t\t\tif($origArr[$theField]) {\n\t\t\t\t\t\t\t$parsedArr[$theField] = date( 'd.m.Y', $origArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$parsedArr[$theField]) {\n\t\t\t\t\t\t\tunset($parsedArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'adodb_date':\n\t\t\t\t\t\tif (!is_object($adodbTime))\t{\n\t\t\t\t\t\t\tinclude_once(PATH_BE_srfeuserregister.'pi1/class.tx_srfeuserregister_pi1_adodb_time.php');\n\n\t\t\t\t\t\t\t// prepare for handling dates before 1970\n\t\t\t\t\t\t\t$adodbTime = t3lib_div::makeInstance('tx_srfeuserregister_pi1_adodb_time');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($origArr[$theField]) {\n\t\t\t\t\t\t\t$parsedArr[$theField] = $adodbTime->adodb_date( 'd.m.Y', $origArr[$theField]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$parsedArr[$theField]) {\n\t\t\t\t\t\t\tunset($parsedArr[$theField]);\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}\n\t\t}\n\n\t\t$fieldsList = array_keys($parsedArr);\n\t\tforeach ($this->tca->TCA['columns'] as $colName => $colSettings) {\n\t\t\tif (in_array($colName, $fieldsList) && $colSettings['config']['type'] == 'select' && $colSettings['config']['MM']) {\n\t\t\t\tif (!$parsedArr[$colName]) {\n\t\t\t\t\t$parsedArr[$colName] = '';\n\t\t\t\t} else {\n\t\t\t\t\t$valuesArray = array();\n\t\t\t\t\t$res = $TYPO3_DB->exec_SELECTquery(\n\t\t\t\t\t\t'uid_local,uid_foreign,sorting',\n\t\t\t\t\t\t$colSettings['config']['MM'],\n\t\t\t\t\t\t'uid_local='.intval($parsedArr['uid']),\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t'sorting');\n\t\t\t\t\twhile ($row = $TYPO3_DB->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$valuesArray[] = $row['uid_foreign'];\n\t\t\t\t\t}\n\t\t\t\t\t$parsedArr[$colName] = implode(',', $valuesArray);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $parsedArr;\n\t}", "public function parse();", "public function parse();", "public function parse();", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function getPayload();", "public function getPayload();", "public function getPayload();", "public function processData() {}", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "private function process($data) {\n\t\treturn json_decode($data, true);\n\t}", "public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}", "public function parse (){\n $this->json = json_decode($this->content, true);\n $this->numItems = count ($this->json);\n }", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->e_data = $this->decode_param($this->data['value']);\r\r\n $this->data = $this->encode_param($this->data['value']);\r\r\n } else {\r\r\n // POST method or something else\r\r\n $this->e_data = $this->decode_param($this->data);\r\r\n $this->data = $this->encode_param($this->data);\r\r\n }\r\r\n // All keys are srings in array, merge it with defaults to override\r\r\n $this->e_data = array_merge($this->default_options, $this->e_data);\r\r\n /**\r\r\n * At this point the this->data variable surely contains the encoded data, no matter what.\r\r\n */\r\r\n }", "private function extractData($decoded)\n {\n $amount = $decoded->{'Amount'};\n $receiverNumber = $decoded->{'ReceiverNumber'};\n $statusCode = $decoded->{'StatusCode'};\n $transactionID = $decoded->{'TransactionID'};\n $processingNumber = $decoded->{'ProcessingNumber'};\n\n //now put them in the variable\n $this->amount = $amount;\n $this->receiverNumber = $receiverNumber;\n $this->statusCode = $statusCode;\n $this->transactionID = $transactionID;\n $this->processingNumber = $processingNumber;\n }", "public function specificParse($stream)\n {\n //Get the JSON string and decode\n $exploded_stream = explode('window.__INITIAL_PROPS__ = JSON.parse(\"', $stream);\n if (count($exploded_stream) !== 2) {\n Log::add(\"The stream doesn't contain the expected data. source_id: \" . $this->source_id);\n return false;\n }\n $exploded_stream = explode('\");</script><script>window.__INITIAL_CONTEXT_VALUE__', $exploded_stream[1]);\n if (count($exploded_stream) !== 2) {\n Log::add(\"The stream doesn't contain the expected data. source_id: \" . $this->source_id);\n return false;\n }\n\n $array_response = json_decode(stripslashes($exploded_stream[0]), true);\n\n //Create the response (array with Advertisement objects)\n $ads_array = array();\n foreach ($array_response[\"initialResults\"][\"items\"] as $key => $ad) {\n $ads_array[$key] = new Advertisement();\n $ads_array[$key]->source_id = $this->source_id;\n $ads_array[$key]->reference = $ad[\"id\"];\n $ads_array[$key]->title = $ad[\"title\"];\n $ads_array[$key]->price = $ad[\"price\"];\n $ads_array[$key]->url = $ad[\"url\"];\n\n $ads_array[$key]->pic_url = (isset($ad[\"img\"])) ? $ad[\"img\"] : null;\n $ads_array[$key]->phone_number = (isset($ad[\"phone\"])) ? $ad[\"phone\"] : null;\n $ads_array[$key]->kms = (isset($ad[\"km\"])) ? $ad[\"km\"] : null;;\n $ads_array[$key]->gear =(strpos($ad[\"title\"], \"AT\")) ? \"A\" : \"M\";\n if (strpos($ad[\"title\"], \"CV \")) {\n $title_exploded = explode(\"CV \", $ad[\"title\"]);\n $title_exploded = explode(\" \", $title_exploded[0]);\n $ads_array[$key]->power = $title_exploded[count($title_exploded) - 1];\n }\n $ads_array[$key]->year = $ad[\"year\"];\n }\n\n return $ads_array;\n }", "private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}", "function parse($data) {\n global $USER;\n if (!is_object($data)) {\n return false;\n }\n // An id may not always exists, like if this is a new ticket.\n if (isset($data->id)) {\n $this->id = $data->id;\n }\n $this->detail = $data->detail;\n $this->summary = $data->summary;\n if (empty($data->userid)) {\n $this->userid = $USER->id;\n } else {\n $this->userid = $data->userid;\n }\n if (isset($data->timecreated)) {\n $this->timecreated = $data->timecreated;\n } else {\n $this->timecreated = time();\n }\n if (isset($data->timemodified)) {\n $this->timemodified = $data->timemodified;\n } else {\n $this->timemodified = time(); \n }\n return true;\n\n }", "public static function parseSQLPayload($payload) {\n\t\t$payload = trim($payload);\n\t\t$payload = preg_replace(\"/(Row[0-9]*): (.*)/i\", \"$2\", $payload);\n\t\t$lines = explode(\"\\n\", $payload);\n\t\t$lines = array_slice($lines, 2);\n\n\t\t// cutting first and last ' from each row in the list\n\t\t$lines = array_map(function($value) {\n\t\t\treturn substr($value, 1, -1);\n\t\t}, $lines);\n\t\t// split after ','\n\t\t$lines = array_map(function($value) {\n\t\t\treturn preg_split('/\\',\\'/', $value);\n\t\t}, $lines);\n\n\t\t// first entry are headers\n\t\t$header = array_shift($lines);\n\n\t\t// put headers as index for array\n\t\tarray_walk($lines,'self::combine_array', $header);\n\n\t\t// return array\n\t\t$result = $lines;\n\t\treturn $result;\n\t}", "public function get_payload() {\n\t\tif ( ! empty( $this->data->payload ) )\n\t\t\treturn json_decode( $this->data->payload );\n\t\telse\n\t\t\treturn false;\n\t}", "protected function parseResponse()\n {\n $data = simplexml_load_string($this->body);\n \n $this->data = $data;\n }", "public function get_payload_request();", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "private function parse($data): void\n {\n if (!isset($data['data'])) {\n App::cliLog('No records found');\n }\n\n $this->items = $data['data'];\n\n $parsedData = [];\n foreach ($this->items as $key => $item) {\n if ($key > $this->limit) break; //limit reached - exit; Api doesn't support limit\n\n $parsedData[] = [\n 'name' => $item['name'],\n 'description' => isset($item['description']) ? $item['description'] : 'No Description',\n 'image' => isset($item['labels']) ? $item['labels']['large'] : \"No Image\"\n ];\n }\n\n $this->items = $parsedData;\n }", "private function parseInputValues()\r\n {\r\n parse_str(file_get_contents(\"php://input\"),$data);\r\n\r\n $data = reset($data);\r\n \r\n $data = preg_split('/------.*\\nContent-Disposition: form-data; name=/', $data);\r\n \r\n $this->inputValues = array();\r\n \r\n foreach($data as $input)\r\n {\r\n // get key\r\n preg_match('/\"([^\"]+)\"/', $input, $key);\r\n \r\n // get data\r\n $input = preg_replace('/------.*--/', '', $input);\r\n \r\n // Store to an array\r\n $this->inputValues[$key[1]] = trim(str_replace($key[0], '', $input));\r\n }\r\n }", "protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}", "private function __parseIncomingData($app) {\n\t\t$parameters = array();\n\t\t$format = '';\n\n\t\t//Check GET \n\t\t$parameters = array_merge($parameters, $_GET, $_POST);\n\n\t\t//Get POST/PUT from PHP input\n\t\t$body = file_get_contents('php://input');\n\n\t\t//Check for content type\n\t\t$content_type = false;\n\t\tif (isset($_SERVER['CONTENT_TYPE'])) {\n\t\t\t$content_type = array_shift(explode(';', $_SERVER['CONTENT_TYPE']));\n\t\t}\n\n\t\tswitch ($content_type) {\n\t\t\tcase 'application/json':\n\t\t\t\t//Decode data\n\t\t\t\t$body_params = json_decode($body, true);\n\n\t\t\t\t//Add to parameters\n\t\t\t\tif ($body_params) {\n\t\t\t\t\tforeach($body_params as $param_name => $param_value) {\n\t\t\t\t\t\t$parameters[$param_name] = $param_value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$format = 'json';\n\t\t\t\tbreak;\n\t\t\tcase 'application/x-www-form-urlencoded':\n\t\t\t\t//Parse variables as query string\n\t\t\t\tparse_str($body, $postvars);\n\n\t\t\t\t//Add to parameters\n\t\t\t\tforeach ($postvars as $f => $v) {\n\t\t\t\t\t$parameters[$f] = $v;\n\t\t\t\t}\n\t\t\t\t$format = 'html';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//Save parameters and format\n\t\t$this->parameters = array_merge($app->RouteParams, $parameters);\n\t\t$this->format = $format;\n\t}", "public function data() {\n $request = $this->requestReader->getContents();\n\t\tif ($request) {\n if ($json_post = CJSON::decode($request)){\n\t\t\t\treturn $json_post;\n\t\t\t}else{\n\t\t\t\tparse_str($request,$variables);\n\t\t\t\treturn $variables;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function compileData(): void\n {\n $data = [];\n\n if ($this->expectsPayload) {\n $data = $this->payload->getData();\n\n if ($this->payload->expectsMessage()) {\n $this->level = $this->payload->getLevel();\n $this->message = $this->payload->getMessage();\n\n $data['flash'] = [\n $this->level => $this->message,\n ];\n }\n }\n\n $data['breadcrumbs'] = app('breadcrumbs')->render();\n\n $this->data = $data;\n\n $this->route = Route::has($this->payload->getRoute())\n ? route($this->payload->getRoute())\n : $this->payload->getRoute();\n }", "abstract public function getRawPostPayload() : array;", "public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['value']) ) {\r\r\n // If called from back-end non-post context\r\r\n $this->data = $this->data['value'];\r\r\n }\r\r\n }", "function payload($data)\n{\n return $data->getPayload()->getHeaders();\n}", "private function validPayload()\n {\n return [\n 'name' => 'Chefaa pharmacy',\n 'address' => 'Maadi',\n ];\n }", "protected function parse()\n {\n\t$event_lines = explode(HCAL_LINE_SPLITER, $this->_Content);\n\n\tforeach ($event_lines as $line)\n\t{\n\t $result = $this->parseProperty($line);\n\t $this->_Properties[$result['name']] = $result['value'];\n\t}\n }", "public function getPayload(): array;", "public function getPayload(): array;", "function parseData()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function getDataWithTypeDebugData() {}", "public function parse()\n {\n }", "public function deserialize($data)\n {\n }", "public function doProcessData() {}", "abstract public function parse ();", "private function parse()\n {\n $lines = file($this->filename);\n\n // skip get worker info\n $offset = 0;\n while (isset($lines[$offset])) {\n $line = $lines[$offset];\n\n if (preg_match('/(?:\\[0m\\t)(\\[.*\\])\\s*({.*})(?:[\\r\\n]*)$/', $line, $matches)) {\n $ctx = json_decode($matches[2], true);\n if (isset($ctx['receive'])) {\n $this->in[] = [$matches[1], $matches[2]];\n $offset++;\n continue;\n }\n\n $this->out[] = [$matches[1], $matches[2]];\n }\n\n $offset++;\n }\n }", "function extractActionData($data) {\n $fields = array(\n 'surfer_handle',\n 'surfer_givenname',\n 'surfer_surname',\n 'surfer_email',\n 'surfer_valid',\n 'surfergroup_id',\n 'surfer_gender',\n 'surfer_avatar'\n );\n $result = array();\n foreach ($fields as $field) {\n if (isset($data[$field])) {\n $result[$field] = $data[$field];\n }\n }\n return $result;\n }", "function parse_data(){\n\n\t $key_file = file_get_contents(\"resp_key.json\");\n\t $built_in_file = file_get_contents(\"built_in_resp.json\");\n\t $this->key_dictonary = json_decode($key_file);\n\t $this->built_in_dictionary = json_decode($built_in_file);\n\n\t if($this->built_in_dictionary == null)\n\t\tvar_dump(\"Built in didn't work\");\n\t if($this->key_dictonary == null)\n\t\tvar_dump(\"key dictionary didn't work\");\n\n }", "public function parse(string $payload): array\n {\n if ($payload === '') {\n return [];\n }\n\n $format = $this->getFormat($payload);\n\n if ($format !== 'php' && \\is_file($payload)) {\n $payload = \\file_get_contents($payload);\n\n if ($payload === false) {\n throw new RuntimeException(\\sprintf('A error occurred during reading [%s].', $payload));\n }\n }\n\n return $this->getParser($format)->parse($payload);\n }", "private function _JsonData() \n {\n $raw = file_get_contents('php://input', true);\n $body = json_decode($raw);\n \n $this->__new((array) $body);\n }", "protected function load()\n\t{\n\n $data = simplexml_load_string(file_get_contents($this->_origin));\n\n\n\n $data = json_decode(json_encode((array)$data), TRUE);\n\n //$this\n\n $this->_data = [];\n\n\n $firstKey = array_keys($data)[0];\n\n //print_r($data[$firstKey]);\n //echo \"<br><br>\";\n\n foreach($data[$firstKey] AS $element) {\n\n\n //var_dump(self::arrayToObject($element));\n\n $this->_fields = array_keys($element);\n\n\n $this->_data[@$element['id']] = self::arrayToObject($element);\n\n }\n\n\t\t$this->reindex();\n\t}", "protected function parseRequest()\n {\n $this->input = $this->request->getPostList()->toArray();\n }", "public function parse()\n {\n // TODO: Implement parse() method.\n }", "private static function parseUrl(stdClass $data){\n\t\tif(!isset($_GET[self::URL_KEY])){\n\t\t\treturn null;\n\t\t}\n\n\t\t$urlData = (string)$_GET[self::URL_KEY];\n\n\t\t//check url\n\t\tif(!preg_match('/^((\\d+)'.self::URL_SEPARATOR.'){5}(\\d+)$/', $urlData)){\n\t\t\treturn null;\n\t\t}\n\n\t\t$split = explode(self::URL_SEPARATOR, $urlData);\n\t\t$loadData = array();\n\n\t\tif(count($split)!=6){\n\t\t\treturn null;\n\t\t}\n\n\t\t//part 1: weaponBase\n\t\t$loadData['weaponBase'] = $split[0];\n\n\t\t//part 2: skillBase\n\t\t$loadData['skillBase'] = $split[1];\n\n\t\t//part 3: types\n\t\tforeach($data->fields->type as $i=>$field){\n\t\t\tif(isset($split[2][$i])){\n\t\t\t\t$loadData[$field] = $split[2][$i];\n\t\t\t}\n\t\t}\n\n\t\t//part 4: enchants\n\t\tforeach($data->fields->enchant as $i=>$field){\n\t\t\tif(isset($split[3][$i])){\n\t\t\t\t$loadData[$field] = $split[3][$i];\n\t\t\t}\n\t\t}\n\n\t\t//part 5: number keys (remove the first 2 parts since those are the two base values we got above)\n\t\t$numberFieldKeys = array_keys($data->fields->number);\n\t\tarray_shift($numberFieldKeys);\n\t\tarray_shift($numberFieldKeys);\n\t\tforeach($numberFieldKeys as $i=>$field){\n\t\t\tif(isset($split[4][$i])){\n\t\t\t\t$loadData[$field] = $split[4][$i];\n\t\t\t}\n\t\t}\n\n\t\t//part 6: bool keys\n\t\t$boolFieldKeys = array_keys($data->fields->bool);\n\t\t$split[5] = strrev(decbin($split[5]));\n\t\tforeach($boolFieldKeys as $i=>$field){\n\t\t\tif(isset($split[5][$i])){\n\t\t\t\t$loadData[$field] = $split[5][$i];\n\t\t\t}\n\t\t}\n\n\t\tif(count($loadData)<1){\n\t\t\treturn null;\n\t\t}\n\n\t\t//force submit mode to show results when loading\n\t\t$loadData['doCalculation'] = true;\n\n\t\treturn $loadData;\n\t}", "protected abstract function handleData();", "public function parse() {\n\t\t$pointer = 0;\n\t\t$ar_line = array();\n\n\t\tforeach ($this->structure as $key => $length) {\n\t\t\t$ar_line[$key] = trim(substr($this->line, $pointer, $length), \"\\n\\r \");\n\t\t\t$pointer += $length;\n\t\t}\n\t\t$ar_line['stamp'] = md5(serialize($ar_line));\n\n\t\tif ($this->return == 'array') {\n\t\t\treturn $ar_line;\n\t\t}\n\t\treturn (object) $ar_line;\n\t}", "function dataHandler($parser, $data){\n \tif ($this->readingdata) {\n \t\t$this->currentdata.=$data; \t\t\n \t}\n }" ]
[ "0.6554432", "0.6545161", "0.6375014", "0.6371666", "0.63637626", "0.6303472", "0.6303472", "0.6303472", "0.6300617", "0.6299072", "0.6167772", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.6128743", "0.61123574", "0.6097233", "0.60209256", "0.6013007", "0.6013007", "0.59479594", "0.59292334", "0.5869812", "0.5859743", "0.5812031", "0.5789564", "0.57845587", "0.5756948", "0.5742682", "0.5738665", "0.573689", "0.5724868", "0.5720563", "0.5720563", "0.5720563", "0.56626654", "0.5660235", "0.5660235", "0.56576943", "0.56574637", "0.5625371", "0.5625371", "0.5625371", "0.5588868", "0.5587775", "0.5587775", "0.5587775", "0.5587775", "0.5568322", "0.5528184", "0.55096924", "0.5506931", "0.55002165", "0.5480602", "0.5479367", "0.546674", "0.5462589", "0.54541487", "0.5452951", "0.5448243", "0.54366165", "0.5427279", "0.5411304", "0.5408479", "0.54083663", "0.5407951", "0.5401889", "0.5399344", "0.5395456", "0.5394911", "0.53720075", "0.5370113", "0.53690237", "0.53690237", "0.53602684", "0.53319466", "0.5327205", "0.530804", "0.5305282", "0.53009266", "0.5298138", "0.5290742", "0.5290491", "0.52886367", "0.5280887", "0.52787966", "0.5276891", "0.52744925", "0.526429", "0.5258554", "0.5249835", "0.5238834" ]
0.0
-1
Retrieves session of this device if one exists Remember that device_uid is mandatory field of request payload. Of it is absent, error is always shown!
protected function getDeviceSession($sessionRequired = true) { if ($this->session) { return $this->session; } $data = $this->getRequestData(); if (!isset($data['session_uid']) && $sessionRequired) { $this->setErrorResponse('session_uid is mandatory for this request!'); } $session = Workapp_Session::getBySessionUid($data['session_uid']); if ($session) { $session->registerAction($_SERVER['REMOTE_ADDR']); } else if ($sessionRequired) { $this->setErrorResponse('This device has no running session which is required by service'); } $this->session = $session; return $this->session; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_session()\n\t\t{\n\t\t\t\tif( file_exists( $this->session_file ) )\n\t\t\t\t{\n\t\t\t\t\t\t$session = file_get_contents( $this->session_file );\n\t\t\t\t\t\tif( !empty( $session ) )\n\t\t\t\t\t\t\treturn $session;\n\t\t\t\t}\n\t\t\t\t$post_data = [ 'params' => json_encode( [ 'user' => $this->api_user, 'password' => $this->api_pass ] ) ];\n\t\t\t\t$response \t= $this->curl( 'Session/login', $post_data );\n\t\t\t\t$json \t\t\t= json_decode( $response );\n\t\t\t\t$session \t = $json->session_id;\n\t\t\t\t$this->save_session( $session );\n\t\t\treturn $session;\n\t\t}", "protected function doGetSession() {\r\n\t\t$code = $this->getCode ();\r\n\t\t// check whether it is a CSRF attack request\r\n\t\tif ($code && $code != $this->store->get ( 'code' )) {\r\n\t\t\t$session = $this->getAccessTokenByAuthorizationCode ( $code );\r\n\t\t\tif ($session) {\r\n\t\t\t\t\r\n\t\t\t\t$this->store->set ( 'code', $code );\r\n\t\t\t\t$this->setSession ( $session );\r\n\t\t\t\t$user = $this->api ( 'passport/users/getLoggedInUser' );\r\n\t\t\t\tif ($user) {\r\n\t\t\t\t\t$session = array_merge ( $session, $user );\r\n\t\t\t\t\t$this->setSession ( $session );\r\n\t\t\t\t}\r\n\t\t\t\treturn $session;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// code was bogus, so everything based on it should be invalidated.\r\n\t\t\t$this->store->removeAll ();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// as a fallback, just return whatever is in the persistent store\r\n\t\t$session = $this->store->get ( 'session' );\r\n\t\t$this->setSession ( $session );\r\n\t\tif ($session && ! isset ( $session ['uid'] )) {\r\n\t\t\t$user = $this->api ( 'passport/users/getLoggedInUser' );\r\n\t\t\tif ($user) {\r\n\t\t\t\t$session = array_merge ( $session, $user );\r\n\t\t\t\t$this->setSession ( $session );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $session;\r\n\t}", "function checkSession()\n {\n if(isset($_COOKIE['sessionId']))\n {\n $response = callApi('GET', 'session', ['sessionid' => $_COOKIE['sessionId']]);\n if($response['code'] == '200')\n return true;\n else\n return false;\n }\n }", "public function getSession() \r\n\t{\t\t\t\r\n\t\t$this->url = $this->server . \"/X?op=login_request\" .\r\n\t\t\t\"&user_name=\" . $this->username .\r\n\t\t\t\"&user_password=\" . $this->password;\r\n\r\n\t\t// get login_response from Metalib\r\n\r\n\t\t$this->xml = $this->getResponse($this->url, $this->timeout);\r\n\t\t\r\n\t\t// extract session ID\r\n\t\t\r\n\t\t$objSession = $this->xml->getElementsByTagName(\"session_id\")->item(0);\r\n\t\treturn $objSession->nodeValue;\r\n\t}", "private function get_session()\n\t\t{\n\t\t\t$auto = $this->use_token();\n\n\t\t\tglobal $user;\n\t\t\tif ($user)\n\t\t\t\treturn (object)['id' => $user->id, 'name' => $user->name, 'state' => $_SESSION['state']];\n\t\t\telse if ($auto)\n\t\t\t\treturn (object)['id' => $auto->id, 'name' => $auto->name, 'state' => $_SESSION['state']];\n\t\t\telse\n\t\t\t\treturn (object)['id' => null, 'name' => null, 'state' => 0];\n\t\t}", "function retrieveSession() {\n session_start();\n\n if (isset($_SESSION['firstName']) &&\n isset($_SESSION['lastName']) &&\n isset($_SESSION['username']) &&\n isset($_SESSION['profilePicture'])) {\n $response = array('firstName' => $_SESSION['firstName'],\n 'lastName' => $_SESSION['lastName'],\n 'username' => $_SESSION['username'],\n 'profilePicture' => $_SESSION['profilePicture']);\n echo json_encode($response);\n } else {\n session_destroy();\n errorHandler('NOT_LOGGED_IN', 406, \"The session has expired\");\n }\n }", "public function getSession()\r\r\n {\r\r\n if ($this->signedRequest && $this->signedRequest->hasOAuthData()) {\r\r\n return FacebookSession::newSessionFromSignedRequest($this->signedRequest);\r\r\n }\r\r\n return null;\r\r\n }", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "function device_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n // die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->input->get('device');\n \n // Get the full device/system information\n $device = $this->device_model->getDeviceInfo( $this->get('id') );\n \n if($device){\n $this->response($device, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }", "public function getSession()\r\n {\r\n return $this->sessionID;\r\n }", "public static function fetch($id)\n {\n // Check $id\n if (empty($id)) {\n return false;\n }\n\n // Load device info\n try {\n\t\t\t$device = PersistentSession::getInstance()->load( 'Wurrd\\\\ClientInterface\\\\Model\\\\Device', (int)$id );\n\t\t} catch (\\Exception $ex) {\n\t\t\t// error_log(\"No device with id $id\");\n\t\t\treturn false;\n\t\t}\n\t\t\n // There is no device with such id in database\n if (!$device) {\n return false;\n }\n\n return $device;\n }", "public function GetRequestSession(){\n\n\t\t\t\tif(isset($this->parent) && is_object($this->parent)){\n\n\t\t\t\t\tif(is_string($this->parent->path)){\n\n\t\t\t\t\t\t$parent = $this->parent;\n\n\t\t\t\t\t\t$this->requestSession = new \\GGNSession($parent::sess_rup, \\GGNSession::ONLINE, $this->parent->path);\n\n\t\t\t\t\t\treturn $this->requestSession;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\t}", "public function getUserSession(){\n return $this->getParam('user-data', 'auth');\n }", "public function hasSession() {}", "public function get($id = '') {\n\t\tif($id == '') {\n\t\t\t$id = $this->id;\n\t\t}\n\t\t$sess = ORM::for_table($this->session_type)->find_one($id);\n\t\treturn $sess;\n\t}", "function getSession() {\n\t\treturn $this->getParam(self::PARAM_REQUEST_SESSION);\n\t}", "public function get()\n {\n return $this->transmission->request(\"session-get\", array());\n }", "public static function check_session() {\n\t\t\t// get redirect_to_default\n\t\t\t$redirect_to_default = Cookie::get('redirect_to_default');\n\t\t\t\n\t\t\t// if empty redirect_to_default set from default settings\n\t\t\tif(empty($redirect_to_default)){$redirect_to_default = REDIRECT_TO_DEFAULT;}\n\t\t\t\t\t\t\n\t\t\t// check if auth token is submitted\n\t\t\tif(isset($_GET['authtoken']))\n\t\t\t{\n\t\t\t\t// check auth token\n\t\t\t\t$authtoken = Functions::encrypt_decrypt('decrypt', $_GET['authtoken'], \"\\x73\\x6f\\x6d\\x31\\x34\\x31\\x30\\x40\\x73\\x6f\\x6d\\x6e\\x65\\x74\\x69\\x63\\x73\");\n\t\t\t\t\t\n\t\t\t\t// get auth token\n\t\t\t\t$authtoken = json_decode($authtoken);\n\t\t\t\t\n\t\t\t\t// set active session\n\t\t\t\tif(!isset($authtoken->keep_session)){$authtoken->keep_session = true;}\n\t\t\t\t\n\t\t\t\t// unset login state\n\t\t\t\tif(!$authtoken->keep_session){self::set_state(false);}\n\t\t\t}\n\t\t\t\n\t\t\t// if session exists\n\t\t\tif(!self::get_state())\n\t\t\t{\t\n\t\t\t\t// check requested url\n\t\t\t\tif(trim(REQUEST_URI) != trim(APP_PATH.'/'.$redirect_to_default))\n\t\t\t\t{\t\n\t\t\t\t\t// get return url\t\t\t\t\t\n\t\t\t\t\t$returnUrl = urlencode(ltrim(str_replace(APP_PATH, '', REQUEST_URI), '/'));\n\t\t\t\t\t\n\t\t\t\t\t// check if auth token is submitted\n\t\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t\t{\n\t\t\t\t\t\t/*\n // get guest user info\n\t\t\t\t\t\t$guest_user = ORM::for_table('sys_user_login');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user pass is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_pass))\n\t\t\t\t\t\t$guest_user = $guest_user->where('user_pass', $authtoken->auth_pass);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user company is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_comp))\n\t\t\t\t\t\t$guest_user = $guest_user->where('sys_company_id', $authtoken->auth_comp);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user name is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_name))\n\t\t\t\t\t\t\t$guest_user = $guest_user->where('user_name', $authtoken->auth_name)->find_one();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$guest_user = $guest_user->find_one($authtoken->auth_user);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// check if user exists\n\t\t\t\t\t\tif(is_object($guest_user))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t// start session and set session values\n\t\t\t\t\t\t\tself::set_state(true);\n\t\t\t\t\t\t\tself::set('user_id', $guest_user->id);\n\t\t\t\t\t\t\tself::set('user_name', $guest_user->user_name);\n\t\t\t\t\t\t\tself::set('first_name', $guest_user->first_name);\n\t\t\t\t\t\t\tself::set('last_name', $guest_user->last_name);\n\t\t\t\t\t\t\tself::set('full_name', trim($guest_user->first_name.' '.$guest_user->last_name));\n\t\t\t\t\t\t\tself::set('email', $guest_user->email);\n\t\t\t\t\t\t\tself::set('mobile', $guest_user->mobile);\n\t\t\t\t\t\t\tself::set('company_id', (empty($guest_user->sys_company_id) ? $authtoken->company_id : $guest_user->sys_company_id));\n\t\t\t\t\t\t\tself::set('is_super_admin', $guest_user->is_super_admin);\t\n\t\t\t\t\t\t\tself::set('is_guest', ($authtoken->auth_user==GUEST_ID ? 1 : 0));\t\n\t\t\t\t\t\t\tself::set('last_login', $guest_user->last_login);\t\n\t\t\t\t\t\t\tself::set('logged_with_master_password', false);\n\t\t\t\t\t\t\tself::set('authtoken', $authtoken);\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// redirect to given path\n\t\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t\t}\n */\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// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.(empty($returnUrl) ? '' : '?returnUrl='.$returnUrl));\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t// check if auth token is submitted\n\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t{\n\t\t\t\t\t// check for valid auth user\n\t\t\t\t\tif($authtoken->auth_user!=GUEST_ID)\n\t\t\t\t\t{\n\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}*/\n\t\t}", "public function get_session() {\n return $_SESSION['login'];\n }", "function getUserSession(){\n\t\t\tChromePhp::log(\"inside retrieveCurrentUserInSession\");\n\t\t\tretrieveCurrentUserInSession();\n\t\t}", "function getSessionExiste()\n{\n $sessionEstValide=false;\n \n setSessionOn();\n\n if (isset($_SESSION['AuthInformation']) && !empty($_SESSION['AuthInformation']))\n {\n $ValidSession = true;\n } \n return $ValidSession;\n}", "public function validateCurrentSession(){$this->lhDB->connect('ibdlhsession');self::getCurrentPhpSid();self::validatePhpSid();$this->lhDB->disconnect();if($this->valid){$uid=$this->uid;return $uid;}else{return false;}}", "private static function getFromSession()\n {\n if (empty($_SESSION['current_user'])) {\n // No user in session, create one.\n $entityClassName = static::ENTITIES_CLASS_NAME;\n $user = new $entityClassName(array(\n 'source' => 'cookie',\n ));\n self::setCurrent($user);\n } else {\n Logger::get()->debug('Found user in session.');\n // Regenerate session ID every SESSION_DURATION minutes.\n if (time() > ($_SESSION['timestamp'] + + self::SESSION_DURATION)) {\n Logger::get()->debug('Regenerated session ID.');\n session_regenerate_id();\n }\n }\n\n return $_SESSION['current_user'];\n }", "function GetSessionUser()\n\t{\n\t\tif(isset($_SESSION['User']))\n\t\t{\n\t\t\t//https://stackoverflow.com/questions/44887880/store-object-in-php-session/44888019 For unseralize user object\n\t\t\treturn unserialize($_SESSION['User']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getSession()\n {\n return isset($this->Session) ? $this->Session : null;\n }", "public function getSession()\n {\n return isset($this->Session) ? $this->Session : null;\n }", "public function loginAction()\n {\n $data = $this->getRequestData();\n if ($this->getDeviceSession(false)) {\n $this->setErrorResponse('Your device is already running a session. Please logout first.');\n }\n $session = Workapp_Session::login($data['username'], $data['password']);\n if (!$session) {\n $this->setErrorResponse('No user with such username and password');\n }\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n $this->_helper->json(array('session_uid' => $session->getSessionUid()));\n }", "protected function getSession () {\n\t\treturn $this->session;\n\t}", "protected function getSession() {\n if (!$this->session) {\n $args = $this->getSiteSection('authentication');\n $args['DEBUG_MODE'] = $this->getSiteVar('DATA_DEBUG');\n $this->session = new Session($args);\n }\n \n return $this->session;\n }", "protected function _session() {\n\t\treturn $this->_crud()->Session;\n\t}", "public static function checkSession() {\n\t\t// Set any API keys\n\t\t$api_keys = array();\n\t\t// Check API Key or Session Authentication\n\t\t$key = \"\";\n\t\tif (isset($_GET['key'])) {\n\t\t\t$key = $_GET['key'];\n\t\t}\n\t\tif (!isset($_SESSION['user']) && !in_array($key, $api_keys)) {\n\t\t\texit('{\"status\":\"error\",\"message\":\"Authentication Error\"}');\n\t\t}\n\t}", "public function getSession() {}", "protected function _getSession() {\n /**\n * Return session value\n */\n return Mage::getSingleton ( 'core/session' );\n }", "public function login()\n\t{\n\n\t\ttry {\n\t\t\t$error = $this->getRequest()->getSession()->get('api.error');\n\t\t\t$this->getRequest()->getSession()->remove('api.error');\n\t\t\treturn compact('error');\n\t\t} catch (ValueNotFoundException $e) {\n\n\t\t}\n\t}", "public function user_check_session_id() {\n if ( user()->check_session_id( in('session_id') ) ) wp_send_json_success();\n else wp_send_json_error();\n }", "public function getSessionId() {}", "abstract protected function retrieveSessionToken() ;", "public function _session_read_method($id) {\n \n # We use this to determine whether or not our session actually exists.\n $strUserAgent = $_SERVER[\"HTTP_USER_AGENT\"];\n $this->php_session_id = $id;\n\n # Set failed flag to 1 for now\n $failed = 1;\n\n # See if this exists in the database or not.\n $sel = 'SELECT id, logged_in, user_id FROM http_session WHERE ascii_session_id=\"' . $id . '\"';\n $result = mysql_query($sel);\n if (!$result) {\n die('Invalid query: ' . mysql_error());\n }\n if (mysql_num_rows($result)>0) {\n $row = mysql_fetch_array($result);\n $this->native_session_id = $row[\"id\"];\n if ($row[\"logged_in\"]==1) {\n $this->logged_in = true;\n $this->user_id = $row[\"user_id\"];\n } else {\n $this->logged_in = false;\n }\n } else {\n $this->logged_in = false;\n # We need to create an entry in the database\n $result = mysql_query(\"INSERT INTO http_session(ascii_session_id, logged_in,user_id, created, user_agent) VALUES ('$id','f',0,now(),'$strUserAgent')\");\n\n # Now get the true ID\n $result = mysql_query(\"SELECT id FROM http_session WHERE ascii_session_id='$id'\");\n $row = mysql_fetch_array($result);\n $this->native_session_id = $row[\"id\"];\n }\n\n # Just return empty string\n return(\"\");\n }", "function find_session($session) {\n global $db;\n\n if (isset($session)) {\n $sql = \"SELECT * FROM sessions WHERE session = :session;\";\n $params = array(\n ':session' => $session\n );\n $records = exec_sql_query($db, $sql, $params)->fetchAll();\n if ($records) {\n // Sessions is a unique field, so only 1 record should be selected.\n return $records[0];\n }\n }\n // if nothing is returned earlier, then return NULL\n return NULL;\n}", "function get_cover_session() {\n static $session = null;\n\n // Is there a cover website global session id available?\n if (!empty($_COOKIE[COVER_COOKIE_NAME]))\n $session_id = $_COOKIE[COVER_COOKIE_NAME];\n\n // If not, bail out. I have no place else to look :(\n else\n return null;\n\n if ($session !== null)\n return $session;\n\n $data = array(\n 'method' => 'session_get_member',\n 'session_id' => $session_id\n );\n\n $response = _http_get_json(COVER_API_URL, $data);\n\n return $session = !empty($response->result)\n ? $response->result\n : null;\n}", "public function setDeviceTokenAction(){\n $data = $this->getRequestData();\n $this->getDeviceSession()->getUserId();\n if($data['device_token']){\n $session = Workapp_Session::getBySessionUid($data['session_uid']);\n if ($session) {\n $session->addDeviceToken($data['device_token']);\n } else {\n $this->setErrorResponse('This device has no running session which is required by service');\n }\n } else {\n $this->setErrorResponse('device_token is mandatory field for this request!');\n }\n $this->_helper->json(array('added' => true));\n }", "public function session() {\n return $this->session;\n }", "public function getFromSession() {\n $data = $this->_getSession();\n \n return $data;\n }", "public function getSession($request_token) {\n $session = $this->get('authentication/session/new', array('request_token' => $request_token));\n\n if(!isset($session['success'])) throw new Exception\\NotFoundException();\n\n return new Data\\Session($session);\n }", "public static function session(\\Flexio\\Api\\Request $request) : void\n {\n\n $post_params = $request->getPostParams();\n\n // TODO: track?\n\n // this function can take either a username/password or a token;\n // put the validator here to validate they're strings, but don't\n // require them so we can perform logic to accomodate either input\n // combination\n $validator = \\Flexio\\Base\\Validator::create();\n if (($validator->check($post_params, array(\n 'username' => array('type' => 'string', 'required' => false, 'default' => ''),\n 'password' => array('type' => 'string', 'required' => false, 'default' => ''),\n 'token' => array('type' => 'string', 'required' => false, 'default' => '')\n ))->hasErrors()) === true)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::INVALID_SYNTAX);\n\n $validated_post_params = $validator->getParams();\n $username = $validated_post_params['username'];\n $password = $validated_post_params['password'];\n $token = $validated_post_params['token'];\n\n // try to get the current user eid from either a session token\n // or from a username/password combination\n $current_user_eid = false;\n\n if (strlen($token) > 0)\n {\n // POSSIBILITY 1: if we have a token, attempt to get the user eid\n // from the token\n $current_user_eid = \\Flexio\\Object\\User::getUserEidFromToken($token);\n if (!$current_user_eid)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::UNAUTHORIZED, _('Invalid token.'));\n }\n else\n {\n // POSSIBILITY 2: we don't have a token, so attempt to get the user eid\n // from the username and password\n $current_user_eid = \\Flexio\\Object\\User::getEidFromIdentifier($username);\n if (!$current_user_eid)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::UNAVAILABLE, _('Invalid username or password.'));\n\n // make sure user isn't deleted\n $current_user = \\Flexio\\Object\\User::load($current_user_eid);\n if ($current_user->getStatus() === \\Model::STATUS_DELETED)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::UNAVAILABLE, _('Invalid username or password.'));\n\n // make sure the user is available (e.g., not deleted and properly verified,\n // if verification is being used)\n if ($current_user->getStatus() !== \\Model::STATUS_AVAILABLE)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::UNAVAILABLE, _('Account not verified. Please verify your account.'));\n\n // verify the user with their credentials\n if ($current_user->checkPassword($password) === false)\n throw new \\Flexio\\Base\\Exception(\\Flexio\\Base\\Error::UNAUTHORIZED, _('Invalid username or password.'));\n }\n\n // generate a token from the user eid\n $token = \\Flexio\\Object\\User::generateTokenFromUserEid($current_user_eid);\n $result = array(\n 'token' => $token\n );\n\n // return the token\n $request->setRequestingUser($current_user_eid);\n $request->setResponseParams($result);\n $request->setResponseCreated(\\Flexio\\Base\\Util::getCurrentTimestamp());\n \\Flexio\\Api\\Response::sendContent($result);\n }", "function getSession() {\n\t\treturn $this->get('_session', $this->get('session'));\n\t}", "public static function getSession(){\n return \\Illuminate\\Auth\\Guard::getSession();\n }", "function find_session($db, $session)\n{\n if (isset($session)) {\n $records = exec_sql_query(\n $db,\n \"SELECT * FROM sessions WHERE session = :session;\",\n array(':session' => $session)\n )->fetchAll();\n if ($records) {\n // sessions are unique, so there should only be 1 record\n return $records[0];\n }\n }\n return NULL;\n}", "public function getSession($token)\n {\n $data = ['token' => $token];\n $result = $this->sendAuthenticatedRequest('auth.getSession', $data, 'get', false);\n if ($result !== null && (string)$result->attributes()->status === 'ok') {\n return $this->toArray($result->session);\n }\n return false;\n }", "function Session() {\n $sesskey = $_COOKIE['FortissimoSession'];\n if (! $sesskey) {\n # they don't have one, so let's ignore\n return;\n }\n\n # try to parse their cookie\n $ct = sscanf($sesskey, \"%d %s %d\", $sessid, $auth, $exptime);\n\n # return if bad cookie, or they say it's expired, or the auth length is wrong or bad sessid\n if ($ct != 3 || $exptime < time() || strlen($auth) != 64 || $sessid <= 0) {\n return;\n }\n\n # okay, so try loading it\n global $ft;\n $row = $ft->dbh->_select_row_as_object('SELECT * FROM tbl:sessions WHERE sessid = ? AND sesskey = ?',\n array($sessid, $auth));\n $userid = $row->userid;\n if (is_null($userid) || $userid <= 0 || $row->exptime < time()) {\n return;\n }\n\n # get the user this refers to\n $this->user = new User($userid);\n }", "public function sess_read()\r\r\n\t{\r\r\n\t\t$session = $_SESSION;\r\r\n\r\r\n\t\t// Is the session data we unserialized an array with the correct format?\r\r\n\t\tif ( ! is_array($session) OR ! isset($session['session_id']) OR ! isset($session['ip_address']) OR ! isset($session['user_agent']) OR ! isset($session['last_activity']))\r\r\n\t\t{\r\r\n\t\t\tlog_message('debug', 'A session was not found.');\r\r\n\t\t\t$this->sess_destroy(FALSE);\r\r\n\t\t\treturn FALSE;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Is the session current?\r\r\n\t\tif (($session['last_activity'] + $this->parent->sess_expiration) < $this->parent->now)\r\r\n\t\t{\r\r\n\t\t\t$this->sess_destroy(FALSE);\r\r\n\t\t\treturn FALSE;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Does the IP Match?\r\r\n\t\tif ($this->parent->sess_match_ip == TRUE AND $session['ip_address'] != $this->CI->input->ip_address())\r\r\n\t\t{\r\r\n\t\t\t$this->sess_destroy(FALSE);\r\r\n\t\t\treturn FALSE;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Does the User Agent Match?\r\r\n\t\tif ($this->parent->sess_match_useragent == TRUE AND trim($session['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 120)))\r\r\n\t\t{\r\r\n\t\t\t$this->sess_destroy(FALSE);\r\r\n\t\t\treturn FALSE;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Session is valid!\r\r\n\t\t$this->parent->userdata = $session;\r\r\n\t\tunset($session);\r\r\n\r\r\n\t\treturn TRUE;\r\r\n\t}", "private function checkSessionId(){\n\t\tif( !$this->isAuth() ){\n\t\t\treturn false;\n\t\t}\n\n\t\t$sql = 'SELECT 1 FROM `users`\n\t\t\t\tWHERE `id` = :user_id\n\t\t\t\tAND `session_id` = :session_id\n\t\t\t\tLIMIT 1';\n\n\t\t$userId = $this->getId();\n\t\t$sessionId = session_id();\n\n\t\t$stmt = $this->pdo->prepare( $sql );\n\t\t$stmt->bindParam(':user_id', $userId, PDO::PARAM_INT );\n\t\t$stmt->bindParam(':session_id', $sessionId, PDO::PARAM_STR);\n\n\t\treturn ($stmt->execute() && $stmt->rowCount() == 1 );\n\t}", "protected function getSession() {\n return $this->_session;\n }", "private function login()\n {\n if(isset($this->sid) && ($this->sid!==false) && isset($this->sidExpiresAt) && ($this->sidExpiresAt> new \\DateTime()))\n {\n return $this->sid;\n }\n $url = 'https://' . trim($this->ip) . ':8080/login?username=' . trim($this->userName) . '&password=' . trim($this->password);\n if(false ===($responseJson_str = @file_get_contents($url, NULL, $this->stream_context))){\n return false;\n }\n $server_auth = json_decode($responseJson_str, true); //переводим JSON в массив\n if ($server_auth['success'] == 1) {\n $this->sid = $server_auth['sid'];\n $this->sidExpiresAt = new \\DateTime();\n $this->sidExpiresAt->modify('+15 minutes');\n } else {\n $this->sid = false;\n }\n return $this->sid;\n }", "public function getSession()\n {\n return $this->hasOne(Session::className(), ['id' => 'SessionId']);\n }", "public function session()\n {\n return $this->sessions()->where('last_activity', '<=', now()->addMinutes(config('laragram.auth.session.lifetime')))->first();\n }", "public function getSession(){\r\n return $this->session;\r\n }", "public function checkSession($id) {\n\t\t$id = $this->DB->sanitize($id);\n\t\treturn $this->DB->query(\"SELECT * FROM `session` WHERE `session_id` = '$id' LIMIT 1;\");\n\t}", "public function getSession()\r\n {\r\n return Mage::getSingleton('firstdatae4/session');\r\n }", "public function LoadRequestSession(){\n\n\t\t\t\tif(isset($this->parent) && is_object($this->parent)){\n\n\t\t\t\t\tif(is_string($this->parent->path)){\n\n\t\t\t\t\t\t$parent = $this->parent;\n\n\t\t\t\t\t\t$this->requestSession = new \\GGNSession($parent::sess_rup, \\GGNSession::ONLINE, $this->parent->path);\n\n\t\t\t\t\t\tif(is_object($this->requestSession)){\n\n\t\t\t\t\t\t\t$this->request = $this->requestSession->expired();\n\n\t\t\t\t\t\t\treturn (is_array($this->request)) ? $this->request : false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse{\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\n\t\t\t}", "public function get_session_id()\n {\n }", "public function login( )\n\t\t{\n\t\t\treturn $this->get_session();\n\t\t}", "public function get_session()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}", "public function getSession()\n {\n return $this->session;\n }", "public function getSession()\n {\n return $this->session;\n }", "public function getSession()\n {\n $session = $this->setSession(self::getHash($this->_optionsSession['session_name']));\n return $session;\n }", "public function testValidDeviceIsReturned()\n {\n $cube_device = new CubeSensorsDevice('tester1', 'tester2', 'token_tester', 'secret_tester');\n\n $mock_response = new Response(200);\n\n $mockResponseBody = Psr7\\stream_for('{\"device\": {\"type\": \"cube\", \"uid\": \"000D6F0004491253\", \"extra\": {\"roomtype\": \"work\", \"name\": \"Front Room\"}}, \"ok\": true}');\n\n $mock_response = $mock_response->withBody($mockResponseBody);\n\n $mock = new MockHandler([\n $mock_response,\n ]);\n\n $cube_device->setupMockDataForRequest($mock);\n\n $device = $cube_device->getDevice('000D6F0004491253');\n\n $this->assertArrayHasKey('uid', $device);\n\n $this->assertArrayHasKey('roomtype', $device);\n\n $this->assertArrayHasKey('name', $device);\n }", "public function getSession()\n {\n return $this['session'];\n }", "public function getSessionKey() {\n if (!$this->session) {\n $session_request = new stdClass;\n $session_request->username = BullhornModelConfig::get('username');\n $session_request->password = BullhornModelConfig::get('password');\n $session_request->apiKey = BullhornModelConfig::get('api_key');\n try {\n $startSessionResponse = $this->getClient()->startSession($session_request);\n $this->session = array();\n $this->session['key'] = $startSessionResponse->return->session;\n $this->session['userId'] = $startSessionResponse->return->userId;\n $this->session['corporationId'] = $startSessionResponse->return->corporationId;\n } catch (Exception $e) {\n $this->setError('Bullhorn API says: ' . $e->getMessage());\n }\n }\n if (!$this->session['key'])\n $this->setError('Could not retrieve a session key from the Bullhorn API: username, password or API key may be incorrect');\n return $this->session['key'];\n }", "public function getUserSession() {\n\t\treturn ($this->isAdmin()) ? Mage::getSingleton('admin/session') : Mage::getSingleton('customer/session');\n\t}", "public function getSession() {\n return $this->session;\n }", "public function checkSession()\n {\n if(isset($_COOKIE['id'])){\n $cookieOrSessionID = $_COOKIE['id'];\n }\n elseif(isset($_SESSION['id'])){\n $cookieOrSessionID = $_SESSION['id'];\n }\n return $cookieOrSessionID;\n }", "public function getUserAction()\n {\n $session = $this->getDeviceSession();\n\n if (!$session) {\n $this->setErrorResponse('This device has no running session');\n }\n\n $session->registerAction($_SERVER['REMOTE_ADDR']);\n\n $user = $session->getUser();\n\n $this->_helper->json($user);\n }", "public function startSession()\r\n {\r\n $result = self::makeCall('startSession', array(), 'sessionID', true);\r\n if (empty($result)) {\r\n return $result;\r\n }\r\n $this->sessionID = $result;\r\n return $result;\r\n }", "protected function getSession()\n {\n $injector = Injector::inst();\n if ($injector->has(HTTPRequest::class)) {\n return $injector->get(HTTPRequest::class)->getSession();\n } elseif (Controller::has_curr()) {\n return Controller::curr()->getRequest()->getSession();\n }\n throw new Exception('No HTTPRequest object or controller available yet!');\n }", "function sys_session_test(){\n session_name(\"MELOLSESSION\");\n session_start();\n if (isset($_SESSION[\"userId\"]) && isset($_SESSION[\"sessionId\"]) && isset($_REQUEST[\"sessionId\"])) {\n if ($_SESSION[\"sessionId\"] == $_REQUEST[\"sessionId\"]) {\n return TRUE;\n }\n }\n return FALSE;\n}", "public static function getSessionSafe($session_id=null)\n {\n // 0. check if the authentication mode is set to server\n if (AUTH_MODE != AUTH_SERVER) {\n throw new RuntimeException(\"Illegal session configuration. This backend has no session login functionality.\");\n }\n \n // 1. retrieve local session if no session_id is given\n if (is_null($session_id)) {\n $session = SessionService::getCurrent();\n if (is_null($session)) {\n throw new RestException(404, \"No current session available.\");\n }\n $session_id = $session[\"guid\"];\n }\n\n // 2. retrieve session from database\n $session_info = SessionService::get($session_id); // will throw an error in case the session cannot be found\n\n // 3. check if session is still valid\n if (strtotime($session_info[\"expires_at\"]) - time() < 0) {\n self::invalidateSession($session_info[\"guid\"]); // delete invalid session\n throw new RestException(400, \"Session has expired. Please log in again.\");\n }\n\n return $session_info;\n }", "public function get_user() {\n\t\treturn ($this->logged_in()) ? $this->session->get($this->config['session_key'], null) : null;\n\t}", "function getSession() {\n global $session, $conn, $MAX_SESSION_AGE;\n if (isset($_COOKIE[\"sessionID\"])) {\n $sessionID = $_COOKIE[\"sessionID\"];\n\n $sessClear = $conn -> prepare(\"\ndelete from session\nwhere utc_timestamp() - lastupdatetime > :maxAge\");\n $sessClear -> bindParam(\":maxAge\", $MAX_SESSION_AGE);\n $sessClear -> execute();\n\n $user = $conn -> prepare(\"\nselect u.username username, u.pk_user_id user_id, s.pk_session_id session_id from session s\njoin user u on s.fk_user_id = u.pk_user_id\nwhere pk_session_id = :session_id\");\n $user -> bindParam(\":session_id\", $sessionID);\n $user -> execute();\n if ($user -> rowCount() > 0) {\n $session = $user -> fetch(PDO::FETCH_ASSOC);\n $updateTimer = $conn -> prepare(\"\nupdate session\nset lastupdatetime = utc_timestamp()\nwhere pk_session_id = :session_id\");\n $updateTimer -> bindParam(\":session_id\", $sessionID);\n $updateTimer -> execute();\n } else {\n $session = null;\n logOutAndForward(true);\n }\n }\n return null;\n}", "function getSession(){\n\t\t$roomid = (int)$_POST['roomid'];\n\t\tif($roomid < 0){ throw new Exception('Invalid player');}\n\t\tglobal $db;\n\t\t$q = $db -> prepare(\"SELECT sessionid FROM game WHERE roomid = ? LIMIT 1\");\n\t\t$q->execute(array($roomid));\n\t\t$r = $q->fetch();\n\t\t// Return current game session\n\t\treturn $r;\n\t}", "public static function get($key) {\n $sessionValue = null;\n if (!empty($_SESSION[$key])) {\n $sessionValue = $_SESSION[$key];\n } else {\n Logger::getLogger()->LogDebug(\"Attempting to get invalid item \n from Session with key : \".$key);\n }\n return $sessionValue;\n }", "public function xhrSessionExist(){\n echo Session::get(\"loggedin\")?\"postoji\":\"ne postoji\";\n }", "public function get_user()\n\t{\n\t\tif ($this->logged_in())\n\t\t{\n\t\t\treturn $this->_session->get($this->_config['session_key']);\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function payswarm_get_session($identity_id = null, $return_expired = false) {\n global $_COOKIE;\n $session = false;\n\n // check to see if the payswarm-session cookie exists\n if(array_key_exists('payswarm-session', $_COOKIE)) {\n $session_id = $_COOKIE['payswarm-session'];\n $session = get_transient('ps_sess_' . $session_id);\n if($session !== false) {\n // ensure client IP address and identity ID match\n $ip = $_SERVER['REMOTE_ADDR'];\n if($session['ip'] !== $ip ||\n ($identity_id !== $session['identity_id'] &&\n $identity_id !== null)) {\n $session = false;\n } else {\n // check expiration\n $now = time();\n $expires = isset($session['expires']) ? $session['expires'] : $now;\n if($expires <= $now) {\n $session = $return_expired ? $expires : false;\n }\n }\n }\n\n if($session === false || is_numeric($session)) {\n // invalid session, clear cookie only (not server session)\n payswarm_clear_session_cookie();\n }\n }\n\n return $session;\n}", "public function get($sessionId)\n {\n $result = DB::table('oauth_sessions')\n ->where('oauth_sessions.id', $sessionId)\n ->first();\n\n if(is_null($result)) {\n return null;\n }\n\n return (new Session($this->getServer()))\n ->setId($result->id)\n ->setOwner($result->owner_type, $result->owner_id);\n }", "protected function validConnect()\n {\n $data = $this->getUserData();\n\n $url = self::$serverPath . '/connect/';\n\n $result = $this->postHttpRequest($data, $url);\n\n if (isset($result->session_id) !== false) {\n $this->sessionId = $result->session_id;\n }\n\n return $result;\n }", "function _read_user_session()\n {\t\t\n\t\tif($this->sh_Options['keeping_logic'] == 'db'){\n\t\t\t$this->is_present = $this->_read_user_session_db();\n\t\t} else {\n\t\t\t$this->is_present = $this->_read_user_session_ss();\n\t\t}\n\t}", "public static function session($key, $value = '')\n {\n if (Session::exists($key)) {\n $session = Session::get($key);\n Session::delete($key);\n return $session;\n } elseif (!empty($value)) {\n return (Session::put($key, $value));\n }\n return null;\n }", "public function getSession(){\n if ($this->_session instanceof Session) {\n return $this->_session;\n }\n return $this->_createSession();\n }", "public function getSession($user)\n {\n $userID = is_numeric($user) ? $user : $user->id;\n\n return $this->sessions()->where('user_id', $userID)->firstOrFail();\n }", "function getSession() {\n\t\treturn $this->getSessionRelatedBySessionId();\n\t}", "private function getSession() {\n\t\t//read session file and fill the array\n\t\tif (file_exists ( self::SESSION_FILE )) {\n\t\t\t$this->session = unserialize ( file_get_contents ( self::SESSION_FILE ) );\n\t\t}\n\t\t\n\t\t//If the last session has expired, remove the session\n\t\tif (isset ( $this->session ) && $this->session ['lastlogin'] + (10 * 60) <= time ()) {\n\t\t\tunset ( $this->session );\n\t\t\t$this->updateSession ();\n\t\t}\n\t}", "public function fetchSessionData() {}", "private function getUserSession()\n {\n $company = $this->getCompany();\n\n if (!isset($company['user']['session'])) {\n throw new BiglionException('User \"session\" not defined', 1);\n }\n\n return $company['user']['session'];\n }", "public function getSession()\n\t{\n\t\treturn $this->session;\n\t}", "protected function checkSessionToken() {}", "public function getUserEid()\n {\n if ($this->app['session']->has($this->app['security.session_key'])) {\n return $this->app['session']->get($this->app['security.session_key']);\n }\n\n return null;\n }" ]
[ "0.62153083", "0.61457247", "0.5904974", "0.5839283", "0.5822668", "0.5770736", "0.5730502", "0.57080996", "0.57080996", "0.5705383", "0.5705383", "0.5704939", "0.55983216", "0.5589834", "0.55773973", "0.5574258", "0.5561495", "0.5534047", "0.55258375", "0.552207", "0.5511367", "0.5496338", "0.54848593", "0.54726803", "0.5467593", "0.54651165", "0.54612935", "0.546041", "0.546041", "0.5438344", "0.54328763", "0.54311764", "0.5426287", "0.5423706", "0.541751", "0.541334", "0.5411477", "0.5401379", "0.53908587", "0.5378437", "0.5378321", "0.53735334", "0.53719646", "0.53669477", "0.536087", "0.5345609", "0.534378", "0.53394514", "0.53393155", "0.5333495", "0.53317994", "0.53286344", "0.53177744", "0.53142804", "0.53128123", "0.5312384", "0.53107274", "0.5304448", "0.53036016", "0.53022766", "0.529995", "0.5299846", "0.5299137", "0.5296059", "0.5294811", "0.5293905", "0.5289666", "0.5289666", "0.52848226", "0.5284705", "0.5283524", "0.52832943", "0.5279771", "0.52788335", "0.5276575", "0.52599174", "0.52591294", "0.5257109", "0.5255697", "0.525489", "0.5254581", "0.5246385", "0.52450114", "0.52449924", "0.52447623", "0.524308", "0.5240678", "0.5240555", "0.5235484", "0.52309597", "0.5230146", "0.52294844", "0.5228211", "0.5219895", "0.5219883", "0.5217761", "0.52153707", "0.5208199", "0.5206275", "0.5204634" ]
0.67759395
0
Serves as a single entry point for universal static route
public function proxyAction() { $action = $this->getParam('call'); $this->forward($action); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function route();", "abstract public function serve();", "public function routeStartup()\n {\n //...\n }", "private static function createRootRoute()\n {\n self::$Router->map('GET|POST', '/', function(){\n Root::executeResponse();\n exit();\n });\n }", "public function indexRoute()\n {\n }", "public function Start()\n\t{\n\t\t$Request=HttpRequest::InternalPath();\n\t\tif (substr($Request,0,strlen(self::$StaticPrefix)+1)==self::$StaticPrefix.\"/\") //static requset\n\t\t{\n\t\t\treturn $this->StaticContent(substr($Request,strlen(self::$StaticPrefix)+1));\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\t$file=$this->MatchRoutes($Request);\n\t\t\treturn $this->StartController($file);\n\t\t}\n\t}", "public static function Main() {\n $routes = New Router();\n \n $routes->index();\n }", "public function getStatic(string $path, string $method = null): Route|null;", "public static function routes(): void\n {\n //\n }", "public static function route()\n {\n return 'index';\n }", "public static function start()\n {\n if (self::$config === null) {\n self::$config = Config::get('routes');\n self::$mimeTypes = Config::get('mimetypes');\n }\n\n foreach (self::$config['routes'] as $route) {\n include self::$config['path'].$route.'.php';\n }\n }", "public function test_public_controller__match()\n {\n $this->getRequestUrl('http://localhost/static.txt');\n \\Staq\\App::create($this->projectNamespace)\n ->setPlatform('local')\n ->run();\n $this->expectOutputHtmlContent('This is an example of static file');\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapFrontWebRoutes();\n $this->mapBackWebRoutes();\n //\n }", "#[Route('/', name: 'homepage')]\n public function index(): Response\n {\n if($this->getUser()){\n $fullPath = $this->getParameter('userRoot').explode('.',$this->getUser()->getUsername())[0].'/';\n }\n\n\n\n return $this->render('default/index.html.twig', [\n\n ]);\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function staticAction($params)\n {\n if (!empty($params['page'])) {\n $this->view->setFile('static/'.$params['page']);\n }\n }", "public function map()\n {\n $this->mapWebRoutes();\n }", "private function initSlim() {\n $this->routeContainer = new Container();\n\n $routeContainer = $this->routeContainer;\n\n $routeContainer['notFoundHandler'] = function ($routeContainer) {\n return function() use ($routeContainer) {\n $this->template->variables['website_page'] = $this->twig->render('error.twig', ['message' => Dictionary::init()['error404']]);\n\n return $routeContainer['response']\n ->withStatus(404)\n ->withHeader('Content-Type', 'text/html');\n };\n };\n\n $this->route = new App($this->routeContainer);\n }", "function public_url($uri = \"\")\n{\n return App::get('base_url') . \"/public\" . $uri;\n}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "public function map()\n {\n $this->mapWebRoutes();\n\n $this->mapApiRoutes();\n\n //\n }", "public function testUrlStatic()\n {\n $this->router->route('login', '/user/login');\n \n // Get static URL with no parameters\n $url = $this->router->url('login');\n $this->assertEquals(\"/user/login\", $url);\n }", "public function express()\n {\n }", "private function route() {\n\n// if (!in_array($_GET['page'], $pages)) {\n// echo \"bad\";\n// exit;\n// }\n\n if (!empty($_GET['page']) && file_exists( __ROOT__.'controller/'.$_GET['page'].'.php')) {\n include __ROOT__.'controller/'.$_GET['page'].'.php';\n } else {\n include __ROOT__.'controller/home.php';\n }\n include __ROOT__.'public/footer.html';\n }", "public function initializeRoutes()\n {\n $this->get(\"/\", \"index\");\n }", "function fs_route() {\n chdir(fs_get_platform_dir());\n\n /*\n * Hack the old autoloading\n */\n $files = glob(fs_get_platform_dir() . '/lib/flourish/*.php');\n\n /*\n * unset dublicate progressbar file\n */\n unset($files[2]);\n\n $load_before = [\n fs_get_platform_dir() . '/lib/flourish/fException.php',\n fs_get_platform_dir() . '/lib/flourish/fExpectedException.php',\n fs_get_platform_dir() . '/lib/flourish/fUnexpectedException.php'\n ];\n\n foreach ($load_before as $file) {\n require_once $file;\n }\n\n foreach ($files as $file) {\n\n require_once $file;\n\n }\n unset($file);\n unset($files);\n\n}", "public function index() {}", "public function index() {}", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "function run() {\n\n // TODO: URL aliases and url_for method\n $routes = [\n // TODO NEXT VERSIONS: use url aliases so not hardcode URLs in templates but write like <a href = \"url_for('posts:new')>\"\n // TODO NEXT VERSIONS: use Slim for routing\n '/' => 'posts_index',\n '/posts/new' => 'posts_new',\n // TODO NEXT VERSIONS: handle ULRs with params like '/posts/<id>/edit'\n ];\n\n // TODO:\n // - incapsulate routing code to a function\n // - this function should not echo and die (it's a mess!!), but return HTTP code and HTTP response body to\n\n // TODO NEXT VERSIONS: make an exception system:\n // - catch PHP's fatal errors (which can arise when executing controller ) and render beatufil page instead of PHP's ugly output\n // - make our own errors system.\n // It's needed 'cause errors have types: incorrect user input and internal errors and\n // we should handle them in different ways:\n // - for user errors we show full messages\n // - for internal errors we show some standard message like 'Sorry, some error occured. Try again later'\n\n foreach($routes as $url_template => $controller) {\n if ($url_template == $_SERVER[\"REQUEST_URI\"]) {\n try {\n $method = 'Controllers\\\\'.$controller;\n $response = $method();\n if (!is_array($response)) {\n $response = ['code' => 200, 'body' => $response];\n }\n }\n catch (\\Exception $e) {\n // TODO: log 500 errors\n $body = (ENV == 'dev') ? \"<pre>\".$e->getMessage().\"\\n\".$e->getTraceAsString().\"</pre>\" : 'Sorry, some error occured';\n $response = ['code' => 500, 'body' => $body];\n }\n\n return $response;\n }\n }\n\n // TODO:\n // - return 404 HTTP code render\n // - custom 404 page\n return ['code' => 404, 'body' => '404 Not Found'];\n}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n }", "public function get(...$args) {\n $this->registerRouteHandler('GET', ...$args);\n }", "public function run(): void\n {\n // missing routing\n // missing proper controller/model system\n // missing middleware framework\n // hacks incoming :)\n\n self::$config['httpMethod'] = $_SERVER['REQUEST_METHOD'];\n self::$config['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n echo $this->handleRequest(self::$config['uri'] === '/' ? '/site/index' : self::$config['uri']);\n }", "public function map() {\n\t\tRoute::middleware( 'web' )->group( mantle_base_path( 'routes/web.php' ) );\n\t\tRoute::middleware( 'rest-api' )->group( mantle_base_path( 'routes/rest-api.php' ) );\n\t}", "public function map()\n {\n $this->mapRoutes();\n\n $this->mapWebRoutes();\n\n //\n }", "function my_asset($path = null)\n{\n return route('homepage') . env('ASSET_URL') . '/' . $path;\n}", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }", "public function serveStaticFile(Request $request) {\n $root = static::getGuiPath();\n $presumed_path = sprintf('%s%s', $root, urldecode($request->getPathInfo()));\n if (is_file($presumed_path)) {\n return static::serveStaticFileAtPath($presumed_path);\n } else {\n return FALSE;\n }\n }", "public static function index()\n {\n\n }", "public function run() {\n //Matcher holen und request matchen\n $matcher = $this->routerContainer->getMatcher();\n $this->route = $matcher->match($this->request);\n\n //404 handler\n if (!$this->route) {\n return ControllerFactory::get(\"notfound\", $this->request)->render();\n }\n\n try {\n //home route\n if ($this->route->name == \"home\") {\n return ControllerFactory::get(\"index\", $this->request)->render();\n }\n\n if (isset($this->route->attributes[\"controller\"])) {\n $controller = ControllerFactory::get($this->route->attributes[\"controller\"], $this->request);\n } else {\n $controller = ControllerFactory::get($this->getControllerName($this->route->name), $this->request);\n }\n\n $controller->setMap($this->map);\n $controller->setRouter($this->route);\n $controller->init();\n\n switch ($this->route->name) {\n case 'ajax_default':\n $controller->ajax($this->route->attributes[\"action\"]);\n break;\n case 'get_default':\n $controller->get($this->route->attributes[\"action\"]);\n break;\n case 'post_default':\n $controller->post($this->route->attributes[\"action\"]);\n break;\n case 'controller_default_route':\n break;\n default:\n $method = $this->routes[$this->route->name][\"method\"];\n if (isset($this->routes[$this->route->name][\"action_param\"])) {\n $action = $this->route->attributes[$this->routes[$this->route->name][\"action_param\"]];\n //dynamically call the matching method\n $controller->$method($action);\n }\n }\n\n return $controller->render();\n } catch (FatalException $e) {\n /** @var Fatal $fatal_error */\n $fatal_error = ControllerFactory::get(\"fatal\", $this->request);\n $fatal_error->setException($e);\n return $fatal_error->render();\n }\n }", "public static function __callStatic(string $name, array $args)\n {\n return self::$router->{$name}(...$args);\n }", "public function route() {\n\t\t$file = $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\tif(\\mfw\\helpers\\FileHelper::fileExists($file)) {\n\t\t\tinclude $this->app_directory . '/controllers/' . $this->controller . '.php';\n\t\t\t$controller = new $this->controller($this->controller, $this->app_directory);\n\t\t\tcall_user_func_array(array($controller, $this->method), $this->arguments);\n\t\t} else {\n\t\t\tif(defined('DOC_ROOT')) {\n\t\t\t\tinclude DOC_ROOT . '/404.php';\n\t\t\t} else {\n\t\t\t\tthrow new \\Exception(\"404 Page not found\");\n\t\t\t}\n\t\t}\n\t}", "#[Route(path: '/', name: 'lsitem_index', methods: ['GET'])]\n public function index(): Response\n {\n return $this->render('framework/ls_item/index.html.twig', []);\n }", "public function run()\n {\n $routeFile = app('path.bootstrap') . '/api.php';\n if (file_exists($routeFile)) {\n $router = $this;\n $routes = require $routeFile;\n add_action('rest_api_init', [$this, 'register']);\n }\n\n if (class_exists('acf')) {\n $this->createAcfRoutes();\n }\n }", "public function index() {\n\t\t$this->landing();\n\t}", "public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n $this->mapAdminRoutes();\n //\n }", "public static function controller()\n {\n self::initialize();\n\n /* get some uri specific datas */\n $requestUri = $_SERVER['REQUEST_URI'];\n $requestedFile = basename($requestUri);\n\n /* do some uri specific datas */\n switch ($requestedFile) {\n case 'live.json':\n self::printJsonLiveValues();\n break;\n\n case 'update.json':\n self::printJsonUpdateStatus();\n break;\n\n case 'update-library.json':\n self::printJsonUpdateLibrary();\n break;\n\n default:\n ApacheHostViewer::printJsonMessageStatus(\"Unknown requested file \\\"$requestedFile\\\".\", 'failed');\n break;\n }\n }", "public static function serveSimpleRoute($p_mainRoute)\n {\n return new StreamedViewResponse(self::$routes[$p_mainRoute]['title'], \"$p_mainRoute.tpl\");\n }", "public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }", "function route(Request $request);", "abstract public function map(Router $router);", "public static function route($argv) {\n\n // New initialiser\n Container::instance()->get(Bootstrapper::class);\n\n // Grab and process the route\n $router = Container::instance()->get(Router::class);\n $router->processRoute($argv);\n\n }", "public function run()\n {\n $this->executeStaticRoutes();\n $this->executeGroupRoutes();\n }", "public function make()\n {\n $this->app->get('/doc', function (Request $request, Response $response) {\n $request;\n $openapi = scan(__DIR__ . \"/../../\");\n return $response\n ->withHeader('Access-Control-Allow-Origin', '*')\n ->withHeader('Access-Control-Allow-Headers', 'Content-Type, Accept, Origin, Authorization')\n ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS')\n ->withJson(json_decode($openapi->toJson()));\n });\n\n $this->app->group('/api/v1', function () {\n $this->group('/address', function () {\n $this->map(['GET'], '/all', 'App\\v1\\Controller\\AddressController:all');\n $this->map(['GET'], '/{id}', 'App\\v1\\Controller\\AddressController:show');\n $this->map(['POST'], '/create', 'App\\v1\\Controller\\AddressController:create');\n $this->map(['PATCH'], '/update/{id}', 'App\\v1\\Controller\\AddressController:update');\n $this->map(['DELETE'], '/{id}', 'App\\v1\\Controller\\AddressController:delete');\n });\n });\n }", "public function __construct() {\n\t\t$this->staticDomain = Config::get('app.static_url');\n\t}", "public function map()\n {\n $this->mapProcessEngineRoutes();\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }", "public function run()\n {\n echo $this->router->resolve();\n }", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapMobileRoutes();\n }", "public function index()\n {\n //dd($_SERVER);\n require 'views/home.php';\n }", "public static function route() {\nimport('TheTrainingMangerLMS.Content.Login');\n//import('TheTrainingMangerLMS.Content.MyAccount.NotFound');\n//import('TheTrainingMangerLMS.Content.MyAccount.Dashboard');\nimport('TheTrainingMangerLMS.Content.MyAccount.CourseBuilder');\nimport('TheTrainingMangerLMS.Content.MyAccount.CourseList');\n\n\t\t// set-up actions\n\t\t// add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\t$section = get_query_var('area');\n\t\t// Find a subhandler to bind\n\t\tif (!is_user_logged_in()) {\n\t\t\t(new Login())->render();\n\t\t} else \n\t\t// Is the logged in user a Trainer\n\t\tif (!ttp_lms_trainer_valid(get_current_user_id())) { // TODO: is Trainer && is Active Trainer\n\t\t\t(new UnAuthorized())->render();\n\t\t} else\n\t\t// Is this a root level request (default) or \n\t\tif (is_null($section) || ($section == '')) {\n\t\t\t(new MyAccount\\Home())->render();\n\t\t} else\n\t\t// Is this a specific request for the course list (can't use this as default)\n\t\tif ($section == \\TheTrainingMangerLMS\\Content\\MyAccount\\CourseList::get_handle()) {\n\t\t\t(new MyAccount\\CourseList())->render();\n\t\t} else \n\t\t// Is this a specific request for the course builder\n\t\tif ($section == \\TheTrainingMangerLMS\\Content\\MyAccount\\CourseBuilder::get_handle()) {\n\t\t\t(new MyAccount\\CourseBuilder())->render();\n\t\t} else {\n\t\t\t(new NotFound())->render();\n\t\t}\n\t}", "function index($args) {\n\t\t//Determine the current theme location\n\t\t$theme_location = $this->theme_location;\n\t\t$file_location = $theme_location . '/static/' . implode('/', $args);\n\n\t\tif (file_exists($file_location)) {\n\t\t\t$extension = Mvc_Functions::get_extension($file_location);\n\t\t\t$func = \"{$extension}_mime\";\n\t\t\tif (method_exists($this, $func)) {\n\t\t\t\t$this->$func($file_location);\n\t\t\t} else {\n\t\t\t\t$mimepath = '/usr/share/magic'; // may differ depending on your machine\n\t\t\t\t// try /usr/share/file/magic if it doesn't work\n\t\t\t\t$mime = finfo_open(FILEINFO_MIME);\n\n\t\t\t\tif ($mime === FALSE) {\n\t\t\t\t\tthrow new Exception('Unable to open finfo');\n\t\t\t\t}\n\t\t\t\t$filetype = finfo_file($mime, $file_location);\n\t\t\t\tfinfo_close($mime);\n\t\t\t\tif ($filetype === FALSE) {\n\t\t\t\t\tthrow new Exception('Unable to recognise filetype');\n\t\t\t\t}\n\n\n\t\t\t\theader(\"Content-Type: $filetype\");\n//\t\t\theader(\"X-Content-Type-Options: nosniff\");\n\t\t\t\theader(\"Access-Control-Allow-Origin:*\");\n\t\t\t\theader('Cache-Control:public, max-age=30672000');\n\t\t\t}\n\n\t\t\techo file_get_contents($file_location);\n\t\t\tdie();\n\t\t} else {\n\t\t\t$this->_404();\n\t\t\tdie();\n\t\t}\n\t}", "public function map()\n {\n //wap端路由为了防止和web端路由冲突一定要放到前面\n $this->mapWapRoutes();\n //web端路由\n $this->mapWebRoutes();\n //api路由\n $this->mapApiRoutes();\n //Backend路由\n $this->mapBackendRoutes();\n }", "public function route_home() {\n\t\techo '<h1>It wurks!</h1>';\n\t}", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function index($path);", "function display_static_content()\n{\n\tglobal $wp_controller;\n\t\n\tif ( !empty($_GET) )\n\t{\n\t\techo $wp_controller->display();\n\t}\n}", "abstract public function index();", "abstract public function index();", "abstract public function index();", "public abstract function index();", "public abstract function index();", "public abstract function index();", "public function index()\n\t{\n\t\tdie('404 error');\n\t}", "public static function route_callback($uri)\n\t{\n\t\tif ($asset = Kohana::find_file(self::PUBLIC_FOLDER, $uri, FALSE))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'controller' => 'publicize',\n\t\t\t\t'action' => 'copy',\n\t\t\t\t'asset' => $asset,\n\t\t\t\t'uri' => $uri,\n\t\t\t);\n\t\t}\n\t}", "public function route() {\r\n register_rest_route( 'api/v1', '/web-data-endpoint', array(\r\n 'methods' => 'GET',\r\n 'callback' => array( $this, 'callback' )\r\n ) );\r\n }", "public function index(){}", "public function serve()\n\t{\n\t\tif($this->getDomain(FALSE) !== $_SERVER['SERVER_NAME'])\n\t\t{\n\t\t\theader('HTTP/1.0 307 Temporary Redirect');\n\t\t\theader('Location: ' . $this->getUrl(TRUE));\n\t\t\texit;\n\t\t}\n\n\t\techo 'SERVING IMAGE: ' . $this->getSlug();\n\t}", "public static function route(){\n\t\t$request=(isset($_GET['request']))?$_GET['request']:'/index';\n\t\t$route_found=false;\n\t\t\n\t\t$vanilla_route_found=self::check_route($request);\n\t\t\n\t\tif(!$vanilla_route_found){\n\t\t\t$xml_request=self::xml_route();\n\t\t\tif($xml_request!==$request){\n\t\t\t\t$route_found=true;\n\t\t\t\t$request=$xml_request;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$args=explode(\"/\",$request);\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\t// Add post arguments to args array\n\t\tif($_SERVER['REQUEST_METHOD']!=\"GET\"){\n\t\t\t$args=array_merge($args,$_POST);\n\t\t}\n\t\tif(!empty($_FILES)){\n\t\t\t$args=array_merge($args,array(\"uploads\" => $_FILES));\n\t\t}\n\t\t\n\t\ttry{\n\t\t\trequire_once('controllers/error_controller.php');\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\t$controller=ucfirst($controller).'Controller';\n\t\t\t\t\t$controller=new $controller();\n\t\t\t\t\t$controller->$action($args);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($route_found){\n\t\t\t\t//print \"Gone\";\n\t\t\t\t$controller=new ErrorController();\n\t\t\t\t$controller->gone();\n\t\t\t}else{\n\t\t\t\t//print \"Not Found\";\n\t\t\t\t$controller=new ErrorController();\n\t\t\t\t$controller->notfound();\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t}\n\t}", "public function run()\n {\n $routes = require BASE_DIR.'/routes/routes.php';\n foreach ($routes as $mainroute) {\n foreach ($mainroute as $route => $method) {\n $args = [];\n if(preg_match(convertUrl($route), $this->request->getCurrentUri(), $args))\n {\n unset($args[0]);\n $args = implode(',', $args);\n\n return $this->response->make($method, $args);\n }\n }\n }\n\n throw new \\Exception(\"Route not found\");\n }", "public function mapRoutes()\n {\n Router::loadRouteFiles(\"web.php\");\n Router::loadRouteFiles('patients.php');\n }", "public function index(){\n return response('', 200);\n }", "function get($uri){\n require __DIR__ . '/../model/object.php';\n $headers = apache_request_headers();\n switch ($uri) {\n case '/':\n index($headers);\n break;\n\n case '/qualcosa.php':\n getQualcosa($headers);\n break;\n\n case '/questionari.php':\n getQuestionariQ($headers);\n break;\n\n case '/esercenti.php':\n getEsercentiQ($headers);\n break;\n\n case '/utenti.php':\n getUtentiQ($headers);\n break;\n\n case '/dashboardApertamente.php':\n getDashboard($headers);\n break;\n\n case '/esercenti.php':\n getEsercentiQ($headers);\n break;\n \n default:\n notFound();\n break;\n }\n}", "public static function run()\n\t{\n\t\ttry {\n\t\t\ttry {\n\t\t\t\tif(substr(Request::getUri(), -1) !== '/') {\n\t\t\t\t\tif(Router::getMatchedRoute(true)) {\n\t\t\t\t\t\tself::redirect(Request::getBaseUri() . Request::getUri() . '/' . Request::getQueryString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// log the uri\n\t\t\t\tLog::out(__METHOD__ . ' URI: ' . Request::getBaseUri() . Request::getUri(), Log::LEVEL_DEBUG);\n\t\t\t\t\n\t\t\t\t// only starts output buffering in development mode\n\t\t\t\tif(!self::isDevMode()) {\n\t\t\t\t\tob_start();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$all_routes_processed = false;\n\t\t\t\t$matched_route = null;\n\t\t\t\t$offset = -1;\n\t\t\t\t\n\t\t\t\t// start searching for matched route\n\t\t\t\twhile(!$all_routes_processed) {\n\t\t\t\t\t$matched_route = Router::getMatchedRoute(false, $offset + 1);\n\t\t\t\t\t\n\t\t\t\t\tif(!$matched_route) {\n\t\t\t\t\t\tApp::notFound();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// log the pattern\n\t\t\t\t\tLog::out(__METHOD__ . ' Matched route: \"' . $matched_route->name . '\", pattern: ' . \n\t\t\t\t\t\t\t$matched_route->getPatternRegex() . ', offset: ' . \n\t\t\t\t\t\t\t$matched_route->getOffset(), Log::LEVEL_DEBUG);\n\t\t\t\t\t\n\t\t\t\t\t// log route params\n\t\t\t\t\tLog::out(__METHOD__ . \" Route params: \\n\" . print_r($matched_route->getParams(), true), \n\t\t\t\t\t\t\tLog::LEVEL_DEBUG); \n\t\t\t\t\t\n\t\t\t\t\t$offset = $matched_route->getOffset();\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tLoader::invoke($matched_route);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(BakedCarrotPassException $e) {\n\t\t\t\t\t\t$all_routes_processed = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$all_routes_processed = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!self::isDevMode()) {\n\t\t\t\t\tob_end_flush();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(Exception $e) {\n\t\t\t\tif(self::isDevMode()) {\n\t\t\t\t\twhile(@ob_end_clean());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$classes_to_test = array(get_class($e), get_parent_class($e), 'Exception');\n\t\t\t\t$executed = false;\n\t\t\t\t\n\t\t\t\tforeach($classes_to_test as $class) {\n\t\t\t\t\tif(isset(self::$exception_handlers[$class])) {\n\t\t\t\t\t\tLoader::invokeExceptionHandler($e, self::$exception_handlers[$class]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tLog::out(__METHOD__ . ' Exception handler \"' . self::$exception_handlers[$class] . '\" invoked for class \"' . \n\t\t\t\t\t\t\t\t$class . '\"', Log::LEVEL_INFO);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$executed = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$executed) {\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\tself::$instance->handleDefaultException($e);\n\t\t}\n\t}", "public function serveStaticFile($staticFilePath, $sitePath, $siteName, $uri)\n {\n return parent::serveStaticFile(\n $staticFilePath,\n $this->extractPathFromUri($sitePath, $siteName),\n $siteName,\n $uri\n );\n }", "public function index();", "public function index();", "public function index();", "public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }", "public static function api()\n {\n Route::get( 'images', '\\\\' .ApiController::class . '@index' )\n ->name( 'api.images.index' );\n Route::get( 'images/{image}', '\\\\' .ApiController::class . '@show' )\n ->name( 'api.images.show' );\n Route::post( 'images', '\\\\' .ApiController::class . '@store' )\n ->name( 'api.images.store' );\n Route::delete( 'images/{image}', '\\\\' .ApiController::class . '@destroy' )\n ->name( 'api.images.destroy' );\n }", "public static function preRouter(){\n\t\t\n\t}", "public function index()\n {\n // load function main\n $this->main();\n }", "public function run()\n {\n $this->router->listen();\n }", "public function run(){\n $this->session->start();\n $this->request->prepareUrl();\n $this->file->require('App/index.php');\n list($controller,$method,$arguments) = $this->route->getProperRoute();\n }" ]
[ "0.6596147", "0.64303917", "0.6234386", "0.62072384", "0.607239", "0.6066156", "0.6044709", "0.5977641", "0.59412307", "0.58559775", "0.57839334", "0.57474697", "0.5699852", "0.56767553", "0.564533", "0.5606903", "0.55916977", "0.55791885", "0.5570306", "0.5563163", "0.5563163", "0.5563163", "0.5563163", "0.5563163", "0.5563163", "0.5563163", "0.5563163", "0.55563074", "0.5553899", "0.55513585", "0.5544721", "0.5528212", "0.55218905", "0.5499976", "0.5499976", "0.5490811", "0.5490811", "0.54791695", "0.5466585", "0.5451601", "0.5440777", "0.54362875", "0.54323995", "0.54302096", "0.5429437", "0.54162943", "0.5410102", "0.5409647", "0.5402234", "0.54008764", "0.53998303", "0.53996235", "0.53994286", "0.53895086", "0.53845906", "0.53837955", "0.5381001", "0.5373655", "0.53733504", "0.5372627", "0.53691274", "0.5325653", "0.5321689", "0.53201085", "0.53178835", "0.53167766", "0.5311041", "0.5304609", "0.5301225", "0.5278723", "0.5272133", "0.5267309", "0.52670705", "0.5260007", "0.5259218", "0.5259218", "0.5259218", "0.5258693", "0.5258693", "0.5258693", "0.5256264", "0.52461505", "0.5228427", "0.521044", "0.5207443", "0.5201067", "0.51913494", "0.519122", "0.51899046", "0.51855975", "0.5184602", "0.5175047", "0.5168838", "0.5168838", "0.5168838", "0.51684016", "0.5165687", "0.51570284", "0.51444554", "0.512941", "0.512754" ]
0.0
-1
Logs in device if correct username and password provided username and password and mandatory fields in payload
public function loginAction() { $data = $this->getRequestData(); if ($this->getDeviceSession(false)) { $this->setErrorResponse('Your device is already running a session. Please logout first.'); } $session = Workapp_Session::login($data['username'], $data['password']); if (!$session) { $this->setErrorResponse('No user with such username and password'); } $session->registerAction($_SERVER['REMOTE_ADDR']); $this->_helper->json(array('session_uid' => $session->getSessionUid())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function login()\n\t{\n\t\tif ( func_get_args() ) {\n\t\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t\tif ( array_key_exists( 'EmailAddress', $args ) ) {\n\t\t\t\t// Login with password\n\t\t\t\t$this->request( 'smugmug.login.withPassword', array( 'EmailAddress' => $args['EmailAddress'], 'Password' => $args['Password'] ) );\n\t\t\t} else if ( array_key_exists( 'UserID', $args ) ) {\n\t\t\t\t// Login with hash\n\t\t\t\t$this->request( 'smugmug.login.withHash', array( 'UserID' => $args['UserID'], 'PasswordHash' => $args['PasswordHash'] ) );\n\t\t\t}\n\t\t\t$this->loginType = 'authd';\n\t\t\t\n\t\t} else {\n\t\t\t// Anonymous login\n\t\t\t$this->loginType = 'anon';\n\t\t\t$this->request( 'smugmug.login.anonymously' );\n\t\t}\n\t\t$this->SessionID = $this->parsed_response['Login']['Session']['id'];\n\t\treturn $this->parsed_response ? $this->parsed_response['Login'] : FALSE;\n\t}", "public function login();", "public function login();", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "private function login(){\n \n }", "function login() {\n\t $login_parameters = array(\n\t\t \"user_auth\" => array(\n\t\t \"user_name\" => $this->username,\n\t\t \"password\" => $this->hash,\n\t\t \"version\" => \"1\"\n\t\t ),\n\t\t \"application_name\" => \"mCasePortal\",\n\t\t \"name_value_list\" => array(),\n\t );\n\n\t $login_result = $this->call(\"login\", $login_parameters);\n\t $this->session = $login_result->id;\n\t return $login_result->id;\n\t}", "public function login($username,$password){\n $data = '{\"device_id\":\"'.$this->device_id.'\",\"guid\":\"'.$this->guid.'\",\"username\":\"'.$username.'\",\"password\":\"'.$password.'\",\"Content-Type\":\"application/x-www-form-urlencoded; charset=UTF-8\"}';\n $sig = $this->generateSignature($data,$this->secret);\n $data = 'signed_body='.$sig.'.'.urlencode($data).'&ig_sig_key_version=6';\n $login = $this->sendRequest('accounts/login/', true, $data, $this->agent, false);\n if(is_array($login) && count($login)==2 && $login[0] == 200 && is_object(json_decode($login[1]))){\n $account = json_decode($login[1]);\n return $account->logged_in_user;\n }else{\n $error = json_decode($login[1]);\n $this->log($error);\n }\n }", "private function user_login() {\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\t\t\tif(!isset($_POST['password']) && !isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email and password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['email'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter email is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['password'])) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t$email = $this->_request['email'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t\t\t\t\t// Input validations\n\t\t\tif(!empty($email) and !empty($password)) {\n\t\t\t\tif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\t\t\t\t$sql = \"SELECT user_name, user_email, user_phone_no, user_pic, user_address, remember_token\n\t\t\t\t\t\t\t\t\tFROM table_user\n\t\t\t\t\t\t\t\t\tWHERE user_email = '$email'\n\t\t\t\t\t\t\t\t\tAND user_password = '\".$hashed_password.\"'\n\t\t\t\t\t\t\t\t\tLIMIT 1\";\n\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t$stmt->execute();\n\t\t\t\t $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n if($stmt->rowCount()=='0') {\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n $this->response($this->json($error), 200);\n }\n\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Sucessfully Login!\", \"data\" => json_encode($results) );\n\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Fields are required\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Invalid Email address or Password\");\n\t\t\t$this->response($this->json($error), 200);\n\t\t}", "private function loginToWigle() {\n\t\t$this->sendCurlRequest(self::WIGLE_LOGIN_URL,array(\"credential_0\"=>$this->user,\"credential_1\"=>$this->password));\n }", "public function login()\n {\n /* validation requirement */\n $validator = $this->validation('login', request());\n\n if ($validator->fails()) {\n\n return $this->core->setResponse('error', $validator->messages()->first(), NULL, false , 400 );\n }\n\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n\n return $this->core->setResponse('error', 'Please check your email or password !', NULL, false , 400 );\n }\n\n return $this->respondWithToken($token, 'login');\n }", "protected function loginIfRequested() {}", "protected function LoginAuthentification()\n {\n \n $tokenHeader = apache_request_headers();\n\n //isset Determina si una variable esta definida y no es NULL\n\n if(isset($tokenHeader['token']))\n { \n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm); \n //var_dump($datosUsers);\n if(isset($datosUsers->nombre) and isset($datosUsers->password))\n { \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('nombre'=>$datosUsers->nombre),\n array('password'=>$datosUsers->password)\n )\n ));\n if(!empty($user))\n {\n foreach ($user as $key => $value)\n {\n $id = $user[$key]->id;\n $username = $user[$key]->nombre;\n $password = $user[$key]->password;\n }\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n\n if($username == $datosUsers->nombre and $password == $datosUsers->password)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n } \n \n }", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "function login($username, $password = null)\n {\n $f3->get('user')->copyfrom('POST');\n k($f3);\n $user = self::load(\"name = $username\");\n k($user);\n }", "public function p_login() {\n\n\t\t# Sanitize the user entered data to prevent any funny-business (re: SQL Injection Attacks)\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\n\t\t# Hash submitted password so we can compare it against one in the db\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t# Search the db for this email and password\n\t\t# Retrieve the token if it's available\n\t\t$q = \"SELECT token \n\t\t\tFROM users \n\t\t\tWHERE email = '\".$_POST['email'].\"' \n\t\t\tAND password = '\".$_POST['password'].\"'\";\n\n\t\t$token = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If we didn't find a matching token in the database, it means login failed\n\t\tif(!$token) {\n\n\t\t\t# Send them back to the login page\n\t\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t# But if we did, login succeeded! \n\t\t} else {\n\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\t\t\t# Send them to the main page - or whever you want them to go\n\t\t\tRouter::redirect(\"/\");\n\t\t}\n\t}", "public function testLoginWithoutUserDetails() :void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserDetails' );\n $this->assertCount(2, $res, 'testLoginWithoutUserDetails' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserDetails' );\n }", "public static function LogIn ($userName = '', $password = '');", "function login($username, $data) {\n if ($username != 'admin' || $data != 'secret') {\n return false;\n }\n return parent::login($username, $data);\n }", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "abstract protected function doLogin();", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "function user_action_login($env, $vars) {\n $username = array_pop($vars['data']['username']);\n // We allow also using email for logging in.\n if (valid_email($username)) {\n $username = UserFactory::getUserFromField($env, 'email', $username);\n }\n\n // Initialize an user object.\n $tmp_user = new User($env, $username);\n // Attempt to log in the user.\n $login = $tmp_user->logIn(array_pop($vars['data']['password']));\n exit($login);\n}", "public function userLogin(){\n\t\t\tif (isset($_POST['user_name']) && isset($_POST['password'])){\n\t\t\t\t$response = $this->model->getUser(\"*\", \"user_name = \".\"'\".$_POST['user_name'].\"'\");\n\t\t\t\t$response = $response[0];\n\t\t\t\t$user_rol = null;\n\t\t\t\t//The user is valid\n\t\t\t\tif ($response['password']==$_POST['password']) {\n\t\t\t\t\t//Verify the roles\n\t\t\t\t\t$response_role = $this->model->getRoles(\"user_id = '\".$response['_id'].\"'\");\n\t\t\t\t\tif (count($response_role)>1) {\n\t\t\t\t\t\t//Multipage user\n\t\t\t\t\t\t$user_rol = array();\n\t\t\t\t\t\tforeach ($response_role as $value) {\n\t\t\t\t\t\t\tarray_push($user_rol, $value['role']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (in_array('ADMIN', $user_rol)) { \n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n \t\t\t\t\t$_SERVER['AUTH_TYPE'] = \"Basic Auth\"; \n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$user_rol = $response_role[0]['role'];\n\t\t\t\t\t\tif ($user_rol == 'ADMIN') {\n\t\t\t\t\t\t\t$_SERVER['PHP_AUTH_USER'] = $_POST['user_name'];\n \t\t\t\t\t$_SERVER['PHP_AUTH_PW'] = $_POST['password'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->createSession($response['user_name'], $user_rol);\n\t\t\t\t\techo 1;\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t}", "public function login($username, $password);", "public function doLogin(){\n $rules = array(\n 'userid' => 'required|max:30',\n 'password' => 'required',\n );\n $display = array(\n 'userid' => 'User ID',\n 'password' => 'Password'\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, array(), $display);\n if($validator->fails()) {\n return \\Redirect::back()\n ->withErrors($validator)\n ->withInput(\\Input::all());\n }else{\n $user = User::where('username', '=', \\Input::get('userid'))\n ->first();\n if(isset($user->id)){\n if($user->level < 3) {\n if (\\Hash::check(\\Input::get('password'), $user->password)) {\n \\Session::put('logedin', $user->id);\n \\Session::put('loginLevel', $user->level);\n \\Session::put('nickname', $user->nickname);\n }\n return \\Redirect::nccms('/');\n }else{\n \\Session::flash('error', 'Permission Error.');\n return \\Redirect::nccms('login');\n }\n }else{\n \\Session::flash('error', 'Email/Password Error.');\n return \\Redirect::nccms('login');\n }\n }\n }", "function login() {\n $params = $this->objService->get_request_params();\n $isSuccess = $this->objQuery->count('user','email= ? AND password = ?', array($params->email,$params->password));\n echo $isSuccess;\n }", "public function login() {\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n if (!empty($email) && !empty($pass)) {\n $user = $this->users_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('ERROR');\n }\n $this->event_log();\n return $this->send_response(array(\n 'privatekey' => $user->privatekey,\n 'user_id' => $user->id,\n 'is_coach' => (bool) $this->ion_auth->in_group('coach', $user->id)\n ));\n }\n return $this->send_error('LOGIN_FAIL');\n }", "function admin_login() {\n\t\t$admin_email = $_REQUEST['admin_email'];\n\t\t$admin_pass = $_REQUEST['admin_pass'];\n\t\tif (!empty($admin_email) && !empty($admin_pass)) {\n\t\t\t$records_user = $this -> conn -> get_table_field_doubles('pg_track_admin', 'admin_email', $admin_email, 'admin_password', md5($admin_pass));\n\t\t\tif (!empty($records_user)) {\n\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid login id and password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'admin_email' => $admin_email, 'admin_pass' => $_REQUEST['admin_pass']);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function authLogin() {\n\t\tif($this->input->post()) {\n\t\t\t$user = $this->input->post('username');\n\t\t\t$pass = $this->input->post('upassword');\n\t\t\t$login = $this->m_user->checkLogin($user, $pass);\n\t\t\tif($login) {\n\t\t\t\t$output = array('success' => true, 'login' => $login);\n\t\t\t\t$this->session->set_userdata('u_login', $login);\n\t\t\t\t$this->session->set_userdata('u_name', $login->username);\n\t\t\t\t$this->session->set_userdata('u_level', $login->level);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t} else {\n\t\t\t\t$output = array('success' => false, 'login' => null);\n\t\t\t\treturn $this->m_user->json($output);\n\t\t\t}\n\t\t}\n\t}", "public function login_post()\n\t{\n\t\t$array['username'] = strtolower($this->post('username'));\n\t\t$array['password'] = hash('sha512', $this->post('password'));\n\n\t\t$error = [];\n\n\t\tif (filter_var($array['username'], FILTER_VALIDATE_EMAIL) \n\t\t\tOR preg_match('/^[A-Za-z][A-Za-z0-9]{5,100}$/', $array['username'])) {\n\n\t\t\tif (empty($array['username'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Username is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else if (empty($array['password'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Password is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else {\n\t\t\t\t$data = $this->api_model->login($array);\n\t\t\t\t$auth_code = $this->createAuthorizationCode($data->id);\n\t \t$is_auth_code_valid = (new Authorization_codes_model)->isValid($auth_code->code);\n\t\t if (!$is_auth_code_valid) {\n\t\t $this->response(['status' => FALSE, 'error' => ['Invalid Authorization Code.']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t }\n\n\t \t$accesstoken = $this->createAccesstoken($auth_code->code);\n\n\t\t\t\tif (empty($data)) {\n\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Username or password is incorrect']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t} else {\n\t\t\t\t\t$result = array(\n\t\t\t\t\t\t'user_id' => (int) $data->id,\n\t\t\t\t\t\t'username' => $data->username,\n\t\t\t\t\t\t'email' => $data->email,\n\t\t\t\t\t\t'access_token' => $accesstoken->token,\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->response(['status' => TRUE, 'message' => 'Login successful.', 'user_details' => $result], REST_Controller::HTTP_OK);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$error[] = 'Invalid username format.';\n\t\t\t$this->response(['status' => FALSE, 'error' => $error], REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "public function login($userName, $password);", "function testSimpleLoginRequest() {\n $Record = $this->RecordObj->create(array('active'=>1));\n $this->AuthwellUser->create();\n $this->assertTrue($this->AuthwellUser->save($Record));\n #debug($this->AuthwellUser->invalidFields());\n\n // then call\n $FormData = array(\n 'AuthwellUser' => array(\n 'email_login' => $Record['email'],\n 'password_login' => $Record['password']\n )\n );\n\n $is_logged_in = $this->AuthwellUser->is_valid_login_request($FormData);\n $Cache = $this->AuthwellUser->UserDataCache;\n\n $this->assertTrue($is_logged_in);\n $this->assertEqual($Cache['User']['email'], $Record['email']);\n }", "protected function login() {\n\t\t\t\n\t\t\t// Generate the login string\n\t\t\t$loginString = str_replace( array('{USER}', '{PASS}'), array( $this->user, $this->pass), $this->loginString );\n\t\t\t\n\t\t\t// Send the login data with curl\n\t\t\t$this->c->{$this->loginMethod}($this->loginUrl, $loginString);\n\t\t\t\n\t\t\t// Check if the login worked\n\t\t\tif($this->is_logged_in()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tdie('Login failed');\n\t\t\t}\n\t\t\t\n\t\t}", "public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }", "public function loginAction() {\n $auth = $this->app->container[\"settings\"][\"auth\"];\n\n // Note: There is no point to check whether the user is authenticated, as there is no authentication\n // check for this route as defined in the config.yml file under the auth.passthrough parameter.\n\n $request = $this->app->request;\n $max_exptime = strtotime($auth[\"maxlifetime\"]);\n $default_exptime = strtotime($auth[\"lifetime\"]);\n $exptime = $default_exptime;\n\n if ( $request->isFormData() )\n {\n $username = $request->post(\"username\");\n $password = $request->post(\"password\");\n $exptime = self::getExpirationTime($request->post(\"expiration\"), $default_exptime, $max_exptime);\n }\n\n if ( preg_match(\"/^application\\\\/json/i\", $request->getContentType()) )\n {\n $json = json_decode($request->getBody(), true);\n if ( $json !== NULL )\n {\n $username = $json[\"username\"];\n $password = $json[\"password\"];\n $exptime = self::getExpirationTime(isset($json[\"expiration\"])?$json[\"expiration\"]:null, $default_exptime, $max_exptime);\n }\n }\n\n if ( empty($username) || empty($password) ) {\n $this->renderUnauthorized();\n return;\n }\n\n /**\n * @var \\PDO\n */\n $pdo = $this->app->getPDOConnection();\n $user = $pdo->select()\n ->from(\"tbl_user\")\n ->where(\"username\", \"=\", $username)\n ->where(\"password\", \"=\", sha1($password))\n ->where(\"status\", \">\", 0)\n ->execute()\n ->fetch();\n\n if ( empty($user) )\n {\n $this->renderUnauthorized();\n return;\n }\n\n $pdo->update(array(\"lastlogin_time\"=>gmdate(\"Y-m-d H:i:s\")))\n ->table(\"tbl_user\")\n ->where(\"id\", \"=\", $user[\"id\"])\n ->execute();\n\n $this->app->setAuthData(Factory::createAuthData($user, $exptime));\n\n $this->render(200);\n }", "public function login()\n {\n $authorized = $this->authorize( $_POST );\n if( !empty( $authorized ) && $authorized !== false ){\n $this->register_login_datetime( $authorized );\n ( new Events() )->trigger( 1, true );\n } else {\n ( new Events() )->trigger( 2, true );\n }\n }", "public function login(){\n\t\t\tValidator::validateOrRedirect($_POST,\n\t\t\t\t\t[\n\t\t\t\t\t\t\t\"required\" => [\"txt-input\", \"password\",\"action\"],\n\t\t\t\t\t\t\t\"email\" => \"txt-input\",\n\t\t\t\t\t],\n\t\t\t\t\t\"/login\");\n\t\t\t$this->resetMessage();\n\t $username=$_POST[\"txt-input\"];\n\t $password=$_POST[\"password\"];\n\t $action=$_POST[\"action\"];\n\t\t\t$userList =[];\n\t\t\t$column_value=array('email'=>$username,'password'=>$password);\n\t\t\t$uss=new User();\n\t\t\t$login=$uss->getBy($column_value);\n\t\t\tif (is_array($login)) {\n\t\t\t\tif (count($login)>0) {\n\t\t\t\t\tforeach ($login as $user)\n\t\t\t {\n\t\t\t\t\t\t$userList[]= array(\n\t\t\t 'user' =>$user['user_name'],\n\t\t\t 'email' =>$user['email'],\n\t\t\t 'password' =>$user['password']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$user=$userList[0][\"email\"];\n\t\t $pass=$userList[0][\"password\"];\n\t\t Redirect::to(\"/products\")->with([\n\t\t 'name'=>$userList[0][\"email\"],\n\t\t 'check'=>\"true\",\n\t\t ])->do();\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\tRedirect::to(\"/login\")->with([\n\t\t \"message\" => \"Ha ocurrido un error: usuario o contraseña incorrectos.</br> Revise por favor\",\n\t\t \"type\" => \"danger\",\n\t\t ])\n\t\t ->do();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\tRedirect::to(\"/login\")->with([\n\t \"message\" => $login,\n\t \"type\" => \"danger\",\n\t ])\n\t ->do();\n\t\t\t}\n\t }", "abstract public function login(array $input);", "public function login($username, $password, $token);", "abstract protected function loginImpl(string $username, string $password): bool;", "private function _logUserIn($inputs)\n\t{\n\t\tCraft::log('Logging in user.');\n\n\t\tif (craft()->userSession->login($inputs['username'], $inputs['password']))\n\t\t{\n\t\t\tCraft::log('User logged in successfully.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCraft::log('Could not log the user in.', LogLevel::Warning);\n\t\t}\n\t}", "function user_login($username,$password,$redirect='/'){\n\t$app = \\Jolt\\Jolt::getInstance();\n\t$user = $app->db->findOne('user', array('login'=>$username) );\n\tif( $user['pass'] == passhash($password) ){\n\t\t$app->store( \"user\",$user['_id'] );\n\t\t$app->redirect( $redirect );\n\t}else{\n\t\t$app->redirect( $app->getBaseUri().'/login');\n\t}\n\n}", "public function login() \n { \n $conf = $GLOBALS['CONF'];\n \n if (!$conf)\n { \n $conf = new Ossim_conf();\n $GLOBALS['CONF'] = $conf;\n } \n \n $version = $conf->get_conf('ossim_server_version');\n if ($conf->get_conf('login_enable_otp') == 'yes')\n {\n $login_method = 'otp';\n }\n else\n {\n ($conf->get_conf('login_enable_ldap') == 'yes') ? 'ldap' : 'pass'; // Login method is OTP, LDAP or PASSWORD\n }\n \n $conn = $this->conn;\n $orig_pass = $this->pass;\n \n $pass = (preg_match('/^[A-Fa-f0-9]{32}$/',$this->pass) && $this->external) ? $this->pass : md5($this->pass); //Used in Wizard Scheduler and Remote Interfaces\n $login = $this->login;\n \n \n $params1 = array($login); \n $query_1 = 'SELECT * FROM users WHERE login = ?'; \n \n $rs_1 = $conn->Execute($query_1, $params1);\n \n if (!$rs_1->EOF) \n {\n // Specific login method for Admin\n if ($rs_1->fields['login_method'] == 'pass' || $login == AV_DEFAULT_ADMIN) \n { \n $login_method = 'pass'; \n }\n }\n \n unset($query_1, $rs_1, $params1); \n \n $query = \"SELECT *, HEX(uuid) AS uuid FROM users WHERE login = ? AND pass = ?\";\n $params = array($login, $pass);\n $rs = $conn->Execute($query, $params); \n \n //Case 1: Login method is 'pass' or external process(AV Report Scheduler or Remote Interface) are trying to log in the system\n if (($login_method != 'ldap' || preg_match('/^[A-Fa-f0-9]{32}$/',$this->pass)) && (!$rs->EOF)) \n { \n //Generate a new session identifier\n session_regenerate_id(); \n $_SESSION['_user_language'] = $rs->fields['language'];\n $_SESSION['_is_admin'] = $rs->fields['is_admin'];\n $_SESSION['_timezone'] = self::get_timezone($rs->fields['timezone']);\n \n //Get secure_id\n if (valid_hex32($rs->fields['uuid']) && $rs->fields['uuid'] != '0x0')\n {\n $_SESSION['_secureid'] = $rs->fields['uuid'];\n }\n else\n {\n self::set_secure_id($conn, $login, sha1($login.'#'.$pass));\n $_SESSION['_secureid'] = sha1($login.\"#\".$pass);\n }\n \n ossim_set_lang($rs->fields['language']);\n $this->allowed_menus = $this->allowedMenus($login);\n \n $_SESSION['_user'] = $login;\n $_SESSION['_remote_login'] = base64_encode(Util::encrypt($login.'####'.$pass, $conf->get_conf('remote_key')));\n $_SESSION['_allowed_menus'] = $this->allowed_menus;\n \n if (preg_match('/pro|demo/i',$version)) \n {\n $_SESSION['_version'] = 'pro';\n $_SESSION['_user_vision'] = Acl::get_user_vision($conn);\n } \n else \n {\n $_SESSION['_version'] = 'opensource';\n $_SESSION['_user_vision'] = self::get_user_vision($conn);\n }\n\n //License info \n $_license = self::get_system_license();\n $_SESSION['_exp_date'] = $_license['appliance']['expire'];\n $_SESSION['_max_devices'] = $_license['appliance']['devices'];\n\n\n //Update Last login date\n self::update_logon_try($login); \n \n Session_activity::insert($conn);\n \n if($login == 'admin' || intval($rs->fields['is_admin']) == 1)\n {\n $this->check_all_user_accounts($conn);\n }\n\n return TRUE;\n }\n \n \n //Case 2: LDAP Login\n if ($login_method == 'ldap' && self::login_ldap($login, $orig_pass)) \n {\n $params = array($login);\n $query = 'SELECT *, HEX(uuid) AS uuid FROM users WHERE login = ?';\n \n //Logged user exists in Database\n if (($rs = $conn->Execute($query, $params)) && ($rs->EOF)) \n { \n if($conf->get_conf('login_ldap_require_a_valid_ossim_user') == 'no')\n {\n //Create the user with default perms\n $timezone = trim(`head -1 /etc/timezone`);\n \n if (preg_match('/pro|demo/i',$version))\n {\n $perms = $conf->get_conf('login_create_not_existing_user_menu');\n $entities[] = $conf->get_conf('login_create_not_existing_user_entity');\n \n $error = self::insert($conn, $login, 'ldap', md5($orig_pass), $login, '', $perms, $entities, array(), array(), NULL , NULL, $conf->get_conf('language') ,0, $timezone, 0);\n }\n else\n { \n list($menu_perms, $perms_check) = self::get_default_perms($conn);\n $perms = array();\n \n foreach($menu_perms as $mainmenu => $menus) \n {\n foreach($menus as $key => $menu)\n {\n $perms[$key] = TRUE;\n }\n }\n \n $template_id = self::update_template($conn, $login.'_perms', $perms);\n \n $error = self::insert($conn, $login, 'ldap', md5($orig_pass), $login, '', $template_id, '', array(), array() , '', '', $conf->get_conf('language') ,0, $timezone, 0);\n } \n \n User_config::copy_panel($conn, $login);\n \n $rs = $conn->Execute($query, $params); //Get information for created user\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n //Password update. Necessary for AV Report Scheduler and Remote Interfaces (save last password in Database)\n self::change_pass($conn, $login, $orig_pass, NULL, FALSE);\n }\n\n $_SESSION['_user_language'] = $rs->fields['language'];\n $_SESSION['_is_admin'] = $rs->fields['is_admin'];\n $_SESSION['_timezone'] = self::get_timezone($rs->fields['timezone']);\n \n //Get secure_id\n if (valid_hex32($rs->fields['uuid']) && $rs->fields['uuid'] != '0x0')\n {\n $_SESSION['_secureid'] = $rs->fields['uuid'];\n }\n else\n {\n self::set_secure_id($conn, $login, sha1($login.'#'.$pass));\n $_SESSION['_secureid'] = sha1($login.'#'.$pass);\n }\n \n ossim_set_lang($rs->fields['language']);\n $this->allowed_menus = $this->allowedMenus($login);\n \n //Generate a new session identifier\n session_regenerate_id(); \n $_SESSION['_user'] = $login;\n $_SESSION['_remote_login'] = base64_encode(Util::encrypt($login.'####'.$pass, $conf->get_conf('remote_key')));\n $_SESSION['_allowed_menus'] = $this->allowed_menus;\n \n if (preg_match('/pro|demo/i',$version)) \n {\n $_SESSION['_version'] = 'pro';\n $_SESSION['_user_vision'] = Acl::get_user_vision($conn);\n } \n else \n {\n $_SESSION['_version'] = 'opensource';\n $_SESSION['_user_vision'] = self::get_user_vision($conn);\n }\n\n //License info \n $_license = self::get_system_license();\n $_SESSION['_exp_date'] = $_license['appliance']['expire'];\n $_SESSION['_max_devices'] = $_license['appliance']['devices'];\n\n \n //Update last login date\n self::update_logon_try($login); \n \n Session_activity::insert($conn);\n \n if($login == 'admin' || intval($rs->fields['is_admin']) == 1)\n {\n $this->check_all_user_accounts($conn);\n }\n \n return TRUE;\n }\n \n //Case 3: OTP Login\n if ($login_method == 'otp' && self::login_otp($login, $orig_pass)) \n {\n $params = array($login);\n $query = 'SELECT *, HEX(uuid) AS uuid FROM users WHERE login = ?';\n \n //Logged user doesn't exist in Database\n if (($rs = $conn->Execute($query, $params)) && ($rs->EOF)) \n { \n if($conf->get_conf('login_ldap_require_a_valid_ossim_user') == 'no')\n {\n //Create the user with default perms\n $timezone = trim(`head -1 /etc/timezone`);\n \n if (preg_match('/pro|demo/i',$version))\n {\n $perms = $conf->get_conf('login_create_not_existing_user_menu');\n $entities[] = $conf->get_conf('login_create_not_existing_user_entity');\n \n $error = self::insert($conn, $login, 'otp', md5($orig_pass), $login, '', $perms, $entities, array(), array(), NULL , NULL, $conf->get_conf('language') ,0, $timezone, 0);\n }\n else\n { \n list($menu_perms, $perms_check) = self::get_default_perms($conn);\n $perms = array();\n \n foreach($menu_perms as $mainmenu => $menus) \n {\n foreach($menus as $key => $menu)\n {\n $perms[$key] = TRUE;\n }\n }\n \n $template_id = self::update_template($conn, $login.'_perms', $perms);\n \n $error = self::insert($conn, $login, 'otp', md5($orig_pass), $login, '', $template_id, '', array(), array() , '', '', $conf->get_conf('language') ,0, $timezone, 0);\n } \n \n User_config::copy_panel($conn, $login);\n \n $rs = $conn->Execute($query, $params); //Get information for created user\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n //Password update. Necessary for AV Report Scheduler and Remote Interfaces (save last password in Database)\n self::change_pass($conn, $login, $orig_pass, NULL, FALSE);\n }\n\n $_SESSION['_user_language'] = $rs->fields['language'];\n $_SESSION['_is_admin'] = $rs->fields['is_admin'];\n $_SESSION['_timezone'] = self::get_timezone($rs->fields['timezone']);\n \n //Get secure_id\n if (valid_hex32($rs->fields['uuid']) && $rs->fields['uuid'] != '0x0')\n {\n $_SESSION['_secureid'] = $rs->fields['uuid'];\n }\n else\n {\n self::set_secure_id($conn, $login, sha1($login.'#'.$pass));\n $_SESSION['_secureid'] = sha1($login.'#'.$pass);\n }\n \n ossim_set_lang($rs->fields['language']);\n $this->allowed_menus = $this->allowedMenus($login);\n \n //Generate a new session identifier\n session_regenerate_id(); \n $_SESSION['_user'] = $login;\n $_SESSION['_remote_login'] = base64_encode(Util::encrypt($login.'####'.$pass, $conf->get_conf('remote_key')));\n $_SESSION['_allowed_menus'] = $this->allowed_menus;\n \n if (preg_match('/pro|demo/i',$version)) \n {\n $_SESSION['_version'] = 'pro';\n $_SESSION['_user_vision'] = Acl::get_user_vision($conn);\n } \n else \n {\n $_SESSION['_version'] = 'opensource';\n $_SESSION['_user_vision'] = self::get_user_vision($conn);\n }\n\n //License info \n $_license = self::get_system_license();\n $_SESSION['_exp_date'] = $_license['appliance']['expire'];\n $_SESSION['_max_devices'] = $_license['appliance']['devices'];\n\n \n //Update last login date\n self::update_logon_try($login); \n \n Session_activity::insert($conn);\n \n if($login == 'admin' || intval($rs->fields['is_admin']) == 1)\n {\n $this->check_all_user_accounts($conn);\n }\n \n return TRUE;\n }\n\n return FALSE;\n }", "function login() {\n\n\t\t//$email = $this -> _request['user_email'];\n\t\t$u_password = $this -> _request['user_password'];\n\t\t$password = $this -> _request['user_password'];\n\t\t$login_id = $this -> _request['login_id'];\n\n\t\t// Input validations\n\t\tif (!empty($login_id) && !empty($password)) {\n\t\t\t$mobile = $login_id;\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t$verify_status = $records[0]['user_mobile_verify_status'];\n\t\t\t$mob = $records[0]['user_contact_no'];\n\t\t\t$id_user = $records[0]['user_id'];\n\t\t\tif (!empty($records)) {\n\n\t\t\t\t$records_user = $this -> conn -> get_table_field_doubles('user', 'user_contact_no', $mobile, 'user_password', md5($password));\n\t\t\t\tif (!empty($records_user)) {\n\t\t\t\t\t$status = $records_user[0]['user_status'];\n\t\t\t\t\tif ($status == '1') {\n\t\t\t\t\t\tif ($verify_status == '1') {\n\n\t\t\t\t\t\t\t$pin_status = $records_user[0]['user_pin_status'];\n\t\t\t\t\t\t\t$reffer_code = $records_user[0]['user_refferal_code'];\n\t\t\t\t\t\t\t$user_id = $records_user[0]['user_id'];\n\t\t\t\t\t\t\t$user_mobile = $records_user[0]['user_contact_no'];\n\t\t\t\t\t\t\t$user_email = $records_user[0]['user_email'];\n\t\t\t\t\t\t\t$user_name = $records_user[0]['user_name'];\n\t\t\t\t\t\t\t$wallet_amount = $records_user[0]['wallet_amount'];\n\t\t\t\t\t\t\t$profile_pic = $records_user['0']['user_profile_pic'];\n\t\t\t\t\t\t\t$user_password = $records_user['0']['user_password'];\n\t\t\t\t\t\t\tif (!empty($profile_pic)) {\n\t\t\t\t\t\t\t\t$img = self_img_url . $profile_pic;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$img = '';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\", 'user_id' => $user_id, 'user_status' => $status, 'user_name' => $user_name, 'wallet_amount' => $wallet_amount, 'user_profile_pic' => $img, 'user_email' => $user_email, 'user_password' => $u_password, 'mobile' => $user_mobile, 'login_type' => 1, 'user_pin_status' => $pin_status, 'refferal_code' => $reffer_code);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$token = $this -> send_code($mob);\n\t\t\t\t\t\t\t$data['user_verified_code'] = $token;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $id_user, $data);\n\t\t\t\t\t\t\t$post = array('status' => \"not_verify\", \"message\" => \"User Mobile verification pending\", 'mobile' => $mob);\n\t\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Account Inactive by admin, please contact to OyaCahrge\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t}\n\t\t\t} elseif (empty($records)) {\n\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_email', $login_id);\n\t\t\t\t$verify_status = $records[0]['user_mobile_verify_status'];\n\t\t\t\t$mob = $records[0]['user_contact_no'];\n\t\t\t\t$id_user = $records[0]['user_id'];\n\t\t\t\tif (!empty($records)) {\n\n\t\t\t\t\t$records_user = $this -> conn -> get_table_field_doubles('user', 'user_email', $login_id, 'user_password', md5($password));\n\t\t\t\t\tif (!empty($records_user)) {\n\t\t\t\t\t\t$status = $records_user[0]['user_status'];\n\t\t\t\t\t\tif ($status == '1') {\n\t\t\t\t\t\t\tif ($verify_status == '1') {\n\n\t\t\t\t\t\t\t\t$pin_status = $records_user[0]['user_pin_status'];\n\t\t\t\t\t\t\t\t$user_id = $records_user[0]['user_id'];\n\t\t\t\t\t\t\t\t$reffer_code = $records_user[0]['user_refferal_code'];\n\t\t\t\t\t\t\t\t$user_name = $records_user[0]['user_name'];\n\t\t\t\t\t\t\t\t$user_mobile = $records_user[0]['user_contact_no'];\n\t\t\t\t\t\t\t\t$wallet_amount = $records_user[0]['wallet_amount'];\n\t\t\t\t\t\t\t\t$profile_pic = $records_user['0']['user_profile_pic'];\n\t\t\t\t\t\t\t\t$user_email = $records_user[0]['user_email'];\n\t\t\t\t\t\t\t\t$user_password = $records_user['0']['user_password'];\n\t\t\t\t\t\t\t\tif (!empty($user_profile_pic)) {\n\t\t\t\t\t\t\t\t\t$img = $path . $user_profile_pic;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$img = 'No image';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Login Successfully\", 'user_id' => $user_id, 'user_status' => $status, 'user_name' => $user_name, 'wallet_amount' => $wallet_amount, 'profile_pic' => $img, 'user_email' => $user_email, 'user_password' => $u_password, 'mobile' => $user_mobile, 'login_type' => 1, 'user_pin_status' => $pin_status, 'refferal_code' => $reffer_code);\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$token = $this -> send_code($mob);\n\t\t\t\t\t\t\t\t$data['user_verified_code'] = $token;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $id_user, $data);\n\t\t\t\t\t\t\t\t$post = array('status' => \"not_verify\", \"message\" => \"User Mobile verification pending\", 'mobile' => $mob);\n\n\t\t\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Account Inactive by admin, please contact to OyaCahrge\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Invalid Login ID or Password\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Login ID and Password are Required\", 'login_id' => $login_id, 'user_password' => $user_password);\n\t\t\t// $this->response($this->json($error), 400);\n\n\t\t}\n\t\techo $this -> json($post);\n\t}", "private function json_login()\n {\n $msg = \"Invalid Request. Email and Password Required\";\n $status = 400;\n $token = null;\n $input = json_decode(file_get_contents(\"php://input\"));\n\n if ($input) {\n\n if (isset($input->email) && isset($input->password)) {\n $query = \"SELECT userID, username, email, password FROM Users WHERE email LIKE :email\";\n $params = [\"email\" => $input->email];\n $res = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n $password = ($res['count']) ? $res['data'][0]['password'] : null;\n if (password_verify($input->password, $password)) {\n $msg = \"User Authorised. Welcome \" . $res['data'][0]['email'];\n $status = 200;\n\n $token = array();\n $token['email'] = $input->email;\n $token['email'] = $res['data'][0]['email'];\n $token['userID'] = $res['data'][0]['userID'];\n $token['username'] = $res['data'][0]['username'];\n $token['iat'] = time();\n $token['exp'] = time() + (60 + 60);\n\n $jwtkey = JWTKEY;\n $token = \\Firebase\\JWT\\JWT::encode($token, $jwtkey);\n\n } else {\n $msg = \"Email or Password is Invalid\";\n $status = 401;\n }\n }\n }\n\n return json_encode(array(\"status\" => $status, \"message\" => $msg, \"token\" => $token));\n }", "public function loginUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n\n // Check email\n if (!$email) {\n $this->showLoginForm(['Please enter email']);\n }\n // Check password\n if (!$password) {\n $this->showLoginForm(['Please enter password']);\n }\n\n // Check user exist and then password\n $user = $this->getUser($email);\n $password = md5($password);\n if (!$user || $password !== $user['password']) {\n $this->showLoginForm(['Error on login']);\n }\n\n // Save login details to cookies\n if (!defined('APP_USERS_COOKIES_EMAIL')\n || !defined('APP_USERS_COOKIES_PASSWORD')) {\n $this->showLoginForm(['Error on login']);\n }\n setcookie(APP_USERS_COOKIES_EMAIL, $email);\n setcookie(APP_USERS_COOKIES_PASSWORD, $password);\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_login']);\n }", "public function doLogin()\r\n {\r\n $input = Request::all();\r\n \r\n if (Auth::attempt(['username' => $input['email'], 'password' => $input['password'], 'deleted_at' => null, 'user_type' => 1]))\r\n {\r\n \r\n $user = Auth::user();\r\n Session::set('current_user_id',$user->id);\r\n return Redirect::intended('/dashboard');\r\n }\r\n else { \r\n Session::flash(\r\n 'systemMessages', ['error' => Lang::get('pages.login.errors.wrong_credentials')]\r\n );\r\n return Redirect::action('UserController@login')\r\n ->withInput(Request::except('password'));\r\n }\r\n }", "public function login() {\r\n $email = filter_input(INPUT_POST, \"email\");\r\n $password = filter_input(INPUT_POST, \"p\");\r\n\r\n if (isset($email, $password) && $email !== false && $password !== false) {\r\n\r\n if ($this->auth->login($email, $password)) {\r\n echo json_encode(\"ok\");\r\n return true;\r\n }\r\n }\r\n echo json_encode(\"zle prihlasovacie udaje\");\r\n return false;\r\n }", "public function executeLogin()\n {\n }", "function doLogin($d){ ///email|password\n $dataArr = explode(\"|\",$d);\n $response = getLoginData($dataArr[0],$dataArr[1]);\n \n if($response === 'null'){\n echo(\"Login Fail\");\n }else{\n echo(\"Login Success\");\n }\n \n }", "public function loginUser()\r\n {\r\n $req = $this->login->authenticate($this->user);\r\n $req_result = get_object_vars($req);\r\n print(json_encode($req_result));\r\n }", "public function p_login() {\n\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\n\t# Search the db for this email and password\n\t# Retrieve the token if it's available\n\t$q = \"SELECT token \n\t\tFROM users \n\t\tWHERE email = '\".$_POST['email'].\"' \n\t\tAND password = '\".$_POST['password'].\"'\";\n\t\n\t$token = DB::instance(DB_NAME)->select_field($q);\t\n\t\t\t\t\n\t# If we didn't get a token back, login failed\n\tif(!$token) {\n\t\t\t\n\t\t# Send them back to the login page\n\n\t\tRouter::redirect(\"/users/login/error\");\n\n\t\t\n\t# But if we did, login succeeded! \n\t} else {\n\t\t\t\n\t\t# Store this token in a cookie\n\t\t@setcookie(\"token\", $token, strtotime('+2 weeks'), '/');\n\t\t\n\t\tRouter::redirect(\"/users/profile\");\n\t\t\t\t\t\n\t}\n }", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->email,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $ipAddress=$_SERVER['REMOTE_ADDR'];\n $macAddr=false;\n\n #run the external command, break output into lines\n $arp=`arp -a $ipAddress`;\n $lines=explode(\"\\n\", $arp);\n\n #look for the output line describing our IP address\n foreach($lines as $line)\n {\n $cols=preg_split('/\\s+/', trim($line));\n if ($cols[0]==$ipAddress)\n {\n $macAddr=$cols[1];\n }\n }\n /////\n $ipaddress = '';\n if (getenv('HTTP_CLIENT_IP'))\n $ipaddress = getenv('HTTP_CLIENT_IP');\n else if(getenv('HTTP_X_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_X_FORWARDED_FOR');\n else if(getenv('HTTP_X_FORWARDED'))\n $ipaddress = getenv('HTTP_X_FORWARDED');\n else if(getenv('HTTP_FORWARDED_FOR'))\n $ipaddress = getenv('HTTP_FORWARDED_FOR');\n else if(getenv('HTTP_FORWARDED'))\n $ipaddress = getenv('HTTP_FORWARDED');\n else if(getenv('REMOTE_ADDR'))\n $ipaddress = getenv('REMOTE_ADDR');\n else\n $ipaddress = 'UNKNOWN';\n\t\t\t\n\t\t\t\t$check = AcUsers::model()->findByAttributes(array('email'=>$this->username));\n\t\t\t\t$user_id = $check->userUuid;\n\n\t\t\t\t// This is the mac Address Logger tab\n $uid = uniqid('', true);\n $log = new AcUserSignIn();\n $log->userSignInUuid = $uid;\n $log->userUuid = $user_id;\n $log->macAddress = $macAddr;\n $log->ipAddress = $ipaddress ;\n if (!empty($log)) {\n $log->save(false);\n\n }\n $this->id_catcher = $uid;\n\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function AdminLogin(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $username = $_POST['email'];\n $password = $_POST['password'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($username) && !empty($password)){\n $res->admin_login($username, $password, $conn);\n $this->dbClose();\n }\n else{\t\n $this->dbClose();\n $error = array('status' => \"0\", \"msg\" => \"Fill Both Fields !!\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }", "function normalLogin($POSTdata) {\n \n //Init variables\n $uname = null;\n $upass = null;\n $umail = null;\n $uid = null;\n $error = array();\n $data = array();\n $output = array();\n \n /*\n ==========================\n 1° step : get/validate data\n ===========================\n */\n //Get usermail\n if(isset($POSTdata['usermail']))\n $umail = $POSTdata['usermail'];\n else $error[] = 'No usermail';\n\n if($umail)\n if(!Validate::isEmail($umail))\n $error[] = 'Invalid usermail';\n \n //Get password\n if(isset($POSTdata['userpassword']))\n $upass = $POSTdata['userpassword'];\n else $error[] = 'No userpassword';\n \n if($upass)\n if(!Validate::isPasswd($upass))\n $error[] = 'Invalid password';\n \n if(sizeof($error)) {\n $output['success'] = 'invalid fields';\n print json_encode($output);\n exit();\n }\n \n \n /*\n ======================\n 2° step : handle data\n ======================\n */\n $data = Db::q('SELECT * FROM '._DB_PREFIX_.'users WHERE playermail = \"'.mysql_escape_string($umail).'\" AND playerpassword = \"'.md5($upass).'\" LIMIT 1');\n if(!sizeof($data)) {\n $output['success'] = 'invalid user 1';\n print json_encode($output);\n die();\n }\n \n if($data[0]['playernick']) \n $output['success'] = 'success';\n else\n {\n $output['success'] = 'invalid user 2';\n print json_encode($output);\n die();\n }\n \n //Start session\n $_SESSION['playernick'] = $data[0]['playernick'];\n $_SESSION['playerid'] = $data[0]['id'];\n $_SESSION['playermail'] = $umail;\n $_SESSION['ltype'] = 'normal';\n \n //Return data\n print json_encode($output);\n die();\n}", "public function login(array $data)\r\n {\r\n if ( array_key_exists('identity', $data) && !empty($data['identity']) ){\r\n $identity = $data['identity'];\r\n }else{\r\n return array('identity'=>'This field is required');\r\n }\r\n\r\n if ( array_key_exists('credential', $data) && !empty($data['credential']) ){\r\n $credential = $data['credential'];\r\n }else{\r\n return array('credential'=>'This field is required');\r\n }\r\n\r\n if ( $identity && $credential ){\r\n $model = Module::locator()->get('ze-auth-model_user');\r\n $identity_type = Module::getOption('identity_type');\r\n switch($identity_type){\r\n case 'username':\r\n $mapper = $model->getByUsername($identity);\r\n break;\r\n case 'email_address':\r\n $mapper = $model->getByEmailAddress($identity);\r\n break;\r\n default:\r\n if ( strpos($identity,'@') === false ){\r\n $mapper = $model->getByUsername($identity);\r\n } else {\r\n $mapper = $model->getByEmailAddress($identity);\r\n }\r\n break;\r\n }\r\n if (!$mapper){\r\n return array('identity'=>'Invalid identity specified');\r\n }\r\n $salt = $mapper->getPasswordSalt();\r\n $password = $mapper->getPassword();\r\n\r\n if (!$this->_isValidCredential($password, $salt, $credential)){\r\n return array('credential'=>'Invalid credential specified');\r\n }\r\n $result = new AuthenticationResult(AuthenticationResult::SUCCESS,$identity);\r\n $session = new AuthenticationSession();\r\n $session->write($result);\r\n }\r\n return true;\r\n }", "public function login() {\n\t\tif(!empty(Session::get('http_response'))) {\n\t\t\thttp_response_code(Session::get('http_response'));\n\t\t\tSession::delete('http_response');\n\t\t}\n\t\tif($_POST && isset($_POST['login']) && isset($_POST['password'])) {\n\t\t\t$user = $this->_model->getLogin(strtolower($_POST['login']));\n\t\t\tif($user && $user->enabled) {\n\t\t\t\tif(hash_equals($user->password,crypt($_POST['password'],$user->password))) {\n\t\t\t\t\tif($user->blocked) {\n\t\t\t\t\t\thttp_response_code(403);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is blocked\"));\n\t\t\t\t\t} elseif($user->verified) {\n\t\t\t\t\t\tSession::set('user',$user);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'success','icon'=>'check','text'=>\"User has logged in successfully\"));\n\t\t\t\t\t\t$redirect = Session::get('login_redirect');\n\t\t\t\t\t\tRouter::redirect(Session::get('login_redirect'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\t\tSession::setMessage(array('alert'=>'warning','icon'=>'exclamation','text'=>\"User is not yet confirmed\"));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thttp_response_code(401);\n\t\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thttp_response_code(401);\n\t\t\t\tSession::setMessage(array('alert'=>'danger','icon'=>'ban','text'=>\"Invalid login name or password\"));\n\t\t\t}\t\n\t\t}\n\t}", "public function login($params) {\r\n if($params['login'] && $params['password']) {\r\n return $this->user->login($params['login'], $params['password']);\r\n }\r\n return false;\r\n }", "function login_attempt() {\n $data = json_decode(file_get_contents(\"../dummyauth.json\"),true);\n if ($_POST['user'] === $data['login'] && password_verify($_POST[\"pass\"], $data['hash'])) {\n $_SESSION['authed'] = true;\n $_SESSION['actor'] = \"https://\". $_SERVER['HTTP_HOST'] . $data['actor'];\n $_SESSION['last_access'] = $_SERVER['REQUEST_TIME'];\n header('Location: index.php');\n exit();\n }\n}", "public function processLogin(): void;", "public function login()\n {\n }", "public function login()\n {\n }", "public function login($data)\n {\n $data['access_level'] = 2;\n $time = microtime();\n $key = Config::get('app.key');\n \n //these are the columns selected\n $columns = ['*'];\n\n $login_with = isset($data['use']) ? $data['use'] : 'email';\n\n if($this->validation->isValidForLogin($data)) {\n \n //$user = $this->authRepository->findByEmail($data, $columns);\n $user = $this->authRepository->findByUsername($data, $columns);\n\n\n if( empty($user) ) {\n return ['valid'=>false,'error'=>'Invalid Email or Password.'];\n }\n\n $user_id = $user->id;\n\n if( $this->hasher->check($data['password'], $user->getAuthPassword()) ) {\n\n $token = base64_encode((\"$time-$user_id-$key\") );\n\n\n $event_data = [\n 'user_id' => $user_id,\n 'api_token' => $token,\n 'expired_at' => Carbon::now()->addDays(Config::get('app.expiration')),\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ];\n\n //fire the event \"auth.login\" this will register the API token details\n Event::fire('auth.login', [$event_data]);\n $this->authRepository->update(['status' => 1], $user_id);\n return ['valid' => true, 'token' => $token];\n } else {\n return ['valid'=>false,'error'=>'Invalid Email or Password.'];\n }\n\n } else {\n $errors = $this->validation->errors()->first();\n return ['valid'=>false,'error'=>$errors];\n }\n\n\n \n }", "public function handleLogin( ){\n\t\t// Filter allowed data\n\t\t$data = Request::only([ 'uid', 'password' ]);\n\n\t\t// Validate user input\n\t\t$validator = Validator::make(\n\t\t\t$data,\n\t\t\t[\n\t\t\t\t'uid' => 'required',\n\t\t\t\t'password' => 'required',\n\t\t\t]\n\t\t);\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$data[$key] = $this->sanitizeLDAP( $value );\n\t\t}\n\n\t\tif($validator->fails()){\n\t\t\t// If validation fails, send back with errors\n\t\t\treturn Redirect::route('login')->withErrors( $validator )->withInput( );\n\t\t}\n\n\t\tif( Auth::attempt( [ 'uid' => $data['uid'], 'password' => $data['password']], true ) ){\n\t\t\t// If login is successful, send them to home\n\t\t\treturn Redirect::route( 'home' );\n\t\t} else {\n\t\t\t// Otherwise, tell them they're wrong\n\t\t\treturn Redirect::route( 'login' )\n\t\t\t\t\t\t ->withErrors([ \n\t\t\t\t\t\t\t\t'message' => 'I\\'m sorry, that username and password aren\\'t correct.' \n\t\t\t\t\t\t\t]);\n\t\t}\n\n\t\treturn Redirect::route( 'login' )->withInput( );\n\t}", "public function user_login(Request $request) {\n\t\t$email = $request->get(\"username\");\n\t\t$password = $request->get(\"password\");\n\n\t\tif (Login::attempt(['email' => $email, 'password' => $password])) {\n\t\t\t$user = Login::user();\n\t\t\t$user->fcm_id = $request->get('fcm_id');\n\t\t\t$user->login_status = 1;\n\n\t\t\t$user->device_token = $request->get('device_token');\n\t\t\t$user->save();\n\t\t\t$data['success'] = 1;\n\t\t\t$data['message'] = \"You have Signed in Successfully!\";\n\t\t\tif ($user->user_type == \"C\") {\n\t\t\t\t$data['data'] = ['userinfo' => array(\"user_id\" => $user->id,\n\t\t\t\t\t\"api_token\" => $user->api_token,\n\t\t\t\t\t\"fcm_id\" => $user->getMeta('fcm_id'),\n\t\t\t\t\t\"device_token\" => $user->getMeta('device_token'),\n\t\t\t\t\t\"socialmedia_uid\" => $user->getMeta('socialmedia_uid'),\n\t\t\t\t\t\"user_name\" => $user->name,\n\t\t\t\t\t\"user_type\" => $user->user_type,\n\t\t\t\t\t\"mobno\" => $user->getMeta('mobno'),\n\t\t\t\t\t\"phone_code\" => $user->getMeta('phone_code'),\n\t\t\t\t\t\"emailid\" => $user->email,\n\t\t\t\t\t\"gender\" => $user->getMeta('gender'),\n\t\t\t\t\t\"password\" => $user->password,\n\t\t\t\t\t\"profile_pic\" => $user->getMeta('profile_pic'),\n\t\t\t\t\t\"status\" => $user->getMeta('login_status'),\n\t\t\t\t\t\"timestamp\" => date('Y-m-d H:i:s', strtotime($user->created_at)))];\n\t\t\t}\n\t\t\tif ($user->user_type == \"D\") {\n\t\t\t\tif ($user->vehicle_id != null) {\n\t\t\t\t\t$v = VehicleModel::find($user->vehicle_id);\n\t\t\t\t\t$vehicle = $v->license_plate;\n\t\t\t\t} else { $vehicle = \"\";}\n\t\t\t\t$data['data'] = ['userinfo' => array(\"user_id\" => $user->id,\n\t\t\t\t\t\"api_token\" => $user->api_token,\n\t\t\t\t\t\"fcm_id\" => $user->getMeta('fcm_id'),\n\t\t\t\t\t\"device_token\" => $user->getMeta('device_token'),\n\t\t\t\t\t\"socialmedia_uid\" => \"\",\n\t\t\t\t\t\"user_name\" => $user->name,\n\t\t\t\t\t\"user_type\" => $user->user_type,\n\t\t\t\t\t\"mobno\" => $user->getMeta('phone'),\n\t\t\t\t\t\"phone_code\" => $user->getMeta('phone_code'),\n\t\t\t\t\t\"emailid\" => $user->email,\n\t\t\t\t\t\"gender\" => $user->getMeta('gender'),\n\t\t\t\t\t\"password\" => $user->password,\n\t\t\t\t\t\"profile_pic\" => $user->getMeta('driver_image'),\n\t\t\t\t\t\"address\" => $user->getMeta('address'),\n\t\t\t\t\t\"id-proof\" => $user->getMeta('license_image'),\n\t\t\t\t\t\"id-proof-type\" => \"License\",\n\t\t\t\t\t\"vehicle-number\" => $vehicle,\n\t\t\t\t\t\"availability\" => $user->getMeta('is_available'),\n\t\t\t\t\t\"status\" => $user->getMeta('login_status'),\n\t\t\t\t\t\"timestamp\" => date('Y-m-d H:i:s', strtotime($user->created_at)))];\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$data['success'] = 0;\n\t\t\t$data['message'] = \"Invalid Login Credentials\";\n\t\t\t$data['data'] = \"\";\n\t\t}\n\n\t\treturn $data;\n\t}", "public function user_login(Request $request) {\n\t\t$email = $request->get(\"username\");\n\t\t$password = $request->get(\"password\");\n\n\t\tif (Login::attempt(['email' => $email, 'password' => $password])) {\n\t\t\t$user = Login::user();\n\t\t\t$user->fcm_id = $request->get('fcm_id');\n\t\t\t$user->login_status = 1;\n\n\t\t\t$user->device_token = $request->get('device_token');\n\t\t\t$user->save();\n\t\t\t$data['success'] = 1;\n\t\t\t$data['message'] = \"You have Signed in Successfully!\";\n\t\t\tif ($user->user_type == \"C\") {\n\t\t\t\t$data['data'] = ['userinfo' => array(\"user_id\" => $user->id,\n\t\t\t\t\t\"api_token\" => $user->api_token,\n\t\t\t\t\t\"fcm_id\" => $user->getMeta('fcm_id'),\n\t\t\t\t\t\"device_token\" => $user->getMeta('device_token'),\n\t\t\t\t\t\"socialmedia_uid\" => $user->getMeta('socialmedia_uid'),\n\t\t\t\t\t\"user_name\" => $user->name,\n\t\t\t\t\t\"user_type\" => $user->user_type,\n\t\t\t\t\t\"mobno\" => $user->getMeta('mobno'),\n\t\t\t\t\t\"phone_code\" => $user->getMeta('phone_code'),\n\t\t\t\t\t\"emailid\" => $user->email,\n\t\t\t\t\t\"gender\" => $user->getMeta('gender'),\n\t\t\t\t\t\"password\" => $user->password,\n\t\t\t\t\t\"profile_pic\" => $user->getMeta('profile_pic'),\n\t\t\t\t\t\"status\" => $user->getMeta('login_status'),\n\t\t\t\t\t\"timestamp\" => date('Y-m-d H:i:s', strtotime($user->created_at)))];\n\t\t\t}\n\t\t\tif ($user->user_type == \"D\") {\n\t\t\t\tif ($user->vehicle_id != null) {\n\t\t\t\t\t$v = VehicleModel::find($user->vehicle_id);\n\t\t\t\t\t$vehicle = $v->license_plate;\n\t\t\t\t} else { $vehicle = \"\";}\n\t\t\t\t$data['data'] = ['userinfo' => array(\"user_id\" => $user->id,\n\t\t\t\t\t\"api_token\" => $user->api_token,\n\t\t\t\t\t\"fcm_id\" => $user->getMeta('fcm_id'),\n\t\t\t\t\t\"device_token\" => $user->getMeta('device_token'),\n\t\t\t\t\t\"socialmedia_uid\" => \"\",\n\t\t\t\t\t\"user_name\" => $user->name,\n\t\t\t\t\t\"user_type\" => $user->user_type,\n\t\t\t\t\t\"mobno\" => $user->getMeta('phone'),\n\t\t\t\t\t\"phone_code\" => $user->getMeta('phone_code'),\n\t\t\t\t\t\"emailid\" => $user->email,\n\t\t\t\t\t\"gender\" => $user->getMeta('gender'),\n\t\t\t\t\t\"password\" => $user->password,\n\t\t\t\t\t\"profile_pic\" => $user->getMeta('driver_image'),\n\t\t\t\t\t\"address\" => $user->getMeta('address'),\n\t\t\t\t\t\"id-proof\" => $user->getMeta('license_image'),\n\t\t\t\t\t\"id-proof-type\" => \"License\",\n\t\t\t\t\t\"vehicle-number\" => $vehicle,\n\t\t\t\t\t\"availability\" => $user->getMeta('is_available'),\n\t\t\t\t\t\"status\" => $user->getMeta('login_status'),\n\t\t\t\t\t\"timestamp\" => date('Y-m-d H:i:s', strtotime($user->created_at)))];\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$data['success'] = 0;\n\t\t\t$data['message'] = \"Invalid Login Credentials\";\n\t\t\t$data['data'] = \"\";\n\t\t}\n\n\t\treturn $data;\n\t}", "public function login_action() \n\t{\n $rules = array(\n 'mail' => 'valid_email|required',\n 'pass' => 'required'\n );\n \n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n // they've passed the filter login try and log 'em in\n\t\tUserModel::login(); \n }", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}", "public function login()\n {\n// в качестве проверемого именпи можно использовать name или email\n $credentials = request(['email', 'password']);\n\n if (! $token = auth()->attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n\n $this->setBindExchangeRabbitMQ($credentials['email'], 'bind');\n return $this->respondWithToken($token);\n }", "public function login()\n {\n $strUsername = !empty($_POST['username']) ? $_POST['username'] : null;\n $strPassword = !empty($_POST['password']) ? $_POST['password'] : null;\n if( is_null($strUsername) || is_null($strPassword) )\n {\n header('HTTP/1.1 422 Unprocessable Entity');\n return ['error' => \"Both a username and a password are required.\"];\n }\n $oRet = $this->oUserModel->checkLogin($strUsername, $strPassword);\n if( $oRet->HasFailure() )\n {\n header('HTTP/1.1 403 Forbidden');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $_SESSION['user_id'] = $oRet->Get();\n $oRet = $this->oUserModel\n ->getUser(['user_id' => $oRet->Get()]);\n if( $oRet->HasFailure() )\n {\n unset($_SESSION['user_id']);\n header('HTTP/1.1 500 Internal Server Error');\n $aRet = ['error' => $oRet->GetError()];\n }\n else\n {\n $aRet = ['success' => true, 'user' => $oRet->Get()[0]];\n }\n }\n return $aRet;\n }", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "function login()\n {\n \t \t$data = file_get_contents('php://input');\n \t\t$this->logservice->log($this->module_name, \"DEBUG\",\"EVENT\",$this->IP,\"$data \");\n\t\t$busData = json_decode($data ,true);\n\t\t//查找该用户名与密码\n\t\t$criteria = array();\n\t\t$criteria[\"and\"] = array(\"Name\" => $busData[\"name\"],\"Password\" => $busData[\"password\"]);\n\t\t$userDat = $this->User->read($criteria);\n\t\tif (!empty($userDat)) {\n\t\t\t\t\n\t\t\t//更新用户的状态\n\t\t\t$data_in = array('Status' => 1);\n \t\t$upd_criteria['and'] = array('User_Id' => $userDat[0]['User_Id']);\n \t\t$result = $this->User->update($data_in, $upd_criteria);\n\t \tif($result !== false)\n\t \t{\n\t\t\t\t$rspData[\"userID\"] =$userDat[0][\"User_Id\"];\n\t\t\t\t$rspData[\"state\"] = \"OK\";\n\t\t\t\t$rspData[\"erroInfo\"] = \"登陆成功ID为\".$userDat[0][\"User_Id\"];\n\n\t\t\t\t$rspInfo = json_encode($rspData);\n\t\t\t\techo $rspInfo;\n\t\t }\n\n\t\t}\n }", "public function authentication(): void\n {\n $userData = $this->getValidated([\n 'name',\n 'password',\n ]);\n\n $user = $this->getUserByName($userData['name']);\n\n if (password_verify($userData['password'], $user->password)) {\n NotificationService::sendInfo('Hello! You are logged in as ' . $user->name);\n $_SESSION['name'] = $user->name;\n $this->redirect(APP_URL);\n }\n\n NotificationService::sendError('failed authentication!');\n $_SESSION['login_modal_show'] = ' show';\n $this->redirect(APP_URL);\n }", "protected function authLogin(){\n $in = \"AUTH LOGIN\" . $this->CRLF;\n fputs($this->smtp, $in, strlen($in));\n if ($this->getCode() != 334){\n return false;\n }\n $in = base64_encode($this->username) . $this->CRLF;\n fputs($this->smtp, $in, strlen($in));\n if ($this->getCode() != 334){\n return false;\n }\n $in = base64_encode($this->password) . $this->CRLF;\n fputs($this->smtp, $in, strlen($in));\n if ($this->getCode() != 235){\n return false;\n }\n return true;\n }", "public function login(string $email, string $password);", "public function login(){\n\n }", "public static function login()\n {\n (new Authenticator(request()))->login();\n }", "private function login(): bool\n {\n $options = [\n \\GuzzleHttp\\RequestOptions::JSON => [\n $this->email,\n $this->password,\n null,\n 'iOS 11.4.1',\n 'Movil',\n 'Aplicación móvil V. 15',\n '0',\n '0',\n '0',\n null,\n 'n',\n ],\n ];\n $response = $this->client->post(self::URI_LOGIN, $options);\n\n $this->isLogged = $response->getStatusCode() === 200 ? true : false;\n return $this->isLogged;\n }", "public function _check_login()\n {\n\n }", "public function login()\n\t{\n\t\t$mtg_login_failed = I18n::__('mtg_login_failed');\n\t\tR::selectDatabase('oxid');\n\t\t$sql = 'SELECT oxid, oxfname, oxlname FROM oxuser WHERE oxusername = ? AND oxactive = 1 AND oxpassword = MD5(CONCAT(?, UNHEX(oxpasssalt)))';\n\t\t$users = R::getAll($sql, array(\n\t\t\tFlight::request()->data->uname,\n\t\t\tFlight::request()->data->pw\n\t\t));\n\t\tR::selectDatabase('default');//before doing session stuff we have to return to db\n\t\tif ( ! empty($users) && count($users) == 1) {\n\t\t\t$_SESSION['oxuser'] = array(\n\t\t\t\t'id' => $users[0]['oxid'],\n\t\t\t\t'name' => $users[0]['oxfname'].' '.$users[0]['oxlname']\n\t\t\t);\n\t\t} else {\n\t\t\t$_SESSION['msg'] = $mtg_login_failed;\n\t\t}\n\t\t$this->redirect(Flight::request()->data->goto, true);\n\t}", "function login() {\n\n $this->visitPath('/user/login');\n\n $loginForm = $this->getSession()->getPage()->findById('user-login-form');\n if (is_null($loginForm)) {\n throw new ExpectationException('Cannot find the login form.', $this->getSession()->getDriver());\n }\n\n $usernameField = $loginForm->findById('edit-name');\n $passwdField = $loginForm->findById('edit-pass');\n\n if (is_null($usernameField) or is_null($passwdField)) {\n throw new ExpectationException('Cannot find the authentication fields.', $this->getSession()->getDriver());\n }\n\n $usernameField->setValue($this->admin_username);\n $passwdField->setValue($this->admin_passwd);\n $loginForm->submit();\n\n $this->assertSession()->elementNotExists('css', '.messages--error');\n }", "public function loginWithPassword() {\n \n // validate input\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('password', 'Passwort', 'required');\n $this->form_validation->set_rules('uuid', 'UUID', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n // load User\n $this->loadUser();\n\t\t\t\n // verify password\n\t\tif (! $this->verify_password()) {\n\t\t\t$this->error(404, 'Verification error');\n\t\t}\n\t\t\n \tif ($this->user_model->getValue('confirmed') == 0) {\n \t\t$this->sendConfirmationMail($this->input->post('email'));\n \t\t$this->error(206, 'Please confirm the account');\n \t}\t\t\n\t\t\n\t\t// refresh token\n\t\t$refresh_token = $this->generateToken();\n\t\t$this->user_model->setValue('refresh_token', $refresh_token);\n\t\t\n\t\t/*\n\t\tIf logging in from a new device for the first time, loadUser will set uuid to null,\n\t\tas there is no entry for the uuid in the db.\n\t\t*/\n\t\tif ($this->user_model->getValue('uuid') == null) {\n\t\t\t$this->user_model->setValue('uuid', $this->input->post('uuid'));\n\t\t\tif (! $this->user_model->insertToken()) {\n\t\t\t\t$this->error(400, 'Error while creating token');\n\t\t\t}\n\t\t} else {\n\t\t\tif (! $this->user_model->updateToken()) {\n\t\t\t\t$this->error(400, 'Error while creating token');\n\t\t\t}\n\t\t}\n\n\t\t// save userid into session and send token\n\t\t$this->session->userid = $this->user_model->getValue('id');\n\t\t$data['refresh_token'] = $refresh_token;\n\t\t$this->response($data);\n }", "public function login($user, $pass, $persistent);", "public function passwordlessLogin($request)\n {\n return $this->startAnonymous()->uri(\"/api/passwordless/login\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "function login()\n\t{\n\t\t$GLOBALS['appshore']->session->createSession();\n\n\t\t$GLOBALS['appshore_data']['layout'] = 'auth';\n\t\t\n\t\t// define next action\n\t\t$result['action']['auth'] = 'login';\n\n\t\t// if a query_string was passed without being auth we keep it to deliver it later\n\t\tif( strpos( $_SERVER[\"QUERY_STRING\"], 'op=') !== false )\n\t\t\t$result['nextop'] = base64_encode($_SERVER[\"QUERY_STRING\"]);\n\t\t\t\n\t\treturn $result;\n\t}", "function login($username, $authtoken) {\n\t\t$this->login = ( $this->send(\"login $username\\npk=$authtoken\\n\\0\") ? true : true );\n\t}", "function loginHandler($inputs = []) {\n $username = $inputs['username'];\n $password = $inputs['password'];\n $sql = 'SELECT * FROM `admin` WHERE `name` = ? AND password = ?';\n $res = getOne($sql, [$username, $password]);\n if (!$res) {\n formatOutput(false, 'username or password error');\n }\n else{\n $buildingRes = getOne(\"SELECT * FROM `admin_building` WHERE admin_id =?\", [$res['id']]);\n $bid = isset($buildingRes['building_id']) ? $buildingRes['building_id'] : '0';\n setLogin($res['id'],$bid);\n formatOutput(true, 'login success', $res);\n }\n}", "public function login(){\n\t\t//$this->output->enable_profiler(TRUE);\n\n\t\tif (($emailId = $this->input->get_post('emailId')) && ($password = $this->input->get_post('password'))) {\n \n $data = array(\n 'email' => $emailId,\n 'password' => $password\n );\n \n $ret = $this->Lootel_model->login($data);\n \n if($ret){\n\t\t\t\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not found\");\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\techo json_encode($response);\n\t\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function usersLogin() {\n // login uses its own handle\n $httpLogin = $this->_prepareLoginRequest();\n $url = $this->_appendApiKey($this->uriBase . '/users/login.json');\n $data = array('login' => $this->username, 'password' => $this->password);\n return $this->_processRequest($httpLogin, $url, 'post', $data);\n }", "public function access() {\n \tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n \t\t$user = Auth::login($_POST['email'], $_POST['pw']);\n \t\tif($user) {\n \t\t\tApp::redirect('dashboard');\n \t\t}\n\t\t\tSession::set('_old_input', $_POST);\n\t\t\tSession::set('_errors', ['login' => \"Email y/o password incorrectos.\"]);\n\t\t\tApp::redirect('login');\n\n \t}\n\n }", "public function login()\n\t{\n\t\t//Compute the hash code of the password submited by user\n\t\t$user_password_hash = $this->passwordEncrypt($this->user_info['user_password']);\n\t\t\n\t\t//Do datebase query to get the hash code of the password\n\t\t$db = BFL_Database :: getInstance();\n\t\t$stmt = $db->factory('select `user_id`,`user_password` from '.DB_TABLE_USER.' WHERE `user_name` = :user_name');\n\t\t$stmt->bindParam(':user_name', $this->user_info['user_name']);\n\t\t$stmt->execute();\n\t\t$rs = $stmt->fetch();\n\t\tif (empty($rs))\n\t\t\tthrow new MDL_Exception_User_Passport('user_name');\n\t\t\n\t\tif ($rs['user_password'] != $user_password_hash)\n\t\t\tthrow new MDL_Exception_User_Passport('user_password');\n\n\t\t//Set user session\n\t\t$auth = BFL_ACL :: getInstance();\n\t\t$auth->setUserID($rs['user_id']);\n\t}", "public function login_post() {\n $email = $this->post('email');\n $password = $this->post('password');\n \n // Validate the post data\n if(!empty($email) && !empty($password)){\n \n // Check if any LoginModel exists with the given credentials\n $con['returnType'] = 'single';\n $con['conditions'] = array(\n 'email' => $email,\n 'password' => md5($password),\n 'status' => 1\n );\n $LoginModel = $this->LoginModel->getRows($con);\n \n if($LoginModel){\n // Set the response and exit\n $this->response([\n 'status' => TRUE,\n 'message' => 'LoginModel login successful.',\n 'data' => $LoginModel\n ], REST_Controller::HTTP_OK);\n }else{\n // Set the response and exit\n //BAD_REQUEST (400) being the HTTP response code\n $this->response(\"Wrong email or password.\", REST_Controller::HTTP_BAD_REQUEST);\n }\n }else{\n // Set the response and exit\n $this->response(\"Provide email and password.\", REST_Controller::HTTP_BAD_REQUEST);\n }\n }", "public function login($data){\r\n\r\n return $this->check_login($data);\r\n\r\n }", "public function login($params) {\n \t$response = $this->requestApi->callAPI('POST', $this->requestUrl('/auth/login'), $params);\n \treturn $response;\n\t}", "public function test_login4()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('12345678','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function login()\n {\n $user = $this->repository->findBy(\n 'email',\n $this->request->input('email')\n );\n if(empty($user)) {\n throw new AuthException(\"These credentials do not match our records.\");\n }\n\n if(app('hash')->check($this->request->input('password'), $user->password)) {\n return $this->respondSuccess([\n 'data' => [\n 'token' => $this->jwt($user->toArray())\n ]\n ]);\n }\n\n throw new AuthException(\"These credentials do not match our records.\");\n\n }", "function login(){\r\n\t\tif(!isset($_POST['username']) || !isset($_POST['password']) ){\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid Request\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//sanitize \r\n\t\t$username = $_POST['username'];\r\n\t\t$password = $_POST['password'];\r\n\t\t\r\n\t\t//query database\r\n\t\t$user = Doo::db()->getOne('Users', array('where' => \"username =:username\", 'param' => array(':username' => $username)));\r\n\t\t//$user = Doo::db()->getOne('Users', array('where' => 'username = \\'' . $username . '\\' '));\r\n\t\t\r\n\t\t//check for result row\r\n\t\tif(empty($user)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid username and/or password. Note: Both fields are case sensitive\";\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//see if user is blocked\r\n\t\tif(!$user->is_enabled) {\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"User is blocked. Contact your administrator\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//compare hash values\r\n\t\tif($user->password === md5($password)) {\r\n\t\t\r\n\t\t\tsession_start();\r\n\t\t\tsession_regenerate_id();\r\n\t\t\tunset($_SESSION['user']);\r\n\t\t\t\t\r\n\t\t\t//save user session vars\r\n\t\t\t$_SESSION['user'] = array(\r\n\t\t\t\t\t\t\t\t\t'id' \t\t\t=> $user->id, \r\n\t\t\t\t\t\t\t\t\t'username' \t\t=> $user->username, \t\r\n\t\t\t\t\t\t\t\t\t'email'\t\t\t=> $user->email,\r\n\t\t\t\t\t\t\t\t\t'cluster_zoom_level' => $user->cluster_zoom_level\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = true;\r\n\t\t\t$this->res->message = \"Login Successful.\";\r\n\t\t\t\r\n\r\n\t\t\t//update user\r\n\t\t\t$user->client_ip = $this->clientIP();\r\n\t\t\tdate_default_timezone_set('UTC');\r\n\t\t\t$user->last_login_utc = date( 'Y-m-d H:i:s', time());\t\r\n\t\t\t$user->update();\r\n\t\t\t\r\n\t\t\t//update log\r\n\t\t\t$log = new Log;\r\n\t\t\t$log->username = $user->username;\r\n\t\t\t$log->ip_address = $this->clientIP();\r\n\t\t\t$log->client_ip = $this->clientIP();\r\n\t\t\t$log->insert();\r\n\t\t\t\r\n\t\t\t//change password\r\n\t\t\tif($user->change_password_on_login == 1){\r\n\t\t\t\t//build response\r\n\t\t\t\t$this->res->success = true;\r\n\t\t\t\t$this->res->message = \"Change Password Requested\";\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else{\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid username and/or password. Note: Both fields are case sensitive\";\t\r\n\t\t}\r\n\t\r\n\t}", "public function login_pass_ok($username, $password)\n {\n }" ]
[ "0.68798774", "0.6727298", "0.6727298", "0.6697732", "0.6625499", "0.66252786", "0.66061527", "0.6581805", "0.6568921", "0.655423", "0.6551905", "0.6521648", "0.6513109", "0.64877295", "0.64711267", "0.64513713", "0.6425759", "0.6419667", "0.640973", "0.6395479", "0.63932705", "0.63929915", "0.6387563", "0.6382792", "0.63769305", "0.63767195", "0.637217", "0.63704455", "0.6368673", "0.63654965", "0.6351659", "0.63513064", "0.63480467", "0.6346136", "0.6342857", "0.6341651", "0.63409114", "0.6335169", "0.6327336", "0.6323726", "0.6320288", "0.63168734", "0.63050747", "0.62992805", "0.6290398", "0.62794876", "0.6278633", "0.62766737", "0.62752056", "0.6261738", "0.62570107", "0.6253093", "0.6253025", "0.6251973", "0.6246998", "0.62468135", "0.62446076", "0.62420845", "0.62409353", "0.6236684", "0.62269", "0.62269", "0.6225229", "0.62234604", "0.6220489", "0.6220489", "0.6219485", "0.6219387", "0.62179255", "0.6214592", "0.6214031", "0.6211129", "0.62052584", "0.6203002", "0.6200509", "0.61944056", "0.6194045", "0.6188944", "0.6188751", "0.6187711", "0.61861247", "0.6181226", "0.61757016", "0.61722153", "0.61655277", "0.6158281", "0.61511767", "0.614791", "0.6147842", "0.6146603", "0.6140107", "0.61396724", "0.61378527", "0.61342055", "0.6134162", "0.61325544", "0.6131067", "0.6127918", "0.6125625", "0.6123948" ]
0.6731581
1
Returns that data about user by device_uid
public function getUserAction() { $session = $this->getDeviceSession(); if (!$session) { $this->setErrorResponse('This device has no running session'); } $session->registerAction($_SERVER['REMOTE_ADDR']); $user = $session->getUser(); $this->_helper->json($user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDeviceDetailsfunction($userId){\r\n global $pdo;\t\r\n\t\t$select = $pdo->prepare(\"SELECT device_registry.* \r\n FROM users \r\n LEFT JOIN device_registry ON users.device=device_registry.id \r\n\t\t\t\t WHERE users.id = ?\");\r\n\t\t$select->execute(array($userId));\r\n\t\t$result_array = $select->fetch(PDO::FETCH_ASSOC);\r\n\t\treturn $result_array;\r\n\t}", "public function getUserInfo($uid) {\n // get user avatar information of song adder\n $_user_nickname = '';\n $_user_avatar_url = '';\n if (!empty(Yii::app()->params['user_default_setting']) && is_array(Yii::app()->params['user_default_setting'])) {\n $_user_nickname = Yii::app()->params['user_default_setting']['nickname'];\n $_user_avatar_url = Yii::app()->createAbsoluteUrl('//') . '/avatar/' . Yii::app()->params['user_default_setting']['avatarurl'];\n }\n $_user = PlatformUser::model()->findByPk($uid);\n if (!is_null($_user)) {\n $_auth_type = strtoupper($_user['auth_type']);\n if (in_array($_auth_type, $this->_other_auth_types)) {\n $_user_nickname = '';\n $_user_avatar_url = '';\n } else if ($_auth_type == ApiController::DEFAULT_AUTH_TYPE) {\n $_user_nickname = empty($_user->display_name) ? $_user_nickname : $_user->display_name;\n $_user_avatar_url = '';\n } else {\n $_user_nickname = empty($_user->display_name) ? $_user_nickname : $_user->display_name;\n $_user_avatar_url = empty($_user->avatar_url) ? $_user_avatar_url : $_user->avatar_url;\n }\n } else {\n $_user_nickname = '';\n $_user_avatar_url = '';\n }\n\n return array('uid' => intval($uid), 'nickname' => $_user_nickname, 'avatarurl' => $_user_avatar_url);\n }", "public function getUserData($userId);", "function getUserInfo($uid)\r\n {\r\n $info = $this->DB->database_select('users', '*', array('uid' => $uid), 1);\r\n return $info;\r\n }", "public static function getUserDeviceDetail($userId) {\n return Device::select('device_token')->where('user_id', $userId)->get();\n }", "function interface_ar_usr_data_get($uid,$pid,$mid)\n\t\t\t{\n\t\t\t\t$sql = 'SELECT ar.*, usr.usr as name FROM '. $this->tbl_usr_ar.' AS ar, '.$this->tbl_usr.' AS usr WHERE ar.mid='.$mid.' AND ar.pid = '.$pid.' AND ar.uid=usr.id AND usr.id = '.$uid;\n\t\t\t\t$usr_ar = $this->DB->query($sql);\n\t\t\t\t//-- wurden die rechte von anderer seite geerbet ?\n\t\t\t\t$inherit_pid = (int)$usr_ar->f('inherit_pid');\n\t\t\t\tif ($inherit_pid > 0 && $inherit_pid != $pid)\n\t\t\t\t{\n\t\t\t\t\t$inheritet_from = $this->_get_path_print($inherit_pid);\n\t\t\t\t}\t\n\t\t\t\twhile($usr_ar->next()) \n\t\t\t\t{\n\t\t\t\t\t$data['info']['usr'][$usr_ar->f('uid')] = array\n\t\t\t\t\t(\n\t\t\t\t\t\t'name' => $usr_ar->f('name'),\n\t\t\t\t\t\t'ar' => $usr_ar->f('ar'),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}", "protected static function basicUserInfo($uid){\n\t\t$user = Usuario::find($uid);\n\t\t// Informacion compartida por todos los usuarios\n\t\t$userData['id'] \t\t= $user->id;\n\t\t$userData['names'] \t\t= $user->nombres;\n\t\t$userData['lastnames'] \t= $user->apellidos;\n\t\t$userData['full_name'] \t= $user->full_name;\n\t\t$userData['email']\t\t= $user->correo;\n\t\t$userData['gender'] \t= $user->genero_id == 1 ? 'Femenino' : 'Masculino';\n\t\t$userData['cellphone'] \t= $user->celular;\n\t\t$userData['terms_use'] \t= $user->terminos_uso == 1 ? true : false;\n\t\t$userData['birth_date'] = $user->fecha_nacimiento;\n\t\t$userData['created_at'] = $user->fecha_creacion->toDateTimeString();\n\t\t$userData['is_active'] = $user->activo;\n\t\t$userData['city'] \t\t= $user->city($user->ciudad_id);\n\t\t$userData['genre'] \t\t= $user->genre($user->genero_id);\n\t\t$userData['zone'] \t\t= $user->zone != NULL ? $user->zone->nombre : NULL;\n\t\t$userData['image'] \t= $user->image != NULL ? [\n\t\t\t\t\t\t\t\t'id'\t=> $user->image->id,\n\t\t\t\t\t\t\t\t'name'\t=> $user->image->nombre_archivo\n\t\t\t\t\t\t\t\t] : false;\n\t\t$userData['bio'] \t\t= $user->biography != NULL ? [\n\t\t\t\t\t\t\t\t'id'\t=> $user->biography->id,\n\t\t\t\t\t\t\t\t'name'\t=> $user->biography->descripcion\n\t\t\t\t\t\t\t\t] : false;\n\t\t$userData['role_id'] = $user->role($user->id)->rol_id;\n\t\treturn [$userData, $user];\n\t}", "public function getUserInformation($uid, User &$userObject = null);", "public function get_users_device_details($user_id) {\n\n $where_cond = '(logs_login_status=1 AND users_id =\"'.$user_id.'\")';\n $user_device_details = $this->db->select('logs_device_type,logs_device_token')->from('ct_user_logs')->where($where_cond)->get()->row_array();\n return $user_device_details;\n }", "function get_user_information($uid, $cid) {\r\n $this->db->select(\"*\");\r\n $this->db->from('users');\r\n $this->db->where('cid', $cid);\r\n $this->db->where('uid', $uid);\r\n $query = $this->db->get();\r\n if ($query->num_rows >= 1) {\r\n return $query->row_array();\r\n }\r\n }", "function patientuser($uid)\n{\n\t$uquery=\"SELECT password FROM users WHERE userid='$uid'\";\n\t$uresults=getdata($uquery);\n\treturn $uresults;\n}", "public static function getUserInfo($uid) {\n $info = array();\n \n if (!$json = @file_get_contents(self::$directory_url . '?uid=' . $uid . '&format=json')) {\n return $info;\n }\n \n if (!$json = json_decode($json, true)) {\n return $info;\n }\n \n $map = array(\n 'givenName' => 'first_name',\n 'sn' => 'last_name',\n 'mail' => 'email'\n );\n \n foreach ($map as $from => $to) {\n if (isset($json[$from][0])) {\n $info[$to] = $json[$from][0];\n }\n }\n \n return $info;\n }", "public function get_profile($uid){\r\n $query = \"SELECT members.mem_id, users.uid\r\n FROM members\r\n INNER JOIN users ON members.fk_users_id = users.uid\r\n WHERE uid = $uid\";\r\n \r\n $result = $this->db->query($query) or die($this->db->error); \r\n $user_data = $result->fetch_array(MYSQLI_ASSOC);\r\n \r\n }", "public function getUser($uid){\n \n $stmt = $this->con->prepare(\"SELECT fullname, phone_no, email, login_with, approval FROM users WHERE uid = ?\");\n $stmt->bind_param(\"s\", $uid);\n $stmt->execute();\n $stmt->bind_result($fullname, $phone_no, $email, $login_with,$approval);\n if($stmt->fetch()){ \n $user = array(); \n $user['uid'] = $uid; \n $user['fullname'] = $fullname; \n $user['phone_no'] = $phone_no; \n $user['email']=$email;\n $user['login_with']=$login_with;\n $user['approval']=$approval;\n return $user; \n }\n return null;\n }", "public function read_single_user() {\n //Create query\n $query = 'SELECT vendor_id, latitude, longitude, time, type FROM ' . $this->table_name . ' WHERE vendor_id = ?';\n\n //Prepare statement\n $stmt = $this->conn->prepare($query);\n //Clean lowercase.\n //Bind UID\n $stmt->bindParam(1, $this->vendor_id);\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }", "function get($uid) {\n\t}", "function getUserInfo($uid)\n {\n $rs = db()->select(\n 'user.username, user.password, attrib.*'\n , [\n '[+prefix+]manager_users user',\n 'INNER JOIN [+prefix+]user_attributes attrib ON ua.internalKey=user.id'\n ]\n , sprintf(\"user.id='%s'\", db()->escape($uid))\n );\n if (db()->count($rs) == 1) {\n $row = db()->getRow($rs);\n if (!isset($row['usertype'])) {\n $row['usertype'] = 'manager';\n }\n if (!isset($row['failedlogins'])) {\n $row['failedlogins'] = 0;\n }\n return $row;\n }\n return false;\n }", "public function getUserInfoVchat6($uid)\r\n\t{\r\n $userInfo = array();\r\n\r\n if ($uid != -1) \r\n {\r\n $userInfo = Db::dbGetRows($this->sqlQuery('PROFILE', '', $uid));\r\n //debug line\r\n //var_dump($this->sqlQuery('PROFILE', '', $uid));\r\n $this->getProfileRows($userInfo);\r\n }\r\n \r\n switch($this->_action)\r\n {\r\n case 'auth': \r\n $groupData = \"auth\";\r\n \r\n //debug line\r\n //var_dump($uid);\r\n\t\t if ($uid == 0)\r\n { \r\n $DataForXml = array(\"DataBegin\" => '<auth error=\"AUTH_ERROR\" />');\r\n }\r\n else\r\n { \r\n \t\t\t$DataForXml = array(\r\n \t\t\t\t\"DataBegin\" => \t\t'<'.$groupData.'>',\r\n \t\t\t\t\"userName\" => \t\t$this->getName($userInfo[0][\"login\"]),\r\n \t\t\t\t\"gender\" => \t\t$this->getGender($userInfo[0][\"gender\"]),\r\n \"level\" => \t\t\t$this->getLevel($userInfo[0][\"lvl\"]),\r\n \t\t\t\t\"photo\" => \t\t\t$this->getPhoto($userInfo[0][\"photo\"], PHOTO_IS_FILE, $userInfo[0][\"id\"], $userInfo[0][\"login\"], $userInfo[0][\"index\"]),\r\n \t\t\t\t\"photoModeImage\" => $this->getPhoto($userInfo[0][\"photo\"], PHOTO_IS_FILE, $userInfo[0][\"id\"], $userInfo[0][\"login\"], $userInfo[0][\"index\"]),\r\n \t\t\t\t\"DataEnd\" => \t\t'</'.$groupData.'>'\t\r\n \t\t\t);\r\n }\r\n break;\r\n \r\n case 'check_guest_name':\r\n $invalidNames = array('SYSTEM', 'ADMIN', 'ADMINISTRATOR', 'MODERATOR', 'ROBOT');\r\n \t$isInvalid = in_array(strtoupper($userName), $invalidNames); \r\n \r\n $groupData = \"checkGuestName\";\r\n \r\n \tif($uid != -1) $DataForXml = array(\"DataBegin\" => \t\t'<'.$groupData.' error=\"AUTH_ERROR\" />');\r\n \r\n \tif($isInvalid) $DataForXml = array(\"DataBegin\" => '<'.$groupData.' error=\"ADMIN_NEED_PASSWORD\" />');\r\n else $DataForXml = array(\r\n \"DataBegin\" => \t\t'<'.$groupData.'>',\r\n \t\t\t\t\"photo\" => \t\t NO_PHOTO_6,\r\n \t\t\t\t\"photoModeImage\" => NO_PHOTO_6,\r\n \"DataEnd\" => \t\t'</'.$groupData.'>'\t\r\n );\r\n break;\r\n \r\n \tcase 'get_user_photo': \r\n $query = $this->sqlQuery('AUTHORIZATION', 'GUEST');\r\n $Authorization = Db::dbGetRows($query);\r\n $uid = $Authorization[0][\"id\"];\r\n \r\n $userInfo = Db::dbGetRows($this->sqlQuery('PROFILE', '', $uid));\r\n //debug line\r\n //var_dump($this->sqlQuery('PROFILE', '', $uid));\r\n $this->getProfileRows($userInfo);\r\n \r\n $groupData = \"userPhoto\";\r\n $DataForXml = array(\r\n \"DataBegin\" => \t\t'<'.$groupData.'>',\r\n \t\t\t\t\"photo\" => \t\t $this->getPhoto($userInfo[0][\"photo\"], PHOTO_IS_FILE, $userInfo[0][\"id\"], $userInfo[0][\"login\"], $userInfo[0][\"index\"]),\r\n \t\t\t\t\"photoModeImage\" => $this->getPhoto($userInfo[0][\"photo\"], PHOTO_IS_FILE, $userInfo[0][\"id\"], $userInfo[0][\"login\"], $userInfo[0][\"index\"]),\r\n \"DataEnd\" => \t\t'</'.$groupData.'>'\t\r\n );\r\n break;\r\n \r\n case 'profile': \r\n $query = $this->sqlQuery('AUTHORIZATION', 'GUEST');\r\n $Authorization = Db::dbGetRows($query);\r\n $uid = $Authorization[0][\"id\"];\r\n \r\n $userInfo = Db::dbGetRows($this->sqlQuery('PROFILE', '', $uid));\r\n //debug line\r\n //var_dump($this->sqlQuery('PROFILE', '', $uid));\r\n $this->getProfileRows($userInfo);\r\n \r\n $groupData = \"profile\";\r\n $DataForXml = array(\r\n \t\t\t\t\"DataBegin\" => \t\t'<'.$groupData.' photoWidth=\"120\" photoHeight=\"120\">',\r\n \t\t\t\t\"name\" => \t\t $this->getName($userInfo[0][\"login\"]),\r\n \"age\" => \t\t $this->getAge($userInfo[0][\"birthday\"], \"YMD\"),\r\n \t\t\t\t\"gender\" => \t\t$this->getGender($userInfo[0][\"gender\"]),\r\n \"country\" => \t\t$this->getLocation($userInfo[0][\"country\"], \"\", \"\"),\r\n \"city\" => \t\t $this->getLocation(\"\", \"\", $userInfo[0][\"city\"]),\r\n \"info\" => \t\t $this->getDetails($userInfo[0][\"description\"]),\r\n \t\t\"DataEnd\" => \t\t'</'.$groupData.'>'\r\n );\r\n break;\r\n \r\n case 'logout': \r\n $DataForXml = array(\"DataBegin\" => '<logout />');\r\n break;\r\n }\r\n \r\n //debug line\r\n //var_dump($DataForXml);\r\n\r\n return $DataForXml;\r\n\t}", "abstract public function loadDeviceInfo($device, $user = null, $params = array());", "public static function get_user_data()\n {\n }", "public static function getInfo($selected_uid) {\n\t$sql=<<<EOM\n\t select username, profile_fields as image\n\t from users\n\t where id = '$selected_uid'\n\t limit 1;\nEOM;\n $query = DB::query($sql);\n $result = $query->execute();\n return $result[0];\n }", "public static function getUserInfo($uid)\n {\n $info = array();\n \n if (!$json = @file_get_contents(self::$directory_url . '?uid=' . $uid . '&format=json')) {\n return $info;\n }\n \n if (!$json = json_decode($json, true)) {\n return $info;\n }\n \n $map = array(\n 'givenName' => 'first_name',\n 'sn' => 'last_name',\n 'mail' => 'email'\n );\n \n foreach ($map as $from => $to) {\n if (isset($json[$from][0])) {\n $info[$to] = $json[$from][0];\n }\n }\n \n return $info;\n }", "function getUserById($uid)\n {\n $stmt = self::$_db->prepare(\"SELECT u.id_user AS id_user, u.username AS username, u.firstname AS firstname, u.lastname AS lastname,u.image AS image FROM user AS u\n WHERE u.id_user=:uid\");\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function get_device_info($user_id, $user_type) {\n\n $val = $this->db->select('*')->from('device_details')->where('user_id', $user_id)->where('type', $user_type)->get()->row_array();\n return $val;\n }", "public function fetchUserData($uid) {\n $this->db->query(\"SELECT * FROM users WHERE id = :id\");\n $this->db->bind(':id', $uid);\n \n $result = $this->db->single();\n \n return $result;\n }", "function fetch_user_info($uid){\n \n $uid = (int)$uid;\n \n $link = mysqli_connect(\"localhost\", \"root\", \"\", \"formstack1\");\n \n $sql = \"SELECT * from `users` where `user_id` = $uid\";\n \n $result = mysqli_query($link, $sql);\n \n $row= mysqli_fetch_array($result);\n \n\treturn mysqli_fetch_assoc($result);\n\t\n\t}", "public function retrieve_user($user)\n{\t\t\n $uid=$user->__get('uid');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE UId = '$uid'\");\n\treturn $q1;\n}", "public function findInfoByUid($uid){\n\t\t$sql = \"SELECT `id`, `name`, `cellphone`, `address` FROM `info` WHERE `uid` = ?\";\n\t\t$res = $this->connect()->prepare($sql);\n\t\t$res->bind_param(\"s\", $uid);\n\t\t$res->execute();\n\t\t$res->bind_result($id, $name, $cellphone, $address);\n\t\tif($res->fetch()) {\n\t\t\t$info = new \\stdClass();\n\t\t\t$info->id = $id;\n\t\t\t$info->name = $name;\n\t\t\t$info->cellphone = $cellphone;\n\t\t\t$info->$address = $address;\n\t\t\treturn $info;\n\t\t}\n\t\treturn NULL;\n\t}", "function getUser() {\n return user_load($this->uid);\n }", "private function getUserData() {\n\t\tglobal $current_user;\n \tget_currentuserinfo();\n \t$userData = array(\n \t 'username' \t=> $current_user->user_login,\n\t\t 'email' \t\t=> $current_user->user_email,\n\t\t 'phone'\t\t=> get_user_meta( $current_user->ID, 'phone', true ),\n\t\t 'fname' \t\t=> $current_user->user_firstname,\n\t\t 'lname' \t\t=> $current_user->user_lastname,\n\t\t 'display name' => $current_user->display_name,\n\t\t 'id' \t\t\t=> $current_user->ID);\n \treturn $userData;\n\t}", "public function getUserData()\n\t{\n\t\t$fbuid = $this->getFBUID();\n\t\t$rs = $this->db->query(\"SELECT * from selective_status_users where fbuid = \" . $this->db->quote($fbuid) . \" limit 1\");\n\t\tif ($rs && $row = $rs->fetch()) {\n\t\t\treturn $row;\n\t\t}\n\t}", "function d4os_io_db_070_os_user_get_uid($uuid) {\n return db_result(db_query(\"SELECT uid FROM {d4os_ui_users} WHERE UUID = '%s'\", array($uuid)));\n}", "function getByUser($uid) {\n // Run the query and get the user details\n $query = sprintf(\"SELECT p.id,\n p.uid,\n p.typeid,\n p.amount,\n p.token,\n p.createdOn,\n pt.desc\n FROM Payments p\n INNER JOIN PaymentTypes pt ON pt.id = p.typeid\n WHERE p.uid=%u\n ORDER BY p.createdOn DESC\",\n $uid);\n\n $conn = \\DB\\getConnection();\n $result = $conn->query($query);\n\n return $result;\n}", "public function get_login_info() {\r\n\t\t// Get user from cached data or from access token\r\n\t\t$user = $this->getUser ();\r\n\t\t\r\n\t\t// If there's bd_sig & bd_user parameter in query parameters,\r\n\t\t// it must be an inside web app(app on baidu) loading request,\r\n\t\t// then we must check whether the uid passed from baidu is the\r\n\t\t// same as we get from persistent data or from access token, \r\n\t\t// if it's not, we should clear all the persistent data and to \r\n\t\t// get an access token again.\r\n\t\tif (isset ( $_REQUEST ['bd_sig'] ) && isset ( $_REQUEST ['bd_user'] )) {\r\n\t\t\t$sig = self::generateSign ( array ('bd_user' => $_REQUEST ['bd_user'] ), $this->apiSecret, 'bd_sig' );\r\n\t\t\tif ($sig != $_REQUEST ['bd_sig'] || $user ['uid'] != $_REQUEST ['bd_user']) {\r\n\t\t\t\t$this->store->remove ( 'session' );\r\n\t\t\t}\r\n\t\t}\r\n\t\t$user = $this->user_data_format($user);\r\n\t\treturn $user;\r\n\t}", "abstract function retrieveSfGuardUserByFacebookUid($facebook_uid);", "function get_info($uid, $what)\r\n\t{\r\n\t\t$this->db->select($what);\r\n\t\t$this->db->where('uid', $uid);\r\n\t\t$query = $this->db->get('users');\r\n\r\n\t\t$result = $query->result();\r\n\r\n\t\tif($query->num_rows() == 1)\r\n\t\t{\r\n\t\t\treturn $result[0]->$what;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "function d4os_io_db_070_os_user_get_all_uid() {\n $list = array();\n $result = db_query(\"SELECT * FROM {d4os_ui_users}\");\n while ($user = db_fetch_object($result)) {\n $list[] = $user;\n }\n return $list;\n}", "private function get_userInfo() {\n $params = [ 'user_ids' => $this->user_id ];\n $result = $this->api->users->get($params);\n $params['fields'] = '';\n $result2 = $this->api2->users->get($params);\n $result['hidden'] = (int)array_has($result2, 'hidden');\n return $result;\n }", "function getUser()\n {\n $stmt = self::$_db->prepare(\"SELECT u.id_user AS id_user, u.username AS username, u.mail AS mail, u.description AS description, u.image AS image FROM user AS u\n WHERE u.id_user=:uid\");\n $uid = self::getUserID();\n $stmt->bindParam(\":uid\", $uid);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC)[0];\n }", "public function getUserData()\n {\n exit(json_encode(['data' => $this->users_model->get_users()]));\n }", "public function findByUid($uid);", "abstract public function getUserInfo();", "function get_owner_data($user_id){\n $ch = curl_init();\n $url = $GLOBALS['App-Logic'].\"?\" .http_build_query([\n 'get_owner_data' => true, //a flag to execute the right code in App-Logic! \n 'user_id' => $user_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 }", "public function login_user_info($userId){\n $sql = \"SELECT firstName,deviceToken FROM users WHERE userId = $userId\";\n $result = $this->db->query($sql);\n if($result->num_rows() > 0){\n return $result->result_array(); \n }else{\n return false;\n }\n }", "function fsf_cms_getUserInfo($fsfcms_user_id)\n {\n global $fsfcms_api_url;\n $fsf_api_file = \"fsf.cms.getUserInfo.php\";\n if(ctype_digit($fsfcms_user_id))\n {\n $fsf_api_options = \"?userId=\" . $fsfcms_user_id;\n } else {\n $fsf_api_options = \"?userSlug=\" . $fsfcms_user_id;\n }\n $fsfcms_cms_get_user_info_json = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options); \n return $fsfcms_cms_get_user_info_json; \n }", "function getUser($userId) {\r\n $results = $this->querySimpleExecute(\"select * from t_user where idUser=$userId\");\r\n return $results = $this->formatData($results)[0];\r\n }", "function get_user_by_device_token($device_token)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `device_token`='$device_token'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n if ($q['result'])\n {\n return $q['result'];\n }\n else\n {\n $q1['query'] = \"SELECT * FROM `device_tokens` WHERE `device_token`='$device_token'\";\n $q1['run'] = $conn->query($q1['query']);\n $q1['result'] = $q1['run']->fetch_assoc();\n \n return $q1['result'];\n }\n\n}", "public function get_user_data($userId)\n\t{\n\t # All the data which is purchased by the user\n\t \n\t $this->load->model('rss_feed_subscription_model');\n\t $this->load->model('psss_purchase_history');\n\t \n\t $sql = ''; \n\t \n\t $sql .=' SELECT A.* FROM '.static::_TABLE .' A ';\n\t $sql .=' LEFT JOIN '.Rss_feed_subscription_model::_TABLE . ' B ON A.'.static::_ID .' = B.'.Rss_feed_subscription_model::_ITEM_ID;\n\t $sql .=' LEFT JOIN '.Psss_purchase_history::_TABLE. ' C ON A.'.static::_ID . ' = C.'. Psss_purchase_history::_ITEM_ID;\n\t $sql .=' WHERE A.'.static::_USER_ID . ' = '.$userId;\n\t $sql .=' OR B.'.Rss_feed_subscription_model::_USER_ID . ' = '. $userId;\n\t $sql .=' OR C.'.Psss_purchase_history::_USER_ID .' = '.$userId;\n\t $sql .=' GROUP BY A.'.static::_ID;\n \n\t $response = $this->db->query($sql)->result();\n\t \n\t return $response;\n\t}", "function get_userdata($user_id)\n {\n }", "public function getData() {\n\t\t$id = $this->user;\n\t\t$this->db->query( 'SELECT * FROM users WHERE crsid = :id' );\n\t\t$this->db->bind( ':id', $id );\n\t\t$row = $this->db->single();\n\n\t\tif ( ! $row[\"name\"] ) {\n\t\t\t$ds = ldap_connect( \"ldap.lookup.cam.ac.uk\" );\n\t\t\t$lsearch = ldap_search( $ds, \"ou=people,o=University of Cambridge,dc=cam,dc=ac,dc=uk\", \"uid=\" . $id . \"\" );\n\t\t\t$info = ldap_get_entries( $ds, $lsearch );\n\t\t\t$name = $info[0][\"cn\"][0];\n\t\t\t$this->db->query( 'UPDATE users SET name=:name WHERE crsid=:id' );\n\t\t\t$this->db->bind( ':id', $id );\n\t\t\t$this->db->bind( ':name', $name );\n\t\t\t$this->db->execute();\n\t\t\t$row[\"name\"] = $name;\n\t\t}\n\n\t\treturn $row;\n\t}", "function get_user_info_data($user_id)\n\t {\n\t //todo:\n\t\t $activity_content_data = $this->User_data->get_user_content_num($user_id);\n\t\t $username = $this->User_data->get_username(array('uId'=>$user_id));\n\t\t $user_photo_path = $this->User_data->get_user_headphotopath($user_id);\n\t\t $kpc_score = $this->User_data->get_user_kpc($user_id);\n\n\t\t $answer_num = isset($activity_content_data[ANSWER]) ? $activity_content_data[ANSWER] :0;\n\t\t $question_num = isset($activity_content_data[QUESTION]) ? $activity_content_data[QUESTION] : 0;\n $follow_num = isset($activity_content_data[FOLLOW]) ? $activity_content_data[FOLLOW] : 0;\n\t $location_data = $this->session->userdata('location_city');\n\t\t $data = array('location'=>$location_data,'kpc_score'=>$kpc_score,'username'=>$username,'headphoto_path'=>$user_photo_path,'answer_num'=>$answer_num,'question_num'=>$question_num,'follow_num'=>$follow_num);\n\t\t //print_r($data);\n\t\t return array_merge($data,$activity_content_data);\n\t }", "function getUserDetails(){\n if(empty($this->userid)){\n return null;\n } \n $userDetailsQuery = \"SELECT * FROM da_userMaster WHERE da_userMaster.username = '$this->userid'\"; \n $dbqry = new dbquery($userDetailsQuery, $this->connid);\n $user = $dbqry->getrowassocarray();\n return $user;\n }", "public function get_uid($user)\n{\t\t\n\t$uname = $user->__get('uname');\n\t$con = connect();\n\t$q1 = mysqli_query($con, \"SELECT * FROM user WHERE Uname = '$uname'\");\n\t$res = mysqli_fetch_array($q1);\n\t$uid= $res['UId'];\n\treturn $uid;\n}", "public function getUserData($userId)\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\nSELECT\n core_person_rowid as person_id,\n core_person_firstname as firstname,\n core_person_lastname as lastname,\n buiz_role_user_name as user_name\nFROM\n view_person_role\nWHERE\n buiz_role_user_rowid = {$userId}\n\nSQL;\n\n // gleich den Datensatz zurückgeben\n return $db->select($sql)->get();\n\n }", "public function getUserData($userID)\n {\n return Filesystem::getUserInformation($userID);\n }", "function getuserdetails($u_id)\n{\n\t$sql=\"select * from user_table where u_id=$u_id\";\n\tforeach($GLOBALS['db']->query($sql) as $row);\n\treturn $row;\n}", "function getUser($orderId){\r\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_orders','uid = \\''.$orderId.'\\'');\r\n\t $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\t $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','fe_users','uid = \\''.$row['cust_fe_user'].'\\'');\r\n\t $user = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);\r\n\t return $user;\r\n\r\n\t}", "protected function getUser() {\r\n\t\t$session = $this->getSession ();\r\n\t\tif (isset ( $session ['uid'] ) && isset ( $session ['uname'] )) {\r\n\t\t\treturn array ('uid' => $session ['uid'], 'uname' => $session ['uname'] );\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function xarbb_userapi_getuserinfo($args)\r\n{\r\n static $users = array();\r\n extract $args;\r\n\r\n // uid is mandatory\r\n if (!isset($uid) || !is_numeric($uid) || $uid < 0) return;\r\n\r\n // If the user is cached, then return it.\r\n // Returning all details for now.\r\n if (isset($users[$uid])) return $users[$uid];\r\n\r\n // Get the details.\r\n $name = xarUserGetVar('name', $uid);\r\n\r\n // The url is set only if we have read permission.\r\n // TODO: these URLs, fetched from this central place, could be directed to some other place.\r\n if (xarSecurityCheck('ReadRole', 0, 'Roles', $uid)) {\r\n $display = xarModUrl('roles', 'user', 'display', array('uid' => $uid));\r\n $mailto = xarModUrl('roles', 'user', 'email', array('uid' => $item['xar_uid']));\r\n } else {\r\n $display = NULL;\r\n $mailto = NULL;\r\n }\r\n\r\n // TODO: detect and handle anonymous users appropriately.\r\n}", "private function getUser()\n {\n if ($this->userData['id']) {\n $user = gateway('northstar')->asClient()->getUser($this->userData['id']);\n\n if ($user && $user->id) {\n info('Found user by id', ['user' => $user->id]);\n\n return $user;\n }\n }\n\n if ($this->userData['email']) {\n $user = gateway('northstar')->asClient()->getUserByEmail($this->userData['email']);\n\n if ($user && $user->id) {\n info('Found user by email', ['user' => $user->id]);\n\n return $user;\n }\n }\n\n if (! isset($this->userData['mobile'])) {\n return null;\n }\n\n $user = gateway('northstar')->asClient()->getUserByMobile($this->userData['mobile']);\n\n if ($user && $user->id) {\n info('Found user by mobile', ['user' => $user->id]);\n\n return $user;\n }\n\n return null;\n }", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "function d4os_io_db_070_os_user_load($data = array()) {\n\n if (is_numeric($data)) {\n\n // get the user by uid\n $UUID = db_result(db_query(\"SELECT UUID FROM {d4os_ui_users} WHERE uid = %d\", array($data)));\n\n if (!$UUID) {\n return FALSE;\n }\n\n $query = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE ua.PrincipalID='%s'\";\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($query, $UUID));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n }\n\n // get only inworld fields\n $user_fields = d4os_ui_users_get_grid_fields();\n\n // Dynamically compose a SQL query:\n $query = array();\n $values = array();\n\n // get the user by keys\n foreach ($data as $key => $value) {\n if (in_array($key, $user_fields)) {\n switch ($key) {\n case 'UUID':\n $query[]= \"ua.PrincipalID = '%s'\";\n $values[] = $value;\n break;\n case 'username':\n $query[]= \"ua.FirstName = '%s'\";\n $values[] = $value;\n break;\n case 'lastname':\n $query[]= \"ua.LastName = '%s'\";\n $values[] = $value;\n break;\n case 'email':\n $query[]= \"ua.Email = '%s'\";\n $values[] = $value;\n break;\n case 'created':\n $query[]= \"ua.Created = %d\";\n $values[] = $value;\n break;\n case 'godLevel':\n $query[]= \"ua.UserLevel = %d\";\n $values[] = $value;\n break;\n }\n }\n }\n $sql = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE \". implode(' AND ', $query);\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($sql, $values));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $uid = db_result(db_query(\"SELECT uid FROM {d4os_ui_users} WHERE UUID = '%s'\", array($user->PrincipalID)));\n $user->uid = $uid;\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n}", "public function getAllUsers() {\n $result = mysql_query(\"SELECT * FROM gcm_devices\");\n return $result;\n }", "public function getUserData($id){\n $query=$this->db->query(\"SELECT CONCAT(firstname,' ',lastname) AS name,email,telephone FROM oc_customer WHERE customer_id=\".$id);\n if($query->num_rows){\n return $query->rows[0];\n }\n else{\n return array(\"auth\"=>\"fail\",\"error\"=>\"Unable to Retrieve User Data.\");\n }\n }", "function lookupUser($uid) {\n\t$host = \"ldap.bath.ac.uk\";\n\t$dn = \"o=bath.ac.uk\";\n\t$con = ldap_connect($host);\n\t// anonymous login\n\tldap_bind($con);\n\t$results = ldap_search($con, $dn, \"uid=\" . $uid);\n\t// get array from search results\n\t$entries = ldap_get_entries($con, $results);\n\t// ensure a user has been found\n\tif ($entries[\"count\"] > 0) {\n\t\treturn Array (\n\t\t\t\"found\" => 1,\n\t\t\t\"uidnumber\" => $entries[0][\"uidnumber\"][0],\n\t\t\t\"accountstate\" => $entries[0][\"accountstate\"][0],\n\t\t\t\"displayname\" => $entries[0][\"displayname\"][0],\n\t\t\t\"mail\" => $entries[0][\"mail\"][0]\n\t\t);\n\t}\n\telse {\n\t\treturn Array (\"found\" => 0);\n\t}\n}", "public static function get_user($user_id);", "function readByUid($case){\n\n // select all query\n if($case==0) {\n $query = \"SELECT * FROM users WHERE fb_uuid=?\";\n } else if($case==1) {\n $query = \"SELECT * FROM users WHERE google_uuid=?\";\n }\n \n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of product to be updated\n if($case==0) {\n $stmt->bindParam(1, $this->fb_uuid);\n } else if($case==1) {\n $stmt->bindParam(1, $this->google_uuid);\n }\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->id = $row['id'];\n $this->user_type = $row['user_type'];\n $this->name = $row['name'];\n $this->apellido = $row['apellido'];\n $this->username = $row['username'];\n $this->telefono = $row['telefono'];\n $this->fecha_nac = $row['fecha_nac'];\n $this->email = $row['email'];\n $this->password = $row['password'];\n $this->image = $row['image'];\n $this->fb_uuid = $row['fb_uuid'];\n $this->google_uuid = $row['google_uuid'];\n }", "public function get_userInfo($user_id){\n\n\t\t\t//$user_id=$this->session->userdata('user_id');\n\t\t\t//$profile_type=$this->session->userdata('profile_type');\n\n\n//\t\t\tif(($this->session->userdata('selected_profile_type'))!=''){\n//\t\t\t\t$profile_type=$this->session->userdata('selected_profile_type');\n//\t\t\t}\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t\t$path=base_url();\n\t\t\t$url = $path.'api/ViewProfile_api/get_userInfo?user_id='.$user_id;\t\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response_json = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$response=json_decode($response_json, true);\n\t\t\treturn $response;\t\n\t\t}", "public function getUserData()\n\t{\n\t\t$userId = $this->session->userdata('user_id');\n\t\t$userData = $this->db->select('*')\n\t\t\t\t\t\t\t ->where('user_id', $userId)\n\t\t\t\t\t\t\t ->get('user');\n\t\treturn $userData->result();\n\t}", "public function getUserData()\r\n {\r\n $system = Shopware()->System();\r\n $userData = $this->admin->sGetUserData();\r\n if (!empty($userData['additional']['countryShipping'])) {\r\n $sTaxFree = false;\r\n if (!empty($userData['additional']['countryShipping']['taxfree'])) {\r\n $sTaxFree = true;\r\n } elseif (\r\n !empty($userData['additional']['countryShipping']['taxfree_ustid'])\r\n && !empty($userData['billingaddress']['ustid'])\r\n && $userData['additional']['country']['id'] == $userData['additional']['countryShipping']['id']\r\n ) {\r\n $sTaxFree = true;\r\n }\r\n\r\n $system->sUSERGROUPDATA = Shopware()->Db()->fetchRow(\"\r\n SELECT * FROM s_core_customergroups\r\n WHERE groupkey = ?\r\n \", array($system->sUSERGROUP));\r\n\r\n if (!empty($sTaxFree)) {\r\n $system->sUSERGROUPDATA['tax'] = 0;\r\n $system->sCONFIG['sARTICLESOUTPUTNETTO'] = 1; //Old template\r\n Shopware()->Session()->sUserGroupData = $system->sUSERGROUPDATA;\r\n $userData['additional']['charge_vat'] = false;\r\n $userData['additional']['show_net'] = false;\r\n Shopware()->Session()->sOutputNet = true;\r\n } else {\r\n $userData['additional']['charge_vat'] = true;\r\n $userData['additional']['show_net'] = empty($system->sUSERGROUPDATA['tax']);\r\n Shopware()->Session()->sOutputNet = empty($system->sUSERGROUPDATA['tax']);\r\n }\r\n }\r\n\r\n return $userData;\r\n }", "function get_users_info_by_id($users_id) {\n return $this->read_data_by_id($users_id);\n }", "public function getCurrentUser(){\n\t\t$cm = \\OC::$server->getContactsManager();\n\t\t// The API is not active -> nothing to do\n\n\t\t$result = $cm->search(\\OCP\\User::getUser(), array('FN'));\n\t\t$r = $result[0];\n\t\t$data = array();\n\t\t$data['id'] = $r['id'];\n\t\t$data['displayname'] = $r['FN'];\n\t\tif(!isset($r['EMAIL'])){\n\t\t\t$r['EMAIL'] = array();\n\t\t}\n\n\t\tif(!isset($r['IMPP'])){\n\t\t\t$r['IMPP'] = array();\n\t\t}\n\t\t$data['backends'] = $this->contactBackendToBackend($r['EMAIL'], $r['IMPP']);\n\t\tlist($addressBookBackend, $addressBookId) = explode(':', $r['addressbook-key']);\n\t\t$data['address_book_id'] = $addressBookId;\n\t\t$data['address_book_backend'] = $addressBookBackend;\n\t\treturn $data;\n\t}", "public function getEmpdeviceid($id)\n{\n\n$query = mysql_query(\"SELECT ji.`userid` , us.`device_id` , us.`email`FROM `gs_jobInfo` AS ji LEFT JOIN `user` AS us ON ji.`userid` = us.`userid` WHERE ji.`id` = '$id'\");\nif(mysql_num_rows($query)>0)\n{\n\nwhile($row = mysql_fetch_assoc($query))\n{\n\n$data = $row;\n\n}\n\nreturn $data;\n}\nelse \n return 0;\n\n}", "function getUserInfo($user_id) {\n jincimport('utility.servicelocator');\n $servicelocator = ServiceLocator::getInstance();\n $logger = $servicelocator->getLogger();\n \n $query = 'SELECT id, username, name, email FROM #__users ' .\n 'WHERE id = ' . (int) $user_id;\n $dbo =& JFactory::getDBO();\n $dbo->setQuery($query);\n $logger->debug('JINCJoomlaHelper: executing query: ' . $query);\n $infos = array();\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0]; \n $infos['user_id'] = $user->id;\n $infos['username'] = $user->username;\n $infos['name'] = $user->name;\n $infos['email'] = $user->email;\n }\n return $infos;\n }\n return $infos;\n }", "function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}", "function getWebUserInfo($uid)\n {\n global $modx;\n\n $field = 'wu.username, wu.password, wua.*';\n $from = '[+prefix+]web_users wu INNER JOIN [+prefix+]web_user_attributes wua ON wua.internalkey=wu.id';\n $rs = db()->select($field, $from, \"wu.id='$uid'\");\n $limit = db()->count($rs);\n if ($limit == 1) {\n $row = db()->getRow($rs);\n if (!$row['usertype']) {\n $row['usertype'] = 'web';\n }\n return $row;\n }\n return false;\n }", "public function profile_detail($post_data){\n $userId = $post_data['userId'];\n\n $sql = \"SELECT userId,firstName,email,password,profile_picture,age,gender,workEducation,city,deviceToken,facebookId,token,tokenExpiry,refreshToken,refreshTokenExpiry,latitude,longitude,lastLogin,connectSherpaFlag FROM users WHERE userId = $userId\";\n $record = $this->db->query($sql);\n if($record->num_rows()>0){\n return $record->result_array();\n }\n\n }", "private function getUserDataById($userId) {\n\n $sql = 'SELECT * FROM user_table WHERE user_id = ?';\n if ($statement = $this->db->prepare($sql)) {\n $statement->bind_param('s', $userId);\n $statement->execute();\n $result = $statement->get_result();\n $row = $result->fetch_array(MYSQLI_ASSOC);\n $statement->close();\n return $row;\n\n } else {\n ChromePhp::log('Error in getUserDataById');\n }\n }", "public function findUserByUid($uid){\n $sql = \"SELECT `uid`, `nickname`, `openid` FROM `user` WHERE `uid` = ?\";\n $res = $this->connect()->prepare($sql);\n $res->bind_param(\"s\", $uid);\n $res->execute();\n $res->bind_result($uid, $nickname, $openid);\n if($res->fetch()) {\n $user = new \\stdClass();\n $user->uid = $uid;\n $user->nickname = $nickname;\n $user->openid = $openid;\n return $user;\n }\n return NULL;\n }", "public function get_fullname($uid){\n $sql3=\"SELECT fullname FROM users WHERE uid = $uid\";\n $result = mysqli_query($this->db,$sql3);\n $user_data = mysqli_fetch_array($result);\n echo $user_data['fullname'];\n }", "function getUserData(XiusQuery &$query)\n\t{\n\t\t$query->select('juser.`id` as userid');\n\t\t$query->from('`#__users` as juser');\n\n\t\t$isMultiple = $this->pluginParams->get('customIsMultiple');\n\n\t\t$tableMapping = $this->getTableMapping();\n\t\t\n\t\tforeach( $tableMapping as $tm){\n\t\t\tif($isMultiple) {\n\t\t\t\t//comma separated values with descending order, so that user can apply sorting in front end \n\t\t\t\t$query->select( \"CONCAT( \\\",\\\" , group_concat({$tm->tableAliasName}.{$tm->originColumnName} ORDER BY {$tm->tableAliasName}.{$tm->originColumnName} DESC), \\\",\\\" )\"\n\t\t\t\t\t\t\t.\" as {$tm->cacheColumnName} \"\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query->select( \"{$tm->tableAliasName}.{$tm->originColumnName} as {$tm->cacheColumnName} \" );\n\t\t\t}\n\t\t\t$query->leftJoin( \" {$tm->tableName} as {$tm->tableAliasName} \"\n\t\t\t\t\t\t\t .\" ON ( {$tm->tableAliasName}.`{$this->pluginParams->get('customUseridColumn')}` = juser.`id` ) \"\n\t\t\t\t\t\t\t);\n\t\t}\n\t}", "public function getUserData()\n {\n $system = Shopware()->System();\n $userData = $this->admin->sGetUserData();\n if (!empty($userData['additional']['countryShipping'])) {\n $sTaxFree = false;\n if (!empty($userData['additional']['countryShipping']['taxfree'])) {\n $sTaxFree = true;\n } elseif (\n !empty($userData['additional']['countryShipping']['taxfree_ustid'])\n && !empty($userData['billingaddress']['ustid'])\n && $userData['additional']['country']['id'] == $userData['additional']['countryShipping']['id']\n ) {\n $sTaxFree = true;\n }\n\n $system->sUSERGROUPDATA = Shopware()->Db()->fetchRow(\"\n SELECT * FROM s_core_customergroups\n WHERE groupkey = ?\n \", array($system->sUSERGROUP));\n\n if (!empty($sTaxFree)) {\n $system->sUSERGROUPDATA['tax'] = 0;\n $system->sCONFIG['sARTICLESOUTPUTNETTO'] = 1; //Old template\n Shopware()->Session()->sUserGroupData = $system->sUSERGROUPDATA;\n $userData['additional']['charge_vat'] = false;\n $userData['additional']['show_net'] = false;\n Shopware()->Session()->sOutputNet = true;\n } else {\n $userData['additional']['charge_vat'] = true;\n $userData['additional']['show_net'] = !empty($system->sUSERGROUPDATA['tax']);\n Shopware()->Session()->sOutputNet = empty($system->sUSERGROUPDATA['tax']);\n }\n }\n\n return $userData;\n }", "public function getUserData()\r\n \t{\r\n \t\tif ($this->_client->getUser())\r\n \t\t{\r\n \t\t\treturn $this->_client->api('/me');\r\n \t\t}\r\n \t\treturn null;\r\n \t}", "function auth_retrieve_user_properties($db, $user_id)\r\r\n{\r\r\n $result_user = func_db_query($db, \"SELECT user_id, username, email, display_name, status, activation_code, first_name, last_name, address, city, \"\r\r\n . \"state, post_code, country, phone1, phone2, phone3, date_of_birth, last_active, post_count, avatar, tag_line, attribute1, \"\r\r\n . \"attribute2, attribute3, attribute4, attribute5, attribute6, attribute7, attribute8, attribute9, attribute10 \"\r\r\n . \"FROM @TABLE_PREFIX@nx3_user WHERE user_id = ? LIMIT 1\", array(\"i\", $user_id));\r\r\n foreach ($result_user[0] as $field => $value)\r\r\n {\r\r\n $_SESSION['NX3_USER'][$field] = $value;\r\r\n }\r\r\n}", "public function data($user_id)\n\t{\n\t\t$user = User::find($user_id);\n\n return $this->transformer->user($user);\n\t}", "public function getUserData($get_extra_info = false, $facebook_uid = null){\r\n\t\t$facebook_uid = $this->getFacebookUid($facebook_uid);\r\n\t\tif(!$get_extra_info && array_key_exists($facebook_uid,$this->cached_user_data)){\r\n\t\t\treturn $this->cached_user_data[$facebook_uid];\r\n\t\t}\r\n\t\t\r\n\t\t$fields = $get_extra_info ? array_merge(self::$data_fields, self::$data_fields_extra) : self::$data_fields;\r\n\t\t$user_info_res = $this->usersGetInfo($facebook_uid, $fields);\r\n\r\n\t\t$user_data = isset($user_info_res[0]) ? $user_info_res[0] : array();\r\n\r\n\t\tif(!$get_extra_info){\r\n\t\t\t$this->cached_user_data[$facebook_uid] = $user_data;\r\n\t\t}\r\n\t\treturn $user_data;\r\n\t}", "public function getUserData($userID)\n {\n return DB::table('users')->where('user_id', '=', $userID);\n }", "public function getdeviceid($id)\n{\n//echo \"SELECT `name`,`device_id` FROM `user` WHERE `userid` = '$id' \";\n$query = mysql_query(\"SELECT `name`,`device_id` FROM `user` WHERE `userid` = '$id' \");\n$row = mysql_num_rows($query);\nif($row == 1)\n{\n\nwhile($data = mysql_fetch_assoc($query))\n{\n\n$dev = $data;\nif($dev['device_id'] != \"\")\nreturn $dev;\nelse \nreturn 0;\n}\n\n}\nelse return 0;\n\n\n}", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "function device_get()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n // die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->input->get('device');\n \n // Get the full device/system information\n $device = $this->device_model->getDeviceInfo( $this->get('id') );\n \n if($device){\n $this->response($device, 200); // 200 being the HTTP response code\n }else{\n $this->response(NULL, 404);\n }\n }", "public function get_user_bymobile($mobile = \"\"){\r\n $query = $this->db->get_where('tblUserInformation', array('mobile' => $mobile));\r\n return $query->row_array();\r\n }", "public function getUserData($id){\n\n \t\t\n \t\t$q = \"SELECT * FROM user_table WHERE id='$id' \";\n\n \t\t$result = $this->connection->query($q);\n\n \t\tif($result->num_rows > 0){\n\n \t\t\t$row = mysqli_fetch_assoc($result);\n\n \t\t}\n\n \t\treturn $row;\n\n \t}", "protected function getCurrentUserData() {}", "protected function getCurrentUserData() {}", "public function getDetail($id_user){\n\t\t$db = new Database();\n\t\t$dbConnect = $db->connect();\n\t\t$sql = \"SELECT * FROM user where id_user = '{$id_user}'\";\n\t\t$data = $dbConnect->query($sql);\n\t\t$dbConnect = $db->close();\n\t\treturn $data->fetch_array();\n\t}", "abstract function getSfGuardUserByFacebookUid($facebook_uid);", "function getUserData($user){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getUserData($user);\r\n }", "public function info($uid)\n {\n $query = $this->from()->where(['uid' => $uid, 'is_delete' => 0]);\n $num = $query->count();\n $carts = $query->fetchAll();\n $totalPrice = 0;\n\n foreach ($carts as $key => $cart) {\n // count total price\n $totalPrice += ($cart['price'] * $cart['num']);\n\n // get sku info detail\n $sku = $this->from('sku')->where(['id' => $cart['sku_id'], 'is_delete' => 0])->fetch();\n $skuAttr = $this->from('sku_attr')\n ->where(['sku_id' => $sku['id']])\n ->select(null)\n ->select(['id', 'attr', 'opt'])\n ->fetchAll();\n $spu = $this->from('spu')\n ->where(['id' => $sku['spu_id'], 'is_delete' => 0])\n ->select(null)\n ->select(['cate_id', 'brand', 'cover_url'])\n ->fetch();\n $carts[$key] = array_merge($spu, $cart);\n $carts[$key]['attr'] = $skuAttr;\n }\n\n // strcutrue result\n $res['num'] = $num;\n $res['freight'] = $totalPrice >= \\Core\\Config::get('freight_limit') ? 0 : \\Core\\Config::get('freight');\n $res['total_price'] = $totalPrice + $res['freight'];\n $res['product'] = $carts;\n\n return $res;\n }", "public function getData(){\n\n // get public user data for this user\n $userData = $this->getSimpleData();\n\n // add sensitive user data\n $userData->email = $this->email;\n\n // all chars\n $userData->characters = [];\n $characters = $this->getCharacters();\n foreach($characters as $character){\n /**\n * @var $character CharacterModel\n */\n $userData->characters[] = $character->getData();\n }\n\n // get active character with log data\n $activeCharacter = $this->getActiveCharacter();\n $userData->character = $activeCharacter->getData(true);\n\n return $userData;\n }", "private function getOneNotifDeviceByDeviceId() {\n $this->user_panel->checkAuth();\n $this->notif_device->findOneByDeviceId();\n }" ]
[ "0.69865817", "0.6762119", "0.6631404", "0.6575231", "0.65657717", "0.64790326", "0.64733106", "0.64292717", "0.63870424", "0.63772", "0.6369383", "0.63531834", "0.63414747", "0.63407683", "0.6308767", "0.62968194", "0.62958753", "0.629142", "0.6289233", "0.62871385", "0.62284523", "0.62239814", "0.6213465", "0.6202902", "0.618267", "0.617704", "0.6139333", "0.61224204", "0.6114479", "0.60938805", "0.604648", "0.60458964", "0.60432756", "0.5952088", "0.5946999", "0.59371257", "0.5932123", "0.5928576", "0.59283936", "0.5926", "0.5923818", "0.58856624", "0.5875607", "0.5862949", "0.58588713", "0.5857424", "0.5856114", "0.5855945", "0.58542323", "0.58523864", "0.58400077", "0.5836924", "0.5834042", "0.5820637", "0.5819982", "0.5817451", "0.5812264", "0.5785405", "0.5772415", "0.57716143", "0.5767383", "0.57666856", "0.5762743", "0.5761432", "0.5758658", "0.5757009", "0.5746592", "0.57445616", "0.5741684", "0.5729975", "0.57243", "0.5724151", "0.57233894", "0.5716621", "0.5713972", "0.57029045", "0.56925935", "0.5690823", "0.56904626", "0.5689625", "0.5687165", "0.56871486", "0.56841683", "0.56841296", "0.5682487", "0.56806463", "0.56755173", "0.5672936", "0.56684256", "0.56667435", "0.56661624", "0.56658804", "0.56655073", "0.5664332", "0.5659282", "0.5659245", "0.56579316", "0.56566775", "0.5654483", "0.56522083" ]
0.57172406
73
This method allows to set error message
private function setErrorResponse($message, $errorCode = 200) { $this->_response->setHttpResponseCode($errorCode); $this->_helper->json(array( 'message' => $message )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setError($msg)\n {\n }", "function setError ($msg) {\r\n $this->errors[]=$msg;\r\n }", "function setError($message) {\n global $error;\n $error = (object) array(\n 'message' => $message\n );\n }", "public function setError($msg) {\n $this->__isError = true;\n $this->__errorMsg = $msg;\n }", "public function setErrorMessage($e){\n //checks if error message is cause due to invalid characters\n if($e -> getMessage() == EnumStatus::$InvalidCharactersError){\n //if so those are removed.\n $this -> saveDisplayName = strip_tags($this -> saveDisplayName);\n $this -> saveUserName = strip_tags($this -> saveUserName);\n }\n $this -> message = $e -> getMessage();\n }", "function setError($message, $code)\n {\n $this->errorMsg\n = $this->errorMsg\n ? $this->errorMsg\n : $message;\n $this->errorIdentifier\n = $this->errorIdentifier\n ? $this->errorIdentifier\n : \"$this->moduleName / $code\";\n }", "public function setErrorMessage($message)\n {\n $this->message = $message;\n }", "private function _setErrorMessage($errorCode = '')\n {\n $this->errorMessage = trans('evatr::messages.'.$errorCode);\n }", "function setErrorMsg($error) {\r\r\n\t\t$this->errorMsg = KT_DynamicData($error, $this->tNG, '', false);\r\r\n\t}", "function set_error($err) {\n # Set Current Error Message\n $this->error_message = $err;\n\n # Add to Error Log\n $this->error_log[] = $err;\n\n # Increment Error Counter\n $this->error_count++;\n }", "public function setErrMsg($value) {\n return $this->set(self::ERR_MSG, $value);\n }", "protected function _setError($msg)\n\t{\n\t\tValidator::ensureParameterIsString($msg);\n\t\t$this->_usrError = $msg;\n\t}", "function set_error() \n {\n $this->error_state = FORMEX_FIELD_ERROR;\n }", "public function setError($err);", "public function setMessage() {\n $numArgs = func_num_args();\n\n switch ($numArgs) {\n default:\n return false;\n break;\n\n // A global rule error message\n case 2:\n foreach ($this->post(null) as $key => $val) {\n $this->_errorPhraseOverrides[$key][func_get_arg(0)] = func_get_arg(1);\n }\n break;\n\n // Field specific rule error message\n case 3:\n $this->_errorPhraseOverrides[func_get_arg(1)][func_get_arg(0)] = func_get_arg(2);\n break;\n }\n\n return true;\n }", "public function setError($msg)\n {\n array_push($this->errors, $msg);\n }", "private function setError($value) {\r\n $this->debug('setError() was called with value: ' . $value);\r\n $this->error = $value;\r\n }", "public function setErrorMSG($errorMSG) {\n if(is_string($errorMSG)){\n switch ($errorMSG) {\n case \"nameError\":\n $this->nameError = \"<small class='error'>Invalid name: Name has to be longer than 2 character and only alphabetic or numeric character</small>\";\n break;\n case \"imageError\":\n $this->imageError = \"<small class='error'>Invalid picture: Picture must be smaller than 3MB and be of types JPG/JPEG, PNG or GIF</small>\";\n break;\n case \"priceError\":\n $this->priceError = \"<small class='error'>Invalid price: Price must be between 1 - 10000 and be of numeric characters</small>\";\n break;\n case \"descError\":\n $this->descError = \"<small class='error'>Invalid description: Description must be longer than 10 characters </small>\";\n break;\n default:\n break;\n }\n }\n }", "protected function setError($message, $code)\n\t{\n\t\t$this->error = true;\n\t\t$this->errorMessage = $message;\n\t\t$this->errorCode = $code;\n\t}", "public function setMsgError($error) {\r\n $this->msg_error = $error;\r\n }", "protected function _set_custom_stuff() {\n //setup our custom error messages\n // $this->setCustomMessages( $this->_custom_messages );\n }", "public static function setError($message)\n {\n self::put(\"error\", $message);\n }", "protected function set_error( $code, $message) {\n\t\t$this->errors->add($code, $message);\n\t}", "public function errorMessage()\n {\n }", "protected function error($message) { \n\t\t$this->error_found = true; \n\t\t$this->error_message = $message; \n\t}", "public function SetError($msg=null) {\n if ($msg==null) { return $this->SetError(\"No message set\"); }\n $this->error_msg = $msg;\n return false;\n }", "protected function setError($msg)\n {\n $this->error_count++;\n if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {\n $lasterror = $this->smtp->getError();\n if (!empty($lasterror['error'])) {\n $msg .= $this->lang('smtp_error') . $lasterror['error'];\n if (!empty($lasterror['detail'])) {\n $msg .= ' Detail: '. $lasterror['detail'];\n }\n if (!empty($lasterror['smtp_code'])) {\n $msg .= ' SMTP code: ' . $lasterror['smtp_code'];\n }\n if (!empty($lasterror['smtp_code_ex'])) {\n $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];\n }\n }\n }\n $this->ErrorInfo = $msg;\n }", "public function setErrMsg(\\SKBuiltinString $value=null)\n {\n return $this->set(self::ERRMSG, $value);\n }", "protected function createValidationErrorMessage() {}", "protected function _set_custom_stuff()\n\t{\n\t\t//setup our custom error messages\n\t\t$this->setCustomMessages($this->_custom_messages);\n\t}", "public static function setErrorMessage($msg){\n $_SESSION[UtilMessage::ERROR_REGISTER] = $msg;\n }", "public function setErrorMessage(?string $value): void {\n $this->getBackingStore()->set('errorMessage', $value);\n }", "function setFailMsg($msg) { $this->_failMsg = $msg; }", "protected function setErrorClassAttribute() {}", "public function setError(string $name, string $error): void\n {\n $this->getInputFilter()->setMessage($name, $error);\n }", "function setError($type, $msg) {\n\t\t$this->errorType = $type;\n\t\t$this->errorMsg = $msg;\n\t}", "private static function setErrorMessage($message) {\n if (self::$_messages[self::$_inputElement][self::$_validationRule]) {\n $message = self::$_messages[self::$_inputElement][self::$_validationRule];\n }\n array_push(self::$_response, ucfirst($message));\n }", "function get_error_message() {\n return $this->error_msg;\n }", "protected function setErrorMessage($message) {\n\t\t$this->lastError = $message;\n\t\treturn $this;\n\t}", "protected function setError($error) {\n $this->error = $error;\n }", "protected function addErrorFlashMessage() {}", "public function error($message) {}", "private function _set_error($error)\n {\n // set error message in $_error property\n $this->_error = $error;\n\n return;\n }", "protected function _error($error = '')\n {\n $this->_error = $error;\n }", "protected function _set_error($error) {\r\n $this->error = $error;\r\n }", "private function error($msg)\n {\n\t\t$this->error = true;\n\t\t$this->error_message .= $msg;\n }", "public function getErrorText(){\n return $this->error;\n }", "private function setError($error) {\n $this->error = $error;\n }", "protected function setError($error) {\r\n $this->error = $error;\r\n }", "function errorMSGControll() {\n $this->errorMSG = $this->model->getErrorMSG();\n $this->view->errorMSGHandler($this->errorMSG);\n }", "public function setErrorMessage($value)\n\t{\n\t\tif(parent::getErrorMessage() === $value)\n\t\t\treturn;\n\n\n\t\tparent::setErrorMessage($value);\n\t\tif($this->getActiveControl()->canUpdateClientSide())\n\t\t{\n\t\t\t$client = $this->getPage()->getCallbackClient();\n\t\t\t$func = 'Prado.Validation.setErrorMessage';\n\t\t\t$client->callClientFunction($func, array($this, $value));\n\t\t}\n\t}", "protected function setError($error) {\n self::$error = $error;\n }", "public function setError($error, $code, $msg){\n $this->errors[$error] = array('code'=>$code, 'message'=>$msg);\n }", "public function setError($message, $key = null) {\n if (!is_null($key))\n $this->errors[$key] = $message;\n else\n $this->errors[] = $message;\n }", "public function setErrors($error) {\n\t\t$params = $this->controller->request->params; \n\t\t$message = $error->getMessage();\n\t\t$url = $this->controller->request->here();\n\t\t$code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500;\n\t\t$this->controller->response->statusCode($code);\n\t\t$this->controller->set(array(\n\t\t\t'name' => $message,\n\t\t\t'message' => h($url),\n\t\t\t'error' => $error,\n\t\t));\n\t\tif(isset($params['admin'])){\n\t\t\t$this->controller->render('/Errors/admin_error','admin_login');\n\t\t}else{\n\t\t\techo \"asdsadsadsa\"; die;\n\t\t\t$this->controller->render('/Errors/error','error');\n\t\t}\n\t}", "public function setErrorMessage($errorMessage)\n\t{\n\t\t$this->errorMessage = $errorMessage;\n\t}", "function setError($message)\n{\n\t$args = array_slice(func_get_args(), 1) ;\n\t$message = vsprintf($this->t($message), $args);\n\n\tif ($this->throwsExceptions) {\n\t\tthrow new AuthException($message);\n\t}\n\telse {\n\t\t$this->errors[] = $message;\n\t\t$this->onError($message);\n\t}\n}", "public static function setErrors($msg){\n $_SESSION[UtilMessage::SET_ERRORS] = $msg;\n }", "protected function setErrorsExist() {}", "public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }", "public function setPropertyNotValidErrorMessage(string $errorMessage);", "abstract protected function _getErrorString();", "protected function setError($error) {\n $this->error = $error;\n }", "protected function setFlashMessage()\n {\n if ($message = $this->session()->getFlash('flash-message')) {\n if ($this->session()->getFlash('flash-error')) {\n $this->pageView()->setError($message);\n } else {\n $this->pageView()->setMessage($message);\n }\n }\n }", "public function set_error($error) {\n $this->error = $error;\n }", "public function setError($message, $code = 0) {\n\t\tif (!empty($message)) {\n\t\t\t$this->err_message = $message;\n\t\t\t$this->err_code = $code;\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')\n {\n }", "public static function setError($message) {\n self::$_class = \"Example\\\\Excel\\\\Controllers\\\\Error\";\n throw new \\Exception($message);\n }", "public function testSetMessage()\n {\n $inputInvalid = 'abcdefghij';\n $this->assertFalse($this->_validator->isValid($inputInvalid));\n $messages = $this->_validator->getMessages();\n $this->assertEquals(\"'$inputInvalid' is more than 8 characters long\", current($messages));\n\n $this->_validator->setMessage(\n 'Your value is too long',\n Zend_Validate_StringLength::TOO_LONG\n );\n\n $this->assertFalse($this->_validator->isValid('abcdefghij'));\n $messages = $this->_validator->getMessages();\n $this->assertEquals('Your value is too long', current($messages));\n }", "public function setError($error)\n\t{\n\t\t$this->error = $error;\n\t}", "function setError( $state);", "protected function setErrorMessage(Message $msg) {\n $this->errors->clearContent()->append($msg);\n return $this;\n }", "function __set_error($error_code = null, $error_message = null,\n $error_details = null) {\n\n $this->error_code = $error_code;\n $this->error_message = $error_message;\n $this->error_details = $error_details;\n\n}", "protected function getErrorFlashMessage() {}", "public function error($message)\n {\n }", "public function error($message)\n {\n }", "public static function customErrorMsg()\n {\n echo \"\\n<p>An error occured, The error has been reported.</p>\";\n exit();\n }", "public function setError($error)\n {\n $this->error = $error;\n }", "public function setError($error)\n {\n $this->error = $error;\n }", "public function setError($error)\n {\n $this->error = $error;\n }", "public static function set_error($error = NULL)\n\t{\n\t\tSession::instance()->set_flash('error', $error);\n\t}", "public function setErrorMessage($errorMessage)\n {\n $this->errorMessage = $errorMessage;\n }", "function setError($code = 1, $message = 'An unknown error occured.', $debug = '') {\r\n\t\t$this->errorCode = $code;\r\n\t\t$this->errorMessage = $message;\r\n\t\tif (DEBUG) {\r\n\t\t\t$this->errorMessage .= $debug;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function setError(string $filename, string $message): void\n {\n $this->errorMessage = 'Unable to upload the file '\n . $filename\n . '. '\n . $message;\n }", "public function setError($error) {\n \t$dbg = debug_backtrace();\n $caller = next($dbg);\n \t$this->error = sprintf('[%s::%s - %s] %s', basename($caller['file']), $caller['function'], $caller['line'], $error);\n }", "public function get_error_message() {\n\t\treturn $this->error_message;\n\t}", "public function setError($value) {\n return $this->set(self::ERROR, $value);\n }", "public function setError($value) {\n return $this->set(self::ERROR, $value);\n }", "public function message()\n {\n return 'The validation error messagess.';\n }", "public function getErrorMessage();", "public function getErrorMessage();", "protected function renderAsError() {}", "public function set_error($msg)\n\t{\n\t\tif (is_array($msg))\n\t\t{\n\t\t\tforeach ($msg as $val)\n\t\t\t{\n\t\t\t\t$msg = ($this->CI->lang->line($val) == FALSE) ? $val : $this->CI->lang->line($val);\n\t\t\t\t$this->error_msg[] = $msg;\n\t\t\t\tlog_message('error', $msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = ($this->CI->lang->line($msg) == FALSE) ? $msg : $this->CI->lang->line($msg);\n\t\t\t$this->error_msg[] = $msg;\n\t\t\tlog_message('error', $msg);\n\t\t}\n\t}", "public function error(string $message): Message\n {\n $this->text = $this->filter($message);\n $this->type = \"button_error icon-error\";\n return $this;\n }", "public function setErrorMessage($errorMessage): void\n {\n $this->errorMessage = $errorMessage;\n }", "public function triggerError() {\n $this->_errors = true;\n }", "public function message()\n {\n return \"Ошибочное значение\";\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }" ]
[ "0.7800508", "0.7569773", "0.75496423", "0.7513437", "0.7476654", "0.74315214", "0.7350046", "0.72910184", "0.7278691", "0.7224812", "0.7207406", "0.71979845", "0.7192795", "0.71900636", "0.71900463", "0.71596473", "0.7157167", "0.7156258", "0.7152166", "0.7135397", "0.7130585", "0.7116585", "0.7114522", "0.71069866", "0.70780486", "0.70447594", "0.70237654", "0.7017293", "0.69915944", "0.69379073", "0.69225186", "0.69208795", "0.691476", "0.6877825", "0.6875622", "0.6869033", "0.6867823", "0.68676895", "0.68456924", "0.6830622", "0.6829154", "0.681781", "0.6809805", "0.6783065", "0.6780627", "0.6779118", "0.6743374", "0.67397475", "0.67314804", "0.6729807", "0.6725669", "0.67206264", "0.67082965", "0.6707664", "0.6707085", "0.6691225", "0.6686027", "0.6679466", "0.6666164", "0.665501", "0.6653786", "0.66517246", "0.66501206", "0.6631987", "0.6631959", "0.6627874", "0.66252875", "0.6621074", "0.66092104", "0.66088307", "0.65886956", "0.6570272", "0.6568457", "0.65538734", "0.6548073", "0.6548073", "0.65293473", "0.652609", "0.652609", "0.652609", "0.6522528", "0.6520194", "0.6506574", "0.6504307", "0.6486661", "0.6486113", "0.6469965", "0.6469965", "0.64639044", "0.6452014", "0.6452014", "0.6437112", "0.64277637", "0.6425507", "0.640345", "0.6402171", "0.63884526", "0.6381664", "0.6381664", "0.6381664", "0.6381664" ]
0.0
-1
get list of user activities getoperations optional field for loading relative operations
public function getUserActivitiesAction() { $getOperations = false; $activity = new Workapp_Activity(); $data = $this->getRequestData(); if (isset($data['getoperations'])) { $getOperations = $data['getoperations']; } $this->_helper->json($activity->getActivityList(array('user_id' => $this->getDeviceSession()->getUserId(), 'getoperations' => $getOperations))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserOperationsAction()\n {\n $operation = new Workapp_Operation();\n $this->_helper->json($operation->getOperationList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "public function getUserActivityList(){\n return($this->userActivityList);\n }", "public function getOpinions()\n {\n return $this->hasMany(Opinions::class, ['task_id' => 'id']);\n }", "public function activities()\n {\n return $this->hasMany(Activity::class, 'activity_of_user_id', 'id');\n }", "public function getOperations()\r\n {\r\n return $this->operations;\r\n }", "function getActivities() \n {\n return $this->instance->getActivities();\n }", "public function actionShowusersactivities()\n\t{\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->limit=6;\t\n\t\t$uid = Yii::app()->user->id; //logged in userId\n\t\t$activityArray = array(); //contains, all activities, Like,Dislikes,Become friends etc\n\t\t$str='';\n\t\t$limit = 10;\n\t\t$flag = (isset($_GET['flag']))?$_GET['flag']:'';\n\t\tif(!empty($uid))\n\t\t{\n\t\t\t// ** User Logged IN ***\n\t\t\t//Show Photo Likes activities of Me & friends of Me\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit,$uid);\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$uname = ($uid==$v['userid'])?'You':$v['username'];\n\t\t\t\t\t$owner_name = $v['ownername'];\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$owner_name.'&#39;s photo:';\n\t\t\t\t\t$src=Yii::app()->baseUrl.'/files/'.$v['owner_id'].'/thumbnail/'.$v['photos_name'];\t\t\t\t\n\t\t\t\t\t$file_path = Yii::getPathOfAlias('webroot').'/files/'.$v['owner_id'].'/'.$v['photos_name'];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!file_exists($file_path)){\n\t\t\t\t\t\t$src=Yii::app()->theme->baseUrl.'/img/noimage.jpg';\n\t\t\t\t\t}\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.$src.'\" />';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t\n\t\t\t\t\t//Duplicate Testing\tDUMMY Data .......\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />';\n\t\t\t\t\t$activityArray['1410354280'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t$activityArray['1410354380'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\t\t\t\t\t\n\t\t\t\t\t//Duplicate Ends\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of Friends..ie who had recently become your friend\t\t\n\t\t\t$criteria->condition = \"t.user_id='\".$uid.\"' AND t.status=1\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['friend']['user_details_avatar'],'name'=>'you','message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Users..ie who had recently Send You Friends Request\t\t\n\t\t\t$criteria->condition = \"t.friend_id='\".$uid.\"' AND t.status=0\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' Had Sent You a Friend Request';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$v['user']['user_details_firstname'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Friend's friends..ie your friend who had add another friend\t\t\t\n\t\t\t$friends=UsersFriends::model()->getActivityFriends($limit,$uid);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t//where $[name] is your(loggedIn User) frnd , who also become frnd with $v['ffname']\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' and '.$v['ffname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Get List of users who started to follow you..\n\t\t\t$followers=UsersFollow::model()->getActivityFollow($limit,$uid);\n\t\t\tif(count($followers)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($followers as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' is now your follower';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tunset($followers);\n\t\t\t\n\t\t\t//Now get List of Extra Notification of Posly, only for Top-Header DUMMY Data .......\n\t\t\tif($flag==\"header\"){\n\t\t\t\t$msg = 'There is an event to be organised at bangalore, at 1-oct-14, for Fashion ..an fasion event';\n\t\t\t\t$activityArray['1410835502'] = array('avatar'=>'avatar1_small.jpg','name'=>'Posly','message'=>$msg,'image'=>''); \n\t\t\t\t//*Duplicate Testing Data\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ** User NOT Logged IN ***\n\t\t\t//Show general user Photo Likes activities , as no body has loggedIn\t\t\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit); \t\t\t\t\t\t\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v){\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$v['ownername'].'&#39;s photo:';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$v['username'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of any user who had recently become friends\n\t\t\t$criteria->condition = \"status=1\";\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$user = $v['user']['user_details_firstname'].' '.$v['user']['user_details_lastname'];\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$user,'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t}\n\t\t\n\t\t//Now Create the display Activity HTML\t\t\n\t\tif(count($activityArray)>0)\n\t\t{\n\t\t\tkrsort($activityArray); \n\t\t\t//Sort activity Array By Keys -- SORT\t\n\t\t\t$unread_notifycount=0;\n\t\t\t$user_notifyReaddate = (!empty($uid))?Yii::app()->user->getState(\"notify_readdate\"):'0';\t\t\t\n\t\t\tforeach($activityArray as $keys=>$values)\n\t\t\t{\t\t\t\n\t\t\t\t$fromurl=strstr($values['avatar'], '://', true);\n\t\t\t\tif($fromurl=='http' || $fromurl=='https')\n\t\t\t\t\t$avatar = $values['avatar']; \n\t\t\t\telse\n\t\t\t\t$avatar = Yii::app()->baseUrl.'/profiles/'.$values['avatar'];\n\t\t\t\tif($flag==\"header\")\n\t\t\t\t{\n\t\t\t\t\t//This is for Top-Header Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li> \n\t\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<div class=\"main\">\n\t\t\t\t\t<span class=\"photo\">\n\t\t\t\t\t<img class=\"avatar-user-l img-responsive\" src=\"'.$avatar.'\" alt=\"\"/>\n\t\t\t\t\t</span>\t\t\t\t\t\n\t\t\t\t\t<div class=\"message\"> \n\t\t\t\t\t\t<span class=\"name\">'.$values['name'].'</span> '.$values['message'].' \n\t\t\t\t\t\t<div class=\"newtime\">'.$this->get_msgtime($keys).'</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</a> \n\t\t\t\t\t</li>\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t} else{\n\t\t\t\t\t//This for Side-Bar UserActivity/Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.$avatar.'\" />\n\t\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<span class=\"notimsg\"><span class=\"name\">'.$values['name'].'</span> '.$values['message'].'</span>'.$values['image'].'\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t</li>\t\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t//Now check For notify Cnt for LoggedIn user\t\t\t\t\n\t\t\t\tif(!empty($uid))\n\t\t\t\t{ //Condition if notify Date in DB is Less then Keys(notifyTimedate), then its an Unread\t\t\n\t\t\t\t\tif($user_notifyReaddate < $keys){\n\t\t\t\t\t\t$unread_notifycount++; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!empty($uid)){\n\t\t\t\t$unread_notifycount = ($unread_notifycount==0)?'':$unread_notifycount;\n\t\t\t\tYii::app()->user->setState('notify_count', $unread_notifycount);\n\t\t\t}\n\t\t}\n\t\tunset($activityArray);\n\t\tif(empty($str)){\n\t\t\t//a Default Dummy status.\n\t\t\t$str='<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />\n\t\t\t<div class=\"message\"> <span class=\"name\">Chanh Ny</span> likes Chi Minh Anh photo. </div>\n\t\t\t</li>';\n\t\t}\t\t\n\t\techo $str;\t\t\n\t\tYii::app()->end();\t\n\t}", "public function getOperations()\n {\n return $this->operations;\n }", "function activityList($userId,$data){\n\n $activity = array(); \n $activity['hasAffiliates'] = 0;\n $aff = $this->common_model->is_data_exists(USER_AFFILIATES,array('user_id'=>$userId));\n if($aff){\n $activity['hasAffiliates'] = 1;\n }\n switch($data['listType']){ //For get activity list\n case 'today' : \n $activity['today'] = $this->todayActivityList($userId,$data);\n break;\n\n case 'tomorrow' : \n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n break;\n\n case 'soon' :\n $activity['soon'] = $this->soonActivityList($userId,$data);\n break;\n\n case 'others' :\n $activity['others'] = $this->othersActivityList($userId,$data);\n break;\n\n default:\n $activity['today'] = $this->todayActivityList($userId,$data);\n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n $activity['soon'] = $this->soonActivityList($userId,$data); \n $activity['others'] = $this->othersActivityList($userId,$data); \n }//End of activity list\n\n //Now we will set events for each activities\n if(!empty($activity['today']) && isset($activity['today'])){\n foreach ($activity['today'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['today'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['tomorrow']) && isset($activity['tomorrow'])){\n foreach ($activity['tomorrow'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['tomorrow'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['soon']) && isset($activity['soon'])){ \n foreach ($activity['soon'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['soon'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }//End of setting events\n return $activity;\n\n }", "public function actiDepor($user){\r\n\t\t$stmt = $this->db->prepare(\"SELECT actividad FROM activities_user WHERE usuario=? AND conf=1\");\r\n\t\t$stmt->execute(array($user));\r\n\t\t$activities_conf = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$activities = array();\r\n\r\n\t\tforeach ($activities_conf as $activity_conf){\r\n\t\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities WHERE id=?\");\r\n\t\t\t$stmt->execute(array($activity_conf[\"actividad\"]));\r\n\t\t\t$actis = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t\tforeach ($actis as $acti){\r\n\r\n\t\t\t\tarray_push($activities, new Activity($acti[\"id\"],\r\n\t\t\t\t\t\t\t\t\t$acti[\"nombre\"],\r\n\t\t\t\t\t\t\t\t\t$acti[\"descripcion\"],\r\n\t\t\t\t\t\t\t\t\t$acti[\"dia\"],\r\n\t\t\t\t\t\t\t\t\t$acti[\"hora_inicio\"],\r\n\t\t\t\t\t\t\t\t\t$acti[\"hora_fin\"],\r\n\t\t\t\t\t\t\t\t\t$acti[\"plazas\"],\r\n\t\t\t\t\t\t\t\t\t$acti[\"entrenador\"]));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $activities;\r\n\t}", "function getOperationInfo() {\n return userpoints_get_info($this->getOperation());\n }", "public function activitiesCaused(){\n\t\treturn $this->hasMany('App\\Useractions', 'ActionByUserId');\n\t}", "public function getList()\n {\n $result = array();\n $list = Pi::registry('activity', 'user')->read();\n foreach ($list as $name => $activity) {\n $result[$name] = array(\n 'title' => $activity['title'],\n 'icon' => $activity['icon'],\n );\n }\n\n return $result;\n }", "public function getEventOperation($id)\n {\n\n $FillableDropdown = new FillableDropdown();\n $operations = $FillableDropdown->eventOperations($default = 2);\n\n $event = Events::findOrFail($id);\n if(count($event) > 0){\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $user_id = $user->id;\n }else{\n\n $user_id = false;\n }\n\n if (isset($user_id)) {\n\n $subscribed_event = $event->user()\n ->wherePivot('user_id', '=', $user_id)\n ->select('operation')\n ->get();\n\n if(isset($subscribed_event) && $subscribed_event->count() > 0){\n\n\n if(isset($subscribed_event[0])){\n\n $op_key = $subscribed_event->first()->operation;\n }\n\n $operation_arr = array();\n if(count($operations) > 0 && isset($op_key)){\n\n foreach (array_values($operations) as $index => $value){\n\n if($index%2 == 0){\n\n $operation_arr = array_add($operation_arr, $index, $value);\n }\n if($op_key == $index && $op_key%2 == 0){\n\n $operation_arr = array_add($operation_arr, $index+1, $operations[$index+1]);\n }\n if($op_key == $index && $op_key%2 != 0){\n\n $operation_arr = array_add($operation_arr, $index-1, $operations[$index-1]);\n }\n\n }\n\n\n if(count($operation_arr) > 0){\n\n if (array_key_exists($op_key, $operation_arr)) {\n\n $operations = array_except($operation_arr, [$op_key]);\n\n return $operations;\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n }else{\n\n return false;\n }\n }\n else{\n return false;\n }\n\n }\n }", "public function activitiesAffected(){\n\t\treturn $this->hasMany('App\\Useractions', 'ActionToUserId');\n\t}", "public function getAllActivities(){\n $this->db->query('SELECT * FROM activity WHERE disabled = 0 ORDER BY name ASC');\n\n //assign result set\n $results = $this->db->resultSet();\n\n return $results;\n }", "public function getOperation();", "public function listAction(){\n\n $session = $this->getRequest()->getSession();\n\n if($session->has('user')){\n\n $options['user'] = $session->get('user');\n \n $em = $this->getDoctrine()->getManager();\n $qb = $em->createQueryBuilder();\n $actividades = $em->getRepository('TesisAdminBundle:Actividad')->findAll();\n $options['actividades'] = $actividades; \n\n return $this->render('TesisAdminBundle:Actividad:list-activities.html.twig',$options);\n }\n\n return $this->render('TesisSCBundle:Main:denegado.html.twig');\n }", "public function getUser()\n {\n return $this->hasMany(User::className(), ['activity_status' => 'id']);\n }", "public function getUserActivityByIdAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if(isset($data['getoperations']) && $activity){\n $operation = new Workapp_Activity();\n $activity->operations = $operation->getActivityRequiredByOperations($activity);\n }\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('no Activity for this user with current activity_id!');\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function getActivitiesEntities() : array;", "public function allOperations(){\n $fonction = Auth::user()->fonction;\n if($fonction == 'admin') return redirect('/admin/dashboard');\n if($fonction == 'gest') return redirect('/gest/dashboard');\n //get all operations\n $operations['operations'] = DB::table('operations')->get();\n return view('tech.alloperations',$operations);\n }", "public function operations()\n {\n return $this->morphMany(History::class, 'user');\n }", "function activity_list(){\n\t\t$this->load->model('operations_model'); \n $data['activity_list']=$this->operations_model->display_activity($id);\n\t\t$this->load->view('activity_list',$data);\n\t\t}", "public function retrieveUserActions()\n {\n return $this->start()->uri(\"/api/user-action\")\n ->get()\n ->go();\n }", "function myActivityList($userId,$data){\n\n $activityData = array();\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n if(empty($data['limit']) && empty($data['offset'])){\n $data['offset'] = 0; $data['limit']= 5; \n }\n $where = array('c.status'=>'1','cc.status'=>'1','a.status'=>'1','a.creator_id'=>$userId);\n \n $this->db->select('IF(a.image IS NULL or a.image = \"\",\"'.$defaultActivityImg.'\",concat(\"'.$activityImg.'\",a.image)) as image,a.name as activityName,a.is_hide,a.activityId,c.club_name');\n $this->db->from(ACTIVITIES.' as a'); \n $this->db->join(CLUBS.' as c','a.club_id = c.clubId');\n $this->db->join(CLUB_CATEGORY.' as cc','c.club_category_id = cc.clubCategoryId'); \n $this->db->join(ACTIVITY_EVENTS.' as ae','a.activityId = ae.activity_id AND ae.status = \"1\"','left');\n \n $this->db->where($where);\n $this->db->group_by('a.activityId');\n $this->db->order_by(\"a.activityId desc\");\n $this->db->limit($data['limit'],$data['offset']);\n $query = $this->db->get();\n if($query->num_rows() >0){\n $activityData = $query->result();\n foreach ($activityData as $key => $value) {\n $activityId = $value->activityId;\n $activityData[$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n return $activityData;\n }", "public function getActionsAttribute()\n {\n return [\n 'id' => $this->id,\n 'cancel' => $this->concept == 'PENDIENTE',\n 'approved' => $this->concept == 'APROBADO',\n 'next' => __('app.selects.project.concept_next.' . $this->concept),\n ];\n }", "function getActivityList() {\n try {\n $items = $this->perform_query_no_param(\"SELECT * from activityModel\");\n return $this->result_to_array($items);\n } catch (Exception $ex) {\n $this->print_error_message(\"Unable to Getting Activity List\");\n return null;\n }\n }", "public function createUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['title']) && isset($data['activity_id'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/operations/' . $user->getKey() . \"-operations\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-operations\");\n $folder->setParentId(4);\n $folder->save();\n }\n\n $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']);\n\n $operation = new Object_Operation();\n $operation->setCreator($user);\n $operation->setTitle($data['title']);\n $operation->setExplanation(isset($data['explanation']) ? $data['explanation'] : \"\");\n $operation->setLocation($geo);\n $operation->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : \"\");\n $operation->setVideo(isset($data['video']) ? Asset_Video::getById($data['video']) : \"\");\n $operation->setActivity(Object_Activity::getById($data['activity_id']));\n $operation->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $operation->setPublished(true);\n $operation->setParentId($folder->getId());\n if (!$operation->save()) {\n $this->setErrorResponse('cannot save Operation object');\n }\n } else {\n $this->setErrorResponse('title and activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($operation);\n }", "function socialActivityGet($opt){\n\n\tif($opt['debug']) $this->pre(\"OPTION\", $opt);\n\n\t$dbMode = 'dbMulti';\n\n\t// GET notification\n\tif($opt['notification']){\n\t\t$join[] = \"INNER JOIN k_socialnotification ON k_socialactivity.id_socialactivity = k_socialnotification.id_socialactivity\";\n\t\t$cond[] = \"k_socialnotification.id_user=\".$opt['id_user'];\n\t}\n\n\t// GET id_user\n\tif(array_key_exists('id_user', $opt)){\n\n\t\tif(is_array($opt['id_user'])){\n\t\t\t$cond[] = \"id_user IN(\".implode(',', $opt['id_user']).\")\";\n\t\t}else\n\t\tif($opt['id_user'] > 0){\n\t\t\t$cond[] = \"id_user=\".$opt['id_user'];\n\t\t}else{\n\t\t\tif($opt['debug']) $this->pre(\"ERROR: ID_USER (ARRAY,NUMERIC)\", \"GIVEN\", var_export($opt['user'], true));\n\t\t\treturn array();\n\t\t}\t\t\n\n\t}\n\n\n\tif($dbMode == 'dbMulti'){\n\n\t\t$group = \"\\nGROUP BY \".(($opt['groupby'] != NULL)\n\t\t\t? $opt['groupby']\n\t\t\t: \"k_socialpost.id_socialpost\");\n\t\t\n\t\t$order = \"\\nORDER BY \".(($opt['order'] != '' && $opt['direction'] != '')\n\t\t\t? $opt['order'].\" \".$opt['direction']\n\t\t\t: \"socialActivityDate DESC\");\n\n\t\t$limit = \"\\nLIMIT \".(($opt['offset'] != '' && $opt['limit'] != '')\n\t\t\t? $opt['offset'].\",\".$opt['limit']\n\t\t\t: \"0,50\");\n\n\t\tif($opt['noLimit'] == true) unset($limit);\n\t}\n\n\t$field\t\t= \"k_socialactivity.*\";\n\t$where\t\t= is_array($cond) ? \"\\nWHERE\\n\".implode(\" AND \", $cond) : NULL;\n\t$inner\t\t= is_array($join) ? \"\\n\".implode(\"\\n\", $join).\"\\n\" : NULL;\n\n\t$activity\t= $this->dbMulti(\"SELECT \".$field.\" FROM k_socialactivity \".$inner. $where . $__group__ . $order . $limit);\n\tif($opt['debug']) $this->pre($this->db_query, $this->db_error, $activity);\n\n\treturn $activity;\n}", "public function getAction(){\n \t$user=Doctrine_Query::create()\n\t\t ->select(\"u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,u.ID_role\")\n\t\t ->from(\"Users u\")\n\t\t ->addWhere(\"u.ID=?\",$this->getRequest()->getParam('id'))\n\t\t ->fetchOne(null,Doctrine::HYDRATE_ARRAY);\n $this->emitLoadData($user);\n }", "public function get_actions() {\n $actions = parent::get_actions();\n $assignaction = new deepsight_action_usersetuser_assign($this->DB, 'usersetuserassign');\n $assignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n array_unshift($actions, $assignaction);\n return $actions;\n }", "public function getAccessionsList(){\n return $this->_get(2);\n }", "public function getAccessionsList(){\n return $this->_get(2);\n }", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "public function getAdditionalActions() {}", "function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true){\n\t\tglobal $current_user;\n\t\t$act_list = array();\n\t\t$seen_ids = array();\n\n\n\t\t// get all upcoming meetings, tasks due, and calls for a user\n\t\tif(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {\n\t\t\t$meeting = new Meeting();\n\n\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t$meeting->disable_row_level_security = true;\n\t\t\t}\n\n\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t$focus_meetings_list = build_related_list_by_user_id($meeting,$user_id,$where);\n\t\t\tforeach($focus_meetings_list as $meeting) {\n\t\t\t\tif(isset($seen_ids[$meeting->id])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$seen_ids[$meeting->id] = 1;\n\t\t\t\t$act = new CalendarActivity($meeting);\n\n\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($show_calls){\n\t\t\tif(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$call = new Call();\n\n\t\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t\t$call->disable_row_level_security = true;\n\t\t\t\t}\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t\t$focus_calls_list = build_related_list_by_user_id($call,$user_id,$where);\n\n\t\t\t\tforeach($focus_calls_list as $call) {\n\t\t\t\t\tif(isset($seen_ids[$call->id])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$seen_ids[$call->id] = 1;\n\n\t\t\t\t\t$act = new CalendarActivity($call);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif($show_tasks){\n\t\t\tif(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$task = new Task();\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);\n\t\t\t\t$where .= \" AND tasks.assigned_user_id='$user_id' \";\n\n\t\t\t\t$focus_tasks_list = $task->get_full_list(\"\", $where,true);\n\n\t\t\t\tif(!isset($focus_tasks_list)) {\n\t\t\t\t\t$focus_tasks_list = array();\n\t\t\t\t}\n\n\t\t\t\tforeach($focus_tasks_list as $task) {\n\t\t\t\t\t$act = new CalendarActivity($task);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $act_list;\n\t}", "public function get_actions(): array;", "public function actiTrainer($user){\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities WHERE entrenador=?\");\r\n\t\t$stmt->execute(array($user));\r\n\t\t$activities_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$activities = array();\r\n\r\n\t\tforeach ($activities_db as $activity){\r\n\r\n\t\t\tarray_push($activities, new Activity($activity[\"id\"],\r\n\t\t\t\t\t\t\t\t$activity[\"nombre\"],\r\n\t\t\t\t\t\t\t\t$activity[\"descripcion\"],\r\n\t\t\t\t\t\t\t\t$activity[\"dia\"],\r\n\t\t\t\t\t\t\t\t$activity[\"hora_inicio\"],\r\n\t\t\t\t\t\t\t\t$activity[\"hora_fin\"],\r\n\t\t\t\t\t\t\t\t$activity[\"plazas\"],\r\n\t\t\t\t\t\t\t\t$activity[\"entrenador\"]));\r\n\t\t}\r\n\t\treturn $activities;\r\n\t}", "public function getOperations() {\n return $this->__getFunctions();\n }", "public function getOperation()\n {\n $objDataBase = $this->_connectSuperDataBase();\n\n $objDataBase->executeQueryStoreProcedure('get_Operations');\n\n\t $row = $objDataBase->exploreAllArraySelect();\n\n if (!isset($row)) {\n $row[0]['Pk_operation'] = 1;\n $row[0]['name'] = Class_Config::get('operation');\n $row[0]['domain'] = Class_Config::get('domain');\n }\n\t\n\n return $row;\n }", "function Activity() {\n\t\t$query_string = Request::$GET;\n\t\t$global_string = $this->buildQuery($query_string);\n\t\t//Display User select tool if user has admin permissions\n\t\t$globalUser = '';\n\t\tif ($this->User->HasModuleItemAccess('administration', CU_ACCESS_ALL, CU_ACCESS_READ)) {\n\t\t\t// $actualUserID = $this->User->ID;\n\t\t\t$userID = Request::get('userID', Request::R_INT);\n\t\t\t// Create Temp user for creating correct permissions\n\t\t\tif ($userID) {\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t$this->TempUser\t\t =& new User();\n\t\t\t$this->TempUser->Initialise($userID, $this->DB);\n\t\t\t} else if ($this->Session->Get('springboardID')) {\n\t\t\t$userID = $this->Session->Get('springboardID');\n\t\t\t$this->TempUser\t\t =& new User();\n\t\t\t$this->TempUser->Initialise($userID, $this->DB);\n\t\t\t} else {\n\t\t\t$this->TempUser->ID = $this->User->ID;\n\t\t\t$userID = $this->User->ID;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t}\n\t\t\t$globalUser = '<label>' . MSG_USER_TO_SHOW . '</label><select id=\"activityUserToShowFilter\">';\n\n\t\t\t$SQL = sprintf(SQL_GET_USER_LIST);\n\t\t\t$userList = $this->DB->Query($SQL);\n\t\t\tif ($userList) {\n\t\t\tfor ($i = 0; $i < count($userList); $i++) {\n\t\t\t\t$globalUser .= '<option value=\"' . $userList[$i]['ID'] . '\"'\n\t\t\t\t. ($this->TempUser->ID == $userList[$i]['ID'] ? ' selected' : '') . '>'\n\t\t\t\t. $userList[$i]['FirstName'].' '.$userList[$i]['LastName'].'</option>';\n\t\t\t\t\n\t\t\t}\n\t\t\t}\n\n\t\t\t$globalUser .= '</select>';\n\t\t\t$tmplDash['globalUser'] = $globalUser;\n\n\t\t\t\t\t\t$tmplDash['displayState'] = ($userID == $this->User->ID) ? \"showDashOnLoad\" : \"dontShowDashOnLoad\";\n\n\t\t\t$tmplDash['showfilter'] = '';\n\n\t\t\t$URI = split (\"index\\.php\",Request::server(SCRIPT_NAME_VAR));\n\t\t\t// Create validity key\n\t\t\t$this->KeyUser =& new User();\n\t\t\t$this->KeyUser->Initialise($userID, $this->DB);\n\t\t\t$key = substr(md5($this->KeyUser->Fullname.$this->KeyUser->PasswordHash), 2, 8);\n\t\t\t$modAction[] = '<a href=\"webcal://' . Request::server(SERVER_NAME_VAR) . $URI[0] . 'system/ical_springboard.php?show=' . $query_string['show'] \n\t\t\t\t. '&completed=' . $query_string['completed'] \n\t\t\t\t. '&action=' . $query_string['action'] \n\t\t\t\t. '&key=' . $key \n\t\t\t\t. '&userid=' . $userID . '\">' . MSG_SYNC_TO_ICAL . '</a>';\n\n\t\t\t$modAction[] = '<a id=\"dash-toggler\" href=\"#\" onclick=\"toggleDash(); return false;\">'.MSG_SHOW_DASH.'</a>';\n\t\t\t\t\t\t$tmplDash['period'] = '';\n\t\t\t$this->setDash($this->getTemplate(\"dashBlock\", $tmplDash));\n\t\t} else {\n\t\t\t$userID = $this->User->ID;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t}\n\t\t$modAction[] = '<a href=\"index.php?module=springboard&completed=1\">'.MSG_VIEW_COMPLETED.'</a>';\n\t\t//end of other user select code.\n\n\t\t$this->CreateTabs('activity');\n\n\t\t// Tell MySQL if we want the week to start on Sunday or Monday.\n\t\t$weekMode = (CU_WEEK_START == 'Sunday') ? 0 : 1;\n\t\t$day = $this->DB->QuerySingle(sprintf(SQL_GET_ACTIVITY_DAY, $userID));\n\t\t$week = $this->DB->QuerySingle(sprintf(SQL_GET_ACTIVITY_WEEK, $weekMode, $userID));\n\t\t$month = $this->DB->QuerySingle(sprintf(SQL_GET_ACTIVITY_MONTH, $userID));\n\n\t\tif($userID == $this->User->ID){\n\t\t\t$tmpl['txtUsername'] = $this->User->Name();\n\t\t} else {\n\t\t\t$tmpl['txtUsername'] = $this->TempUser->Name();\n\t\t}\n\t\t$tmpl['txtDayComments'] = $day['Comments'];\n\t\t$tmpl['txtDayHours'] = $day['Hours'];\n\t\t$tmpl['txtWeekComments'] = $week['Comments'];\n\t\t$tmpl['txtWeekHours'] = $week['Hours'];\n\t\t$tmpl['txtMonthComments'] = $month['Comments'];\n\t\t$tmpl['txtMonthHours'] = $month['Hours'];\n\n\t\t$tmpl['issues'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_OPEN_ISSUES, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\t$url = \"index.php?module=springboard&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['name'] = \"<a href=\\\"$url\\\">{$r['TaskName']}</a>\";\n\t\t\t\t$url = \"index.php?module=projects&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['value'] = \"<a href=\\\"$url\\\">{$r['ProjectName']}</a>\";\n\t\t\t\t$tmpl['issues'] .= $this->getTemplate('activity_item', $itemTmpl);\n\t\t\t}\n\t\t}\n\n\t\t$tmpl['commentary'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_RECENT_COMMENTARY, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\t$url = \"index.php?module=springboard&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['name'] = \"<a href=\\\"$url\\\">{$r['TaskName']}</a>\";\n\t\t\t\t$url = \"index.php?module=projects&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['value'] = \"<a href=\\\"$url\\\">{$r['ProjectName']}</a>\";\n\t\t\t\t$tmpl['commentary'] .= $this->getTemplate('activity_item', $itemTmpl);\n\t\t\t}\n\t\t}\n\n\t\t$tmpl['pages'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_PAGES_VISITED, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\tswitch ($r['Context'])\n\t\t\t\t{\n\t\t\t\t\tcase 'client': $context = MSG_CLIENT; $url = \"index.php?module=clients&action=view&id={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'project': $context = MSG_PROJECT; $url = \"index.php?module=projects&action=view&projectid={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'task': $context = MSG_TASK; $url = \"index.php?module=projects&action=taskview&projectid={$r['Comment']}&taskid={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'file': $context = MSG_FILE; $url = \"index.php?module=files&action=view&fileid={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'contact': $context = MSG_CONTACT; $url = \"index.php?module=contacts&action=view&id={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'projectreport': $context = MSG_REPORT; $url = \"index.php?module=reports&action=analysis&report={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'workreport': $context = MSG_REPORT; $url = \"index.php?module=reports&action=timesheets&report={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'login': $context = MSG_LOGIN; $url = '';\n\t\t\t\t\tdefault: $context = ''; $url = '';\n\t\t\t\t}\n\n\t\t\t\tif ($context != '')\n\t\t\t\t{\n\t\t\t\t\tif ($url == '')\n\t\t\t\t\t\t$itemTmpl['name'] = \"$context: {$r['Detail']}\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$itemTmpl['name'] = \"<a href=\\\"$url\\\">$context: {$r['Detail']}</a>\";\n\t\t\t\t\t$itemTmpl['value'] = $r['Timestamp'];\n\t\t\t\t\t$tmpl['pages'] .= $this->getTemplate('activity_item', $itemTmpl);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tmpl['groupactivity'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_TASK_TIMES_FOR_GROUP_MEMBERS, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\t$url = \"index.php?module=springboard&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['task'] = \"<a href=\\\"$url\\\">{$r['TaskName']}</a>\";\n\t\t\t\t$itemTmpl['user'] = $r['Name'];\n\t\t\t\t$itemTmpl['elapsed'] = substr($r['Elapsed'], 0, -3);\n\t\t\t\t$tmpl['groupactivity'] .= $this->getTemplate('group_activity_item', $itemTmpl);\n\t\t\t}\n\t\t}\n\n\t\t$this->setTemplate('activity', $tmpl);\n\n\t\t$modHeader = MSG_ACTIVITY;\n\t\t$this->setHeader($modHeader, $insert);\n\t\t$this->SetModule($modHeader, $modAction);\n\t\t$this->Render();\n\t}", "function othersActivityList($userId,$data){\n\n $activityData = array();\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n if(empty($data['limit']) && empty($data['offset'])){\n $data['offset'] = 0; $data['limit']= 5; \n }\n $arrr = '[]';\n $where = array('c.status'=>'1','cc.status'=>'1','a.status'=>'1','a.creator_id !='=>$userId,'a.is_hide'=>0,'cum.club_user_status'=>'1','cum.member_status'=>'1','cum.user_id'=>$userId,'ae.activityEventId'=>NULL);\n \n $this->db->select('IF(a.image IS NULL or a.image = \"\",\"'.$defaultActivityImg.'\",concat(\"'.$activityImg.'\",a.image)) as image,a.name as activityName,a.activityId,c.club_name,IF(aj.activityJoinId IS NULL,0,1) as is_like');\n $this->db->from(CLUB_USER_MAPPING.' as cum');\n $this->db->join(CLUBS.' as c','cum.club_id = c.clubId');\n $this->db->join(CLUB_CATEGORY.' as cc','c.club_category_id = cc.clubCategoryId'); \n $this->db->join(ACTIVITIES.' as a','cum.club_id = a.club_id'); \n $this->db->join(ACTIVITY_EVENTS.' as ae','a.activityId = ae.activity_id','left');\n $this->db->join(ACTIVITY_JOIN.' as aj','a.activityId = aj.activity_id AND aj.user_id = \"'.$userId.'\"','left');\n $this->db->where($where);\n $this->db->group_by('a.activityId');\n $this->db->order_by(\"ae.event_date asc,ae.event_time asc\");\n $this->db->limit($data['limit'],$data['offset']);\n $query = $this->db->get();\n if($query->num_rows() >0){\n $activityData = $query->result();\n }\n return $activityData;\n\n }", "public function getUserAgendasAction()\n {\n $agenda = new Workapp_Agenda();\n $this->_helper->json($agenda->getAgendaList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "public function getAvailableActionsAttribute($value = null){\n $AuthUser = $this->_GETAUTHUSER(); if(!$AuthUser) return [];\n $role = $this->_GETAUTHUSER()->rolename;\n $role_actions = $this->_GETROLEACTIONS($role);\n if(!$this->exists) return $this->_GETARRAYVALUES($this->actions,$role_actions);\n $actions = array_filter($role_actions,function($ra){ return ($this->conditional_action && array_key_exists($ra,$this->conditional_action)) ? call_user_func([$this,$this->conditional_action[$ra]],$this) : true; });\n return $this->_GETARRAYVALUES($this->actions,$actions);\n }", "public function actionOperations()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/operations');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('operations', array(\n\t\t\t'type'=>CAuthItem::TYPE_OPERATION,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsOperationTableSort',\n\t\t\t\t'element'=>'.operation-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t\t'pagination'=>array(\n\t\t\t\t\t\t'pageSize'=>5,\n\t\t\t\t),\n\t\t\t),\n\t\t));\n\t\t\n\t\t// Render the view\n\t\t$this->render('operations', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}", "public function getAllInfoActivity()\n {\n return QcOverTimeRequest::where('action', $this->getDefaultHasAction())->get();\n }", "function get_activity_date()\n\t{\n\t\t$my = $this->Session->read('Auth.User');\n\t\t$entityOn = $this->Session->read('entityOn');\n\t\t\n\t\t$clean = new Sanitize();\n\t\t\n\t\t$stream_id = $clean->html($this->params['url']['stream_id']); // from GET\n\t\t// TODO: Remove \"filters\", send tag_id, user_id etc (as a number or csv)\n\t\tif(isset($this->params['url']['type'])){\n\t\t\t$filter_type = $clean->html($this->params['url']['type']);\n\t\t}else{\n\t\t\t$filter_type = NULL;\n\t\t}\t\n\t\tif(isset($this->params['url']['filter_id'])){\n\t\t\t$filter_id = $clean->html($this->params['url']['filter_id']);\n\t\t}else{\n\t\t\t$filter_id = NULL;\n\t\t}\n\t\tif(isset($this->params['url']['parent_id'])){\n\t\t\t$parent_id = $clean->html($this->params['url']['parent_id']);\n\t\t}else{\n\t\t\t$parent_id = NULL;\n\t\t}\n\t\t\n\t\t$tag_id = NULL;\n\t\t$user_id = NULL;\n\t\tif ($filter_type == 'Filter_Tags')\n\t\t\t$tag_id = $clean->html($this->params['url']['filter_id']);\n\t\telse if ($filter_type == 'Filter_Users')\n\t\t\t$user_id = $clean->html($this->params['url']['filter_id']);\n\t\t\n\t\t$paginatedPage = 1;// = $this->params['url']['date'];\n\t\t$PAGESIZE = 20;\n\t\t\n\t\t$isGetActivityByDate = array_key_exists('date', $this->params['url']);\n\t\t$activities = NULL;\n\t\t\n\t\tif($filter_type == 'Filter_Tags'){$filter_type_id = 1;}\n\t\telse if($filter_type == 'Filter_Users'){$filter_type_id = 2;}\n\n\t\t//$message = 'No activities found in this tag.<br/>Be the first to add one!';\n\t\t$message = '';\n\t\t$readOnly = false;\n\t\tif ($filter_type == \"Filter_Users\" && (int)$filter_id != (int)$my['id']) {\n\t\t\t$json['readOnly'] = true;\n\t\t\t//$message = 'You have not posted anything yet.<br/>Try it now!';\n\t\t\t$message=\"\";\n\t\t}\n\t\t\n\t\t$json = array (\n\t\t\t'message'\t=> $message,\n\t\t\t'status' \t=> 'failed',\n\t\t\t'timestamp' => $this->params['url']['timestamp']\n\t\t);\n\t\t\n\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t$access = $this->Session->read('Streams.Access');\n\t\t\n\t\t$permissionResults = $this->Stream->hasPermission($stream_id, $my['id'], $permissions, $access);\n\t\t//if the permission and access info is not in the session variable, write them!\n\t\t// FIXME: Shouldn't this be taken care of in the function?!!\n\t\tif (array_key_exists('permissionToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('StreamsUser.Permission', $permissionResults['permissionToAdd']['stream_id'], $permissionResults['permissionToAdd']['permission'], $permissions);\n\t\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t}\n\t\tif (array_key_exists('accessToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('Streams.Access', $permissionResults['accessToAdd']['stream_id'], $permissionResults['accessToAdd']['access'], $access);\n\t\t\t$access = $this->Session->read('Streams.Access');\n\t\t}\n\t\t\t\t\n\t\t$flag = $permissionResults['flag'];\n\t\tif($flag)\n\t\t{\t\t\t\n\t\t\tif($entityOn['controller'] == 'pages' && $entityOn['action'] == 'view' && isset($entityOn['Page']['comment_id'])){\n\t\t\t\t$comment_id = $entityOn['Page']['comment_id'];\n\t\t\t}else{\n\t\t\t\t$comment_id = NULL;\n\t\t\t}\n\t\t\t\n\t\t\tif ($filter_id > -1) //only update stream_view if it's not favourite activity\n\t\t\t{\n\t\t\t\t$ip = $this->RequestHandler->getClientIP();\n\t\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t\t$this->Stream->query('INSERT INTO stream_views_history (stream_id, entity_id, entity_type, user_id, ip, created) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\" )');\n\t\t\t\t\t\t\n\t\t\t\t//create/update stream_views entry\n\t\t\t\t$parameters = array(\n\t\t\t\t\t'stream_id' => $stream_id,\n\t\t\t\t\t'entity_id' => $filter_id,\n\t\t\t\t\t'entity_type' => $filter_type_id,\n\t\t\t\t\t'user_id' => $my['id']\n\t\t\t\t);\n\t\t\t\t$this->Stream->StreamView->recursive = -1;\n\t\t\t\t$view_id= $this->Stream->StreamView->find('first', array('fields'=> array('id'), 'conditions'=> $parameters));\n\t\t\t\tif(isset($view_id['StreamView']['id']))\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->id = $view_id;\n\t\t\t\t\t$this->Stream->query('UPDATE stream_views SET modified = \"'.$date.'\" WHERE id = '.$view_id['StreamView']['id'].'');\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->create();\t\n\t\t\t\t\t$this->Stream->query('INSERT INTO stream_views (stream_id, entity_id, entity_type, user_id, ip, created, modified) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\", \"'.$date.'\")');\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//debug($this->core);\n\t\t\t$options = array(\n\t\t\t\t'stream_id'\t\t=> $stream_id, \n\t\t\t\t'tag_id' \t\t=> $tag_id, // we need to send filters as themselves e.g. \"tags\" - remove the whole \"filter\" notion\n\t\t\t\t'type_id' \t\t=> '1,2,3,4,5,6,7,8,9,44, ', //$this->core['widget']['types'], // csv // We want certain types back \n\t\t\t\t'user_id'\t\t=> $user_id,\n\t\t\t\t'comment_id'\t=> $comment_id,\n\t\t\t\t'parent_id'\t\t=> $parent_id, // for Replies\n\t\t\t\t'widget_id'\t\t=> NULL, //for Thought widget => Actually for thoughts you want ALL hence leave NULL\n\t\t\t\t'search_terms' \t=> NULL,\n\t\t\t\t'date'\t\t\t=> NULL,\n\t\t\t\t'start_date' \t=> NULL,\n\t\t\t\t'end_date' \t\t=> NULL,\n\t\t\t\t'paginatedPage' => $paginatedPage,\n\t\t\t\t'limit'\t\t\t=> $PAGESIZE\n\t\t\t);\n\t\t\tif (!$isGetActivityByDate) //this is the initial fetch of the activity feed\n\t\t\t{\n\t\t\t\t$options['pagination'] = true;\t\t\n\t\t\t\t//$datePagination = $this->__getCountByDate($data); //need to get the dates where activity entries exist\n\t\t\t\t$datePagination = $this->Stream->Comment->getPagination($this->core, $options);\n\t\t\t\t//debug($datePagination);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$options['date'] = $clean->html($this->params['url']['date']);\n\t\t\t\t//$data['date'] = '2009-07-24';\n\t\t\t\t\t\n\t\t\t//$activities = $this->Stream->CommentsStream->__getThoughtsforStream($data);]\n\t\t\t$thoughts = $this->Stream->Comment->get($this->core, $options);\n\t\t\t//debug($activities);\n\t\t\t$activityArray = $thoughts;//$this->Stream->__getActivitiesList($activities, $my, false, $filter_id, $filter_type, $permissions);\n\t\t\t\n\t\t\tif($activityArray != NULL)\n\t\t\t{\n\t\t\t\t$activities = $activityArray;\n\t\t\t\t//debug($activity);\n\t\t\t\t\n\t\t\t\tif(!$isGetActivityByDate) //initial fetch of activity feed\n\t\t\t\t{\n\t\t\t\t\t/*debug($activity);\n\t\t\t\t\tdebug($filter_type);\n\t\t\t\t\tdebug($datePagination);*/\n\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('thoughts', 'datePagination', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity_pagination'); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('message','thoughts', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity'); \n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = 'No activities found.';\n\t\t\t\t$this->set(compact('message', 'filter_type', 'thoughts'));\n\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t$this->render('/activities/activity');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = 'You do not have permission to view this Stream';\n\t\t\t$this->set(compact('message', 'filter_type', 'activities'));\n\t\t\t$this->layout = 'ajax';\n\t\t\t$this->render('/activities/activity'); \t\t\t\t\t\n\t\t}\n\t}", "protected function getListActivity()\n {\n $arrAtividade = $this->getService('OrdemServico\\Service\\AtividadeFile')\n ->fetchPairs(array(), 'getIdAtividade', 'getCodigoAtividadeDescricao', array('co_atividade' => 'asc'));\n natcasesort($arrAtividade);\n return $arrAtividade;\n }", "public static function getInactives() {\n\t\treturn BaseQuery::create(\"User\")->filterById(0, Criteria::GREATER_THAN)->filterByActive(0)->find();\n\t}", "public function get_inprogress_opportunities() {\n\t\tif($this->session->userdata('uid')){\n\t\t\ttry {\n\t\t\t\t$user_id = $this->session->userdata('uid');\n\t\t\t\t$new = $this->opp_sales->fetch_inprogress_opportunities($user_id);\n\t\t\t\techo json_encode($new);\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function listActiUser($activity_id) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities_user WHERE actividad=?\");\r\n\t\t$stmt->execute(array($activity_id));\r\n\t\t$relations_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$relations = array();\r\n\r\n\t\tforeach ($relations_db as $relation) {\r\n\t\t\tarray_push($relations, new ActivityWUser($relation[\"usuario\"], $relation[\"actividad\"], $relation[\"conf\"]));\r\n\t\t}\r\n\r\n\t\treturn $relations;\r\n\t}", "public function getOperations()\n {\n $operations = [];\n foreach (static::attributes() as $attribute => $type) {\n if ($type === Operation::class && isset($this->$attribute)) {\n $operations[$attribute] = $this->$attribute;\n }\n }\n return $operations;\n }", "function loadActivity(){\n\t\t\t$this->articleEvents->add( $this->db->getUserActivity($this->getName()) ,true );\t\t\t\n\t\t}", "public function index()\n\t{\n\t\t//echo CI_VERSION; die;\n // $this->load->view('common/header');\n // $data['user']=\"--testing--\";\n\t\t$this->load->model('operations_model'); \n\t\t$id ='';\n\t\t$activity_id = '';\n $data['customers']=$this->operations_model->display_customer($id);\n\t\t$data['projects']=$this->operations_model->display_projects($id);\n\t\t$data['activities']=$this->operations_model->display_activity($id);\n\t\t//echo \"<pre/>\"; print_r($data['activities']);\n\t\t$activity_id = $data['activities'][0]['activity_id'];\n\t\t//echo $activity_id; die;\n\t\t$data['sub_activities']=$this->operations_model->display_sub_activity($activity_id);\n\t\t$data['units']=$this->operations_model->display_unit($id);\n\t\t//echo \"<pre/>\"; print_r($data); die;\n\t\t$this->load->view('operations',$data);\n \n\t}", "public function retrieveInactiveUserActions()\n {\n return $this->start()->uri(\"/api/user-action\")\n ->urlParameter(\"inactive\", true)\n ->get()\n ->go();\n }", "public function getLTIUsers();", "public static function getActions()\n\t{\n\t\t$user\t= JFactory::getUser();\n\t\t$result\t= new JObject;\n\n\t\t$assetName = 'com_wbty_users';\n\n\t\t$actions = array(\n\t\t\t'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.edit.state', 'core.delete'\n\t\t);\n\n\t\tforeach ($actions as $action) {\n\t\t\t$result->set($action,\t$user->authorise($action, $assetName));\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getAllActionsAttribute()\n\t{\n\t\t$output = array();\n\t\t//check if model has default permissions. if so, lets add them.\n\t\tif($defaults = config('alpacajs.model-permissions.'. class_basename($this), false)){\n\t\t\t$output = $defaults;\n\t\t} \n\t\t//check if model exist, if it does then check if it has actions.\n\t\tif($this->exists && $modelActions = $this->actions)\n\t\t{\n\t\t\t$output = array_merge($output, $modelActions);\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "public function getAllActivitiesAssignedToAParticularUser(\n $options\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activities';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'user_id' => $this->val($options, 'userId'),\n 'filter_id' => $this->val($options, 'filterId'),\n 'type' => $this->val($options, 'type'),\n 'start' => $this->val($options, 'start', 0),\n 'limit' => $this->val($options, 'limit'),\n 'start_date' => DateTimeHelper::toSimpleDate($this->val($options, 'startDate')),\n 'end_date' => DateTimeHelper::toSimpleDate($this->val($options, 'endDate')),\n 'done' => $this->val($options, 'done'),\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function index(User $user)\n {\n $userActivities = $user->activities()->get();\n return ActivityResource::collection($userActivities);\n }", "public function describeActiveOperationTaskWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->isHistory)) {\n $query['IsHistory'] = $request->isHistory;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->pageNumber)) {\n $query['PageNumber'] = $request->pageNumber;\n }\n if (!Utils::isUnset($request->pageSize)) {\n $query['PageSize'] = $request->pageSize;\n }\n if (!Utils::isUnset($request->region)) {\n $query['Region'] = $request->region;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n if (!Utils::isUnset($request->taskType)) {\n $query['TaskType'] = $request->taskType;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DescribeActiveOperationTask',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DescribeActiveOperationTaskResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function getAutoposList(){\n return $this->_get(2);\n }", "function sub_activity_list(){\n\t\t$this->load->model('operations_model'); \n $data['sub_activity_list']=$this->operations_model->display_activity($id);\n\t\t$this->load->view('sub_activity_list',$data);\n\t\t}", "function bigbluebuttonbn_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) {\n}", "public function getActivities()\n {\n $enrollments = Enrollment::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $enrol = Enroll::where('id', $item->enrolid)->first();\n return ['type' => 'enroll',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $enrol->courseid)->first()->fullname,\n ];\n });\n\n $completions = Completion::latest('timecompleted')->take(4)->get()->sortBy('timecompleted')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n return ['type' => 'completion',\n 'ts' => $item->timecompleted,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $item->course)->first()->fullname,\n ];\n });\n\n $grades = Grades::latest('timecreated')->take(4)->get()->sortBy('timecreated')->map(function ($item){\n $user = User::where('id', $item->userid)->first();\n $grade = DB::table('mdl_grade_items')->where('id', $item->itemid)->first();\n\n return ['type' => 'grade',\n 'ts' => $item->timecreated,\n 'user' => $user->firstname . ' ' . $user->lastname,\n 'course' => Course::where('id', $grade->courseid)->first()->fullname,\n 'score' => $item->finalgrade,\n ];\n });\n\n\n $merged = array_merge($enrollments->toArray(), $completions->toArray(), $grades->toArray());\n\n return collect($merged)->sortByDesc('ts')->take(4)->toArray();\n }", "public function getList($user);", "public function activities()\n {\n return $this->morphMany(Config::get('auditing.activity'), 'auditable');\n }", "public function getOpis()\n {\n return $this->opis;\n }", "private function _getAllSectionOperations($userOperations)\n {\n $operations = [];\n\n $operationList = App::getInstance()\n ->getOperation()\n ->getSectionOperations(true);\n asort($operationList);\n\n $type = Operation::TYPE_SECTIONS;\n\n foreach ($operationList as $key => $label) {\n $value = false;\n $hasSections = array_key_exists(\n $type,\n $userOperations\n );\n if ($hasSections === true) {\n $hasAll = array_key_exists(\n Operation::ALL,\n $userOperations[$type]\n );\n if ($hasAll === true) {\n $value = in_array(\n $key,\n $userOperations[$type][Operation::ALL]\n );\n }\n }\n\n $operations[] = [\n 'label' => $label,\n 'name' => sprintf(\n 'operations.%s.%s.%s',\n $type,\n Operation::ALL,\n $key\n ),\n 'value' => $value\n ];\n }\n\n return $operations;\n }", "function aspirelists_get_view_actions() {\n return array('view', 'view all');\n}", "public function getActivityInfo()\n {\n return QcBonusDepartment::where('applyStatus', 1)->where('action', 1)->get();\n }", "public function getActionsAttribute()\n {\n return [\n 'id' => $this->id,\n 'beneficiary_id' => $this->beneficiary->id,\n 'cancel' => $this->state == 'PENDIENTE',\n 'approved' => $this->state == 'APROBADO',\n 'next' => __('app.selects.loan.state_next.' . $this->state),\n ];\n }", "public static function get_activities_returns() {\n\n $data = new external_multiple_structure(\n new external_single_structure(\n [\n 'instance' => new external_value(PARAM_INT, 'instance'),\n 'name' => new external_value(PARAM_ALPHANUMEXT, 'name'),\n 'modname' => new external_value(PARAM_ALPHANUMEXT, 'modname'),\n //'shortname' => new external_value(PARAM_ALPHANUMEXT, 'course name'),\n ]\n )\n );\n }", "public function getJobQueriesOperations(){ return $this->APICallSub( '/jobs', 'tools', \"Couldn't get the queries and operations.\" ); }", "public function getUserOperationByIdAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) {\n $this->setErrorResponse('no Operation for this user with current operation_id!');\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n $this->_helper->json($operation);\n }", "public function user()\n {\n return $this->belongsToMany('App\\User')\n ->withPivot('operation','created_at', 'updated_at')\n ->withTimestamps();\n }", "public function getActivo()\n {\n return $this->activo;\n }", "function getOperarios() // Ok\n {\n $userdata = $this->session->userdata('user_data');\n $empresaId = $userdata[0]['id_empresa'];\n $this->db->select('sisusers.usrId, sisusers.usrLastName, sisusers.usrname');\n $this->db->join('usuarioasempresa', 'usuarioasempresa.usrId = sisusers.usrId');\n $this->db->from('sisusers');\n $this->db->where('usuarioasempresa.empresaid', $empresaId);\n $this->db->where('usuarioasempresa.estado', 'AC');\n $query = $this->db->get();\n $i = 0;\n foreach ($query->result() as $row)\n { \n $equipos[$i]['label'] = $row->usrLastName.\", \". $row->usrname ;\n $equipos[$i]['value'] = $row->usrId;\n $i++;\n }\n return $equipos; \n }", "public function get_actions() {\n $actions = parent::get_actions();\n $unassignaction = new deepsight_action_usersetuser_unassign($this->DB, 'usersetuserunassign');\n $unassignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n $unassignaction->condition = 'function(rowdata) { return (rowdata.canunassign == \\'0\\') ? false : true; }';\n array_unshift($actions, $unassignaction);\n return $actions;\n }", "public function getActions()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n \"SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Actions p\n WHERE p.screenStatus = '1'\"\n \n );\n $result = $query->getResult();\n \n return $result;\n }", "public function activities() {\n \n // Verify if is a team's member\n if ( $this->session->userdata( 'member' ) && !get_user_option('display_activities') ) {\n redirect('user/app/dashboard');\n }\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n // Load view/user/activities.php file\n $this->body = 'user/activities';\n $this->user_layout();\n }", "public function getOpencalls()\n\t{\n\t\t//db connection\n\t\t$db = JFactory::getDBO();\n\t\t$user = JFactory::getUser();\n\t\t$query = \"SELECT * FROM #__content WHERE id='\".@$_REQUEST['id'].\"' AND created_by='\".$user->id.\"' AND state=1 LIMIT 1 \";\n\t\t$db->setQuery($query);\n\t\t$items = $db->loadObjectList();\n\t\treturn $items;\n\t}", "public function getActivities()\n {\n $activities = $this->findBy(array(), array('name' => 'ASC'));\n \n $data = array();\n foreach ($activities as $activity) {\n $data[] = array('activity' => array(\n 'id' => $activity->getId(),\n 'name' => $activity->getName(),\n 'needsTicket' => $activity->getNeedsTicket(),\n 'factor' => $activity->getFactor()\n ));\n }\n \n return $data;\n }", "public function session_list($user_id = null, $start_date = null, $end_date = null, $activitygroup_id = null, $unit_id = null, $activity_id=null, $is_publish=null) {\n $conditions = array();\n $link['Activitygroup'] = array(\n 'fields'=>array(\n 'Activitygroup.name'\n )\n );\n\n if(!empty($user_id)){\n $conditions['AND'][$this->alias . \".countuser_id\"] = $user_id;\n }\n if(!empty($start_date)){\n $conditions['AND'][$this->alias . \".date >=\"] = $start_date;\n }\n if(!empty($end_date)){\n $conditions['AND'][$this->alias . \".date <=\"] = $end_date;\n }\n if(!empty($activitygroup_id)){\n $conditions['AND'][\"Activity.activitygroup_id\"] = $activitygroup_id;\n }\n if(!empty($activity_id)){\n $conditions['AND'][\"Activity.id\"] = $activity_id;\n }\n if(!empty($unit_id)){\n $conditions['AND'][\"Unit.id\"] = $unit_id;\n $link['Unit'] = array(\n 'fields'=>array(\n 'Unit.name'\n )\n );\n }\n\n if(isset($is_publish)){\n if($is_publish === 0){\n $conditions['AND'][\"Activity.publish\"] = 0;\n }else if($is_publish === 1){\n $conditions['AND'][\"Activity.publish\"] = 1;\n }\n }\n\n $options = array(\n 'fields' => array(\n 'Activitysession.id',\n \"Activitysession.date\",\n \"Activitysession.starttime\",\n \"Activitysession.endtime\",\n \"Activitysession.session\",\n \"(Activitysession.extra_attendant * Activitysession.session) as total_extra_attendant\"\n ),\n 'link' => array(\n 'Activity'=>array(\n 'fields'=>array(\n 'Activity.id',\n \"Activity.name\",\n \"Activity.activity_code\"\n ),\n 'link'=>$link\n ),\n 'Countuser'=>array(\n 'fields'=>array(\n 'Countuser.name'\n )\n ),\n\n ),\n \"conditions\"=>$conditions,\n \"order\"=>\"Activitysession.date DESC\"\n );\n\n return $this->find('all',$options);\n }", "public function getTaskListList(){\n return $this->_get(2);\n }", "function statusModificationList( $user = false )\n {\n if ( $user === false )\n $user = eZUser::currentUser();\n else if ( is_numeric( $user ) )\n $user = eZUser::fetch( $user );\n\n if ( !is_object( $user ) )\n {\n eZDebug::writeError( \"Cannot calculate status access list without a user\", __METHOD__ );\n return false;\n }\n\n $accessResult = $user->hasAccessTo( 'owshop' , 'setstatus' );\n $accessWord = $accessResult['accessWord'];\n $access = false;\n\n $currentStatusID = $this->attribute( \"status_id\" );\n\n $statusList = array();\n if ( $accessWord == 'yes' )\n {\n // We have full access so we return all of them\n $statusList = eZOrderStatus::fetchOrderedList( true, false );\n return $statusList;\n }\n\n if ( $accessWord == 'limited' )\n {\n $limitationList = $accessResult['policies'];\n $access = true;\n // All 'to' statues will be appended to this array\n $accessList = array();\n foreach ( $limitationList as $pid => $limit )\n {\n $access = true;\n foreach ( $limit as $name => $value )\n {\n if ( $name == 'FromStatus' )\n {\n if ( !in_array( $currentStatusID, $value ) )\n $access = false;\n }\n if ( !$access )\n break;\n }\n if ( $access )\n {\n if ( isset( $limit['ToStatus'] ) )\n {\n $accessList = array_merge( $accessList, $limit['ToStatus'] );\n }\n else\n {\n // We have full access for the current status so we return all of them\n $statusList = eZOrderStatus::fetchOrderedList( true, false );\n return $statusList;\n }\n }\n }\n if ( count( $accessList ) > 0 )\n {\n $accessList = array_unique( array_merge( $accessList, array( $currentStatusID ) ) );\n $statuses = eZOrderStatus::fetchOrderedList( true, false );\n foreach ( $statuses as $status )\n {\n if ( in_array( $status->attribute( 'status_id' ), $accessList ) )\n $statusList[] = $status;\n }\n }\n }\n return $statusList;\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public function operationlist(Request $req)\n {\n $user = Report::all();\n \treturn view('nurse.OperationList', ['user'=>$user]);\n \n }", "function canViewActivities($user) {\n \treturn $user->isAdministrator() || $user->isProjectManager();\n }", "function getUserActivity( $stream ) \n\t{\n\t\t$userId = $this->getCurrentUserId();\n\n\t\t$parameters = array();\n\t\t$parameters['format']\t= 'json';\n\t\t$parameters['count']\t= 'max';\n\t\t\n\t\t$response = $this->api->get('user/' . $userId . '/updates', $parameters);\n\n\t\tif( ! $response->updates || $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( 'User activity request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\t$activities = array();\n\n\t\tforeach( $response->updates as $item ){\n\t\t\t$ua = new Hybrid_User_Activity();\n\n\t\t\t$ua->id = (property_exists($item,'collectionID'))?$item->collectionID:\"\";\n\t\t\t$ua->date = (property_exists($item,'lastUpdated'))?$item->lastUpdated:\"\";\n\t\t\t$ua->text = (property_exists($item,'loc_longForm'))?$item->loc_longForm:\"\";\n\n\t\t\t$ua->user->identifier = (property_exists($item,'profile_guid'))?$item->profile_guid:\"\";\n\t\t\t$ua->user->displayName = (property_exists($item,'profile_nickname'))?$item->profile_nickname:\"\";\n\t\t\t$ua->user->profileURL = (property_exists($item,'profile_profileUrl'))?$item->profile_profileUrl:\"\";\n\t\t\t$ua->user->photoURL = (property_exists($item,'profile_displayImage'))?$item->profile_displayImage:\"\"; \n\n\t\t\t$activities[] = $ua;\n\t\t}\n\n\t\tif( $stream == \"me\" ){\n\t\t\t$userId = $this->getCurrentUserId();\n\t\t\t$my_activities = array();\n\n\t\t\tforeach( $activities as $a ){\n\t\t\t\tif( $a->user->identifier == $userId ){\n\t\t\t\t\t$my_activities[] = $a;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $my_activities;\n\t\t}\n\n\t\treturn $activities;\n\t}", "public static function cooperations(array $attributes=array())\r\n {\r\n include_once(JRESEARCH_COMPONENT_ADMIN.DS.'models'.DS.'cooperations'.DS.'cooperations.php');\r\n\r\n $model = new JResearchModelCooperations();\r\n $coops = $model->getData(null, true);\r\n\r\n $cooperationOptions = array();\r\n foreach($coops as $coop)\r\n {\r\n $cooperationOptions[] = JHTML::_('select.option', $coop->id, $coop->name);\t\r\n }\r\n\r\n return self::htmllist($cooperationOptions, $attributes);\r\n }", "function monitor_list_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"instance_activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "public function operations();", "public function getActivities()\r\n {\r\n return Controllers\\Activities::getInstance();\r\n }", "public function rest() {\n return CMap::mergeArray(\n parent::rest(), array(\n 'resource' => 'users',\n 'idProperty' => 'userID',\n 'container' => 'users',\n 'multiContainer' => 'DATA',\n )\n );\n }" ]
[ "0.6590937", "0.62222964", "0.5662353", "0.5580183", "0.55617446", "0.5561594", "0.5475497", "0.5430238", "0.5419893", "0.5412079", "0.53882253", "0.53675765", "0.53154325", "0.53088087", "0.5296811", "0.52896863", "0.5279485", "0.5278199", "0.5268028", "0.5262805", "0.52625835", "0.52325207", "0.52257925", "0.521273", "0.5206838", "0.5200549", "0.51864016", "0.5181787", "0.5160039", "0.51555383", "0.51494527", "0.5132127", "0.51211274", "0.51211274", "0.51178545", "0.51178545", "0.51178545", "0.51178545", "0.51178545", "0.51178545", "0.51127136", "0.50886613", "0.50743836", "0.5069039", "0.5054266", "0.5038963", "0.5034077", "0.5026276", "0.50221634", "0.5017413", "0.5017033", "0.5014637", "0.50098366", "0.5005902", "0.5003683", "0.49894673", "0.49865055", "0.49788105", "0.49776325", "0.49761152", "0.49518275", "0.49310058", "0.49293244", "0.49256954", "0.4914172", "0.49093467", "0.49067152", "0.48945117", "0.48826325", "0.4879583", "0.48630822", "0.4856007", "0.48550767", "0.48547462", "0.48439875", "0.48418948", "0.48378378", "0.4834907", "0.48319504", "0.48318788", "0.48287424", "0.48272607", "0.48239678", "0.4823347", "0.48168418", "0.4813765", "0.48038247", "0.4803394", "0.47982162", "0.47823563", "0.47817114", "0.47719944", "0.4771311", "0.47697714", "0.47689223", "0.47670385", "0.4759232", "0.47569785", "0.47556368", "0.47535467" ]
0.7027519
0
returns user activity by activity_id activity_id mandatory field
public function getUserActivityByIdAction() { /** @var Object_Activity $activity */ $data = $this->getRequestData(); if (isset($data['activity_id'])) { $activity = Object_Activity::getById($data['activity_id']); if(isset($data['getoperations']) && $activity){ $operation = new Workapp_Activity(); $activity->operations = $operation->getActivityRequiredByOperations($activity); } if (!$activity) { $this->setErrorResponse('no Activity with this activity_id!'); } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) { $this->setErrorResponse('no Activity for this user with current activity_id!'); } } else { $this->setErrorResponse('activity_id is mandatory field for this request!'); } $this->_helper->json($activity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getActivityUser($activityId) \n {\n return $this->instance->getActivityUser($activityId);\n }", "public function listActiUser($activity_id) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities_user WHERE actividad=?\");\r\n\t\t$stmt->execute(array($activity_id));\r\n\t\t$relations_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t$relations = array();\r\n\r\n\t\tforeach ($relations_db as $relation) {\r\n\t\t\tarray_push($relations, new ActivityWUser($relation[\"usuario\"], $relation[\"actividad\"], $relation[\"conf\"]));\r\n\t\t}\r\n\r\n\t\treturn $relations;\r\n\t}", "function edd_wallet_get_activity( $user_id ) {\n\t$activity = edd_wallet()->db->get_customer_wallet( $user_id );\n\n\treturn $activity;\n}", "public function getActivity($id){\n $this->db->query('SELECT * FROM activity WHERE id = :activity_id');\n\n $this->db->bind(':activity_id', $id);\n\n //get row\n $results = $this->db->singleResult();\n\n return $results;\n }", "function get_activity($id)\n\t{\n\t\t$xml = $this->load_url(\"activities/$id\");\n\n\t\tif(!$xml):\n\t\t\treturn false;\n\t\tendif;\n\n\t\t// parse into nicer array\n\t\t$_activity = (isset($xml['entry'])) ? $xml['entry'] : false;\n\t\t$activity = $_activity['content']['Activity'];\n\t\t$activity['id'] = $id;\n\n\t\tif(isset($activity['FileName'])):\n\t\t\t$activity['FileName'] = $this->get_id_from_link($activity['FileName']);\n\t\tendif;\n\n\t\treturn $activity;\n\t}", "function getUserActivity( $stream ) \n\t{\n\t\t$userId = $this->getCurrentUserId();\n\n\t\t$parameters = array();\n\t\t$parameters['format']\t= 'json';\n\t\t$parameters['count']\t= 'max';\n\t\t\n\t\t$response = $this->api->get('user/' . $userId . '/updates', $parameters);\n\n\t\tif( ! $response->updates || $this->api->http_code != 200 )\n\t\t{\n\t\t\tthrow new Exception( 'User activity request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\t$activities = array();\n\n\t\tforeach( $response->updates as $item ){\n\t\t\t$ua = new Hybrid_User_Activity();\n\n\t\t\t$ua->id = (property_exists($item,'collectionID'))?$item->collectionID:\"\";\n\t\t\t$ua->date = (property_exists($item,'lastUpdated'))?$item->lastUpdated:\"\";\n\t\t\t$ua->text = (property_exists($item,'loc_longForm'))?$item->loc_longForm:\"\";\n\n\t\t\t$ua->user->identifier = (property_exists($item,'profile_guid'))?$item->profile_guid:\"\";\n\t\t\t$ua->user->displayName = (property_exists($item,'profile_nickname'))?$item->profile_nickname:\"\";\n\t\t\t$ua->user->profileURL = (property_exists($item,'profile_profileUrl'))?$item->profile_profileUrl:\"\";\n\t\t\t$ua->user->photoURL = (property_exists($item,'profile_displayImage'))?$item->profile_displayImage:\"\"; \n\n\t\t\t$activities[] = $ua;\n\t\t}\n\n\t\tif( $stream == \"me\" ){\n\t\t\t$userId = $this->getCurrentUserId();\n\t\t\t$my_activities = array();\n\n\t\t\tforeach( $activities as $a ){\n\t\t\t\tif( $a->user->identifier == $userId ){\n\t\t\t\t\t$my_activities[] = $a;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $my_activities;\n\t\t}\n\n\t\treturn $activities;\n\t}", "public function get ($activityId, $optParams = array())\n {\n $params = array('activityId' => $activityId);\n $params = array_merge($params, $optParams);\n $data = $this->__call('get', array($params));\n if ($this->useObjects()) {\n return new Activity($data);\n } else {\n return $data;\n }\n }", "public function activityActorId();", "function get_activity_date()\n\t{\n\t\t$my = $this->Session->read('Auth.User');\n\t\t$entityOn = $this->Session->read('entityOn');\n\t\t\n\t\t$clean = new Sanitize();\n\t\t\n\t\t$stream_id = $clean->html($this->params['url']['stream_id']); // from GET\n\t\t// TODO: Remove \"filters\", send tag_id, user_id etc (as a number or csv)\n\t\tif(isset($this->params['url']['type'])){\n\t\t\t$filter_type = $clean->html($this->params['url']['type']);\n\t\t}else{\n\t\t\t$filter_type = NULL;\n\t\t}\t\n\t\tif(isset($this->params['url']['filter_id'])){\n\t\t\t$filter_id = $clean->html($this->params['url']['filter_id']);\n\t\t}else{\n\t\t\t$filter_id = NULL;\n\t\t}\n\t\tif(isset($this->params['url']['parent_id'])){\n\t\t\t$parent_id = $clean->html($this->params['url']['parent_id']);\n\t\t}else{\n\t\t\t$parent_id = NULL;\n\t\t}\n\t\t\n\t\t$tag_id = NULL;\n\t\t$user_id = NULL;\n\t\tif ($filter_type == 'Filter_Tags')\n\t\t\t$tag_id = $clean->html($this->params['url']['filter_id']);\n\t\telse if ($filter_type == 'Filter_Users')\n\t\t\t$user_id = $clean->html($this->params['url']['filter_id']);\n\t\t\n\t\t$paginatedPage = 1;// = $this->params['url']['date'];\n\t\t$PAGESIZE = 20;\n\t\t\n\t\t$isGetActivityByDate = array_key_exists('date', $this->params['url']);\n\t\t$activities = NULL;\n\t\t\n\t\tif($filter_type == 'Filter_Tags'){$filter_type_id = 1;}\n\t\telse if($filter_type == 'Filter_Users'){$filter_type_id = 2;}\n\n\t\t//$message = 'No activities found in this tag.<br/>Be the first to add one!';\n\t\t$message = '';\n\t\t$readOnly = false;\n\t\tif ($filter_type == \"Filter_Users\" && (int)$filter_id != (int)$my['id']) {\n\t\t\t$json['readOnly'] = true;\n\t\t\t//$message = 'You have not posted anything yet.<br/>Try it now!';\n\t\t\t$message=\"\";\n\t\t}\n\t\t\n\t\t$json = array (\n\t\t\t'message'\t=> $message,\n\t\t\t'status' \t=> 'failed',\n\t\t\t'timestamp' => $this->params['url']['timestamp']\n\t\t);\n\t\t\n\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t$access = $this->Session->read('Streams.Access');\n\t\t\n\t\t$permissionResults = $this->Stream->hasPermission($stream_id, $my['id'], $permissions, $access);\n\t\t//if the permission and access info is not in the session variable, write them!\n\t\t// FIXME: Shouldn't this be taken care of in the function?!!\n\t\tif (array_key_exists('permissionToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('StreamsUser.Permission', $permissionResults['permissionToAdd']['stream_id'], $permissionResults['permissionToAdd']['permission'], $permissions);\n\t\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t}\n\t\tif (array_key_exists('accessToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('Streams.Access', $permissionResults['accessToAdd']['stream_id'], $permissionResults['accessToAdd']['access'], $access);\n\t\t\t$access = $this->Session->read('Streams.Access');\n\t\t}\n\t\t\t\t\n\t\t$flag = $permissionResults['flag'];\n\t\tif($flag)\n\t\t{\t\t\t\n\t\t\tif($entityOn['controller'] == 'pages' && $entityOn['action'] == 'view' && isset($entityOn['Page']['comment_id'])){\n\t\t\t\t$comment_id = $entityOn['Page']['comment_id'];\n\t\t\t}else{\n\t\t\t\t$comment_id = NULL;\n\t\t\t}\n\t\t\t\n\t\t\tif ($filter_id > -1) //only update stream_view if it's not favourite activity\n\t\t\t{\n\t\t\t\t$ip = $this->RequestHandler->getClientIP();\n\t\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t\t$this->Stream->query('INSERT INTO stream_views_history (stream_id, entity_id, entity_type, user_id, ip, created) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\" )');\n\t\t\t\t\t\t\n\t\t\t\t//create/update stream_views entry\n\t\t\t\t$parameters = array(\n\t\t\t\t\t'stream_id' => $stream_id,\n\t\t\t\t\t'entity_id' => $filter_id,\n\t\t\t\t\t'entity_type' => $filter_type_id,\n\t\t\t\t\t'user_id' => $my['id']\n\t\t\t\t);\n\t\t\t\t$this->Stream->StreamView->recursive = -1;\n\t\t\t\t$view_id= $this->Stream->StreamView->find('first', array('fields'=> array('id'), 'conditions'=> $parameters));\n\t\t\t\tif(isset($view_id['StreamView']['id']))\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->id = $view_id;\n\t\t\t\t\t$this->Stream->query('UPDATE stream_views SET modified = \"'.$date.'\" WHERE id = '.$view_id['StreamView']['id'].'');\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->create();\t\n\t\t\t\t\t$this->Stream->query('INSERT INTO stream_views (stream_id, entity_id, entity_type, user_id, ip, created, modified) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\", \"'.$date.'\")');\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//debug($this->core);\n\t\t\t$options = array(\n\t\t\t\t'stream_id'\t\t=> $stream_id, \n\t\t\t\t'tag_id' \t\t=> $tag_id, // we need to send filters as themselves e.g. \"tags\" - remove the whole \"filter\" notion\n\t\t\t\t'type_id' \t\t=> '1,2,3,4,5,6,7,8,9,44, ', //$this->core['widget']['types'], // csv // We want certain types back \n\t\t\t\t'user_id'\t\t=> $user_id,\n\t\t\t\t'comment_id'\t=> $comment_id,\n\t\t\t\t'parent_id'\t\t=> $parent_id, // for Replies\n\t\t\t\t'widget_id'\t\t=> NULL, //for Thought widget => Actually for thoughts you want ALL hence leave NULL\n\t\t\t\t'search_terms' \t=> NULL,\n\t\t\t\t'date'\t\t\t=> NULL,\n\t\t\t\t'start_date' \t=> NULL,\n\t\t\t\t'end_date' \t\t=> NULL,\n\t\t\t\t'paginatedPage' => $paginatedPage,\n\t\t\t\t'limit'\t\t\t=> $PAGESIZE\n\t\t\t);\n\t\t\tif (!$isGetActivityByDate) //this is the initial fetch of the activity feed\n\t\t\t{\n\t\t\t\t$options['pagination'] = true;\t\t\n\t\t\t\t//$datePagination = $this->__getCountByDate($data); //need to get the dates where activity entries exist\n\t\t\t\t$datePagination = $this->Stream->Comment->getPagination($this->core, $options);\n\t\t\t\t//debug($datePagination);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$options['date'] = $clean->html($this->params['url']['date']);\n\t\t\t\t//$data['date'] = '2009-07-24';\n\t\t\t\t\t\n\t\t\t//$activities = $this->Stream->CommentsStream->__getThoughtsforStream($data);]\n\t\t\t$thoughts = $this->Stream->Comment->get($this->core, $options);\n\t\t\t//debug($activities);\n\t\t\t$activityArray = $thoughts;//$this->Stream->__getActivitiesList($activities, $my, false, $filter_id, $filter_type, $permissions);\n\t\t\t\n\t\t\tif($activityArray != NULL)\n\t\t\t{\n\t\t\t\t$activities = $activityArray;\n\t\t\t\t//debug($activity);\n\t\t\t\t\n\t\t\t\tif(!$isGetActivityByDate) //initial fetch of activity feed\n\t\t\t\t{\n\t\t\t\t\t/*debug($activity);\n\t\t\t\t\tdebug($filter_type);\n\t\t\t\t\tdebug($datePagination);*/\n\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('thoughts', 'datePagination', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity_pagination'); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('message','thoughts', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity'); \n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = 'No activities found.';\n\t\t\t\t$this->set(compact('message', 'filter_type', 'thoughts'));\n\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t$this->render('/activities/activity');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = 'You do not have permission to view this Stream';\n\t\t\t$this->set(compact('message', 'filter_type', 'activities'));\n\t\t\t$this->layout = 'ajax';\n\t\t\t$this->render('/activities/activity'); \t\t\t\t\t\n\t\t}\n\t}", "public function findById($id) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities WHERE id=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t\t$activity = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif($activity != null) {\r\n\t\t\treturn new Activity($activity[\"id\"],\r\n\t\t\t\t\t\t\t\t$activity[\"nombre\"],\r\n\t\t\t\t\t\t\t\t$activity[\"descripcion\"],\r\n\t\t\t\t\t\t\t\t$activity[\"dia\"],\r\n\t\t\t\t\t\t\t\t$activity[\"hora_inicio\"],\r\n\t\t\t\t\t\t\t\t$activity[\"hora_fin\"],\r\n\t\t\t\t\t\t\t\t$activity[\"plazas\"],\r\n\t\t\t\t\t\t\t\t$activity[\"entrenador\"]);\r\n\t\t} else {\r\n\t\t\treturn NULL;\r\n\t\t}\r\n\t}", "public function getInfo($activityId = null, $field = null)\n {\n if (empty($activityId)) {\n return TfBuildingActivity::where('action', 1)->get();\n } else {\n $result = TfBuildingActivity::where(['activity_id' => $activityId, 'action' => 1])->first();\n if (empty($field)) {\n return $result;\n } else {\n return $result->$field;\n }\n }\n }", "public function activities()\n {\n return $this->hasMany(Activity::class, 'activity_of_user_id', 'id');\n }", "public function activityForeignId();", "function activity_assignment($activity_id) {\n \n }", "function getUserActivity( $stream )\n\t{\n\t\tif( $stream == \"me\" ){\n\t\t\t$response = $this->api->get( 'newsfeed/list_events.json?events_category=own' );\n\t\t}\n\t\telse{\n\t\t\t$response = $this->api->get( 'newsfeed/list_events.json?events_category=friends' );\n\t\t}\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User activity stream request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif( ! $response ){\n\t\t\treturn ARRAY();\n\t\t}\n\n\t\t$activities = ARRAY();\n\n\t\tforeach( $response as $item ){\n\t\t\t$ua = new Hybrid_User_Activity();\n\n\t\t\t$ua->id = (property_exists($item,'id_event'))?$item->id_event:\"\";\n\t\t\t$ua->date = (property_exists($item,'timestamp'))?$item->timestamp:\"\";\n\t\t\t$ua->text = (property_exists($item,'content'))?$item->content:\"\";\n\t\t\t$ua->text = ($ua->text)?trim(strip_tags($ua->text)):\"\";\n\n\t\t\t$ua->user->identifier = (property_exists($item->from,'id_user'))?$item->from->id_user:\"\";\n\t\t\t$ua->user->displayName = (property_exists($item->from,'username'))?$item->from->username:\"\";\n\t\t\t$ua->user->profileURL = (property_exists($item->from,'user_url'))?$item->from->user_url:\"\";\n\t\t\t$ua->user->photoURL = (property_exists($item->from,'avatar_url'))?$item->from->avatar_url:\"\";\n\n\t\t\t$activities[] = $ua;\n\t\t}\n\n\t\treturn $activities;\n\t}", "static function getFirstActivityFor($cid, $whereClauses = NULL) {\n $query = \"\n SELECT `ca`.*\n FROM `civicrm_activity` AS `ca`\n INNER JOIN `civicrm_activity_contact` AS `cat`\n ON `cat`.`activity_id` = `ca`.`id`\n AND `cat`.`record_type_id` = %0\n AND `cat`.`contact_id` = %1\n \";\n if (!empty($whereClauses)) {\n if (!is_array($whereClauses)) {\n $whereClauses = array($whereClauses);\n }\n $query .= ' WHERE (' . implode(') AND (', $whereClauses) . ') ';\n }\n $query .= \"\n ORDER BY `ca`.`activity_date_time` ASC\n LIMIT 1\n \";\n\n $dao = CRM_Core_DAO::executeQuery($query, array(\n array(self::RECORD_TYPE_TARGET, 'Int'),\n array($cid, 'Int'),\n ));\n if (!$dao->fetch()) {\n return NULL;\n }\n return get_object_vars($dao);\n }", "function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true){\n\t\tglobal $current_user;\n\t\t$act_list = array();\n\t\t$seen_ids = array();\n\n\n\t\t// get all upcoming meetings, tasks due, and calls for a user\n\t\tif(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {\n\t\t\t$meeting = new Meeting();\n\n\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t$meeting->disable_row_level_security = true;\n\t\t\t}\n\n\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t$focus_meetings_list = build_related_list_by_user_id($meeting,$user_id,$where);\n\t\t\tforeach($focus_meetings_list as $meeting) {\n\t\t\t\tif(isset($seen_ids[$meeting->id])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$seen_ids[$meeting->id] = 1;\n\t\t\t\t$act = new CalendarActivity($meeting);\n\n\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($show_calls){\n\t\t\tif(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$call = new Call();\n\n\t\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t\t$call->disable_row_level_security = true;\n\t\t\t\t}\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t\t$focus_calls_list = build_related_list_by_user_id($call,$user_id,$where);\n\n\t\t\t\tforeach($focus_calls_list as $call) {\n\t\t\t\t\tif(isset($seen_ids[$call->id])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$seen_ids[$call->id] = 1;\n\n\t\t\t\t\t$act = new CalendarActivity($call);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif($show_tasks){\n\t\t\tif(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$task = new Task();\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);\n\t\t\t\t$where .= \" AND tasks.assigned_user_id='$user_id' \";\n\n\t\t\t\t$focus_tasks_list = $task->get_full_list(\"\", $where,true);\n\n\t\t\t\tif(!isset($focus_tasks_list)) {\n\t\t\t\t\t$focus_tasks_list = array();\n\t\t\t\t}\n\n\t\t\t\tforeach($focus_tasks_list as $task) {\n\t\t\t\t\t$act = new CalendarActivity($task);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $act_list;\n\t}", "public function activityAction() {\n\tif($this->_getParam('id',false)){\n\t$activities = new PrimaryActivities();\n\t$this->view->activities = $activities->getActivityDetails($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public static function getActivities($user_id)\n {\n if (! isset($user_id)) {\n return;\n }\n\n $activity = Activity::where('user_id', $user_id)\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $activity;\n }", "function socialActivityGet($opt){\n\n\tif($opt['debug']) $this->pre(\"OPTION\", $opt);\n\n\t$dbMode = 'dbMulti';\n\n\t// GET notification\n\tif($opt['notification']){\n\t\t$join[] = \"INNER JOIN k_socialnotification ON k_socialactivity.id_socialactivity = k_socialnotification.id_socialactivity\";\n\t\t$cond[] = \"k_socialnotification.id_user=\".$opt['id_user'];\n\t}\n\n\t// GET id_user\n\tif(array_key_exists('id_user', $opt)){\n\n\t\tif(is_array($opt['id_user'])){\n\t\t\t$cond[] = \"id_user IN(\".implode(',', $opt['id_user']).\")\";\n\t\t}else\n\t\tif($opt['id_user'] > 0){\n\t\t\t$cond[] = \"id_user=\".$opt['id_user'];\n\t\t}else{\n\t\t\tif($opt['debug']) $this->pre(\"ERROR: ID_USER (ARRAY,NUMERIC)\", \"GIVEN\", var_export($opt['user'], true));\n\t\t\treturn array();\n\t\t}\t\t\n\n\t}\n\n\n\tif($dbMode == 'dbMulti'){\n\n\t\t$group = \"\\nGROUP BY \".(($opt['groupby'] != NULL)\n\t\t\t? $opt['groupby']\n\t\t\t: \"k_socialpost.id_socialpost\");\n\t\t\n\t\t$order = \"\\nORDER BY \".(($opt['order'] != '' && $opt['direction'] != '')\n\t\t\t? $opt['order'].\" \".$opt['direction']\n\t\t\t: \"socialActivityDate DESC\");\n\n\t\t$limit = \"\\nLIMIT \".(($opt['offset'] != '' && $opt['limit'] != '')\n\t\t\t? $opt['offset'].\",\".$opt['limit']\n\t\t\t: \"0,50\");\n\n\t\tif($opt['noLimit'] == true) unset($limit);\n\t}\n\n\t$field\t\t= \"k_socialactivity.*\";\n\t$where\t\t= is_array($cond) ? \"\\nWHERE\\n\".implode(\" AND \", $cond) : NULL;\n\t$inner\t\t= is_array($join) ? \"\\n\".implode(\"\\n\", $join).\"\\n\" : NULL;\n\n\t$activity\t= $this->dbMulti(\"SELECT \".$field.\" FROM k_socialactivity \".$inner. $where . $__group__ . $order . $limit);\n\tif($opt['debug']) $this->pre($this->db_query, $this->db_error, $activity);\n\n\treturn $activity;\n}", "final public function get_activity() {\r\n\t\tthrow new BadMethodCallException('You do not have permission as an anonymous user to attempt this action');\r\n\t}", "public function getUserActivitiesAction()\n {\n $getOperations = false;\n $activity = new Workapp_Activity();\n $data = $this->getRequestData();\n if (isset($data['getoperations'])) {\n $getOperations = $data['getoperations'];\n }\n $this->_helper->json($activity->getActivityList(array('user_id' => $this->getDeviceSession()->getUserId(), 'getoperations' => $getOperations)));\n }", "function ajan_core_record_activity() {\n\n\tif ( !is_user_logged_in() )\n\t\treturn false;\n\n\t$user_id = ajan_loggedin_user_id();\n\n\tif ( ajan_is_user_inactive( $user_id ) )\n\t\treturn false;\n\n\t$activity = ajan_get_user_last_activity( $user_id );\n\n\tif ( !is_numeric( $activity ) )\n\t\t$activity = strtotime( $activity );\n\n\t// Get current time\n\t$current_time = ajan_core_current_time();\n\n\t// Use this action to detect the very first activity for a given member\n\tif ( empty( $activity ) ) {\n\t\tdo_action( 'ajan_first_activity_for_member', $user_id );\n\t}\n\n\tif ( empty( $activity ) || strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) ) {\n\t\tajan_update_user_last_activity( $user_id, $current_time );\n\t}\n}", "function activityDetail($userId,$activityId){\n\n $where = array('activityId'=>$activityId);\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n $defaultUserImg = base_url().USER_DEFAULT_IMAGE;\n $userImg = base_url().USER_MAIN_IMAGE;\n $this->db->select('a.activityId,a.name,a.location,a.latitude,a.longitude,a.fee_type,a.fee,a.min_users,a.max_users,a.user_role,a.description,a.terms_conditions,IF(a.image IS NULL || a.image = \"\",\"'.$defaultActivityImg.'\",concat(\"'.$activityImg.'\",a.image)) as image,IF(aj.activityJoinId IS NULL,0,1) as is_like,COALESCE(ut.tag_name,\"\")as leader_name,COALESCE(u1.full_name,\"\")as creator_name,(case \n when (u1.profile_image = \"\") \n THEN \"'.$defaultUserImg.'\"\n when (u1.profile_image != \"\" && u1.is_profile_url = 1) \n THEN u1.profile_image\n ELSE\n concat(\"'.$userImg.'\",u1.profile_image) \n END) as creator_profile_image,c.club_name');\n $this->db->from(ACTIVITIES.' as a');\n $this->db->join(CLUBS.' as c','a.club_id = c.clubId');\n $this->db->join(CLUB_CATEGORY.' as cc','c.club_category_id = cc.clubCategoryId AND cc.status = \"1\"'); \n $this->db->join(USERS.' as u1','a.creator_id = u1.userId'); \n $this->db->join(USER_TAGS.' as ut','a.leader_id = ut.userTagId','left');\n $this->db->join(ACTIVITY_JOIN.' as aj','a.activityId = aj.activity_id AND aj.user_id = \"'.$userId.'\"','left');\n $this->db->where($where);\n $q = $this->db->get();\n if($q->num_rows()){\n $row = $q->row();\n $nextEvent = $this->getNextEvent($activityId);\n if($nextEvent){\n $row->next_event = $nextEvent;\n }\n return $row;\n }\n\n }", "function getactivity($userid)\n\t{\n\t\t$sql=\"select * from king_board_activity where userid=? order by id desc limit 9\";\n\t\treturn $this->db->query($sql,$userid)->result_array();\n\t}", "function _tincan_lrs_activities_get_handler($activityId, $params) {\n switch($activityId) {\n case 'profile':\n $result = _tincan_lrs_activity_profiles_get_processor($params);\n break;\n case 'state':\n $result = _tincan_lrs_activity_state_get_processor($params);\n break;\n default:\n $result = _tincan_lrs_activity_get_processor($params, $activityId);\n \n }\n return $result;\n\n}", "function Activity() {\n\t\t$query_string = Request::$GET;\n\t\t$global_string = $this->buildQuery($query_string);\n\t\t//Display User select tool if user has admin permissions\n\t\t$globalUser = '';\n\t\tif ($this->User->HasModuleItemAccess('administration', CU_ACCESS_ALL, CU_ACCESS_READ)) {\n\t\t\t// $actualUserID = $this->User->ID;\n\t\t\t$userID = Request::get('userID', Request::R_INT);\n\t\t\t// Create Temp user for creating correct permissions\n\t\t\tif ($userID) {\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t$this->TempUser\t\t =& new User();\n\t\t\t$this->TempUser->Initialise($userID, $this->DB);\n\t\t\t} else if ($this->Session->Get('springboardID')) {\n\t\t\t$userID = $this->Session->Get('springboardID');\n\t\t\t$this->TempUser\t\t =& new User();\n\t\t\t$this->TempUser->Initialise($userID, $this->DB);\n\t\t\t} else {\n\t\t\t$this->TempUser->ID = $this->User->ID;\n\t\t\t$userID = $this->User->ID;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t}\n\t\t\t$globalUser = '<label>' . MSG_USER_TO_SHOW . '</label><select id=\"activityUserToShowFilter\">';\n\n\t\t\t$SQL = sprintf(SQL_GET_USER_LIST);\n\t\t\t$userList = $this->DB->Query($SQL);\n\t\t\tif ($userList) {\n\t\t\tfor ($i = 0; $i < count($userList); $i++) {\n\t\t\t\t$globalUser .= '<option value=\"' . $userList[$i]['ID'] . '\"'\n\t\t\t\t. ($this->TempUser->ID == $userList[$i]['ID'] ? ' selected' : '') . '>'\n\t\t\t\t. $userList[$i]['FirstName'].' '.$userList[$i]['LastName'].'</option>';\n\t\t\t\t\n\t\t\t}\n\t\t\t}\n\n\t\t\t$globalUser .= '</select>';\n\t\t\t$tmplDash['globalUser'] = $globalUser;\n\n\t\t\t\t\t\t$tmplDash['displayState'] = ($userID == $this->User->ID) ? \"showDashOnLoad\" : \"dontShowDashOnLoad\";\n\n\t\t\t$tmplDash['showfilter'] = '';\n\n\t\t\t$URI = split (\"index\\.php\",Request::server(SCRIPT_NAME_VAR));\n\t\t\t// Create validity key\n\t\t\t$this->KeyUser =& new User();\n\t\t\t$this->KeyUser->Initialise($userID, $this->DB);\n\t\t\t$key = substr(md5($this->KeyUser->Fullname.$this->KeyUser->PasswordHash), 2, 8);\n\t\t\t$modAction[] = '<a href=\"webcal://' . Request::server(SERVER_NAME_VAR) . $URI[0] . 'system/ical_springboard.php?show=' . $query_string['show'] \n\t\t\t\t. '&completed=' . $query_string['completed'] \n\t\t\t\t. '&action=' . $query_string['action'] \n\t\t\t\t. '&key=' . $key \n\t\t\t\t. '&userid=' . $userID . '\">' . MSG_SYNC_TO_ICAL . '</a>';\n\n\t\t\t$modAction[] = '<a id=\"dash-toggler\" href=\"#\" onclick=\"toggleDash(); return false;\">'.MSG_SHOW_DASH.'</a>';\n\t\t\t\t\t\t$tmplDash['period'] = '';\n\t\t\t$this->setDash($this->getTemplate(\"dashBlock\", $tmplDash));\n\t\t} else {\n\t\t\t$userID = $this->User->ID;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t}\n\t\t$modAction[] = '<a href=\"index.php?module=springboard&completed=1\">'.MSG_VIEW_COMPLETED.'</a>';\n\t\t//end of other user select code.\n\n\t\t$this->CreateTabs('activity');\n\n\t\t// Tell MySQL if we want the week to start on Sunday or Monday.\n\t\t$weekMode = (CU_WEEK_START == 'Sunday') ? 0 : 1;\n\t\t$day = $this->DB->QuerySingle(sprintf(SQL_GET_ACTIVITY_DAY, $userID));\n\t\t$week = $this->DB->QuerySingle(sprintf(SQL_GET_ACTIVITY_WEEK, $weekMode, $userID));\n\t\t$month = $this->DB->QuerySingle(sprintf(SQL_GET_ACTIVITY_MONTH, $userID));\n\n\t\tif($userID == $this->User->ID){\n\t\t\t$tmpl['txtUsername'] = $this->User->Name();\n\t\t} else {\n\t\t\t$tmpl['txtUsername'] = $this->TempUser->Name();\n\t\t}\n\t\t$tmpl['txtDayComments'] = $day['Comments'];\n\t\t$tmpl['txtDayHours'] = $day['Hours'];\n\t\t$tmpl['txtWeekComments'] = $week['Comments'];\n\t\t$tmpl['txtWeekHours'] = $week['Hours'];\n\t\t$tmpl['txtMonthComments'] = $month['Comments'];\n\t\t$tmpl['txtMonthHours'] = $month['Hours'];\n\n\t\t$tmpl['issues'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_OPEN_ISSUES, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\t$url = \"index.php?module=springboard&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['name'] = \"<a href=\\\"$url\\\">{$r['TaskName']}</a>\";\n\t\t\t\t$url = \"index.php?module=projects&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['value'] = \"<a href=\\\"$url\\\">{$r['ProjectName']}</a>\";\n\t\t\t\t$tmpl['issues'] .= $this->getTemplate('activity_item', $itemTmpl);\n\t\t\t}\n\t\t}\n\n\t\t$tmpl['commentary'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_RECENT_COMMENTARY, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\t$url = \"index.php?module=springboard&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['name'] = \"<a href=\\\"$url\\\">{$r['TaskName']}</a>\";\n\t\t\t\t$url = \"index.php?module=projects&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['value'] = \"<a href=\\\"$url\\\">{$r['ProjectName']}</a>\";\n\t\t\t\t$tmpl['commentary'] .= $this->getTemplate('activity_item', $itemTmpl);\n\t\t\t}\n\t\t}\n\n\t\t$tmpl['pages'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_PAGES_VISITED, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\tswitch ($r['Context'])\n\t\t\t\t{\n\t\t\t\t\tcase 'client': $context = MSG_CLIENT; $url = \"index.php?module=clients&action=view&id={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'project': $context = MSG_PROJECT; $url = \"index.php?module=projects&action=view&projectid={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'task': $context = MSG_TASK; $url = \"index.php?module=projects&action=taskview&projectid={$r['Comment']}&taskid={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'file': $context = MSG_FILE; $url = \"index.php?module=files&action=view&fileid={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'contact': $context = MSG_CONTACT; $url = \"index.php?module=contacts&action=view&id={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'projectreport': $context = MSG_REPORT; $url = \"index.php?module=reports&action=analysis&report={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'workreport': $context = MSG_REPORT; $url = \"index.php?module=reports&action=timesheets&report={$r['ContextID']}\"; break;\n\t\t\t\t\tcase 'login': $context = MSG_LOGIN; $url = '';\n\t\t\t\t\tdefault: $context = ''; $url = '';\n\t\t\t\t}\n\n\t\t\t\tif ($context != '')\n\t\t\t\t{\n\t\t\t\t\tif ($url == '')\n\t\t\t\t\t\t$itemTmpl['name'] = \"$context: {$r['Detail']}\";\n\t\t\t\t\telse\n\t\t\t\t\t\t$itemTmpl['name'] = \"<a href=\\\"$url\\\">$context: {$r['Detail']}</a>\";\n\t\t\t\t\t$itemTmpl['value'] = $r['Timestamp'];\n\t\t\t\t\t$tmpl['pages'] .= $this->getTemplate('activity_item', $itemTmpl);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tmpl['groupactivity'] = '';\n\t\t$rows = $this->DB->Query(sprintf(SQL_GET_TASK_TIMES_FOR_GROUP_MEMBERS, $userID));\n\t\tif (is_array($rows))\n\t\t{\n\t\t\tforeach ($rows as $r)\n\t\t\t{\n\t\t\t\t$url = \"index.php?module=springboard&action=taskview&projectid={$r['ProjectID']}&taskid={$r['TaskID']}\";\n\t\t\t\t$itemTmpl['task'] = \"<a href=\\\"$url\\\">{$r['TaskName']}</a>\";\n\t\t\t\t$itemTmpl['user'] = $r['Name'];\n\t\t\t\t$itemTmpl['elapsed'] = substr($r['Elapsed'], 0, -3);\n\t\t\t\t$tmpl['groupactivity'] .= $this->getTemplate('group_activity_item', $itemTmpl);\n\t\t\t}\n\t\t}\n\n\t\t$this->setTemplate('activity', $tmpl);\n\n\t\t$modHeader = MSG_ACTIVITY;\n\t\t$this->setHeader($modHeader, $insert);\n\t\t$this->SetModule($modHeader, $modAction);\n\t\t$this->Render();\n\t}", "public function activity()\n {\n return $this->belongsTo('App\\Models\\Activity','activity_id');\n }", "public function show($id)\n {\n return Activity::findOrFail($id);\n }", "public function id() {\n return $this->activity_array['id'];\n }", "public function getUser()\n {\n return $this->hasMany(User::className(), ['activity_status' => 'id']);\n }", "public function show($id)\n {\n $activity = Activity::find($id);\n return $activity;\n }", "public function get_activity() {\r\n\t\treturn ActionFactory::fetch_activity(clone $this);\r\n\r\n\t}", "public function show()\n {\n return $this->activities->userActivityForPeriod(\n Auth::user()->id,\n Carbon::now()->subWeeks(2),\n Carbon::now()\n );\n }", "public function userExistAct($activityid, $username){\r\n\t\t$stmt = $this->db->prepare(\"SELECT count(usuario) FROM activities_user WHERE usuario=? AND actividad=?\");\r\n\t\t$stmt->execute(array($username, $activityid));\r\n\r\n\t\tif($stmt->fetchColumn() > 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function show(User $user, Activity $activity)\n {\n return new ActivityResource($activity);\n }", "public function activity()\n {\n return $this->belongsTo('App\\Modules\\Models\\Activity');\n }", "function bigbluebuttonbn_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) {\n}", "public function deleteUserActivityAction()\n {\n /** @var Object_Activity $activity */\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $activity->getCreator()->getId()) {\n $activity->setPublished(false);\n if ($activity->save()) {\n $operations = new Workapp_Activity();\n $op = $operations->getActivityRequiredByOperations($activity);\n foreach ($op as $operation) {\n $operation = Object_Operation::getById($operation->getId());\n $operation->setPublished(false);\n if (!$operation->save()) {\n $this->setErrorResponse('cannot delete relative Operation objects!');\n }\n }\n } else {\n $this->setErrorResponse('cannot delete Activity object!');\n }\n } else {\n $this->setErrorResponse('no Activity for this user with current activity_id!');\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n\n }\n $this->_helper->json(array('deleted' => true));\n }", "public static function getActivityComments($activity_id)\n\t{\n\t\t$comments = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT pac.id, pac.text, UNIX_TIMESTAMP(pac.created_on) AS created_on, pac.user_id\n\t\t\t FROM profiles_activity_comments AS pac\n\t\t\t WHERE pac.activity_id = ? AND pac.status = ?\n\t\t\t ORDER BY pac.created_on ASC', \n\t\t\tarray((int) $activity_id, (string) 'visible')\n\t\t);\n\n\t\t// add userinfo\n\t\tforeach($comments as &$comment)\n\t\t{\n\t\t\t$profile = FrontendProfilesModel::get($comment['user_id']);\n\t\t\t$comment['username'] = $profile->getDisplayName();\n\t\t\t$comment['avatar'] = $profile->getSetting('avatar');\n\t\t\t$comment['facebook_id'] = $profile->getSetting('facebook_id');\n\t\t\t$comment['url'] = $profile->getUrl();\n\t\t\t$comment['deletable'] = ($profile->getId() == FrontendProfilesAuthentication::getProfile()->getId());\n\t\t}\n\n\t\treturn $comments;\n\t}", "public static function getActivity($idActivity) {\r\n\t\t$idActivity\t= intval($idActivity);\r\n\r\n\t\treturn TodoyuRecordManager::getRecord('TodoyuProjectActivity', $idActivity);\r\n\t}", "protected function get_activity($instanceid) {\n global $DB;\n\n if (empty($this->activitiesdata[$this->get_module_name()][$instanceid])) {\n $this->activitiesdata[$this->get_module_name()][$instanceid] = $DB->get_record($this->get_module_name(),\n array('id' => $instanceid), '*', MUST_EXIST);\n }\n return $this->activitiesdata[$this->get_module_name()][$instanceid];\n\n }", "public function getUserActivityList(){\n return($this->userActivityList);\n }", "public function actionShowusersactivities()\n\t{\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->limit=6;\t\n\t\t$uid = Yii::app()->user->id; //logged in userId\n\t\t$activityArray = array(); //contains, all activities, Like,Dislikes,Become friends etc\n\t\t$str='';\n\t\t$limit = 10;\n\t\t$flag = (isset($_GET['flag']))?$_GET['flag']:'';\n\t\tif(!empty($uid))\n\t\t{\n\t\t\t// ** User Logged IN ***\n\t\t\t//Show Photo Likes activities of Me & friends of Me\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit,$uid);\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$uname = ($uid==$v['userid'])?'You':$v['username'];\n\t\t\t\t\t$owner_name = $v['ownername'];\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$owner_name.'&#39;s photo:';\n\t\t\t\t\t$src=Yii::app()->baseUrl.'/files/'.$v['owner_id'].'/thumbnail/'.$v['photos_name'];\t\t\t\t\n\t\t\t\t\t$file_path = Yii::getPathOfAlias('webroot').'/files/'.$v['owner_id'].'/'.$v['photos_name'];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!file_exists($file_path)){\n\t\t\t\t\t\t$src=Yii::app()->theme->baseUrl.'/img/noimage.jpg';\n\t\t\t\t\t}\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.$src.'\" />';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t\n\t\t\t\t\t//Duplicate Testing\tDUMMY Data .......\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />';\n\t\t\t\t\t$activityArray['1410354280'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t$activityArray['1410354380'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\t\t\t\t\t\n\t\t\t\t\t//Duplicate Ends\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of Friends..ie who had recently become your friend\t\t\n\t\t\t$criteria->condition = \"t.user_id='\".$uid.\"' AND t.status=1\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['friend']['user_details_avatar'],'name'=>'you','message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Users..ie who had recently Send You Friends Request\t\t\n\t\t\t$criteria->condition = \"t.friend_id='\".$uid.\"' AND t.status=0\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' Had Sent You a Friend Request';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$v['user']['user_details_firstname'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Friend's friends..ie your friend who had add another friend\t\t\t\n\t\t\t$friends=UsersFriends::model()->getActivityFriends($limit,$uid);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t//where $[name] is your(loggedIn User) frnd , who also become frnd with $v['ffname']\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' and '.$v['ffname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Get List of users who started to follow you..\n\t\t\t$followers=UsersFollow::model()->getActivityFollow($limit,$uid);\n\t\t\tif(count($followers)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($followers as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' is now your follower';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tunset($followers);\n\t\t\t\n\t\t\t//Now get List of Extra Notification of Posly, only for Top-Header DUMMY Data .......\n\t\t\tif($flag==\"header\"){\n\t\t\t\t$msg = 'There is an event to be organised at bangalore, at 1-oct-14, for Fashion ..an fasion event';\n\t\t\t\t$activityArray['1410835502'] = array('avatar'=>'avatar1_small.jpg','name'=>'Posly','message'=>$msg,'image'=>''); \n\t\t\t\t//*Duplicate Testing Data\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ** User NOT Logged IN ***\n\t\t\t//Show general user Photo Likes activities , as no body has loggedIn\t\t\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit); \t\t\t\t\t\t\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v){\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$v['ownername'].'&#39;s photo:';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$v['username'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of any user who had recently become friends\n\t\t\t$criteria->condition = \"status=1\";\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$user = $v['user']['user_details_firstname'].' '.$v['user']['user_details_lastname'];\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$user,'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t}\n\t\t\n\t\t//Now Create the display Activity HTML\t\t\n\t\tif(count($activityArray)>0)\n\t\t{\n\t\t\tkrsort($activityArray); \n\t\t\t//Sort activity Array By Keys -- SORT\t\n\t\t\t$unread_notifycount=0;\n\t\t\t$user_notifyReaddate = (!empty($uid))?Yii::app()->user->getState(\"notify_readdate\"):'0';\t\t\t\n\t\t\tforeach($activityArray as $keys=>$values)\n\t\t\t{\t\t\t\n\t\t\t\t$fromurl=strstr($values['avatar'], '://', true);\n\t\t\t\tif($fromurl=='http' || $fromurl=='https')\n\t\t\t\t\t$avatar = $values['avatar']; \n\t\t\t\telse\n\t\t\t\t$avatar = Yii::app()->baseUrl.'/profiles/'.$values['avatar'];\n\t\t\t\tif($flag==\"header\")\n\t\t\t\t{\n\t\t\t\t\t//This is for Top-Header Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li> \n\t\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<div class=\"main\">\n\t\t\t\t\t<span class=\"photo\">\n\t\t\t\t\t<img class=\"avatar-user-l img-responsive\" src=\"'.$avatar.'\" alt=\"\"/>\n\t\t\t\t\t</span>\t\t\t\t\t\n\t\t\t\t\t<div class=\"message\"> \n\t\t\t\t\t\t<span class=\"name\">'.$values['name'].'</span> '.$values['message'].' \n\t\t\t\t\t\t<div class=\"newtime\">'.$this->get_msgtime($keys).'</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</a> \n\t\t\t\t\t</li>\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t} else{\n\t\t\t\t\t//This for Side-Bar UserActivity/Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.$avatar.'\" />\n\t\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<span class=\"notimsg\"><span class=\"name\">'.$values['name'].'</span> '.$values['message'].'</span>'.$values['image'].'\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t</li>\t\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t//Now check For notify Cnt for LoggedIn user\t\t\t\t\n\t\t\t\tif(!empty($uid))\n\t\t\t\t{ //Condition if notify Date in DB is Less then Keys(notifyTimedate), then its an Unread\t\t\n\t\t\t\t\tif($user_notifyReaddate < $keys){\n\t\t\t\t\t\t$unread_notifycount++; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!empty($uid)){\n\t\t\t\t$unread_notifycount = ($unread_notifycount==0)?'':$unread_notifycount;\n\t\t\t\tYii::app()->user->setState('notify_count', $unread_notifycount);\n\t\t\t}\n\t\t}\n\t\tunset($activityArray);\n\t\tif(empty($str)){\n\t\t\t//a Default Dummy status.\n\t\t\t$str='<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />\n\t\t\t<div class=\"message\"> <span class=\"name\">Chanh Ny</span> likes Chi Minh Anh photo. </div>\n\t\t\t</li>';\n\t\t}\t\t\n\t\techo $str;\t\t\n\t\tYii::app()->end();\t\n\t}", "public function getActivity($activityId) {\n try {\n $key = self::CACHE_KEY_PREFIX . '_' . $activityId;\n if (Cache::has($key)) {\n $data = Cache::get($key);\n return $data;\n }\n $activity = Activity::where('activityId', '=', $activityId)->get();\n if (!isset($activity[0])) {\n return json_encode(array());\n }\n $activity = $activity[0];\n $data = array();\n $data['activity_id'] = $activity->activityId;\n $data['enter'] = $activity->enter;\n $data['click'] = $activity->click;\n $data['exit'] = $activity->exit;\n $data['updated_at'] = $activity->updated_at;\n $data['created_at'] = $activity->created_at;\n Cache::add($key, $data, 60);\n return $data;\n }\n catch (Exception $e) {\n //log error\n }\n return array();\n }", "function myActivityList($userId,$data){\n\n $activityData = array();\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n if(empty($data['limit']) && empty($data['offset'])){\n $data['offset'] = 0; $data['limit']= 5; \n }\n $where = array('c.status'=>'1','cc.status'=>'1','a.status'=>'1','a.creator_id'=>$userId);\n \n $this->db->select('IF(a.image IS NULL or a.image = \"\",\"'.$defaultActivityImg.'\",concat(\"'.$activityImg.'\",a.image)) as image,a.name as activityName,a.is_hide,a.activityId,c.club_name');\n $this->db->from(ACTIVITIES.' as a'); \n $this->db->join(CLUBS.' as c','a.club_id = c.clubId');\n $this->db->join(CLUB_CATEGORY.' as cc','c.club_category_id = cc.clubCategoryId'); \n $this->db->join(ACTIVITY_EVENTS.' as ae','a.activityId = ae.activity_id AND ae.status = \"1\"','left');\n \n $this->db->where($where);\n $this->db->group_by('a.activityId');\n $this->db->order_by(\"a.activityId desc\");\n $this->db->limit($data['limit'],$data['offset']);\n $query = $this->db->get();\n if($query->num_rows() >0){\n $activityData = $query->result();\n foreach ($activityData as $key => $value) {\n $activityId = $value->activityId;\n $activityData[$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n return $activityData;\n }", "public function getActivity ($id) {\n\t\t$activities = DB::table('users_activities')\n\t\t\t->where('user_id',$id)\n\t\t\t->orderBy('id','desc')\n\t\t\t->simplePaginate(20);\n\n\t\treturn view('pages.account.partials.activitypartial')->with('activities',$activities);\n\t}", "public function testGetActivityByActivityIdForNonExistingId() {\n\n $activity = $this->timesheetDao->getActivityByActivityId(-1);\n $this->assertEquals(null, $activity);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function setActivityID($value)\n {\n return $this->set('ActivityID', $value);\n }", "public function activityActor();", "public function getDetailsOfAnActivity(\n $id\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activities/{id}';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'id' => $id,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function activity()\n {\n return $this->belongsTo('App\\Activity');\n }", "public function create($uid, $activity)\n\t{\n\t\treturn $this->request->send('POST', \"/profiles/$uid/activities\", $activity);\n\t}", "static public function getActivityId( $name ) {\n\t\t$model = new Moondee_Activity_Model_Activity();\n\t\t$activity_data = $model->fetchRow('id = '.$activity_id);\n\t\t\n\t\tif( $activity_data['id'] ){\n\t\t\treturn $activity_data['id'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function activity()\n {\n return $this->belongsTo(Activity::class);\n }", "function getProfile($id){\n return $this->activity_model->fetchProfile($id)->row();;\n }", "public function findByTrackingId(string $tracking_id): Activity{\n $query = <<<SQL\n select id, type, duration, polyline, ROUND(latitude/100000, 5) latitude, ROUND(longitude/100000, 5) longitude, started_at, ended_at, tracking_id, user_id \n from activities\n where tracking_id=:tracking_id;\nSQL;\n $query = $this->db->prepare($query);\n $query->execute([':tracking_id' => $tracking_id]);\n\n $activity = $query->fetch();\n\n if($activity === false){\n throw new ResourceNotFoundException('Activity with given tracking id could not be found!');\n }\n\n return new Activity(\n $activity['type'],\n $activity['distance'],\n $activity['duration'],\n $activity['polyline'],\n new Point($activity['longitude'], $activity['latitude']),\n $activity['started_at'],\n $activity['ended_at'],\n $activity['tracking_id'],\n $activity['user_id'],\n $activity['organization_id'],\n $activity['id']\n );\n }", "public function show($id)\n {\n $my_activity = DB::table('my_activity')\n //->join('activity', 'sub_activity.activity_id', '=', 'activity.id')\n ->join('users', 'my_activity.created_by_user_id', '=', 'users.id')\n //->join('assignment', 'assignment.sub_activity_id', '=', 'sub_activity.id')\n ->select([\n 'my_activity.name as my_activity_name',\n //'activity.name as activity_name',\n 'users.id as users_id',\n 'my_activity.*',\n 'my_activity.id as my_activity_id',\n 'my_activity.*',\n 'users.name as user_name',\n //'assignment.petugas'\n ])\n ->where('my_activity.id','=',$id)\n ->first();\n\n $users = DB::table('users')\n ->select([\n 'users.*'\n ])\n ->get();\n if ($my_activity != null){\n return view('myactivity.show', ['my_activity' => $my_activity], ['users' => $users]);\n }else{\n return abort(404, \"Kegiatan atau Sub-Kegiatan dengan id $id tidak ditemukan\");\n }\n }", "public function updateUserActivityAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Activity!');\n } else {\n if (isset($data['title'])) {\n $activity->setTitle($data['title']);\n }\n if (isset($data['photo'])) {\n $activity->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (!$activity->save()) {\n $this->setErrorResponse('cannot update Activity object');\n }\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function get_activity_type($activity_id, $thread_id = NULL, $process_id = NULL) {\n\t\t$query = $this->db->select ( 'id_thread' )->where ( 'id', $activity_id )->get ( 'activities' );\n\t\t$result = $query->row ();\n\t\t$thread_id = $result->id_thread;\n\t\t\n\t\t// get activity_type\n\t\t$query = $this->db->query ( 'select sa.id as activity_type from setup_activities sa JOIN setup_processes sp ON sa.id_process=sp.id JOIN threads t ON t.type=sp.key JOIN activities a ON a.id_thread=t.id where a.id=' . $activity_id . ' and t.id=' . $thread_id . ' and sa.key = (select aa.type from activities aa where aa.id= ' . $activity_id . ')' );\n\t\treturn $query->row ();\n\t}", "public function getID($activityID, $dataSetType = false, $options = []) {\n $activity = parent::getID($activityID, $dataSetType);\n if ($activity) {\n $this->calculateRow($activity);\n $activities = [$activity];\n self::joinUsers($activities);\n $activity = array_pop($activities);\n }\n\n return $activity;\n }", "public function get_activity($accid, $since = -1, $max = -1) {\n if(!isset($this->gateways[$accid]))\n $this->gateways[$accid] = $this->find_storage($accid);\n\n $params = array(\"json\"=>\"true\",\"accid\"=>$accid); \n if($since >= 0) \n $params[\"since\"] = $since;\n\n if($max >= 0) \n $params[\"max\"] = $max;\n\n $result = $this->call_json($this->gateways[$accid].\"/Activity.action\", $params);\n if($result->status != \"ok\") {\n throw new Exception(\"Failed to load activity for account $accid from \".$this->appliance_url.\": \".$result->error);\n } \n //error_log(\"got \".$result->status.\" sessions back\");\n return $result->sessions;\n }", "function getJoinedUser($userId,$activityId){\n \n $where = array('userId'=>$userId);\n $defaultUserImg = base_url().USER_DEFAULT_IMAGE;\n $userImg = base_url().USER_MAIN_IMAGE;\n $this->db->select('u.full_name,u.userId,(case \n when (u.profile_image = \"\") \n THEN \"'.$defaultUserImg.'\"\n when (u.profile_image != \"\" && u.is_profile_url = 1) \n THEN u.profile_image\n ELSE\n concat(\"'.$userImg.'\",u.profile_image) \n END) as profile_image,if(aj.activityJoinId IS NULL,0,1) as isJoined');\n $this->db->from(USERS.' as u');\n $this->db->join(ACTIVITY_JOIN.' as aj','u.userId = aj.user_id AND aj.activity_id = \"'.$activityId.'\" AND aj.affiliate_id = 0','left');\n $this->db->where($where);\n $q = $this->db->get();\n if($q->num_rows()){\n $row = $q->row();\n $row->affiliates = $this->getJoinUserAffiliates($userId,$activityId);\n return $row;\n }\n\n }", "public function punch($employee_id, $activity_id)\n {\n // set active employee id\n $this->_employeeId = $employee_id;\n // get last timesheet activity\n $this->_lastAction = $this->_lastActivity();\n $this->shift = $this->getShift();\n return $this->_filterAction($activity_id);\n }", "public function activityObject();", "public function activity()\n {\n return $this->belongsTo('App\\Models\\Activity\\Activity');\n }", "public function getEntityId()\n {\n return $this->activityId;\n }", "public function session_count_by_activity($user_id = null, $start_date = null, $end_date = null, $activitygroup_id = null, $unit_id = null, $activity_id=null, $is_publish=null) {\n $conditions = array();\n $link['Activitygroup'] = array(\n 'fields'=>array(\n 'Activitygroup.name'\n )\n );\n\n if(!empty($user_id)){\n $conditions['AND'][$this->alias . \".countuser_id\"] = $user_id;\n }\n if(!empty($start_date)){\n $conditions['AND'][$this->alias . \".date >=\"] = $start_date;\n }\n if(!empty($end_date)){\n $conditions['AND'][$this->alias . \".date <=\"] = $end_date;\n }\n if(!empty($activitygroup_id)){\n $conditions['AND'][\"Activity.activitygroup_id\"] = $activitygroup_id;\n }\n if(!empty($activity_id)){\n $conditions['AND'][\"Activity.id\"] = $activity_id;\n }\n if(!empty($unit_id)){\n $conditions['AND'][\"Unit.id\"] = $unit_id;\n $link['Unit'] = array(\n 'fields'=>array(\n 'Unit.name'\n )\n );\n }\n\n if(isset($is_publish)){\n if($is_publish === 0){\n $conditions['AND'][\"Activity.publish\"] = 0;\n }else if($is_publish === 1){\n $conditions['AND'][\"Activity.publish\"] = 1;\n }\n }\n\n $options = array(\n 'fields' => array(\n \"sum(Activitysession.session) as total_session_count\",\n \"sum(Activitysession.session * Activitysession.extra_attendant) as total_extra_attendant\"\n ),\n 'link' => array(\n 'Activity'=>array(\n 'fields'=>array(\n 'Activity.id',\n \"Activity.name\",\n \"Activity.activity_code\",\n \"Activity.startdate\",\n \"Activity.enddate\",\n ),\n 'link'=>$link\n ),\n 'Countuser'=>array(\n 'fields'=>array(\n 'Countuser.name'\n )\n ),\n\n ),\n \"conditions\"=>$conditions,\n \"group\"=>array(\"Activity.id\")\n );\n\n return $this->find('all',$options);\n }", "function getActivityEvents($userId,$activityId){\n\n $activityData = array();\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n $data['offset'] = 0; $data['limit']= 10; \n $where1 = array('ae.status'=>'1','a.status'=>'1','ae.activity_id'=>$activityId);\n $this->db->select('ae.activityEventId,ae.event_title,ae.event_date,ae.event_time,ae.description,ae.location,ae.latitude,ae.longitude,a.fee,a.fee_type,a.max_users,count(DISTINCT aj.activityJoinId) as total_users,count(DISTINCT ac.activityConfirmId) as joined_users,if(ac_me.activityConfirmId IS NULL,0,1) as is_confirm,if(aj1.activityJoinId IS NULL,0,1) as hasJoined,if(aj2.activityJoinId IS NULL,0,1) as hasAffiliatesJoined');\n $this->db->from(ACTIVITY_EVENTS.' as ae');\n $this->db->join(ACTIVITIES.' as a','ae.activity_id = a.activityId'); \n $this->db->join(ACTIVITY_JOIN.' as aj','a.activityId = aj.activity_id','left');\n $this->db->join(ACTIVITY_CONFIRM.' as ac','ae.activityEventId = ac.activity_event_id','left');\n $this->db->join(ACTIVITY_CONFIRM.' as ac_me','ae.activityEventId = ac_me.activity_event_id AND ac_me.user_id = \"'.$userId.'\"','left');\n $this->db->join(ACTIVITY_JOIN.' as aj1','a.activityId = aj1.activity_id AND aj1.user_id = \"'.$userId.'\"','left');\n $this->db->join(ACTIVITY_JOIN.' as aj2','a.activityId = aj2.activity_id AND aj2.user_id = \"'.$userId.'\" AND aj2.affiliate_id != 0','left');\n $this->db->where($where1);\n $this->db->group_by('ae.activityEventId');\n $this->db->order_by(\"ae.event_date asc,ae.event_time asc\");\n $this->db->limit($data['limit'],$data['offset']);\n $query = $this->db->get();\n if($query->num_rows() >0){\n $activityData = $query->result();\n }\n return $activityData;\n\n }", "public function search(Google_Service_AnalyticsReporting_SearchUserActivityRequest $postBody, $optParams = array())\n {\n $params = array('postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('search', array($params), \"Google_Service_AnalyticsReporting_SearchUserActivityResponse\");\n }", "public function getLastActivity(): ?AbstractUserActivity\n {\n return app(UserActivityService::class)->getUserActivity($this);\n }", "public function save($activity) {\r\n\t\t$stmt = $this->db->prepare(\"INSERT INTO activities (nombre, descripcion, dia, hora_inicio, hora_fin, plazas, entrenador) VALUES (?, ?, ?, ?, ?, ?, ?)\");\r\n\t\t$stmt->execute(array($activity->getNombre(), $activity->getDescripcion(), $activity->getDia(), $activity->getHoraInicio(), $activity->getHoraFin(), $activity->getPlazas(), $activity->getEntrenador()));\r\n\t\t$stmt = $this->db->query(\"SELECT MAX(id) FROM activities\");\r\n\t\t$id = $stmt->fetch();\r\n\t\treturn $id;\r\n\t}", "public function getActivities()\n\t{\n\t\t// Load component tables\n\t\tJTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_activitystream/tables');\n\n\t\t// Variable to store activity data fetched\n\t\t$result = array();\n\n\t\t// Variable to store request response\n\t\t$result_arr = array();\n\n\t\t$ActivityStreamModelActivities = $this->getModel('Activities');\n\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$type = $jinput->get(\"type\", '', 'STRING');\n\n\t\t// Return result related to specified activity type\n\t\tif (empty($type))\n\t\t{\n\t\t\t$result_arr['success'] = false;\n\t\t\t$result_arr['message'] = JText::_(\"COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE\");\n\n\t\t\techo json_encode($result_arr);\n\n\t\t\tjexit();\n\t\t}\n\n\t\t$actor_id = $jinput->get('actor_id', '', 'CMD');\n\t\t$object_id = $jinput->get('object_id', '', 'CMD');\n\t\t$target_id = $jinput->get('target_id', '', 'STRING');\n\t\t$from_date = $jinput->get('from_date', '');\n\t\t$start = $jinput->get('start', '0');\n\t\t$limit = $jinput->get('limit');\n\t\t$filter_condition = $jinput->get('filter_condition', '', 'STRING');\n\n\t\t// Set model state\n\t\t$ActivityStreamModelActivities->setState(\"type\", $type);\n\t\t$ActivityStreamModelActivities->setState(\"actor_id\", $actor_id);\n\t\t$ActivityStreamModelActivities->setState(\"object_id\", $object_id);\n\t\t$ActivityStreamModelActivities->setState(\"target_id\", $target_id);\n\t\t$ActivityStreamModelActivities->setState(\"from_date\", $from_date);\n\t\t$ActivityStreamModelActivities->setState(\"list.limit\", $limit);\n\t\t$ActivityStreamModelActivities->setState(\"access\", \"1\");\n\t\t$ActivityStreamModelActivities->setState(\"state\", '1');\n\t\t$ActivityStreamModelActivities->setState(\"list.start\", $start);\n\t\t$ActivityStreamModelActivities->setState(\"filter_condition\", $filter_condition);\n\n\t\t$result['results'] = $ActivityStreamModelActivities->getItems();\n\n\t\t// If no activities found then return the error message\n\t\tif (empty($result['results']))\n\t\t{\n\t\t\t$result_arr['success'] = false;\n\t\t\t$result_arr['message'] = JText::_(\"COM_ACTIVITYSTREAM_NO_ACTIVITY\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result_arr['success'] = true;\n\t\t\t$result_arr['data'] = $result;\n\t\t\t$result_arr['data']['total'] = $ActivityStreamModelActivities->getTotal();\n\t\t}\n\n\t\techo json_encode($result_arr);\n\n\t\tjexit();\n\t}", "public function getActivityShops($activity)\n {\n\n $criteria = Criteria::create()\n ->where(Criteria::expr()->eq(\"activity\",$activity))->setMaxResults(1);\n $res = $this->shops->matching($criteria);\n return $res->first();\n }", "public function session_list($user_id = null, $start_date = null, $end_date = null, $activitygroup_id = null, $unit_id = null, $activity_id=null, $is_publish=null) {\n $conditions = array();\n $link['Activitygroup'] = array(\n 'fields'=>array(\n 'Activitygroup.name'\n )\n );\n\n if(!empty($user_id)){\n $conditions['AND'][$this->alias . \".countuser_id\"] = $user_id;\n }\n if(!empty($start_date)){\n $conditions['AND'][$this->alias . \".date >=\"] = $start_date;\n }\n if(!empty($end_date)){\n $conditions['AND'][$this->alias . \".date <=\"] = $end_date;\n }\n if(!empty($activitygroup_id)){\n $conditions['AND'][\"Activity.activitygroup_id\"] = $activitygroup_id;\n }\n if(!empty($activity_id)){\n $conditions['AND'][\"Activity.id\"] = $activity_id;\n }\n if(!empty($unit_id)){\n $conditions['AND'][\"Unit.id\"] = $unit_id;\n $link['Unit'] = array(\n 'fields'=>array(\n 'Unit.name'\n )\n );\n }\n\n if(isset($is_publish)){\n if($is_publish === 0){\n $conditions['AND'][\"Activity.publish\"] = 0;\n }else if($is_publish === 1){\n $conditions['AND'][\"Activity.publish\"] = 1;\n }\n }\n\n $options = array(\n 'fields' => array(\n 'Activitysession.id',\n \"Activitysession.date\",\n \"Activitysession.starttime\",\n \"Activitysession.endtime\",\n \"Activitysession.session\",\n \"(Activitysession.extra_attendant * Activitysession.session) as total_extra_attendant\"\n ),\n 'link' => array(\n 'Activity'=>array(\n 'fields'=>array(\n 'Activity.id',\n \"Activity.name\",\n \"Activity.activity_code\"\n ),\n 'link'=>$link\n ),\n 'Countuser'=>array(\n 'fields'=>array(\n 'Countuser.name'\n )\n ),\n\n ),\n \"conditions\"=>$conditions,\n \"order\"=>\"Activitysession.date DESC\"\n );\n\n return $this->find('all',$options);\n }", "public function __construct(AcitivityUser $activity_user)\n {\n $this->activity_user = $activity_user;\n }", "function loadActivity(){\n\t\t\t$this->articleEvents->add( $this->db->getUserActivity($this->getName()) ,true );\t\t\t\n\t\t}", "public function hideActivity($activityId = null)\n {\n if (empty($activityId)) $activityId = $this->postId();\n return TfBuildingActivity::where('activity_id', $activityId)->update(['action' => 0]);\n\n }", "protected function import_from_activity(&$record) {\n static $status_id = null;\n if (!$status_id) {\n $status_id = array_flip(CRM_Contribute_PseudoConstant::contributionStatus());\n }\n // lookup activity\n if (!$kid = kid_number_get_info($record['kid'])) {\n $message = ts(\"Failed looking up activity for KID number '%1' at line %2\", array(\n 1 => $record['kid'],\n 2 => $record['line_no']\n ));\n $this->addReportLine('warning', $message);\n if (!$this->test) {\n $this->createFailureTableEntry($record, $message);\n }\n return;\n }\n\n //code below is not neccesary\n //we check if a 9KID number is linked to a contact rather than demanding a \n //certain entity\n /* if ($kid['entity'] != 'Activity' && $kid['entity'] != 'ActivityTarget') {\n\n $message = ts(\n \"Matched wrong type of entity (%1 - should be Activity) for KID number '%2' at line %3\",\n array(\n 1 => $kid['entity'],\n 2 => $record['kid'],\n 3 => $record['line_no']\n )\n );\n\n $this->addReportLine('error', $message);\n\n if (!$this->test)\n $this->createFailureTableEntry($record, $message);\n\n return;\n } */\n $activity_id = false;\n if ($kid['entity'] == 'Activity' || $kid['entity'] == 'ActivityTarget') {\n $activity_id = $kid['entity_id'];\n }\n \n //get contact ID from kid record\n $contact_id = $kid['contact_id'];\n //if contact ID is not set try to retrieve it from the linked entity (Activity)\n if (empty($contact_id) && ($kid['entity'] == 'Activity' || $kid['entity'] == 'ActivityTarget')) {\n $contact_id = CRM_Core_DAO::singleValueQuery(\"\n SELECT contact_id FROM civicrm_activity_contact\n WHERE record_type_id = %1 AND activity_id = %2 AND contact_id = %3\", array(\n 1 => array(3, 'Positive'),\n 2 => array($kid['entity_id'], 'Positive'),\n 3 => array($kid['contact_id'], 'Positive'),\n ));\n }\n\n //check if contact_id is found\n if (empty($contact_id)) { \n $message = ts(\"Failed looking up activity target contact for KID number '%1' at line %2 (%3 ID %4 and Contact ID %5)\", array(\n 1 => $record['kid'],\n 2 => $record['line_no'],\n 3 => $kid['entity'],\n 4 => $kid['entity_id'],\n 5 => $kid['contact_id'],\n )\n );\n $this->addReportLine('warning', $message);\n if (!$test) {\n $this->createFailureTableEntry($record, $message);\n }\n return;\n }\n\n // check for duplicate transaction numbers ..\n if ($this->transactionIDExists($record)) {\n return;\n }\n\n $trxn_id = $record['transmission_number'] . '-' . $record['transaction_number'];\n $aksjon_id = $kid['aksjon_id'];\n\n // lookup aksjon_id from the activity, if it exists\n if (empty($aksjon_id) && !empty($activity_id)) {\n $aksjon_id = CRM_Core_DAO::singleValueQuery(\"SELECT aksjon_id_38 FROM civicrm_value_maf_norway_aksjon_import_1578 WHERE entity_id = %1\", array(1 => array($activity_id, 'Positive')));\n }\n if (empty($kid['earmarking']) && !empty($activity_id)) {\n $kid['earmarking'] = CRM_Core_DAO::singleValueQuery(\"SELECT _remerking_98 FROM civicrm_value_kid_earmark_1591 WHERE entity_id = %1\", array(1 => array($activity_id, 'Positive')));\n }\n\n // payment instrument check - this will fail on circle dev server, as payment instruments not present\n // we should not see this warning in production\n if (!$payment_instrument_id = $this->getPaymentInstrumentID($record['transaction_type'])) {\n $this->addReportLine('warning', ts(\"Payment instrument unmatched for transaction type %1 - KID Number '%2', line %3. %4\", array(\n 1 => $record['transaction_type'],\n 2 => $record['kid'],\n 3 => $record['line_no'],\n 4 => $this->test ? ts('Record will still be imported, but with payment instrument unset.') : ts('Record was imported with payment instrument unset.')\n )));\n }\n\n if ($this->test) {\n // if test mode, inform the user a match was made, but do not update\n $this->addReportLine('ok', ts(\"Matched KID number '%1' with activity id %2 at line %3\", array(\n 1 => $record['kid'],\n 2 => $kid['entity_id'],\n 3 => $record['line_no']\n ))); \n } else { \n // create contribution linked to the activity\n $params = array(\n 'total_amount' => $record['amount'] / 100,\n 'financial_type_id' => 1, \n 'contact_id' => $contact_id,\n 'receive_date' => $this->convertNETSDate($record['nets_date']),\n 'trxn_id' => $trxn_id,\n 'invoice_id' => md5(uniqid(rand())),\n 'source' => 'NETS',\n 'contribution_status_id' => $status_id['Completed']\n );\n\n if ($payment_instrument_id) {\n $params['payment_instrument_id'] = $payment_instrument_id;\n }\n\n foreach ($this->custom_fields as $name => $id) { \n switch (true) {\n case isset($record[$name]):\n $params['custom_' . $id] = $record[$name];\n break;\n case $name == 'kid_number':\n $params['custom_' . $id] = $record['kid'];\n break;\n \n /*\n * BOS1311802 Critical bug in OCR import\n * Erik Hommel ([email protected]) on 22/11/2013\n * trying to create a contribution with a null value\n * in aksjon_id. So included a test on aksjon_id being\n * set and not empty\n */\n case $name == 'aksjon_id':\n if (isset($aksjon_id) && !empty($aksjon_id)) {\n $params['custom_' . $id] = $aksjon_id;\n }\n break;\n case $name == 'balans_konto':\n // balans konto always set to 1920\n $params['custom_' . $id] = '1920';\n break;\n case $name == 'sent_to_bank':\n // always set to 'No' for this type of transaction\n $params['custom_' . $id] = 0;\n break;\n }\n }\n try {\n $result = civicrm_api3('contribution', 'create', $params); \n } catch (CiviCRM_API3_Exception $e) {\n $message = ts(\"An error occurred saving contribution data for KID Number '%1' (%2) at line %3: %4\", array(\n 1 => $record['kid'],\n 2 => $this->getDisplayName($contact_id),\n 3 => $record['line_no'],\n 4 => $e->getMessage()\n ));\n\n $this->addReportLine('error', $message);\n $this->createFailureTableEntry($record, $message);\n\n return;\n }\n \n $contribution = reset($result['values']);\n /*\n * BOS1406389/BOS1405148\n */\n $actQuery = ocr_contribution_activity_query($contribution['id'], $activity_id); \n CRM_Core_DAO::singleValueQuery($actQuery, array(\n 1 => array($contribution['id'], 'Positive'),\n 2 => array($activity_id, 'Positive')\n )\n );\n /*\n * BOS1312346 retrieve earmarking from activity and set as default\n * for contribution in nets transactions custom group\n */\n $earmark = '';\n if (!empty($kid['earmarking'])) {\n $earmark = $kid['earmarking'];\n } else {\n $earmark = ocr_get_act_earmark($activity_id, $contribution['id']);\n }\n ocr_set_act_earmark($earmark, $contribution['id']);\n // end BOS1312346\n\n $this->addReportLine('ok', ts(\"Successfully created contribution (id: %1) for KID Number '%2' (%3) at line %4\", array(\n 1 => $contribution['id'],\n 2 => $record['kid'],\n 3 => CRM_Core_DAO::singleValueQuery(\n \"SELECT display_name FROM civicrm_contact WHERE id = %1\",\n array(1 => array($contact_id, 'Positive'))\n ),\n 4 => $record['line_no']\n )));\n /*\n * BOS1405148 add contribution/activity and contribution/donor group\n * based on contact and receive_date\n */\n \t\t\t\ttry {\n \t$latestActivityId = ocr_get_latest_activity($contribution['contact_id']);\n \tocr_create_contribution_activity($contribution['id'], $latestActivityId);\n \t$donorGroupId = ocr_get_contribution_donorgroup($contribution['id'], $contribution['receive_date'], $contribution['contact_id']);\n \tocr_create_contribution_donorgroup($contribution['id'], $donorGroupId);\n\t\t\t\t} catch (CiviCRM_API3_Exception $e) {\n $message = ts(\"Failed setting donor group. (contribution id: %1, KID: '%2', contact: %3) at line %5 with message: %4\", array(\n 1 => $contribution['id'],\n \t2 => $record['kid'],\n \t3 => $this->getDisplayName($contribution['contact_id']),\n 4 => $e->getMessage(),\n \t5 => $record['line_no']\n ));\n $this->addReportLine('warning', $message);\n return;\n }\n\n $this->addReportLine('ok', ts(\"Successfully completed contribution (id: %1) for KID Number '%2' (%3) at line %4\", array(\n 1 => $contribution['id'],\n 2 => $record['kid'],\n 3 => $this->getDisplayName($contribution['contact_id']),\n 4 => $record['line_no']\n )));\n }\n }", "public function __construct($activity, User $user)\n {\n $this->activity = $activity;\n $this->user = $user;\n }", "function get_activity_meta( $activity_id, $activity_type ) {\r\n\r\n\t\t// Init Data.\r\n\t\t$data = array();\r\n\r\n\t\tswitch ( $activity_type ) {\r\n\r\n\t\t\tcase 'activity_quote':\r\n\t\t\t\t// Get Quote Data.\r\n\t\t\t\t$data['quote_text'] = bp_activity_get_meta( $activity_id, 'yz-quote-text' );\r\n\t\t\t\t$data['quote_owner'] = bp_activity_get_meta( $activity_id, 'yz-quote-owner' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t// Get Link Data.\r\n\t\t\tcase 'activity_link':\r\n\t\t\t\t$data['link_url'] = bp_activity_get_meta( $activity_id, 'yz-link-url' );\r\n\t\t\t\t$data['link_title'] = bp_activity_get_meta( $activity_id, 'yz-link-title' );\r\n\t\t\t\t$data['link_desc'] = bp_activity_get_meta( $activity_id, 'yz-link-desc' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t// Get Giphy Data.\r\n\t\t\tcase 'activity_giphy':\r\n\t\t\t\t$data['giphy_image'] = bp_activity_get_meta( $activity_id, 'giphy_image' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn apply_filters( 'yz_get_edit_activity_content_by_type', $data, $activity_type, $activity_id );\r\n\t}", "public function activity(){\n return $this->belongsTo('App\\Models\\Activity','act_type');\n }", "public static function findByJTI($id)\n {\n /** @var User $user */\n if (self::tableName() == '{{%user}}'){ // 中台SSO,不需要access_token_expired_at\n $user = static::find()->where([\n '=', 'id', $id\n ])\n ->andWhere([\n '=', 'status', self::STATUS_ACTIVE\n ])->one();\n }else{ // 微信端仍旧需要\n $user = static::find()->where([\n '=', 'id', $id\n ])\n ->andWhere([\n '=', 'status', self::STATUS_ACTIVE\n ])->one();\n// ->andWhere([\n// '>', 'access_token_expired_at', new Expression('NOW()') // 微信端使用,即永不过期,因为不会做判断\n// ])->one();\n }\n\n return $user;\n }", "function getJoinUserAffiliates($userId,$activityId){\n\n $data = array();\n $where = array('ua.user_id'=>$userId);\n $this->db->select('userAffiliateId,affiliate_name,if(aj.activityJoinId IS NULL,0,1) as isJoined');\n $this->db->from(USER_AFFILIATES.' as ua');\n $this->db->join(ACTIVITY_JOIN.' as aj','ua.userAffiliateId = aj.affiliate_id AND aj.activity_id = \"'.$activityId.'\" AND aj.user_id = \"'.$userId.'\"','left');\n $this->db->where($where);\n $q = $this->db->get();\n if($q->num_rows()){\n $data = $q->result();\n }\n return $data;\n\n }", "public function getActivity(){\n\t\t$activityJSON = json_decode('[{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091459,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091506,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862412,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091625,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091919,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458855256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862529,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458878187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458884355,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458951476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458954501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459027340,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459031419,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036422,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036489,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036803,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459039428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459041802,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459045348,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459052681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459054504,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459095354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459103693,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106189,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106533,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106764,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107148,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107592,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459108612,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459108859,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459116818,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459117841,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459118056,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459119912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459122951,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459124218,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459128266,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128588,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459130553,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131015,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131421,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131513,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131527,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131569,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131625,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131736,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131740,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131839,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132001,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132411,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132504,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132807,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459133055,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133407,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133441,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133465,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133492,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133507,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133511,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133615,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133644,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133723,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134005,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134041,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134152,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134206,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134408,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134572,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134581,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135440,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459135552,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136623,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136624,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136693,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136765,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136830,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136838,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136877,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137197,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137301,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137334,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137389,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138075,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138127,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138180,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138599,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459138837,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138857,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139196,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139728,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459139916,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459140265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363777,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363778,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362805,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459363876,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459372978,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459383363,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459403946,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885868,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885870,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459921911,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459922060,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460149101,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460154126,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460165710,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165742,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165745,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241854,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074050,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460068718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440021,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460496700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460497103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500872,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459277007,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459278245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459320218,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459360248,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362702,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459374597,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459394150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459396245,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459398742,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399066,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399156,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399378,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459399529,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399739,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400211,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400630,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400686,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400859,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400940,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400951,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401128,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401174,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401186,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401215,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401469,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459402071,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402195,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402542,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402551,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459404536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459404915,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405537,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405603,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405776,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406030,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406090,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407272,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407322,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407476,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408828,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408999,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459413295,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440105,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440425,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443054,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443074,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443102,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443119,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443158,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443520,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443696,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443777,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459446291,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459526366,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459704710,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072516,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074115,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232036,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460246528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250345,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460514183,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460518330,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460519779,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460523934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232451,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460307680,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460515263,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519047,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460520866,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460249923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460254929,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460515460,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519269,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525976,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460527887,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460697367,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680199,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680217,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460680924,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680956,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681107,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681317,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681589,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681787,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681901,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682008,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682069,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682913,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460684169,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460685921,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460686277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460686909,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687670,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460689203,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690237,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690481,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460692290,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460695261,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460727282,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460695587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751998,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680258,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681907,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460694376,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460754522,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756048,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460758121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460843708,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460848382,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460835446,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460842868,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848973,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916368,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924220,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924373,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460917702,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460930922,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848040,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460849169,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460854613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859331,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916771,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932451,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859255,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859280,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460913502,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916609,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933975,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460931001,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933992,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690702,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460690703,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460694377,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460746602,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752225,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460754523,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460833949,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460842616,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460870052,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948365,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752002,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460755659,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460835972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460951953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948511,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948773,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951251,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460952232,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460955069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962897,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932429,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460934562,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460943791,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951769,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460957051,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962696,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461100004,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460511060,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460524256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525274,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525288,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525358,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525714,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525781,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460526586,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460529681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460952655,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460960195,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460976232,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461017048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107213,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932349,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932358,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461009132,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014454,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107316,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460052009,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460483549,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460494428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526286,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526459,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460527491,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460529046,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460603259,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460966099,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461107331,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107501,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110199,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460171872,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460173203,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460174200,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460231864,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460239810,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460317732,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460327728,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460335915,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460485984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460497970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499694,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499783,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499817,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499822,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499925,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500085,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500311,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460500315,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500324,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500346,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500435,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500437,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500448,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500452,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500571,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501404,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501419,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501726,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460501788,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502786,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503543,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460504438,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460511336,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460604302,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104939,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105562,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111751,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112017,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461125417,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935895,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460939457,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944211,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460944678,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944850,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460945971,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460946923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947846,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947902,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948148,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948337,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460948348,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948441,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460949023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949429,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949775,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949860,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460949890,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460950123,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460950910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951798,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460958944,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460959747,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460959960,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960040,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960509,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960601,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960769,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960775,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960888,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960906,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460961127,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460961179,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460962695,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963592,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963712,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963750,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964286,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964291,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460964381,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964621,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964775,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965160,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965298,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461008879,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461090151,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102204,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461102276,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102506,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461103526,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461103770,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106883,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107063,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107964,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108055,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108484,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109745,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109930,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109942,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110024,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110366,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110546,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110573,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110627,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110664,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110670,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461111111,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111333,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111336,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111443,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111548,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461111613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111676,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461112249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112463,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112633,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113143,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113215,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113307,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113583,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113689,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114087,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114228,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114303,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114406,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114469,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114737,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114791,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114933,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114942,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115117,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461115151,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116134,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461116244,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116379,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461119303,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461121523,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461122625,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123034,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123637,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123772,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461124550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126859,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127738,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127889,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128029,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128432,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128741,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461128937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129510,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129601,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129678,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130145,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130150,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130151,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131381,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461132279,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461192042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714753,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714914,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716190,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459717945,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459721768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459722848,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459726240,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459732605,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459734819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459735947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736050,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736143,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736153,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736162,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736467,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736597,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736935,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737023,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737270,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737278,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459737611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737635,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737842,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737978,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738067,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738656,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459738759,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739031,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459739498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739838,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459741134,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741257,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741342,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742002,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742020,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742380,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742507,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742616,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743111,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743247,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743427,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743439,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743442,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743515,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743544,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743576,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743726,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744091,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744178,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744192,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744219,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744297,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744814,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745648,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745778,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746161,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459746302,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459746437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746794,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746974,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746980,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747076,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747158,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747309,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747384,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747549,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747553,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747584,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747715,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747754,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747762,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747820,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748293,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748577,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748922,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748932,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749300,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749618,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749784,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749810,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749848,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749890,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750704,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750805,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750928,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751073,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751328,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751380,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751385,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751428,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751497,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751512,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751576,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751748,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752310,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752578,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752688,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752891,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753461,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753505,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753580,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460160150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166197,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167931,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460170970,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460238640,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460258700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460265851,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460317221,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460326650,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460328076,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460330953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460331422,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460334550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460339277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460431663,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460433944,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460434618,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460435130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437306,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437318,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437459,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437631,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437792,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438236,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438253,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439515,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439574,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439605,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460493473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110334,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126555,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461270347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333782,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333842,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461371326,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503714,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503724,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460524255,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460529582,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607349,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460608706,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609058,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460609081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609586,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460610035,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460611953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612043,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612695,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460612713,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460613973,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460614117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460614588,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460615101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615167,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461109673,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461818721,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461882154,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882298,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882881,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883568,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461885826,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461887194,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460495947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460496869,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460517967,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460608470,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461101191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106428,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106538,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109904,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110836,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115060,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115156,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115382,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123212,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127141,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461132965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461134296,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461188023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461253841,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461275430,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461291029,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461299970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461307230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461338321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461341524,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461361910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461376273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461378319,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461384392,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461388841,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461422894,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461437636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461448456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461474362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461480100,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461482202,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461505503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461524155,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461534168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461537084,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539241,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461540182,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461544687,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461550993,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461559744,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461563898,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461708868,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461819989,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461861185,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461874701,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461881867,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461893239,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461894417,\"source\":\"googledrive\"}]');\n\t\treturn $activityJSON;\n\t}", "public static function get_last_activity( $user_id ) {\n\t\tglobal $wpdb;\n\n\t\t// Sanitize and remove empty values.\n\t\t$user_ids = array_filter( wp_parse_id_list( $user_id ) );\n\n\t\tif ( empty( $user_ids ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$uncached_user_ids = bp_get_non_cached_ids( $user_ids, 'bp_last_activity' );\n\t\tif ( ! empty( $uncached_user_ids ) ) {\n\t\t\t$bp = buddypress();\n\n\t\t\t$user_ids_sql = implode( ',', $uncached_user_ids );\n\t\t\t$user_count = count( $uncached_user_ids );\n\n\t\t\t$last_activities = $wpdb->get_results( $wpdb->prepare( \"SELECT id, user_id, date_recorded FROM {$bp->members->table_name_last_activity} WHERE component = %s AND type = 'last_activity' AND user_id IN ({$user_ids_sql}) LIMIT {$user_count}\", $bp->members->id ) );\n\n\t\t\tforeach ( $last_activities as $last_activity ) {\n\t\t\t\twp_cache_set( $last_activity->user_id, array(\n\t\t\t\t\t'user_id' => $last_activity->user_id,\n\t\t\t\t\t'date_recorded' => $last_activity->date_recorded,\n\t\t\t\t\t'activity_id' => $last_activity->id,\n\t\t\t\t), 'bp_last_activity' );\n\t\t\t}\n\t\t}\n\n\t\t// Fetch all user data from the cache.\n\t\t$retval = array();\n\t\tforeach ( $user_ids as $user_id ) {\n\t\t\t$retval[ $user_id ] = wp_cache_get( $user_id, 'bp_last_activity' );\n\n\t\t\tif ( isset( $retval['user_id'] ) ) {\n\t\t\t\t$retval[ $user_id ]['user_id'] = (int) $retval[ $user_id ]['user_id'];\n\t\t\t}\n\t\t\tif ( isset( $retval['activity_id'] ) ) {\n\t\t\t\t$retval[ $user_id ]['activity_id'] = (int) $retval[ $user_id ]['activity_id'];\n\t\t\t}\n\t\t}\n\n\t\treturn $retval;\n\t}", "public static function getUserActivities($user_id, $offset = 0, $limit = 10)\n\t{\n\t\t$activities = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT pa.id, pa.user_id, pa.action, pa.title, pa.url, pa.status, UNIX_TIMESTAMP(pa.created_on) AS created_on\n\t\t\t FROM profiles_activity AS pa\n\t\t\t WHERE pa.user_id = ?\n\t\t\t ORDER BY pa.created_on DESC\n\t\t\t LIMIT ?,?', \n\t\t\tarray(\n\t\t\t\t(int) $user_id,\n\t\t\t\t(int) $offset,\n\t\t\t\t(int) $limit\n\t\t\t)\n\t\t);\n\n\t\t// add comments\n\t\tforeach($activities as &$activity) $activity['comments'] = FrontendProfilesModel::getActivityComments($activity['id']);\n\n\t\treturn $activities;\n\t}", "public function getUserId($id=NULL)\n\t{\n\t\t$result = Yii::app()->db->createCommand()\n \t->select('*')\n \t->from($this->tableName())\n \t \t->where('id=:id', array(':id'=>$id))\t\n \t \t->queryRow();\n\t\t\n\t\treturn $result;\n\t}", "public function activities() {\n \n // Verify if is a team's member\n if ( $this->session->userdata( 'member' ) && !get_user_option('display_activities') ) {\n redirect('user/app/dashboard');\n }\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n // Load view/user/activities.php file\n $this->body = 'user/activities';\n $this->user_layout();\n }", "public function view(User $user, Activity $activity)\n {\n return (empty($activity->community_id)\n\t\t\t\t|| $activity->creator_id === $user->id\n\t\t\t\t|| $user->communities->contains($activity->community_id));\n }", "public function activitiesAction ($id = false){\n $this->layout = 'ajax';\n $userInfo = $this->permissions->getUserInformation();\n\n $activities = new \\modules\\pm\\models\\Pm_history('add');\n $activities->from_user_id = $userInfo->user_id;\n $activities->pm_issue_id = $id;\n $activities->datetime = date('Y-m-d H:i:s');\n $activities->actions = $this->input->post('actions');\n\n\n if ($aid = $activities->save()) {\n\n $activities = new \\modules\\pm\\models\\Pm_history();\n $activities -> pm_history_id = $aid;\n\n return json_encode(['status' => 'success',\n 'item' => $activities->get(),\n 'total' => $activities->takenTime($id)\n\n ]);\n }\n\n else\n\n return json_encode(['status' => 'faild']);\n\n\n }", "public function show(Activity $activity)\n {\n //\n }", "public function edit($id)\n {\n $validator = Validator::make(['id' => $id], ['id' => 'required|integer']);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n\n $activity = Activity::find($id);\n\n return APIHandler::response(1, \"Activity\", $activity);\n }", "public function activitiesCaused(){\n\t\treturn $this->hasMany('App\\Useractions', 'ActionByUserId');\n\t}" ]
[ "0.7046892", "0.65258414", "0.6336385", "0.6264158", "0.61854005", "0.60966206", "0.6078802", "0.6000422", "0.5991526", "0.5969905", "0.59408194", "0.59275883", "0.59137857", "0.582163", "0.57755333", "0.5726601", "0.5723117", "0.5710577", "0.57078654", "0.5700123", "0.56964666", "0.56962013", "0.56769586", "0.5663904", "0.56445825", "0.5642982", "0.5641021", "0.56325406", "0.5622864", "0.56227356", "0.5600125", "0.55836964", "0.55764735", "0.55439633", "0.55361843", "0.5517457", "0.5513657", "0.5481284", "0.5477599", "0.54678744", "0.5466054", "0.5465316", "0.5448579", "0.54352206", "0.5418206", "0.5384721", "0.5369306", "0.5337788", "0.53225464", "0.53225464", "0.53215533", "0.53215533", "0.53215533", "0.53215533", "0.53215533", "0.5315662", "0.53138095", "0.5308212", "0.5300527", "0.52983385", "0.5295707", "0.52880806", "0.5285812", "0.5277807", "0.5276239", "0.5273418", "0.5272677", "0.52669024", "0.5264752", "0.52628773", "0.5256358", "0.5255084", "0.52450335", "0.5236136", "0.52108276", "0.5208578", "0.51995075", "0.51951724", "0.5185428", "0.5183085", "0.51729167", "0.5164784", "0.5162838", "0.5154807", "0.5151117", "0.51447636", "0.5144481", "0.5139897", "0.5121035", "0.5110403", "0.50930464", "0.5089547", "0.5087365", "0.5084816", "0.50807244", "0.508071", "0.5080076", "0.50791216", "0.50756705", "0.50702995" ]
0.7477701
0
delete user activity with relative operations activity_id mandatory field
public function deleteUserActivityAction() { /** @var Object_Activity $activity */ /** @var Object_Operation $operation */ $data = $this->getRequestData(); if (isset($data['activity_id'])) { $activity = Object_Activity::getById($data['activity_id']); if (!$activity) { $this->setErrorResponse('no Activity with this activity_id!'); } elseif ($this->getDeviceSession()->getUserId() == $activity->getCreator()->getId()) { $activity->setPublished(false); if ($activity->save()) { $operations = new Workapp_Activity(); $op = $operations->getActivityRequiredByOperations($activity); foreach ($op as $operation) { $operation = Object_Operation::getById($operation->getId()); $operation->setPublished(false); if (!$operation->save()) { $this->setErrorResponse('cannot delete relative Operation objects!'); } } } else { $this->setErrorResponse('cannot delete Activity object!'); } } else { $this->setErrorResponse('no Activity for this user with current activity_id!'); } } else { $this->setErrorResponse('activity_id is mandatory field for this request!'); } $this->_helper->json(array('deleted' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($activity) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE FROM activities WHERE id=?\");\r\n\t\t$stmt->execute(array($activity->getId()));\r\n\t}", "function deleteactivity() {\n $this->auth(WL_ADM_LEVEL);\n $activity_id = $this->uri->segment(3);\n $this->m_activities->delete($activity_id);\n $this->activities();\n }", "public function delete() {\n if (!isset($this->currentUser)) {\n throw new Exception(\"Not in session. Editing users requires login\");\n }\n if ($this->currentUser->getUser_type()!=usertype::Administrator){\n throw new Exception(\"Not valid user. Editing activity requires Administrator\");\n }\n\n // Get the user object from the database\n $idactivity = $_REQUEST[\"idactivity\"];\n $activity = $this->activityMapper->findById($idactivity);\n\n // Does the user exist?\n if ($activity == NULL) {\n throw new Exception(\"no such activity with id: \".$idactivity);\n }\n\n // Delete the user object from the database\n $images = json_decode($activity->getImage());\n $this->activityMapper->delete($activity);\n\n if($images != NULL){\n for($i=0; $i<count($images); $i++) {\n unlink($images[$i]);\n }\n }\n\n $this->view->setFlash(sprintf(i18n(\"Activity successfully deleted\") . \".\",$activity->getIdactivity()));\n\n $this->view->redirect(\"activities\", \"index\");\n\n }", "function deleteActivity($id) {\n try {\n $item = $this->perform_query_one_param(\"DELETE FROM activityModel WHERE activityModel.id = ?\", \"i\", intval($id));\n $item = $this->perform_query_one_param(\"DELETE FROM activity WHERE activity.idActivity = ?\", \"i\", intval($id));\n } catch(Exception $ex) {\n $this->print_error_message(\"Unable to Delete activity \".$ex->getMessage() );\n } \n }", "public function deleteUser($activityid, $username) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE FROM activities_user WHERE usuario=? AND actividad=?\");\r\n\t\t$stmt->execute(array($username, $activityid));\r\n\t}", "function bp_activity_action_delete_activity( $activity_id = 0 ) {\n\n\t// Not viewing activity or action is not delete\n\tif ( !bp_is_activity_component() || !bp_is_current_action( 'delete' ) )\n\t\treturn false;\n\n\tif ( empty( $activity_id ) && bp_action_variable( 0 ) )\n\t\t$activity_id = (int) bp_action_variable( 0 );\n\n\t// Not viewing a specific activity item\n\tif ( empty( $activity_id ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'bp_activity_delete_link' );\n\n\t// Load up the activity item\n\t$activity = new BP_Activity_Activity( $activity_id );\n\n\t// Check access\n\tif ( ! bp_activity_user_can_delete( $activity ) )\n\t\treturn false;\n\n\t// Call the action before the delete so plugins can still fetch information about it\n\tdo_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id );\n\n\t// Delete the activity item and provide user feedback\n\tif ( bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $activity->user_id ) ) )\n\t\tbp_core_add_message( __( 'Activity deleted successfully', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' );\n\n\tdo_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id );\n\n\t// Check for the redirect query arg, otherwise let WP handle things\n \tif ( !empty( $_GET['redirect_to'] ) )\n\t\tbp_core_redirect( esc_url( $_GET['redirect_to'] ) );\n\telse\n\t\tbp_core_redirect( wp_get_referer() );\n}", "public function deleteActivity(Request $request) {\n $res_failed = [\n 'message' => 'Delete failed',\n 'status' => 'ERROR'\n ];\n\n $validator = Validator::make($request->all(), [\n 'id' => 'required'\n ]);\n\n if($validator->fails()){\n return response()->json($validator->errors()->toJson(), 400);\n }\n\n try {\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n } else {\n // ONLY EXPERT USER CAN DELETE\n if (!parent::checkAccess($user->profile_id, 'expert')) {\n return response()->json(['Only EXPERT user can delete activity'], 422);\n }\n $activity = Activity::find($request->get('id'));\n $activity->user_id = $user->id;\n if($activity->save()) {\n if($activity->delete()) {\n return response()->json([\n 'message' => 'Delete success',\n 'status' => 'OK'\n ], 200);\n } else {\n return response()->json($res_failed, 422);\n }\n } else {\n return response()->json($res_failed, 422);\n }\n }\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n }", "public function forceDeleted(Activity $activity)\n {\n //\n }", "public function deleteActivitiesById($activities_id,$pagination = false){\n \t $total_count = MU_Model::count_all_data('activities',array('act_deleted' => 0));\n \t $delete_activities = MU_Model::deleteRecordById('activities',array(\"act_deleted\" => 1) ,array('act_id' => $activities_id));\n \t if($delete_activities){\n \t\t redirect(strtolower(get_class()).'/list_record');\n \t }\n }", "public function delete(User $user, Activity $activity)\n {\n return $activity->creator_id === $user->id;\n }", "function wpachievements_wordpress_deletion($user_id){\r\n if( !empty($user_id) ){\r\n global $wpdb;\r\n $wpdb->delete( WPACHIEVEMENTS_ACTIVITY_TABLE, array( 'uid' => $user_id ), array( '%d' ) );\r\n }\r\n }", "function deleteCharacterActivity($id) {\n try {\n $item = $this->perform_query_one_param(\"DELETE FROM activity WHERE activity.id = ?\", \"i\", strval($id)); \n } catch (Exception $ex) {\n $this->print_error_message(\"Unable to delete activity to character\");\n }\n }", "function time_tracker_activity_delete($entity) {\n entity_get_controller('time_tracker_activity')->delete($entity);\n}", "public function actionUserdelete()\n {\n $timeLimit = time() - 0;\n $deactivateRequests = DeactivateAccount::find()->where(['processingDate' => null])->andWhere('creationDate < '.$timeLimit)->all();\n\n foreach ($deactivateRequests as $request)\n {\n $user = $request->user;\n\n if ($user->last_login <= $request->creationDate+3)\n {\n $user->setScenario('status');\n $user->status = User::STATUS_DELETED;\n $user->save();\n\n Campaign::updateAll(['status' => Campaign::STATUS_DELETED], 'userId = :userId', [':userId' => $user->id]);\n }\n\n $request->setScenario('processing');\n $request->processingDate = time();\n $request->save();\n }\n }", "public function destroy(Request $request,$id)\n {\n //$userId = $request->user()->id; \n\n $activity = Activity::find($id);\n if($activity != null){\n $activity->destroy($id);\n }\n\n Assignment::where('activityId', '=', $id)->delete();\n }", "public function delete_activities(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\"=>$id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"activities\",array(\"act_id\"=>$id));\n }\n if($result) echo 't';\n }", "public function destroy($activity)\n {\n $data = Activity::find($activity);\n $data->delete();\n return redirect('/data');\n }", "public function destroy(User $user, Activity $activity)\n {\n $activity->delete();\n return response()->json([\n 'Successefully deleted!'\n ]);\n }", "public function deleteCommission(){\n\t\t$id = $this->input->post('id');\n\n\t\t//get deleted user info\n\t\t$userInfo = singleDbTableRow($id,'commissions');\n\t\t$categoryName = $userInfo->user_id;\n\t\t// add a activity\n\t\tcreate_activity(\"Deleted {$id} commissions\");\n\t\t//Now delete permanently\n\t\t$this->db->where('id', $id)->delete('commissions');\n\t\treturn true;\n\t}", "public function delete_user($user);", "public function delete(User $user, Meeting $meeting)\n {\n //\n }", "public function delete() {\n $streamTbl = Engine_Api::_()->getDbTable('stream', 'activity');\n $streamTbl->delete('(`object_id` = '.$this->getIdentity().' AND `object_type` = \"ynjobposting_job\")');\n $activityTbl = Engine_Api::_()->getDbTable('actions', 'activity');\n $activityTbl->delete('(`object_id` = '.$this->getIdentity().' AND `object_type` = \"ynjobposting_job\")');\n $attachmentTbl = Engine_Api::_()->getDbTable('attachments', 'activity');\n $attachmentTbl->delete('(`id` = '.$this -> getIdentity().' AND `type` = \"ynjobposting_job\")');\n $this->changeStatus('deleted');\n $this->feature(0, false);\n }", "public function destroy($id)\n {\n //\n $activity = BudgetActivity::find($id)->delete();\n }", "public function destroy(Request $request, $id)\n {\n $this->middleware(function($request,$next){\n if(\\Auth::user()->can('delete_user')){\n return $next($request);\n }\n return redirect()->back();\n });\n $uid=\\Auth::id();\n $user = User::findOrFail($id);\n $user->delete();\n ActivityLog::where('task_id',$id)->where('changetype','Delete User')->update(['user_id'=>$uid]);\n\n \n $request->session()->flash('message', 'User is successfully deleted');\n return back();\n }", "public static function deleteActivity($idActivity) {\r\n\t\t$idActivity\t= intval($idActivity);\r\n\r\n\t\treturn TodoyuRecordManager::deleteRecord(self::TABLE, $idActivity);\r\n\t}", "public function delete($user){\n }", "public function destroy(Activity $activity)\n {\n $activity->delete();\n return redirect('/admin/activities')->with('status','Item deleted successfully!');\n }", "public function delete($user)\n {\n\n }", "public function delete(User $user, Attendance $attendance)\n {\n //\n }", "function time_tracker_delete_activity_confirm_submit($form, &$form_state) {\n $form_state['redirect'] = 'admin/config/time_tracker/activities';\n $taid = $form_state['values']['taid'];\n $activity = entity_load('time_tracker_activity', array($taid));\n $activity = $activity[$taid];\n time_tracker_activity_delete($activity);\n drupal_set_message(t('Activity %name Deleted', array('%name' => $activity->name)));\n}", "public function destroy(Activity $activity)\n {\n $activity->delete();\n }", "public function delete()\n {\n $ids = Request::get(\"id\");\n\n $ids = is_array($ids) ? $ids : [$ids];\n\n foreach ($ids as $ID) {\n\n $activity = TenderActivity::findOrFail($ID);\n\n // Fire deleting action\n\n Action::fire(\"activity.deleting\", $activity);\n\n\n $activity->delete();\n\n // Fire deleted action\n\n Action::fire(\"activity.deleted\", $activity);\n }\n\n return Redirect::back()->with(\"message\", trans(\"tenders::activities.events.deleted\"));\n }", "public function delete_attempt(\\question_usage_by_activity $quba) {\n // Do nothing here. Use by subclasses.\n }", "public function delete(User $user, ExamRoom $examRoom)\n {\n //\n }", "public function deleteUserAgendaAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $agenda->getCreator()->getId()) {\n $agenda->setPublished(false);\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot delete Agenda object!');\n }\n } else {\n $this->setErrorResponse('no Agenda for this user with current agenda_id!');\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function deleted(Activity $activity)\n {\n $this->tryRemoveFile($activity->content_path);\n foreach($activity->images as $image){\n $image->delete();\n }\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleted_user_action($id) {\r\n $this->db->delete_by_user_id($id);\r\n }", "public static function delete($ID)\n\t{\n\t\tif(!self::exists($ID))\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, array(), DeleteException::NOT_FOUND);\n\t\t}\n\n\t\tif(self::hasDependencies($ID))\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, array(), DeleteException::DEPENDENCIES_FOUND);\n\t\t}\n\n\t\t/** @var Main\\Entity\\DeleteResult $result */\n\t\t$result = null;\n\t\ttry\n\t\t{\n\t\t\t$result = CustomTypeTable::delete($ID);\n\t\t}\n\t\tcatch(\\Exception $ex)\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, array($ex->getMessage()), 0, '', 0, $ex);\n\t\t}\n\n\t\t$success = $result->isSuccess();\n\t\tif(!$success)\n\t\t{\n\t\t\tthrow new DeleteException(\\CCrmOwnerType::CustomActivityType, $ID, $result->getErrorMessages());\n\t\t}\n\n\t\tunset(self::$existMap[$ID]);\n\t\tself::eraseUserFields($ID);\n\t}", "public function ual_activity_logout() {\n\n\t\t// Store user id.\n\t\t$user_id = get_current_user_id();\n\n\t\t// If we have the user id, continue.\n\t\tif ( ! empty( $user_id ) ) {\n\t\t\t// Get user data with id.\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Store a user name.\n\t\t\t$user_name = $user->display_name ? $user->display_name : $user->user_nicename;\n\n\t\t\t// Log this activity.\n\t\t\tdo_action( 'ual_log_action', $user->ID, $user_name . ' logged out', 'logged-out' );\n\t\t}\n\t}", "function edithistory_delete()\n{\n\tglobal $db, $mybb, $user;\n\t$db->update_query(\"edithistory\", array('uid' => 0), \"uid='{$user['uid']}'\");\n}", "public function forceDelete(User $user, Attraction $attraction)\n {\n //\n }", "public function delete(User $user)\n {\n //\n }", "public function delete_user($user_id) {\r\n $this->conn->connect();\r\n if ($user_id != null) {\r\n $res = $this->conn->execute_query(\"\r\n UPDATE Shifts\r\n SET UserID=NULL\r\n WHERE UserID=?;\",\"d\",$user_id);\r\n $res = $this->conn->execute_query(\"\r\n DELETE FROM Requests\r\n WHERE UserID=?;\",\"d\",$user_id);\r\n $res = $this->conn->execute_query(\"\r\n DELETE FROM Users\r\n WHERE UserId=?;\",\"d\",$user_id);\r\n }\r\n }", "Public Function PermanentDelete()\n\t{\n\t\t$this->_db->delete('bevomedia_user', 'ID = ' . $this->id);\n\t\t$this->_db->delete('bevomedia_user_info', 'ID = ' . $this->id);\n\t}", "public function destroy($id)\n {\n $user = User::find($id);\n \n $log = activitylog::where('log_activeon_id', $id)->get();\n foreach ($log as $key => $value) {\n $value->delete();\n }\n $image_path = Storage::delete('userprofile/'.$user->user_img);\n $user = User::destroy($id);\n $user->save();\n\n // Activity Log\n $log = new activitylog();\n $log->log_user_id = Auth::user()->user_id;\n $log->log_description = \"Deleted Account\";\n $log->log_url = URL::full();\n $log->log_sitemap_id = 1;\n $log->log_activeon_id = $id;\n $log->save();\n \n return back();\n }", "public function userLogDestroy(Request $request)\n {\n $item = Activity::findOrFail($request->id);\n Activity::find($request->id)->delete();\n return response()->json(['success'=>'User log deleted successfully.']);\n }", "public function delete_activity_by_id( $activity_id ) {\n\n\t\t$sql = \"DELETE FROM activities WHERE id = :id\";\n\t\t$sth = $this->conn->prepare( $sql) ;\n\t\t$sth->execute(\n\t\t\tarray(\n\t\t\t\t':id' => $activity_id,\n\t\t\t\t)\n\t\t\t);\n\t\t$row_count = $sth->rowCount();\n\n\t\treturn $row_count > 0 ? true : false;\n\t}", "public function destroy(Request $request, Activity $activity)\n {\n $this->authorizeActionOnActivity($request, $activity);\n $activity->delete();\n return redirect()->action('ActivityController@index')\n ->withSuccess(__('Activity has been deleted.'));\n }", "public function destroy(Activity $action)\n {\n $action->delete();\n }", "public function delete()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['enabled'] = 0;\n $update['data']['active'] = 0;\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/logout','refresh');\n\n }", "public function delete(User $user, Cargo $cargo)\n {\n //\n }", "public function delete(User $user, InterventionRequest $interventionRequest)\n {\n //\n }", "public function deleteAjax(){\n\t\t$id = $this->input->post('id');\n\n\t\t//get deleted user info\n\t\t$userInfo = singleDbTableRow($id);\n\t\t$fullName = user_full_name($userInfo);\n\t\t// add a activity\n\t\tcreate_activity(\"Deleted {$id} from OTP Transactions\");\n\t\t//Now delete permanently\n\t\t$this->db->where('id', $id)->delete('otp_transactions');\n\t\treturn true;\n\t}", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function deleteID($activityID, $options = []) {\n // Get the activity first.\n $activity = $this->getID($activityID);\n if ($activity) {\n // Log the deletion.\n $log = val('Log', $options);\n if ($log) {\n LogModel::insert($log, 'Activity', $activity);\n }\n\n // Delete comments on the activity item\n $this->SQL->delete('ActivityComment', ['ActivityID' => $activityID]);\n\n // Delete the activity item\n return parent::deleteID($activityID);\n } else {\n return false;\n }\n }", "public static function delete_last_activity( $user_id ) {\n\t\tglobal $wpdb;\n\n\t\t$existing = self::get_last_activity( $user_id );\n\n\t\tif ( empty( $existing ) || empty( $existing[ $user_id ]['activity_id'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$deleted = $wpdb->delete(\n\t\t\tbuddypress()->members->table_name_last_activity,\n\n\t\t\t// WHERE.\n\t\t\tarray(\n\t\t\t\t'id' => $existing[ $user_id ]['activity_id'],\n\t\t\t),\n\n\t\t\t// WHERE sanitization format.\n\t\t\tarray(\n\t\t\t\t'%s',\n\t\t\t)\n\t\t);\n\n\t\twp_cache_delete( $user_id, 'bp_last_activity' );\n\n\t\treturn $deleted;\n\t}", "public function deleteJob($job, $user, $inputs)\n {\n // Check if the user is recruiter\n if ($user->type === 2) {\n throw new AccessException('Not Authorized.');\n }\n\n $createdJobs = $user->createdJobs()->pluck('id')->toArray();\n\n if(!in_array($job->id, $createdJobs)) {\n throw new AccessException('Job does not exists.'); \n }\n \n $job->recruiter()->dissociate($user);\n $job->save();\n }", "public function confirm_deleteactivity($activity_id) {\n $this->template->content = View::instance('v_activities_deleteact');\n $this->template->title = \"Confirm delete?\";\n $this->template->content->activity_id = $activity_id;\n\n # Render template\n echo $this->template;\n\n }", "public function delete(User $user, User $model)\n {\n //\n }", "public function forceDelete(User $user, Mission $mission)\n {\n //\n }", "public function delete(User $user, User $model)\n {\n }", "public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleteAction()\n {\n try {\n // load the task-user relation ID from the request\n \t$taskUserId = $this->_getRequest()->getParameter(\n TDProject_Project_Controller_Util_WebRequestKeys::TASK_USER_ID,\n FILTER_VALIDATE_INT\n );\n // delete the task-user relation\n $this->_getDelegate()->deleteTaskUser(\n TechDivision_Lang_Integer::valueOf(\n new TechDivision_Lang_String($taskUserId)\n )\n );\n\t\t\t// reset the ActionForm\n $this->_getActionForm()->reset();\n } catch(Exception $e) {\n // create and add and save the error\n $errors = new TechDivision_Controller_Action_Errors();\n $errors->addActionError(\n new TechDivision_Controller_Action_Error(\n TDProject_Project_Controller_Util_ErrorKeys::SYSTEM_ERROR,\n $e->__toString()\n )\n );\n // adding the errors container to the Request\n\t\t\t$this->_saveActionErrors($errors);\n\t\t\t// set the ActionForward in the Context\n\t\t\treturn $this->_findForward(\n\t\t\t TDProject_Core_Controller_Util_GlobalForwardKeys::SYSTEM_ERROR\n\t\t\t);\n }\n // return to the logging detail page\n return $this->createAction();\n }", "public function destroy($item_uuid, $activity_uuid)\n {\n $item = Item::where('uuid' ,'=', $item_uuid)->first();\n if(empty($item)) return Response::json([], 404);\n if( ! $this->has_access( $item->collection->project_id ) ) return Response::json([], 401);\n\n $activity = Activity::where('uuid', '=', $activity_uuid)->first();\n $activity->delete();\n return Response::json([], 204);\n }", "public function deleteUser()\n {\n $this->delete();\n }", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function delete($id)\n {\n $activity_type = ActivityType::find($id);\n $activity_type->delete();\n return redirect('/activity-types')->with('status','Activity Type Deactivated');\n }", "public function delete(User $user, Approval $resource)\n {\n // This only happens with actions\n return false;\n }", "public function deleteAction(){\r\n\t\t$this->getHelper('viewRenderer')->setNoRender();\r\n\t\t$this->_helper->layout->disableLayout();\t\r\n\t\t$id = $this->_getParam('id');\r\n\t\t//\"UPDATE `user` SET `active`=abs(`active`-1) WHERE user_id='$id'\";\r\n\t\t$sql =\"DELETE FROM `user` WHERE `user_id` = '\".$id.\"'\";\r\n\t\t//echo $sql;die();\r\n\t\t$del = Zend_Registry::get(\"db\")->query($sql);\r\n\t\t\r\n\t\tif($del){\r\n\t\t\t$this->_flashMessenger->addMessage('Selected record deleted');\r\n\t\t\t$this->_redirect('/admin/user/');\t\r\n\t\t}\r\n\t}", "public static function deleteActivityComment($id)\n\t{\n\t\tFrontendModel::getDB(true)->delete('profiles_activity_comments', 'id = ?', (int) $id);\n\t}", "public function deleteUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $operation->getCreator()->getId()) {\n $operation->setPublished(false);\n if (!$operation->save()) {\n $this->setErrorResponse('cannot delete Operation object!');\n }\n } else {\n $this->setErrorResponse('no Operation for this user with current operation_id!');\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function delete()\n {\n $user = new Task();\n $attributes = $this->request->body();\n\n if( $user->setAttributes($attributes)->delete() ) {\n // return ['status' => 'success']; // for ajax\n header(\"Location: /task/index\");\n exit;\n }\n\n return ['status' => 'cannot delete'];\n }", "public function actionDelete($id)\n {\n $model=$this->findModel($id);\n $user_id = $_SESSION['user']['id'];\n $user_group = $_SESSION['user']['user_group'];\n\n if (empty($model->acc_status)) $model->acc_status='';\n\n if ($model->acc_status!='ПРОВЕДЕНО') {\n\n $arChanges=Logs::getLastChanges($model);\n\n if(!empty($model->files)) foreach ($model->files as $file) {\n if ($file->table == 'accident') {\n $arChanges[$file->type]=array('from'=>'existed files', 'to'=>'');\n\n if ((@unlink(Yii::getAlias('@webroot') . $file->url)) || (!file_exists($_SERVER['DOCUMENT_ROOT'] . $file->url))) {\n $file->delete();\n }\n }\n }\n\n $arChanges['works']=array('from'=>'', 'to'=>'');\n if(!empty($model->works)) foreach ($model->works as $work) {\n $arChanges['works']['from'].=((!empty($work->full_work_performed)) ? $work->full_work_performed:\"$work->reason\").'; ';\n\n $works_files = Files::find()->where(['AND', ['link_id' => $work->id], ['table_name' => 'works']]);\n foreach ($works_files->all() as $works_file) {\n if (@unlink(Yii::getAlias('@webroot') . $works_file->url)) {\n// $works_file->delete();\n }\n }\n\n Files::deleteAll(['AND', ['link_id' => $work->id], ['table_name' => 'works']]);\n\n $work->delete();\n }\n if (empty($arChanges['works']['from'])) unset($arChanges['works']);\n\n Logs::createLog('ACCIDENT DELETE', $user_id, $arChanges, $model->id);\n\n $model->delete();\n\n }\n \n return $this->redirect(['index']);\n }", "public function delete(User $user, Negocio $negocio)\n {\n //\n }", "function time_tracker_delete_activity_confirm($form, &$form_state, $taid) {\n\n if ($taid) {\n $form['taid'] = array(\n '#type' => 'value',\n '#default_value' => $taid,\n );\n $question = t('Are you sure you want to delete the activity: !activity_name', array('!activity_name' => _time_tracker_get_activity_name($taid)));\n return confirm_form($form, $question, 'admin/config/time_tracker/activities');\n }\n else {\n return $form['msg']['#value'] = 'No Activity ID passed in.';\n }\n}", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function forceDelete(User $user, Meeting $meeting)\n {\n //\n }", "public function delete(Action $action) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE from accion WHERE id_accion=?\");\r\n\t\t$stmt->execute(array($action->getCodaction()));\r\n\t}", "public function delete(User $user, Evento $evento)\n {\n //\n }", "public function actionDelete($id)\n {\n///\n$nombre=Yii::$app->user->identity->username;\n$connection = \\Yii::$app->db;\n$db = $connection->createCommand(\"INSERT INTO auditoria (id, user, modelo, accion, fechahora) VALUES (NULL, '$nombre', 'PropiedadDet', 'Borrar', NOW());\")->execute();\n///\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "public function delIdentity()\n\t{\n\t\t// Verifier l'adhesion\n\t\t$q = new Bn_query('u2a', '_asso');\n\t\t$q->setFields('u2a_adherentid');\n\t\t$q->addWhere('u2a_userid='. $this->getVal('id', -1));\n\t\t$adheId = $q->getOne();\n\t\t$q->deleteRow();\n\t\t$q->setTables('adherents');\n\t\t$q->deleteRow('adhe_id=' . $adheId);\n\t}" ]
[ "0.7376134", "0.7281043", "0.7278024", "0.68819493", "0.684782", "0.65834564", "0.6548257", "0.652638", "0.6502628", "0.64717984", "0.63860434", "0.637702", "0.63534546", "0.6336945", "0.6214879", "0.61666733", "0.61556756", "0.61385363", "0.61157084", "0.6069745", "0.60640466", "0.6051903", "0.6036621", "0.6022815", "0.60080427", "0.5986737", "0.5928772", "0.5917822", "0.5894646", "0.5894175", "0.58818203", "0.5881717", "0.5860399", "0.58555835", "0.58369464", "0.5834288", "0.5816273", "0.5816273", "0.5816273", "0.581562", "0.58038944", "0.57772195", "0.57731616", "0.5744053", "0.5734979", "0.5730481", "0.57250786", "0.5717082", "0.57130915", "0.56914675", "0.56889796", "0.5686707", "0.5685104", "0.56787246", "0.5674744", "0.5666867", "0.566532", "0.5655454", "0.5645146", "0.5634322", "0.56305987", "0.56301147", "0.5628305", "0.562652", "0.5624249", "0.56205994", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56203866", "0.56190604", "0.5617996", "0.56147283", "0.56107354", "0.56031775", "0.5601346", "0.5598844", "0.559383", "0.559066", "0.558795", "0.5582521", "0.55803", "0.5572385", "0.556758", "0.5566934", "0.5566491", "0.554978", "0.5546971", "0.5545614", "0.55416876", "0.5536807" ]
0.82117146
0
this action creates user activity title is mandatory field photo is optional field
public function createUserActivityAction() { $data = $this->getRequestData(); if (isset($data['title'])) { $user = Object_User::getById($this->getDeviceSession()->getUserId()); $folder = Object_Folder::getByPath('/activities/' . $user->getKey() . "-activities"); if (!$folder) { $folder = new Object_Folder(); $folder->setKey($user->getKey() . "-activities"); $folder->setParentId(3); $folder->save(); } $activity = new Object_Activity(); $activity->setCreator($user); $activity->setTitle($data['title']); $activity->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : ""); $activity->setKey(Pimcore_File::getValidFilename($user->getKey() . "-" . $data['title'] . "-" . time())); $activity->setPublished(true); $activity->setParentId($folder->getId()); if (!$activity->save()) { $this->setErrorResponse('cannot save Activity object'); } } else { $this->setErrorResponse('title is mandatory field for this request!'); } $this->_helper->json($activity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n //创建活动时,点击后会先创建个活动,然后跳到修改页面,因为添加活动图需要有活动ID,\n $model = new ActivityInfo();\n //加载默认值\n $model->loadDefaultValues();\n $model->Tiltle = '1';\n $model->Url = '1';\n $model->JumpTo = '1';\n if ($model->save()) {\n $model->Tiltle = '';\n $model->Url = '';\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['index']);\n // }\n // $model->StartTime = date(\"Y-m-d\");\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n }", "public function actionCreate()\n {\n $model = new Person();\n /** @var EntityForm $EntityForm */\n $EntityForm = new EntityForm(new ActivityDirection());\n\n if ($model->load(Yii::$app->request->post())) {\n\n /** Save activities directions mapping **/\n if ($model->activities_ids) {\n $model->setRelated('activities', $model->activities_ids, true);\n }\n\n if(UploadedFile::getInstance($model, 'logo'))\n {\n $model->logo=UploadedFile::getInstance($model, 'logo');\n $model->logo->saveAs('../../frontend/web/mt/img/'.$model->logo->baseName.\".\".$model->logo->extension);\n $model->logo=$model->logo->baseName.\".\".$model->logo->extension; \n }\n if($model->tags)\n $model->tags = implode(\", \", $model->tags);\n $model->raiting = 0;\n $model->reviews = 0;\n \n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'entityForm' => $EntityForm\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new UserScreening();\n if(Yii::$app->request->isPost)\n { $model->load(Yii::$app->request->post());\n $model->file = UploadedFile::getInstance($model, 'file');\n $filename = Yii::$app->security->generateRandomString(32) . '_' . $model->file->baseName . '.' . $model->file->extension;\n $bool_saved = $model->file->saveAs(Yii::getAlias('@webroot').'/../uploads/' . $filename);\n if($bool_saved)\n {\n $model->status = 0;\n $model->cv = $filename;\n $model->file = null; // So that on saving it should not look for it again\n if($model->save()) {\n return $this->redirect(Url::to(['user-screening/index']));\n }\n else {\n throw new ErrorException(Json::encode($model->getErrors()));\n }\n }\n else {\n echo \"Error in uploading file\" ; exit;\n }\n }\n else\n {\n $model = new UserScreening();\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "function createactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $name = $this->input->post('name');\n $multiplicity = $this->input->post('multiplicity');\n $severity = $this->input->post('severity');\n $unit = $this->input->post('unit');\n $desc = $this->input->post('desc');\n $this->m_activities->create($wl_id, $name, $multiplicity, $severity, $unit, $desc);\n $this->activities();\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $foto = UploadedFile::getInstance($model,'use_foto');\n\n if ($foto == ''){\n $model->use_foto = 'usuario_anonimo.jpg';\n }else{\n\n $modelFoto = User::find()->count();\n\n $foto->saveAs('img/user/'. $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension);\n $model->use_foto = $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension;\n }\n\n /*\n * 1. usuario Administrador\n * 2. usuario Investigador\n * 3. usuario Registrado\n */\n\n /* if($model->rol_id != 2){\n $model ->use_estado = 1;\n //Aqui va codigo borrar el perfil del investigador\n }*/\n\n $model -> use_estadoAudit = 'N';\n $model -> use_fechaCreacion = date('y-m-d H:i:s');\n $model -> use_fechaAudit = date('y-m-d H:i:s');\n $model -> use_accion = 'N';\n\n\n if($model->signup()){\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Registro agregado!</h4>\n El registro se agregó correctamente.\n </div>\n ');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n $model = new News();\n// $id = Yii::$app->user->id;\n if ($model->load(Yii::$app->request->post())) {\n $model->user_id = \\Yii::$app->user->id;\n $model->date = date('y-m-d h:m:s');\n $model->save();\n// print_r($model->getErrors());\n// die();\n// return $this->redirect(['view', 'id' => $model->id]);\n // return $this->redirect(['view', 'id' => $model->id]);\n $imageName = Yii::$app->security->generateRandomString();\n $image = \\yii\\web\\UploadedFile::getInstance($model, 'picture');\n\n if ($image !== null) {\n $model->picture = $image->getBaseName();\n $path = Yii::getAlias('../web/picture/') . $model->picture;\n\n// print_r($model->getErrors());\n// die();\n }\n if ($model->save()) {\n ($image !== null) ? $image->saveAs($path) : '';\n// print_r($model->getErrors());\n// die();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n \n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n// } else {\n// return $this->render('create', [\n// 'model' => $model,\n// ]);\n }", "public function handleactivitycreate()\n {\n $game = new activity_master;\n $game->activitytitle = Input::get('activitytitle');\n $game->description = Input::get('description');\n $game->domain = Input::get('domain');\n \n $game->save();\n\n \n return Redirect::to('/admin');\n }", "public function getCrearFoto(){\n\t\treturn 'formulario de de crear Albumes';\n\t}", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function actionCreate()\n {\n $model = new Campaign();\n $reward = new Reward();\n\n if ($model->load(Yii::$app->request->post(''))) {\n $model-> c_author = Yii::$app->user->identity->getId();\n \n //$imageName = $model->c_title;\n $model->file = UploadedFile::getInstance($model,'file');\n $model->file->saveAs('uploads/campaign_img/'.$model->file->baseName.'.'.$model->file->extension);\n $model->c_image=$model->file->baseName.'.'.$model->file->extension;\n \n// $model->videoFile = UploadedFile::getInstance($model, 'videoFile');\n// $model->videoFile->saveAs('uploads/campaign_video/'.$model->videoFile->baseName.'.'.$model->videoFile->extension);\n// $model->c_video=$model->videoFile->baseName.'.'.$model->videoFile->extension;\n \n if($model->save(false)){ \n $reward->load(Yii::$app->request->post(''));\n $reward->c_id = $model->c_id;\n if ($reward->save(false)){\n return $this->redirect(['view', 'id' => $model->c_id]);\n }\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'reward' => $reward,\n ]);\n }", "public function actionCreate()\n {\n $model = new Abonent();\n\n if ($model->load(Yii::$app->request->post())){\n \n /**\n * model saves file using event AFTER_INSERT \n */\n $model->imageFile = UploadedFile::getInstance($model, 'imageFile');\n if($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 //\n return view('admin.activity.create');\n }", "public function actionCreate()\n {\n $model = new Action();\n if (Yii::$app->request->isPost) {\n $postActionFields = Yii::$app->request->post('ActionFields', []);\n $actionFieldsModels = [];\n for ($i = 0; $i < count($postActionFields); $i++) {\n $actionFieldsModels[] = new ActionFields();\n }\n if ($model->load(Yii::$app->request->post()) && Model::loadMultiple($actionFieldsModels, ['ActionFields' => $postActionFields])) {\n if (($model->validate() && Model::validateMultiple($actionFieldsModels))) {\n if ($model->save(false)) {\n foreach ($actionFieldsModels as $actionField) {\n $actionField->action_id = $model->id;\n $actionField->save(false);\n }\n //share op socialMedia\n $this->socialMediaPost($model);\n //redirect to view\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n }\n } else {\n $actionFieldsModels = $model->actionFields;\n }\n return $this->render('create', ['model' => $model, 'actionFields' => $actionFieldsModels]);\n\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'image' => 'required',\n 'description' =>'required'\n ]);\n \n \n $file =$request->image;\n \n $activity = new Activity();\n $activity->name = $request->name;\n $activity->image =$file ;\n $activity->description = $request->description;\n \n $activity->users_id =$request->user_id ;\n \n $activity->save();\n\n return redirect('/activity')->with('success_message','Upload berhasil');\n }", "public function actionCreate()\n {\n $model = new Banner();\n $model->scenario = 'create';\n\n $model->active = true;\n $model->visit_count = 0;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->image = UploadedFile::getInstance($model, 'image');\n\n if ($model->upload() && $model->save(false)) {\n return $this->redirect(['index']);\n } else {\n notify()->addError(t('app', 'Something went wrong'));\n }\n }\n\n return $this->render('form', [\n 'action' => 'create',\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t\t$image = $this->uploadImage();\n if ($image) {\n $this->data('image', $image);\n }\n\t\t$this->data([\n\t\t\t'story_title' => $this->request->post('story_title'),\n\t\t\t'story_name' => $this->request->post('story_name'),\n\t\t\t'details' => $this->request->post('details'),\n\t\t\t'status' => $this->request->post('status'),\n\t\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t])->insert($this->table);\n\t}", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "public function actionCreate()\n {\n $model = new ActivityDetail();\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 createTourist(){\n \t$filename = $_FILES['image']['name'];\n \tif(strlen($filename) > 4){\n $image_name = $this->_imageUpload();\n }else{\n \t$image_name = NULL;\n }\n\n $this->adminModel->createTourist($image_name);\n redirect('admin');\n }", "public function actionCreate()\n {\n $model = new User();\n $employee=new UserProfile();\n if ($model->load(Yii::$app->request->post()) && $employee->load(Yii::$app->request->post())) {\n $model->password=Yii::$app->getSecurity()->generatePasswordHash($model->password);\n if($model->save()){\n $employee->user_id=$model->id;\n $employee->photo = UploadedFile::getInstance($employee, 'photo');\n if ($employee->photo){ \n $photo_name='profile_'.date('Ymdhis').'.' . $employee->photo->extension; \n $employee->photo->saveAs(\\Yii::$app->basePath.'/web/images/' . $photo_name);\n $employee->photo=$photo_name;\n }\n if($employee->save())\n {\n return $this->redirect(['index']);\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'employee'=>$employee\n ]);\n }", "public function actionCreate()\n {\n $model = new UserProfile();\n\n $model->user_id = Yii::$app->user->identity->id;\n\n\n $POST_VARIABLE = Yii::$app->request->post('Place');\n echo $POST_VARIABLE['first_name'];\n\n if ($already_exists = RecordHelpers::userHas('user_profile')) {\n return $this->render('view', [\n\n 'model' => $this->findModel($already_exists),\n ]);\n\n } elseif ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash(\"success\", Yii::t('app', 'Profile successfully created!'));\n return $this->redirect(['view']);\n\n } else {\n// echo $model->user_id;\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n }\n\n// if ($model->load(Yii::$app->request->post()) && $model->save()) {\n//\n// return $this->redirect(['view', 'id' => $model->id]);\n// } else {\n// return $this->render('create', [\n// 'model' => $model,\n// ]);\n// }\n }", "public function created(Activity $activity)\n {\n //\n }", "public function action_createblank(){\n\t\t\n\t\t\t$userinfo = array();\n\t\t\t\n\t\t\t$userinfo['mis'] = '';\n\t\t\t$userinfo['name'] = '';\n\t\t\t$userinfo['username'] = '';\n\t\t\t$userinfo['iohid'] = '';\n\t\t\t$userinfo['password'] = '';\n\t\t\t\n\t\t\t$userinfo['email'] = '';\n\t\t\t$userinfo['mobileno'] = '';\n\t\t\t$userinfo['dob'] = 'DD / MM / YYYY';\n\t\t\t$userinfo['gender'] = '';\n\t\t\t$userinfo['year'] = '';\n\t\t\t$userinfo['stream']= '';\n\t\t\t\n\t\t\t$userinfo['age'] = ''; \n\t\t\t$userinfo['orderid'] = '';\n\t\t\t$year = 'blank';\n\t\t\t$stream = 'blank';\n\t\t\t//$this->placepdfvalue(json_encode($userinfo),str_replace('coep2013_', '', $user->username).'_1', 'studentinfo.php');\n\t\t\t$this->placepdfvalue(json_encode($userinfo),'blank', 'stjohnhealthcard.php',$year,$stream );\n\t\t\tdie;\n\t}", "public function actionCreate()\n {\n $user_id = Yii::$app->user->id;\n $model = new Website();\n\n $model->user_id=$user_id;\n\n // check if request is post\n if ($model->load(Yii::$app->request->post())) {\n\n //save website in database\n $website = new Website();\n $website->user_id = $user_id;\n $website->title = $_POST['Website']['title'];\n $website->type = $_POST['Website']['type'];\n $website->description = $_POST['Website']['description'];\n $website->url = $_POST['Website']['url'];\n\n // save model and if successful, will upload image\n if($website->save()){\n\n // get the last website id that has been saved to website table\n $website_id = Yii::$app->db->getLastInsertID();\n\n // upload all images\n foreach ($_POST['image'] as $index => $each_image){\n $image_name = Image::uploadImage('image','600','400','websites',true,$index);\n $image = new Image();\n $image->website_id = $website_id;\n $image->image = $image_name;\n $image->save();\n }\n }\n\n\n\n return $this->redirect('index');\n }else{\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n }", "public function actionCreate()\n {\n $model = new User;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // получаем изображение для последующего сохранения\n $file = UploadedFile::getInstance($model, 'image');\n if ($file && $file->tempName) {\n $fileName = self::_saveFile($model, $file);\n if ($fileName) {\n $model->image = $fileName;\n } else {\n // уведомить пользователя, админа о невозможности сохранить файл\n }\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n MainFunctions::register('Добавлен пользователь ' . $model->name);\n return $this->redirect(['view', 'id' => $model->_id]);\n } else {\n return $this->render('create', ['model' => $model]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_createExtraParameters;\n\n parent::createAction();\n }", "public function actionCreate() {\n $model = new ArticleModel;\n if (isset($_POST['ArticleModel'])) {\n $isUseOuterUrl = $_POST['isUseOuterUrl']*1;\n if ($isUseOuterUrl=='1' && empty($_POST['ArticleModel']['outer_url'])) {\n $errMsg = '您没有填写url '.$isUseOuterUrl;\n } elseif ($isUseOuterUrl=='0' && empty($_POST['ArticleModel']['content'])) {\n $errMsg = '您没有输入活动详情 '.$_POST['ArticleModel']['content'].$isUseOuterUrl;\n } else {\n $model->attributes = $_POST['ArticleModel'];\n if ($isUseOuterUrl==1) {\n //unset($_POST['ArticleModel']['content']);\n $model->content = '&nbsp;';\n } else {\n //unset($_POST['ArticleModel']['outer_url']);\n $model->outer_url = '';\n }\n $model->admin_id = Yii::app()->memberadmin->id;\n $model->admin_name = Yii::app()->memberadmin->name;\n\n // 查出第一张图片为封面图\n $imgpreg = '<img.*?src=\"(.*?)\">';\n $ret = preg_match($imgpreg, $_POST['ArticleModel']['content'], $matched);\n if ($ret) {\n $model->surface_url = $matched[1];\n }\n \n if ($model->save()) {\n // 未发布不产生url\n if ($model->status == ArticleModel::STATUS_PUBLISHED) {\n $model->visit_url = $this->createFanghuServerUrl('article/show', array(\n 'id'=>$model->id,\n 'sign'=> $model->makeSign($model->id),\n ));\n $model->save();\n\n // 如果是发布 增加统计记录\n //StasticArticleModel::addStastic($model, date('Y-m-d'));\n }\n // 增加操作日志\n ArticleOperLogModel::saveAnOper($model->id, 0, $model->status);\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n \n //$model->abstract = htmlspecialchars_decode(mb_substr(strip_tags($model->content), 0, 40));\n\n }\n $arrAttributeLabels = $model->attributeLabels();\n $form = $this->beginWidget('CSmartyValidatorJs', array(\n 'id' => 'actcms-form',\n 'enableClientValidation' => true,\n 'clientOptions' => array(\n 'validateOnSubmit' => false,\n 'validateOnChange' => true,\n ),\n ));\n foreach ($model->FormElements as $attributeName => $value) {\n $form->error($model, $attributeName);\n }\n\n $this->endWidget();\n $js = '';\n Yii::app()->getClientScript()->render($js,1);\n //报错信息处理\n $errMsg = $errMsg ? $errMsg : CHtml::errorSummary($model,'<i class=\"ace-icon fa fa-times\"></i>请更正以下错误');\n $this->smarty->assign(\"errormsgs\", CHtml::errorSummary($model));\n //render data\n $arrRender = array(\n 'modelName' => 'ArticleModel',\n 'attributes' => $model->getAttributes(),\n 'attributeLabels' => $arrAttributeLabels,\n 'FormElements'=>$model->FormElements,\n 'action' => 'Create',\n 'errormsgs' => $errMsg, //报错信息处理\n 'jsShell'=>$js,\n 'dataObj' => $model,\n 'isUseOuterUrl' => $isUseOuterUrl,\n 'arrType' => ArticleModel::$ARR_TYPE,\n 'arrStatus' => ArticleModel::$ARR_STATUS,\n 'domain_str' => Yii::app()->params['FanghuServerDomain'],\n );\n\n $this->smartyRender('actcms/create.tpl', $arrRender);\n }", "public function actionCreate()\n {\n $model = new PatientDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->image = UploadedFile::getInstance($model,'image');\n if($model->image)\n {\n $ext = $model->image->getExtension();\n $filename = time().\".{$ext}\";\n\n $model->image->saveAs(Yii::getAlias('@storage').'/patient/'.$filename);\n $model->image = $filename;\n }\n\n if($model->save())\n {\n Yii::$app->session->setFlash('success', 'Created Successfully.');\n return $this->redirect(['create']);\n }\n Yii::$app->session->setFlash('success', 'Created Successfully.');\n return $this->redirect(['create']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Presentacion();\n\n if ($model->load(Yii::$app->request->post())) {\n //var_dump($_POST);\n //exit();\n \n //Imagen de fondo\n $file = UploadedFile::getInstance($model, 'ruta');\n $ext = end((explode(\".\", $file->name)));\n $path = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext}\";\n $file->saveAs('uploads/' . $path);\n $model->ruta = $path;\n\n //Imagen left\n $file2 = UploadedFile::getInstance($model, 'ruta_img');\n $ext2 = end((explode(\".\", $file2->name)));\n $path2 = 'slide_index'.Yii::$app->security->generateRandomString().\".{$ext2}\";\n $file2->saveAs('uploads/' . $path2);\n $model->ruta_img = $path2;\n\n if($model->save()){\n return $this->redirect(['index']);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create(): void\n {\n\n $description = null;\n $image = null;\n $velo_id = null;\n\n if (!empty($_POST['description']) && $_POST['description'] != \"\") {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!empty($_POST['image'])) {\n $image = htmlspecialchars($_POST['image']);\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n\n if (!$description || !$image || !$velo_id) {\n die(\"formulaire mal rempli\");\n }\n\n $this->model->insert($description, $image, $velo_id);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "function postViewerActivity($title, $body) {\r\n $this->debug(\"Posting viewer activity with title: $title and body: $body\");\r\n\r\n $batch = $this->osapi->newBatch();\r\n\r\n $activity = new osapiActivity();\r\n $activity->setField('title', $title);\r\n $activity->setField('body', $body);\r\n\r\n $this->debug(\"Created OsapiActivity object: \" . print_r($activity, true));\r\n\r\n $create_params = array(\r\n 'userId' => '@me', //$this->userId,\r\n 'groupId' => '@self',\r\n 'activity' => $activity,\r\n 'appId' => '@app' //$this->appId\r\n );\r\n\r\n $batch->add($this->osapi->activities->create($create_params), 'createActivity');\r\n\r\n $response = $batch->execute();\r\n $this->debug(\"Response:<br /><pre>\" . print_r($response, true) . \"</pre>\");\r\n\r\n return $response;\r\n }", "public function actionCreate() {}", "public function actionCreate() {}", "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 actionCreate(){ \n // function to create User.\n //redirect a user if not super admin\n\n $site_url = Yii::$app->params['yii_url'];\n $upload_url = \"\";\n if($site_url == \"http://dev.digitalvidya.com/assist\") {\n $upload_url - $site_url.\"/uploads/user_image/\";\n } else {\n $upload_url = $site_url . \"/uploads/\";\n }\n if (!Yii::$app->CustomComponents->check_permission('create_user')) {\n return $this->redirect(['site/index']);\n }\n\n $model = new DvUsers();\n if (!empty($model->course)) {\n $model->course = explode(',', $model->course);\n }\n\n\n if ($model->load(Yii::$app->request->post())) {\n if (!empty($model->course)) {\n $model->course = implode(\",\", $_POST['DvUsers']['course']);\n }\n\n if (isset($_POST['usermeta']['day_avail'])) {\n $day_avail = $_POST['usermeta']['day_avail'];\n }\n\n if (!empty($day_avail)) {\n $day_avail = implode(\",\", $_POST['usermeta']['day_avail']);\n }\n\n $userdata = Yii::$app->request->post();\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($userdata); die;\n\t\t\tif($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n\t\t\t\t$email = $userdata['DvUsers']['email'];\n\t\t\t\t$phone = $userdata['usermeta']['phone'];\n\t\t\t\t$fname = $userdata['DvUsers']['first_name'];\n\t\t\t\t$lname = $userdata['DvUsers']['last_name'];\n\t\t\t\t$fb_link = $userdata['usermeta']['fb_link'];\n\t\t\t\t$linkedin_link = $userdata['usermeta']['linkedin_link'];\n\t\t\t\t$twitter_link = $userdata['usermeta']['twitter_link'];\n\t\t\t\t\n\t\t\t\tif(isset($userdata['usermeta']['description'])){\n\t\t\t\t\t$desc = $userdata['usermeta']['description'];\n\t\t\t\t}else{\n\t\t\t\t\t$desc = \"\";\n\t\t\t\t}\n\n\t\t\t\n\t\t\t \n\t\t\t}\n\t\t\t\n $model->save();\n\n $uid = Yii::$app->db->getLastInsertID();\n\t\t\tif($userdata['usermeta']['role'] == 4){\n\t\t\t\t$usre_role = 1;\n\t\t\t\t$profile_visibility = $userdata['usermeta']['profile_visibility'];\n\t\t\t}else{\n\t\t\t\t$usre_role = 2;\n\t\t\t\t$profile_visibility = 1;\n\t\t\t}\n\n if($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n // ***************** Start of curl ************************\n \n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n CURLOPT_USERAGENT => 'Get course data',\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => [\n \n 'ta_email' => $email,\n 'tm_fname' => $fname,\n 'tm_lname' => $lname,\n 'tm_phone' => $phone,\n 'tm_facebook' => $fb_link,\n 'tm_linkedin' => $linkedin_link,\n 'tm_twitter' => $twitter_link,\n 'tm_description' => $desc,\n 'tm_image_url' => $upload_url.'img_'.$uid.'.jpg',\n 'tm_image_name' => 'img_'.$uid.'.jpg',\n 'profile_visibility' => $profile_visibility,\n\t\t\t\t\t\t'user_role' => $usre_role\n\n ]\n ]);\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n $resulst = json_decode($resp,true);\n curl_close($curl);\n\t\t\t\t//echo \"<pre>\";print_r($resulst);die;\n // ************* End of the curl ************************\n }\n\n $model->picture = UploadedFile::getInstance($model, 'picture');\n if (!empty($model->picture->baseName)) {\n $model->picture->saveAs('uploads/user_image/img_' . $uid . '.' . $model->picture->extension);\n $user_image = 'img_' . $uid . '.' . $model->picture->extension;\n Yii::$app->db->createCommand(\"UPDATE assist_users SET picture = '$user_image' WHERE id = '$uid' AND status = 1 \")->execute();\n }\n\n $usermeta = $_POST['usermeta'];\n unset($usermeta['day_avail']);\n\t\t\tif(isset($resulst['user_id'])){\n\t\t\t\t$usermeta['wp_user_id'] = $resulst['user_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\tif(isset($resulst['post_id'])){\n\t\t\t\t\n\t\t\t\t$usermeta['wp_post_id'] = $resulst['post_id'];\n\t\t\t\t$usermeta['trainer_profile_url'] = $_SERVER['SERVER_NAME'].\"/?p=\".$resulst['post_id'];\n\t\t\t}\n\n\n foreach ($usermeta as $key => $val) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => $key, 'meta_value' => $val])->execute();\n }\n\n if (!empty($day_avail)) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => 'day_avail', 'meta_value' => $day_avail])->execute();\n }\n\n $user_password = $_POST['DvUsers']['password']; \n\n // send email\n if ($usermeta['notify'] == 1) {\n $subject = Yii::$app->params['site_name'].\" New Account Invitation\";\n $body = \" <h3>Welcome to \". Yii::$app->params['site_name'].\"</h3>\n <p>Hi $model->first_name,</p>\n <p>Your login details are:</p>\n <p>Site URL: \". Yii::$app->params['yii_url'].\"</p>\n <p>Username: $model->username</p>\n <p>Password: $user_password</p>\n <br>\n <br>\n <p>Thanks and Regards</p>\n <p>Digital Vidya Team</p>\n \";\n\n $is_sent = Yii::$app->mailer->compose()\n ->setFrom('[email protected]')\n //->setTo('[email protected]')\n ->setTo($model->email)\n ->setBcc ('[email protected]')\n ->setSubject($subject)\n ->setHtmlBody($body)\n ->send();\n \n }\n\n return $this->redirect(['view', 'id' => $uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $subtitleList = DB::table('subtitle')\n ->leftJoin('activity', 'subtitle.activity_id', '=', 'activity.id')\n ->select('subtitle.id', DB::raw('(CASE WHEN subtitle.activity_id = \"0\" THEN CONCAT(subtitle.Name,\"(此副標未有所屬的活動)\") ELSE CONCAT(activity.name,\"-\",subtitle.name) END) AS SubtitleName'))\n ->get();\n\n\n $activity_record = DB::table(DB::raw('(select activity_record.id,activity_record.subtitle_id, activity_record.name, activity_record.img,subtitle.name AS subtitleName,subtitle.activity_id from activity_record left join subtitle on activity_record.subtitle_id = subtitle.id) AS activity_record'))\n ->leftJoin('activity','activity_record.activity_id', '=', 'activity.id')\n ->select('activity_record.id',DB::raw('(CASE WHEN activity_record.subtitle_id = \"0\" THEN \"此圖片未有所屬的副標\" WHEN activity_record.subtitle_id != \"0\" AND activity_record.activity_id = \"0\" THEN CONCAT(activity_record.subtitleName,\"(此副標未有所屬的活動)\") ELSE CONCAT(activity.name,\"-\",activity_record.subtitleName) END) AS subtitleName'),'activity_record.name as activity_recordName','activity_record.img')\n ->get();\n\n\n return view('Backstage.activity_record.create', compact('subtitleList', 'activity_record'));\n }", "public function create()\n {\n\n $activity = new TenderActivity();\n\n if (Request::isMethod(\"post\")) {\n\n $activity->name = Request::get('name');\n $activity->status = Request::get('status',0);\n\n $activity->user_id = Auth::user()->id;\n // Fire saving action\n\n Action::fire(\"activity.saving\", $activity);\n\n if (!$activity->validate()) {\n return Redirect::back()->withErrors($activity->errors())->withInput(Request::all());\n }\n\n $activity->save();\n // Fire saved action\n\n Action::fire(\"activity.saved\", $activity);\n\n return Redirect::route(\"admin.tenders.activities.edit\", array(\"id\" => $activity->id))\n ->with(\"message\", trans(\"tenders::activities.events.created\"));\n }\n $this->data[\"activity\"] = $activity;\n\n return View::make(\"tenders::activities.edit\", $this->data);\n }", "public function actionCreate()\n {\n $model = new ApplicationPhoto();\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 creating(AvItem $model)\n {\n # Set Current User as Creator\n $model->setAttribute('creator', $model->getAttribute('creator') ?: $this->getUserId() );\n }", "public function actionCreate()\n {\n $model = new Usuario();\n $imageModel = new Imageupload();\n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()){\n\n $model->save();\n\n $imageModel->image = UploadedFile::getInstance($imageModel,'image');\n \n $imageModel->image->saveAs('uploads/'.$model->legajo.'_'.$model->empresa. $imageModel->image->extension);\n\n $imageModel->upload();\n // file is uploaded successfully\n //$model->imageFile = 'dgfg';\n \n \n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n return $this->render('create', [\n 'model' => $model,\n 'imageModel' => $imageModel,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'imageModel' => $imageModel,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Photo();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Upload.Developer.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_upload())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_create_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_create') . ' Upload');\n\t\tTemplate::render();\n\t}", "public function actionCreate()\n {\n\n if (Yii::$app->user->isGuest) { \n return Yii::$app->getResponse()->redirect('index.php?r=admin/login');\n } \n else \n {\n\n $model = new AuditionData();\n if ($model->load(Yii::$app->request->post())) {\n\n // echo '<pre>'; print_r($_POST); die;\n $model->to_date = $_POST['AuditionData']['to_date'];\n $model->eligibility = $_POST['AuditionData']['eligibility'];\n $model->registration_detail = $_POST['AuditionData']['registration_detail'];\n \n $model->venue = $_POST['AuditionData']['venue'];\n $model->docs_requirement = $_POST['AuditionData']['docs_requirement'];\n $model->youtube_link = $_POST['AuditionData']['youtube_link'];\n $model->facebook_link = $_POST['AuditionData']['facebook_link'];\n $model->twitter_link = $_POST['AuditionData']['twitter_link'];\n $model->instagram_link = $_POST['AuditionData']['instagram_link'];\n \n\n\n if(($model->from_date < $model->to_date) || ($model->from_date == \"\" && $model->to_date == \"\")|| ($model->from_date != \"\" && $model->to_date == \"\")){\n //echo 'ok'; die;\n $model->audition_image= UploadedFile::getInstance($model, 'audition_image');\n\n if($model->from_date != \"\" && $model->to_date == \"\"){\n $model->to_date = $model->from_date;\n }\n if($model->from_date == \"\" && $model->to_date != \"\"){\n Yii::$app->session->setFlash('error', \"From Date is Empty...\");\n //Yii::$app->session->getFlash('error');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n if($model->from_date == \"\" && $model->to_date == \"\"){\n $model->from_date = \"Coming Soon\";\n }\n if($model->audition_image != \"\"){\n $pic_name = uniqid().\".\".$model->audition_image->extension;\n $model->audition_image->saveAs(Yii::getAlias('@frontend') .\"/web/themes/ikp/audition_data/\".$pic_name);\n $model->audition_image = \"/audition_data/\".$pic_name;\n }else{\n $model->audition_image = \"\";\n }\n if(!$model->save()){\n return $this->render('create', [\n 'model' => $model,\n ]); \n }\n return Yii::$app->getResponse()->redirect('index.php?r=admin/index');\n }else{\n Yii::$app->session->setFlash('error', \"From Date is less then to date....\");\n //Yii::$app->session->getFlash('error');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n} else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n}\n}\n}", "public function actionCreate()\n\t{\n\t\t$model=new Photo;\n\t\tif(isset($_POST['Photo']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Photo'];\n if (!empty($_POST['Photo']['subcategoryArr']))\n $model->subcategory = implode(\",\", $_POST['Photo']['subcategoryArr']);\n if (!empty($_POST['Photo']['sizesArr']) && $_POST['Photo']['size'] == 1)\n $model->sizes = implode(\",\", $_POST['Photo']['sizesArr']);\n if (!empty($_POST['Photo']['colorArr']))\n $model->color = implode(\",\", $_POST['Photo']['colorArr']);\n\t\t\tif($model->save()){\n\t\t\t\t$this->redirect('/admin/photo/create');\n }\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new News();\n\n if ($model->load(Yii::$app->request->post())) {\n // Uploads File\n $this->CreateDir($model->ref);\n $model->docs = $this->uploadMultipleFile($model);\n\n $curentDate = date('Y-m-d H:i:s');\n $model->post_date = $curentDate;\n $model->update_date = $curentDate;\n $model->view = 0;\n\n if($model->save()){\n $model->icon = UploadedFile::getInstance($model,'icon');\n if($model->icon){\n $iconFullName = Yii::getAlias('@webroot').'/uploaded/news/icons/';\n $iconFullName .= $model->id;\n $iconFullName .= '.'.$model->icon->extension;\n $model->icon->saveAs($iconFullName);\n }\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->ref = substr(Yii::$app->getSecurity()->generateRandomString(),10);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('activity.create');\n }", "public function create($uid, $activity)\n\t{\n\t\treturn $this->request->send('POST', \"/profiles/$uid/activities\", $activity);\n\t}", "private function createActivityTable()\n {\n $createTable = \"CREATE TABLE IF NOT EXISTS `mapping`.`userActivity` (\n\n `oldAttemptID` int(11) NOT NULL, \n `userId` varchar(50) NOT NULL DEFAULT '00',\n `sessionId` varchar(50) NOT NULL DEFAULT '00',\n\n `oldActivityId` varchar(45) DEFAULT NULL, \n `contentId` varchar(50) NOT NULL DEFAULT '00',\n `revisionNumber` int(11) NOT NULL DEFAULT 1,\n `contentLanguageCode` varchar(50) NOT NULL DEFAULT 'en',\n `extraParams` varchar(100) DEFAULT NULL,\n\n `timeTaken` int(11) NOT NULL DEFAULT 0,\n `score` int(11) NOT NULL DEFAULT 0,\n `result` varchar(50) DEFAULT NULL,\n `activityType` varchar(20) DEFAULT NULL,\n `status` varchar(20) DEFAULT NULL,\n `activityTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n `contentAttemptNumber` int(11) NOT NULL DEFAULT 1,\n `srNo` int(11) NOT NULL AUTO_INCREMENT,\n `mode` varchar(20) NOT NULL DEFAULT 'Activity',\n `subject` varchar(20) NOT NULL DEFAULT 'math',\n `isSchoolLogin` int(10) NOT NULL DEFAULT 1,\n `contentType` varchar(20) DEFAULT 'activity',\n `attemptCount` int(10) NOT NULL DEFAULT 1\n \n PRIMARY KEY (`srNo`),\n CONSTRAINT UC_User_Attempt UNIQUE (userId,oldActivityId,oldAttemptID)\n )\";\n $result = $this->mySQL->rawQuery($createTable);\n }", "public function create()\n {\n $activityImages = ActivityImage::all();\n\n return view('pages.activities.create', ['activityImages' => $activityImages]);\n }", "public function addPhotoAction(){\n $data = $this->getRequestData();\n $types = array('activity', 'operation', 'people');\n if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']);\n if (!$folder) {\n switch($data['type']){\n case 'activity':\n $fid = 3;\n break;\n case 'operation':\n $fid = 4;\n break;\n case 'people':\n $fid = 7;\n break;\n }\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-\" . $data['type']);\n $folder->setParentId($fid);\n $folder->save();\n }\n\n $asset = new Asset_Image();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save photo!');\n }\n } else {\n $this->setErrorResponse('photo and type is mandatory for this request!');\n }\n\n $this->_helper->json(array('photo' => $asset->getId()));\n }", "public static function create_record() {\n\t\t$extension = self::get_extension();\n\t\t$sql = \"INSERT INTO photo_directory (user_id, time_uploaded, extension) VALUES ('{$_SESSION['user_id']}', NOW(), '{$extension}'); \";\n\t\t$do_it_bitch = mysql_query($sql);\n\n\t\t// Create record in photo_description\n\t\t$photo_id = self::max_photo_id();\n\t\t$description = $_POST['description'];\n\t\tif ($description == 'false') {\n\t\t\t$sql = \"INSERT INTO photo_descriptions (photo_id) VALUES ({$photo_id}); \";\n\t\t\t$do_it_bitch = mysql_query($sql);\n\t\t} else {\n\t\t\t$sql = \"INSERT INTO photo_descriptions (photo_id, photo_description) VALUES ({$photo_id}, '{$description}'); \";\n\t\t\t$do_it_bitch = mysql_query($sql);\n\t\t}\n\t}", "public function createAction()\n {\n if(isset($_FILES['user_avatar']) && $_FILES['user_avatar']['size']!=0)\n $avatar = $_FILES['user_avatar'];\n else\n $avatar = null;\n\n $user = new User($_POST);\n if($user->save($avatar)){\n if(($avatar && user::uploadAvatar($user->email,$avatar)) || !$avatar){\n Flash::addMessage('Registered Successfully, Please login!');\n }else{\n Flash::addMessage('Registered Successfully, Please login! Uploaded Avatar file not allowed. Please try uploading Avatar later through Profile page');\n }\n\n if(isset($_SESSION['admin']) && $_SESSION['admin'])\n $this->redirect('/museum/gamify/admin');\n else\n $this->redirect('/museum/gamify');\n\n }else{\n if(isset($_SESSION['admin']) && $_SESSION['admin'])\n View::renderTemplate('Admin/index.html', array(\n 'user' => $user));\n else\n View::renderTemplate('Home/index.html', array(\n 'user' => $user));\n //var_dump($user->errors);\n } \n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function creating(ProgressionStatus $model)\n {\n # Set Current User as Creator\n $model->setAttribute('creator', $model->getAttribute('creator') ?: $this->getUserId() );\n }", "function getActivity()\n\t\t{\n\t\t\t$userID = $_POST[\"userID\"];\n\t\t\t$title = \"userPost\";\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t\n\t\t\techo $this->postActivity($userID, $title, $description, $link);\n\t\t}", "public function create()\n {\n $choose_year = Year::withTrashed()->where('choose', 1)->first();\n $activity_type = Event_type::all()->where('sort', 'activity');\n return view('admin.activity.create', compact('choose_year', 'activity_type'));\n }", "function createMetaData()\n\t{\n\t\tparent::createMetaData();\n\t\t$this->saveAuthorToMetadata();\n\t}", "public function createAction()\n {\n echo (new View('userCreate'))->render();\n }", "public function actionCreate()\n {\n $model = new SubmitData();\n $postRequest = Yii::$app->request->post();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $apartment_ids = $postRequest['SubmitData']['apartment_ids'];\n $lengthApartment_ids = count($apartment_ids);\n $apartment_idsVal = '';\n $package_id = '';\n\n foreach ($apartment_ids as $key => $val) {\n if ($key != $lengthApartment_ids - 1) {\n $apartment_idsVal .= $val . ',';\n } else {\n $apartment_idsVal .= $val;\n }\n }\n\n $model->apartment_ids = $apartment_idsVal;\n $contact_time = $postRequest['SubmitData']['contact_time'];\n $contact_timeVal = '';\n $lengthContact_time = count($contact_time);\n $package_id_arr = $model->package_id;\n\n foreach ($contact_time as $key => $val) {\n\n if ($key != $lengthContact_time - 1) {\n $contact_timeVal .= $val . ',';\n } else {\n $contact_timeVal .= $val;\n }\n }\n\n foreach($package_id_arr as $i => $j){\n if($i != (count($package_id_arr) - 1)){\n $package_id .= $j . ',';\n }else{\n $package_id .= $j;\n }\n }\n\n $model->contact_time = $contact_timeVal;\n $model->contact_person = 'person';\n $model->package_id = $package_id;\n $image = UploadedFile::getInstances($model, 'image');\n $imgVal = '';\n $model->image = $image;\n\n if ($model->upload()) {\n\n $url = explode('http:', explode('backend', $_SERVER[\"HTTP_REFERER\"])[0])[1];\n\n if($url == NULL){\n\n $url = explode('https:', explode('backend', $_SERVER[\"HTTP_REFERER\"])[0])[1];\n\n }\n\n $lengthImage = count($image);\n\n foreach ($image as $key => $val) {\n if ($key != $lengthImage - 1) {\n $imgVal .= $url . 'frontend/web/img/upload/' . $val->name . ';';\n } else {\n $imgVal .= $url . 'frontend/web/img/upload/' . $val->name;\n }\n }\n\n $model->image_url = $imgVal;\n\n if ($model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n }else{\n\n return $this->goBack();\n\n }\n }else{\n\n return $this->refresh();\n\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('myactivity.add_myactivity');\n }", "public function actionCreate()\n {\n $model = new Gallery();\n $file = new UploadForm();\n $file->imageFile = UploadedFile::getInstance($file, 'imageFile');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($file->upload($model->id, null, $file::TYPE_GALLERY)) {\n $model->image = $file->getNameImage($model->id, null, $file::TYPE_GALLERY);\n $model->save();\n } else {\n $model->image = null;\n $model->save();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', compact('file', 'model'));\n }\n }", "public function actionCreate()\n {\n $model = new Admin();\n if ($model->load(Yii::$app->request->post())) {\n $imageUploadFile = UploadedFile::getInstance($model,'img');\n if($imageUploadFile != null ){\n $saveUrl = $this->qiniu($imageUploadFile);\n $model->img = $saveUrl;\n }\n $model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function create()\n {\n $data = array();\n $data['title'] = $_POST['title'];\n $data['content'] = $_POST['content'];\n $data['time'] = $_POST['time'];\n \n $this->model->create($data);\n header('location:'. URL .'index');\n }", "protected function _actionAdd($context)\n\t{\t\n\t\t$data = $context->data;\t\t\n\t\t$file = KRequest::get('files.file', 'raw');\n\t\t$content = @file_get_contents($file['tmp_name']);\n\t\t$filesize = strlen($content);\n\t\t$uploadlimit = $this->_max_upload_limit * 1024 * 1024; \n\t\t\n\t\t$exif = (function_exists('exif_read_data')) ? @exif_read_data($file['tmp_name']) : array();\n\n\t\tif($filesize == 0)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('File is missing');\t\n\t\t\t\n\t\t return;\n\t\t}\n\t\t\n\t\tif($filesize > $uploadlimit)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('Exceed maximum size');\t\n\n\t\t return;\n\t\t}\n\n\t\t$orientation = 0;\n\t\t\n\t\tif(!empty($exif) && isset($exif['Orientation']) )\n {\n $orientation = $exif['Orientation']; \n }\t\t\n\t\t\n\t\t$data['portrait'] = array('data'=>$content,'rotation'=>$orientation,'mimetype'=>isset($file['type']) ? $file['type'] : null);\t\t\t\t\n \n\t\t$photo = $this->actor->photos->addNew($data);\t\n\t\t\n\t\t$photo->setExifData($exif);\n\t\t\n\t\t$photo->save();\n\t\t\n\t\t$this->setItem($photo);\n\t\t\n\t\t$this->getResponse()->status = KHttpResponse::CREATED;\n\t\t\n if($photo->body && preg_match('/\\S/',$photo->body))\n {\n $context->append(array( \n 'story' => array('body'=>$photo->body)\n )); \n }\n\n\t\treturn $photo;\n\t}", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()))\n {\n if(isset($_FILES['User']['name']['image']) && $_FILES['User']['name']['image'] != null)\n {\n if($model->image_path != '' && $model->image_path != null && file_exists(Yii::getAlias('@webroot').'/'.$model->image_path))\n {\n unlink(Yii::getAlias('@webroot').\"/\".$model->image_path);\n }\n $new_image['name'] = $_FILES['User']['name']['image'];\n $new_image['type'] = $_FILES['User']['type']['image'];\n $new_image['tmp_name'] = $_FILES['User']['tmp_name']['image'];\n $new_image['error'] = $_FILES['User']['error']['image'];\n $new_image['size'] = $_FILES['User']['size']['image'];\n\n $name = Yii::$app->common->normalUpload($new_image, Yii::$app->params['userimage']);\n $model->image_path = $name;\n }\n $model->password =md5($model->password);\n $model->i_by = Yii::$app->user->id;\n $model->i_date = time();\n $model->u_by = Yii::$app->user->id;\n $model->u_date = time();\n\n if($model->save(false))\n {\n $msg=\"User has been successfully added\";\n $flash_msg = \\Yii::$app->params['msg_success'].$msg.\\Yii::$app->params['msg_end'];\n \\Yii::$app->getSession()->setFlash('flash_msg', $flash_msg);\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create(Request $request)\n\t{\n\t\t//\n\t\t$item = DB::table('activity_item')\n\t\t->get();\n\n\t\t$detail = [];\n\t\tif ($request->input('id')) {\n\t\t\t$detail = DB::table('activity')\n\t\t\t->where('id', $request->input('id'))\n\t\t\t->first();\n\t\t}\n\n\t\tTemplate::assign('detail', $detail);\n\t\tTemplate::assign('item', $item);\n\t\tTemplate::assign('can_change', 1);\n\t\tif($detail){\n\t\t\tif($detail->specail_config){\n\t\t\t\t$specail_game_system = DB::table('activity_specail_config')\n\t\t\t\t->get();\n\t\t\t\t$specail_game_system = tran_key($specail_game_system, 'type', true);\n\n\t\t\t\tTemplate::assign('specail_game_system', $specail_game_system);\n\t\t\t\tTemplate::render('h5/member/activity/create_specail');\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\tTemplate::assign('specail_game_system', []);\n\t\tTemplate::render('h5/member/activity/create');\n\t}", "public function create()\n {\n //\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.create', compact('usuario'));\n }", "public function actionCreate()\n {\n $model=new Services;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Services']))\n {\n $hourminutes = 0;\n if($_POST['Services']['hours'] != 0) {\n $hourminutes = ($_POST['Services']['hours'] * 60);\n }\n\n $model->attributes=$_POST['Services'];\n $model->user_id = $_POST['Services']['user_id'];\n $model->resource_id = $_POST['Services']['resource_id'];\n\n if($model->is_display == \"on\"){\n $model->is_display = 1;\n }else{\n $model->is_display = 0;\n }\n $model->service_duration = $hourminutes + $_POST['Services']['minutes'];\n\n $model->service_image = CUploadedFile::getInstance($model, 'service_image');\n /*echo $model->service_image;die;*/\n $imageName = $this->getImageName($model->service_image);\n if (CUploadedFile::getInstance($model, 'service_image') != '') {\n $model->service_image = $imageName;\n }\n\n $model->created_at = date('Y-m-d H:i:s');\n $model->modified_at = date('Y-m-d H:i:s');\n\n if($model->save()){\n if (CUploadedFile::getInstance($model, 'service_image') != '') {\n $model->service_image = CUploadedFile::getInstance($model, 'service_image');\n $model->service_image->saveAs(Yii::app()->basePath . '/..' . $imageName);\n }\n\n $this->redirect(array('view','id'=>$model->service_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n 'from' => \"create\",\n ));\n }", "public function __construct()\n {\n $last_activity = Activity::inLog('profile_view')->get()->last();\n $profile = $last_activity->causer;\n $img = $profile->user->name . '.jpg';\n $this->activity = array(\n \"time\" => $last_activity->created_at->toW3cString(),\n \"name\" => $profile->firstName,\n \"img\" => $img,\n \"index\" => $profile->user->name\n );\n }", "public function create(){\n $dataReceiveFromPost = array(\n 'socialMedia' => $this->input->post(\"socialMedia\"),\n 'url' => $this->input->post(\"url\"),\n );\n $resultSocialCreate = $this->Social_Model->create($dataReceiveFromPost);\n echo json_encode($resultSocialCreate);\n }", "public function actionCreate()\n {\n $model = new Book();\n\n \n $model->imageFileName_Fl = UploadedFile::getInstance($model, 'imageFileName_Fl');\n if ($model->imageFileName_Fl && $model->validate()) { \n $s2=$model->id . '_' . $model->imageFileName_Fl->baseName . '.' . $model->imageFileName_Fl->extension; \n $model->imageFileName_Fl->saveAs(Yii::getAlias('@frontend').'/web/uploads/' . $s2);\n $model->imageFileName=$s2;\n }\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 createAnime($title, $year, $author, $synopsis, $photoName, $type) {\n\t\t$anime = new Anime(uniqid(), $title, $year, $author, $synopsis, $photoName, $type);\n\t\t//$this->sqlStore->saveAnime($anime);\n\t\t$anime->save();\n\t}", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function create()\n {\n return view('admin.activities.create');\n }", "protected function _buildTitle()\n\t{\n\t\tif ($this->_task)\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER_' . strtoupper($this->_task));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$title = Lang::txt('COM_MEMBERS_REGISTER');\n\t\t}\n\t\t\\Document::setTitle($title);\n\t}", "public function actionCreate()\n {\n $model = new StarGreeting;\n if (isset($_POST['StarGreeting'])) {\n //时间过滤\n $this->checkTime($model);\n //上传处理\n $portrait_list = $this->portrait_list;\n $voice_list = $this->voice_list;\n if (!isset($_FILES['StarGreeting']['name'])) {\n $this->json_alert(1, '请选择上传文件');\n }\n $file_list = array_keys($_FILES['StarGreeting']['name']);\n $bg_img_path = '';\n $img_type = ['png', 'jpg'];\n if (in_array('bg_img', $file_list)) {\n $bg_img = CUploadedFile::getInstanceByName('StarGreeting[bg_img]');\n $bg_img_re = $this->upload($bg_img, $img_type, 2);\n if ($bg_img_re['code'] != 0) {\n return $this->json_alert('1', $bg_img_re['msg']);\n }\n $bg_img_path = $bg_img_re['data']['path_file_name'];\n }\n //count处理\n $type = $_POST['StarGreeting']['type'];\n $json_data = $this->create_data();\n $model->title = $_POST['StarGreeting']['title'];\n $model->type = $_POST['StarGreeting']['type'];\n $model->status = $_POST['StarGreeting']['status'];\n $model->channel_id = $_POST['StarGreeting']['channel_id'];\n $model->bg_img = $bg_img_path;\n $model->start_time = $this->start_time;\n $model->end_time = $this->end_time;\n $model->content = $json_data;\n $model->created = time();\n $model->updated = time();\n if ($id = $model->save()) {\n Yii::app()->user->setFlash('success', '更新成功');\n $model->pull($model->attributes['id']);\n $this->json_alert(0, '更新成功');\n }\n $error = $model->getErrors();\n $this->json_alert(1, current(current($error)));\n }\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate($title) {\n $path = $this->module->create($title);\n if(!$path) {\n $this->stdout(\"Unable to create file\", Console::FG_RED);\n return 1;\n }\n\n $this->stdout(\"The file \", Console::FG_GREEN);\n $this->stdout($path, Console::FG_GREEN, Console::BOLD);\n $this->stdout(\" has been generated.\", Console::FG_GREEN);\n return 0;\n }", "private function create_title( $params ) {\n\n $title = !empty( $params['om_title'] ) ? $params['om_title'] : '';\n\n if ( empty( $title ) ) {\n\n $title = !empty( $params['om_custom_event'] ) ? $params['om_custom_event'] : '';\n if ( empty( $title ) ) {\n $title = $params['om_event'];\n }\n\n $street = !empty( $params['om_area_street'] ) ? $params['om_area_street'] : '';\n if ( !empty( $street ) ) {\n $title .= ' - ' . $street;\n }\n\n }\n\n return sanitize_text_field( $title );\n\n }", "public function initializeCreateAction() {\n\t\t$this->setTypeConverterConfigurationForImageUpload('newExample');\n\t}", "public function actionCreate()\n {\n $model = new Tblchannels();\n $modelusers = new Tblusers();\n $modeltags = new Tbltags();\n \n\n $mt = explode(' ', microtime());\n $new = ((int)$mt[1]) * 1000 + ((int)round($mt[0] * 1000));\n\n $users = Tblusers::find()->all();\n $schedulesArray = ArrayHelper::map($users,'user_id', function ($users, $defaultValue) {\n return $users->username. ' - ' .$users->email;\n });\n\n if ($model->load(Yii::$app->request->post())) {\n $request = Yii::$app->request->post();\n $file= UploadedFile::getInstance($model,'image');\n if($file){\n $imagename = 'channels_Picture_'.$model->user_id.'_'.$new;\n $model->image = $file;\n $model->image->saveAs('uploads/'.$imagename.'.'.$model->image->extension);\n $model->image = $imagename.'.'.$model->image->extension;\n }else{\n $model->image ='';\n }\n $newtime = strtotime($model->time);\n $model->time= $newtime;\n $model->created_at = $new;\n $model->updated_at = $new;\n $model->save();\n $channel_id = $model['channel_id'];\n if(isset($request['Tbltags']) && !empty($request['Tbltags'])){\n $tagId = $request['Tbltags']['tag_id'];\n foreach($tagId as $tag){\n $modelChanneltags = new Tblchanneltags();\n $modelChanneltags->channel_id = $channel_id;\n $modelChanneltags->tag_id = $tag; \n $modelChanneltags->created_at = time();\n $modelChanneltags->updated_at = time(); \n $modelChanneltags->save(); \n }\n }\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'modelusers' => $modelusers,\n 'schedulesArray' => $schedulesArray,\n 'modeltags' => $modeltags,\n ]);\n }", "public static function storeActivity($title = null, $details = null, $url = null)\n {\n $ip = Helpers::getIP();\n $externalIp = Helpers::getExternalIP();\n $useragent = $_SERVER['HTTP_USER_AGENT'];\n $user = Auth::user()->id;\n\n if (null == $url) {\n $url = url()->current();\n }\n\n Activity::create([\n 'ipaddress' => $ip,\n 'externalip' => $externalIp,\n 'useragent' => $useragent,\n 'url' => $url,\n 'title' => $title,\n 'details' => $details,\n 'user_id' => $user,\n 'is_read' => false,\n ]);\n }", "public function create()\n {\n return view(\"ContentManager::user.create\",['model' => \"\"]);\n }", "public function activityAction() {\n\tif($this->_getParam('id',false)){\n\t$activities = new PrimaryActivities();\n\t$this->view->activities = $activities->getActivityDetails($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function actionCreate()\n {\n $model = new Banners();\n if(!empty(Yii::$app->request->post())) {\n $postData = Yii::$app->request->post();\n if(!empty($_FILES['Banners']['name']['image'])) {\n $postData['Banners']['image'] = $this->uploadFiles($_FILES)['file_path'];\n } else {\n Yii::$app->session->setFlash('error', \"Image should be mandatory\");\n return $this->redirect(['create']);\n }\n if ($model->load($postData) && $model->save()) {\n return $this->redirect(['index']);\n } \n }\n \n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "function create_new() {\n if($this->table_title != '' ) {\n $this->title = 'New ' . $this->table_title .\n $this->makeForm();\n }\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 actionCreate()\n {\n $model = new User();\n\n $profile = new UserProfile();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $userProfile = Yii::$app->request->post('UserProfile');\n $profile->user_id = $model->id;\n $profile->phone = $userProfile['phone'];\n $profile->firstname = $userProfile['firstname'];\n $profile->lastname = $userProfile['lastname'];\n $profile->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'profile' => $profile,\n ]);\n }", "public function createFromPost($info)\n\t{\n\t\t//task info\n\t\tif (isset($_SESSION['userid'])) $this->userid = $_SESSION['userid'];\n\t\t\n\t\tif (isset($info['title'])) $this->title = $info['title'];\n\t\t\n\t\tif (isset($info['description'])) $this->description = $info['description'];\n\t\t\n\t\tif (isset($info['content'])) $this->content = $info['content'];\n\t\t\n\t\tif (isset($info['location'])) $this->location = $info['location'];\n\t\t\n\t\tif (isset($info['price'])) $this->price = $info['price'];\n\t\t\n\t\t//metadata\n\t\tif (isset($info['category'])) $this->category = $info['category'];\n\t\t\n\t\tif (isset($info['tags'])) $this->tags = $info['tags'];\n\t\t\n\t\tif (isset($info['numimg'])) $this->numimg = $info['numimg'];\n\t\t\n\t\tif (isset($info['enddatetime'])) $this->enddatetime = $info['enddatetime'];\n\t}", "public function actionCreate()\n {\n $model = new Items([\n 'scenario' => 'create',\n ]);\n $model->image = \"\";\n $model->deleted = Items::NOT_DELETED;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) \n {\t\t\n // Upload Image and Thumb if is not Null\n $imagepath = Yii::getAlias('@webroot').\"/\".Yii::$app->controller->module->imagepath;\n $thumbpath = Yii::getAlias('@webroot').\"/\".Yii::$app->controller->module->thumbpath;\n $imgnametype = Yii::$app->controller->module->imgname;\n $imgname = $model->title;\n\n $file = \\yii\\web\\UploadedFile::getInstance($model, 'image');\n\n // If is set an image, update it\n if(isset($file))\n {\n if ($file->name != \"\")\n { \n $filename = $this->uploadCatImage($file,$imagepath,$thumbpath,$imgname,$imgnametype);\n $model->image = $filename;\t\n }\n }\n // Save changes\n $model->save();\t\n\n Yii::$app->session->setFlash('success', 'Статья сохранена');\n return $this->redirect([\n 'index'\n ]);\n } else {\n //Yii::$app->session->setFlash('error', 'Модель данных не может быть сохранена');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //\n\n $user_id = Auth::id();\n\n $profileimage = Application::where('user_id', $user_id)->first();\n return view('uploads.create')->with('profileimage',$profileimage);\n }", "public function actionCreate()\n {\n $model = new Posts();\n if ($model->load(Yii::$app->request->Post())){\n $model->imageFile = UploadedFile::getInstance($model, 'imageFile');\n if ($model->upload()) {\n $model->imageFile = null;\n if ($model->save(false)) {\n return $this->redirect(['view', 'id' => $model->id]);\n } \n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_presenca/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_presenca.create')\n;\n\t}", "public function actionCreate()\n {\n $model = new AplikasiItday();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $name = Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s'));\n $structure = '../../file/'.$name;\n\n // To create the nested structure, the $recursive parameter \n // to mkdir() must be specified.\n\n if (!mkdir($structure, 0777, true)) {\n die('Failed to create folders...');\n }else{\n $model->folder = $structure;\n }\n\n $img = UploadedFile::getInstance($model, 'poster');\n if (!empty($img)) {\n if(is_object($img))\n {\n \n $model->poster = Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s'));//Formats a date, time or datetime in a float number as UNIX timestamp (seconds since 01-01-1970).\n \n $model->poster .='.'.$img->extension;\n\n $path = $structure.\"/\".$model->poster; //represent file paths or URLs // @app: Your application root directory\n $img->saveAs($path, false);\n }\n }\n\n $video = UploadedFile::getInstance($model, 'video');\n if (!empty($video)) {\n if(is_object($video))\n {\n $model->video .= Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s'));\n $model->video .='.'.$video->extension;\n\n $path = $structure.\"/\".$model->video;\n $video->saveAs($path, false);\n } \n }\n\n $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 createFilmAction()\n {\n // Get entity Manager\n $em = $this->get('doctrine')->getManager();\n\n //Create new Film\n $film = new Film();\n \n // Retrive category\n $category = $em->getRepository('VideotechBundle:Category')\n ->find($_POST['categorySelecter']);\n\n // Set main info\n $film->setTitle($_POST['title']);\n\t$film->setDescription($_POST['description']);\n $film->setCategory($category);\n\n // Upload file\n if (is_uploaded_file($_FILES['image']['tmp_name'])) {\n\n\t $image = new UploadedFile($_FILES['image']['tmp_name'], $_FILES['image']['name']);\n $film->setImageFile($image);\n\t $film->setImageName($_FILES['image']['name']);\n\t $film->setImageSize(filesize($_FILES['image']['tmp_name']));\n }\n\n\n // alert doctrine to follow this object\n $em->persist($film);\n\n // Execute pending DB operations\n $em->flush();\n\n\t//Sending email to admin\n\n\t$this->sendEmailToAdmin($film, \"création\");\n\n\n // redirect to the survey list route\n return $this->redirectToRoute('videotech_homepage');\n }", "public function actionCreate()\n {\n $model = new Tokodepan();\n $user = Yii::$app->user->identity->id;\n $user_id = User::findOne($user);\n $cari = Toko::find()->orderBy(['TOKO_ID'=>SORT_DESC])->limit(1)->one();\n $t_id = $cari->TOKO_ID;\n $pecah = substr($t_id, 4);\n $konvert = intval($pecah) + 1 ; \n $kode = 'TOKO'.$konvert;\n if ($model->load(Yii::$app->request->post())) {\n $upload = UploadedFile::getInstance($model,'TOKO_FOTO'); \n //$toko = Toko::findOne($id);\n if ($upload == NULL) { \n $model->TOKO_ID = $kode;\n $model->ID = $user;\n $model->TOKO_STATUS = 10;\n //$model->TOKO_FOTO = $toko->TOKO_FOTO;\n $model->save();\n\n }else{\n $imageName = $kode; \n $model->TOKO_ID = $kode;\n $model->ID = $user;\n $model->TOKO_STATUS = 10;\n $model->TOKO_FOTO = UploadedFile::getInstance($model,'TOKO_FOTO');\n $model->TOKO_FOTO->saveAs('../../frontend/web/toko/'.$imageName.'.'.$model->TOKO_FOTO->extension);\n $model->TOKO_FOTO = $imageName.'.'.$model->TOKO_FOTO->extension;\n $model->save();\n }\n return $this->redirect(['user/index', 'id' => $user_id->ID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'kode' => $kode,\n 'user' => $user,\n ]);\n }\n }", "public function create()\n\t{\n\t\t$submittedPostData = $this->input->post();\n\t\t$submittedPostData['img'] = $_FILES['img']['name'];\n\t\t\n\t\t// Move file to 'uploads' folder\n\t\tmove_uploaded_file($_FILES['img']['tmp_name'], '/Users/Christina/Sites/TCP/assets/uploads/' . $_FILES['img']['name']);\n\t\t\n\t\t// Save the image uploaded and get its' filename\n\t\t// var_dump($this->upload->display_errors());\n\t\t$this->Journeys_model->insert_entry($submittedPostData);\n\t\t$this->load->view('journeys_view');\n\t\tredirect('journeys');\n\t}", "public function actionCreate()\n {\n///\n$nombre=Yii::$app->user->identity->username;\n$connection = \\Yii::$app->db;\n$db = $connection->createCommand(\"INSERT INTO auditoria (id, user, modelo, accion, fechahora) VALUES (NULL, '$nombre', 'PropiedadDet', 'Crear', NOW());\")->execute();\n///\n\n $model = new PropiedadDet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n// return $this->redirect(['view', 'id' => $model->id_propiedad_det]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Blog;\n if (!Yii::app()->params['blog_user_auto'])\n $model->scenario = 'bloguser';\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n $model->publish_date = date(\"m/d/Y H:i:s\");\n if (isset($_POST['Blog'])) {\n $model->attributes = $_POST['Blog'];\n $model->createdon = new CDbExpression('NOW()');\n $model->page_address_identifier = CommonFunctions::getUrlFriendlyString($model->title, $model->tableName(), 0, 'blog_id');\n $model->publish_date = (trim($_POST['Blog']['publish_date']) != '' ? date(Yii::app()->params['mysqlDateTimeFormat'], strtotime($_POST['Blog']['publish_date'])) : '');\n //Start a transaction in case something goes wrong\n if (Yii::app()->params['ajaxFileUpload'])\n $model->image = Yii::app()->user->getState(Yii::app()->params['blogajaxImageVar']);\n $transaction = $model->dbConnection->beginTransaction();\n try {\n //Save the model to the database\n if ($model->save()) {\n /* $fileurl = $model->blogImgBehavior->FileUrl;\n $filename = substr($fileurl,strrpos($fileurl, \"/\")+1);\n CommonFunctions::updateFileField($filename,$model->blog_id,'blog_id','image',$model->tableName()); */\n $file_name = CUploadedFile::getInstance($model, 'image');\n if ($file_name !== null) {\n $fileurl = $model->blogImgBehavior->FileUrl;\n $filemask = substr($fileurl, strrpos($fileurl, \"/\") + 1);\n CommonFunctions::updateFileField($filemask, $model->blog_id, 'blog_id', 'image', $model->tableName(), 'image_name_date', $file_name);\n }\n //update page identifier\n if (substr($model->page_address_identifier, -2) == '-0') {\n CommonFunctions::updatePageAddressField($model->tableName(), \"page_address_identifier\", substr($model->page_address_identifier, 0, strlen($model->page_address_identifier) - 1) . $model->blog_id, 'blog_id', $model->blog_id);\n }\n\n $transaction->commit();\n EUserFlash::setSuccessMessage(CommonFunctions::getText(MSG_RECORD_INSERT_SUCCESS));\n $this->redirect(array('admin'));\n }\n } catch (Exception $e) {\n $transaction->rollback();\n Yii::app()->handleException($e);\n $message = $e->getMessage();\n EUserFlash::setErrorMessage($message);\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new Accident();\n\n $user_id = $_SESSION['user']['id'];\n $user_group = $_SESSION['user']['user_group'];\n\n if ($user_group <= 20) {\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model = Accident::setDates($model);\n\n $model->responsible = $user_id;\n\n if (empty($model->acc_status)) {\n $model->acc_status = 'ОТКРЫТА';\n }\n\n $arChanges = Logs::getChanges($model);\n\n if ($model->save()) {\n\n $file_changes = Files::saveFiles('accident', $model->id, $_FILES);\n if (!empty($file_changes)) $arChanges += $file_changes;\n\n Logs::createLog('ACCIDENT CREATE', $user_id, $arChanges, $model->id);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'getParams' => Yii::$app->request->get(),\n 'user' => $_SESSION['user'],\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'getParams' => Yii::$app->request->get(),\n 'user' => $_SESSION['user'],\n ]);\n }\n }\n }" ]
[ "0.6225597", "0.61761963", "0.60630184", "0.6027381", "0.587341", "0.5873331", "0.5851472", "0.5823526", "0.5807852", "0.5795582", "0.5781162", "0.57804143", "0.5771506", "0.571188", "0.5706706", "0.5690823", "0.5679584", "0.5660068", "0.5653067", "0.56362337", "0.56070554", "0.56061447", "0.5590899", "0.5585103", "0.55796975", "0.5572308", "0.5555037", "0.5531214", "0.5529135", "0.55271137", "0.552349", "0.551789", "0.551789", "0.5517689", "0.55122703", "0.54993194", "0.54839826", "0.5473714", "0.5456617", "0.5448949", "0.5443833", "0.5439967", "0.5430556", "0.5428411", "0.5411292", "0.54078525", "0.539578", "0.53946316", "0.537496", "0.5374933", "0.536717", "0.5361572", "0.53592974", "0.53524446", "0.53337526", "0.53126395", "0.5306652", "0.530508", "0.53048134", "0.5292369", "0.52810824", "0.52772456", "0.52762944", "0.5272039", "0.5267977", "0.5266136", "0.5265844", "0.5246621", "0.5240869", "0.5232095", "0.52315664", "0.5227997", "0.5227582", "0.52271545", "0.52207553", "0.5217454", "0.5211913", "0.5209606", "0.5204451", "0.5202563", "0.52004164", "0.5200344", "0.5196121", "0.51894325", "0.51893294", "0.51865286", "0.51860327", "0.5185175", "0.51814604", "0.5179309", "0.51777613", "0.5176831", "0.5170591", "0.51573247", "0.51559395", "0.5154217", "0.5137191", "0.5130825", "0.51301223", "0.5126108" ]
0.7001468
0
this action updates user activity by activity_id title is mandatory field photo is optional field
public function updateUserActivityAction() { /** @var Object_Activity $activity */ $data = $this->getRequestData(); if (isset($data['activity_id'])) { $activity = Object_Activity::getById($data['activity_id']); if (!$activity) { $this->setErrorResponse('no Activity with this activity_id!'); } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) { $this->setErrorResponse('you have no rights to change this Activity!'); } else { if (isset($data['title'])) { $activity->setTitle($data['title']); } if (isset($data['photo'])) { $activity->setPhoto(Asset_Image::getById($data['photo'])); } if (!$activity->save()) { $this->setErrorResponse('cannot update Activity object'); } } } else { $this->setErrorResponse('activity_id is mandatory field for this request!'); } $this->_helper->json($activity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_activity($pid) {\n $a_name = $_POST['activity_name'];\n $a_destination = $_POST['activity_destination'];\n $a_caption = $_POST['caption'];\n $a_meta_title = $_POST['meta_title'];\n $a_meta_keywords = $_POST['meta_keywords'];\n $a_meta_description = $_POST['meta_description'];\n $a_description = $_POST['data'];\n $a_image = $this->upload_activity_image();\n $a_publish = $_POST['publish'];\n if (empty($a_image)) {\n $sql = \"UPDATE activity SET activity_name='$a_name',destination_id='$a_destination',caption='$a_caption',meta_title='$a_meta_title',meta_keywords='$a_meta_keywords',meta_description='$a_meta_description',description='$a_description',publish='$a_publish' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n } else {\n $sql = \"UPDATE activity SET activity_name='$a_name',destination_id='$a_destination',caption='$a_caption',meta_title='$a_meta_title',meta_keywords='$a_meta_keywords',meta_description='$a_meta_description',description='$a_description',image= '$a_image',publish='$a_publish' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n }\n\n\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo \"<script type='text/javascript'>alert('Activity updated successfully')</script>\";\n }\n }", "public function update($activity) {\r\n\t\t$stmt = $this->db->prepare(\"UPDATE activities SET nombre=?, descripcion=?, dia=?, hora_inicio=?, hora_fin=?, plazas=?, entrenador=? WHERE id=?\");\r\n\t\t$stmt->execute(array($activity->getNombre(), $activity->getDescripcion(), $activity->getDia(), $activity->getHoraInicio(), $activity->getHoraFin(), $activity->getPlazas(), $activity->getEntrenador(), $activity->getId()));\r\n\t}", "public function update(Request $request, Activity $activity)\n {\n /*\n UPDATING THE activity\n */\n\n $activity->title = $request->title;\n $activity->description = $request->description;\n $activity->save();\n\n /*\n UPDATING THE image(s)\n */\n if($request->image_url[0] != null)\n {\n //Delete all the images.\n $oldImages = ActivityImage::where('activity_id', $activity->id)->get()->all();\n foreach($oldImages as $oldImage)\n {\n $oldImage->delete();\n }\n\n //Create the new images and delete the temporary files.\n $counter = 1;\n $activityImagesFolderPath = 'app\\\\tmp\\\\activityImages\\\\' . '\\\\';\n\n foreach ($request->image_url as $image_url) {\n $activityImage = new activityImage();\n $activityImage->activity_id = $activity->id;\n $activityImage->title = $request->title . '_img' . $counter;\n $activityImage->image_url = $image_url;\n $activityImage->save();\n\n $counter++;\n\n //Deleting the temporary files\n File::delete(storage_path($activityImagesFolderPath . $image_url));\n }\n }\n\n return redirect('/admin/activities')->with('status', 'Book edited successfully!');\n }", "function updateactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $activity_id = $this->input->post('activityid');\n $name = $this->input->post('name');\n $multiplicity = $this->input->post('multiplicity');\n $severity = $this->input->post('severity');\n $unit = $this->input->post('unit');\n $desc = $this->input->post('desc');\n $status = $this->m_activities->update($activity_id, $wl_id, $name, $multiplicity, $severity, $unit, $desc);\n $this->activities();\n }", "public function edit() {\n if (!isset($_REQUEST[\"idactivity\"])) {\n throw new Exception(\"A activity id is mandatory\");\n }\n\n if (!isset($this->currentUser)) {\n throw new Exception(\"Not in session. Editing activitys requires login\");\n }\n\n // Get the activity object from the database\n $idactivity = $_REQUEST[\"idactivity\"];\n $activity = $this->activityMapper->findById($idactivity);\n $trainers = $this->userMapper->findAllTrainers();\n $places = $this->resourceMapper->findAllPlaces();\n // Does the activity exist?\n if ($activity == NULL) {\n throw new Exception(\"no such activity with id: \".$idactivity);\n }\n\n if (isset($_POST[\"submit\"])) { // reaching via HTTP Post...\n $i = 0;\n //load images in server folder\n $dir_load = 'resources/images/';\n\n // populate the activity object with data form the form\n $activity->setIduser($_POST[\"id_user\"]);\n $activity->setName($_POST[\"name\"]);\n $activity->setDescription($_POST[\"description\"]);\n $activity->setType($_POST[\"type\"]);\n $activity->setPlace($_POST[\"place\"]);\n $activity->setSeats($_POST[\"seats\"]);\n\n // Si no se edita mantiene las imágenes actuales.\n if($_FILES['images']['name'][0] == \"\"){\n $activity->setImage($activity->getImage());\n }// Sube las nuevas imágenes.\n elseif(count($_FILES['images']['name']) > 0){\n $images = array();\n $tmp = array();\n for($i=0; $i<count($_FILES['images']['name']); $i++) {\n $tmpFilePath = $_FILES['images']['tmp_name'][$i];\n if($tmpFilePath != \"\"){\n $filePath = $dir_load . date('d-m-Y-H-i-s').'-'.$_FILES['images']['name'][$i];\n array_push($images,$filePath);\n array_push($tmp,$tmpFilePath);\n }\n }\n $img = json_decode($activity->getImage());\n for($i=0; $i<count($img); $i++) {\n unlink($img[$i]);\n }\n $activity->setImage(json_encode($images));\n\n } else {\n $activity->setImage(NULL);\n }\n\n try {\n // validate Post object\n $activity->checkIsValidForUpdate(); // if it fails, ValidationException\n\n // update the Post object in the database\n $this->activityMapper->update($activity);\n\n if(count($_FILES['images']['name']) > 0){\n $files = json_decode($activity->getImage());\n for($i=0; $i<count($files); $i++) {\n move_uploaded_file($tmp[$i], $files[$i]);\n }\n }\n // POST-REDIRECT-GET\n // Everything OK, we will redirect the user to the list of posts\n // perform the redirection. More or less:\n // header(\"Location: index.php?controller=posts&action=index\")\n // die();\n $this->view->setFlash(sprintf(i18n(\"Activity successfully updated.\")));\n $this->view->redirect(\"activities\", \"index\");\n\n }catch(ValidationException $ex) {\n // Get the errors array inside the exepction...\n $errors = $ex->getErrors();\n // And put it to the view as \"errors\" variable\n $this->view->setVariable(\"errors\", $errors);\n }\n }\n\n // Put the Post object visible to the view\n $this->view->setVariable(\"activity\", $activity);\n $this->view->setVariable(\"places\", $places);\n $this->view->setVariable(\"trainers\", $trainers);\n\n // render the view (/view/activitys/add.php)\n if (isset($this->currentUser) && $this->currentUser->getUser_type() == usertype::Administrator){\n $this->view->render(\"activities\", \"edit\");\n }\n }", "public function update(Request $request ,$ac)\n {\n \n $activity = Activity::find($ac);\n $activity->name = $request->name;\n $activity->description = $request->description;\n $activity->image= $request->image;\n $activity->post_by = $request->post_by;\n \n $activity->save;\n return redirect('/data')->with('success_message','edit berhasil');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required|max:255',\n 'pic' => 'image',\n 'type' => 'required',\n 'sticker' => 'required|numeric',\n 'date' => 'required'\n ]);\n\n $activity = Event::findOrFail($id);\n $choose_year = Year::where('choose', 1)->first();\n\n $pic = $request->pic;\n if(($pic)!=null){\n $pic = time().$pic->getClientOriginalName();\n $pic->move('uploads/activity', $pic);\n $pic = 'uploads/activity/'.$pic;\n $activity->pic = $pic;\n }\n\n $activity->years_id = $choose_year->id;\n $activity->name = $request->name;\n $activity->event_types_id= $request->type;\n $activity->sticker = $request->sticker;\n $activity->date = $request->date;\n $activity-> update();\n\n\n\n Session::flash('success', \"You successfully created a new item .\");\n\n return redirect()->route('activities.index');\n }", "public function updated(Activity $activity)\n {\n //\n }", "public function update(UpdateActivityRequest $request, int $id): RedirectResponse\n {\n $this->authorize('update-activity');\n $activity_type = \\App\\Models\\ActivityType::findOrFail($request->input('activity_type_id'));\n $activity = \\App\\Models\\Activity::findOrFail($id);\n\n $activity->activity_date_time = $request->input('activity_date_time');\n $activity->activity_type_id = $request->input('activity_type_id');\n $activity->subject = $request->input('subject');\n $activity->details = $request->input('details');\n $activity->medium_id = $request->input('medium_id');\n $activity->status_id = $request->input('status_id');\n $activity->duration = $request->input('duration');\n $activity->priority_id = $request->input('priority_id');\n $activity->location = $request->input('location');\n // $activity->phone_number = $request->input('phone_number');\n $activity->save();\n\n $activity_target = \\App\\Models\\ActivityContact::whereActivityId($id)->whereRecordTypeId(config('polanco.activity_contacts_type.target'))->firstOrFail();\n $activity_target->contact_id = $request->input('target_id');\n $activity_target->save();\n\n $activity_source = \\App\\Models\\ActivityContact::whereActivityId($id)->whereRecordTypeId(config('polanco.activity_contacts_type.creator'))->firstOrFail();\n $activity_source->contact_id = $request->input('assignee_id');\n $activity_source->save();\n\n $activity_assignee = \\App\\Models\\ActivityContact::whereActivityId($id)->whereRecordTypeId(config('polanco.activity_contacts_type.assignee'))->firstOrFail();\n $activity_assignee->contact_id = $request->input('creator_id');\n $activity_assignee->save();\n\n return Redirect::action([self::class, 'show'], $id);\n }", "public function update(Request $request, Activity $activity)\n {\n $this->validate($request,\n [\n 'title'=>'required',\n 'start_time'=>'required',\n 'end_time'=>'required',\n 'contents'=>'required',\n ],\n [\n 'title.required'=>'活动标题不能为空',\n 'start_time.required'=>'活动开始时间不能为空',\n 'end_time.required'=>'活动结束时间不能为空',\n 'contents.required'=>'活动内容不能为空',\n ]);\n $start_time = strtotime($request->start_time);\n $end_time = strtotime($request->end_time);\n $activity->update(\n [\n 'title'=>$request->title,\n 'contents'=>$request->contents,\n 'start_time'=>$start_time,\n 'end_time'=>$end_time,\n ]\n );\n session()->flash('success','修改成功');\n return redirect()->route('activities.index');\n }", "public function update(Request $request, $id)\n {\n //\n $activity = Activity::find($id);\n $activity -> title = $request->title;\n $activity -> activity_site = $request->activity_site;\n $activity -> rtime = $request->rtime;\n $activity -> registration_num = $request->registration_num;\n $activity -> attention_num = $request->attention_num;\n $activity -> intro = $request->intro;\n\n if ($request->hasFile('image')) {\n $activity -> image = '/'.$request->image->store('uploads/'.date('Ymd'));\n }\n \n if($activity -> save()){\n return redirect('/activity')->with('success', '编辑成功');\n }else{\n return back()->with('error','编辑失败');\n }\n }", "public function update(StoreActivity $request, Activity $activity)\n {\n $this->authorizeActionOnActivity($request, $activity);\n $validated = $request->validated();\n $activity->fill($validated);\n $activity->save();\n return back()->withSuccess(__('Activity updated successfully.'));\n }", "public function update(Request $request, Activity $activity)\n {\n $request->validate([\n \"name\" => \"required\",\n \"met\" => \"required|numeric\",\n \"carb_ratio\" => \"required|numeric\",\n \"fat_ratio\" => \"required|numeric\",\n ]);\n\n $activity->name = $request->name;\n $activity->met = $request->met;\n $activity->carb_ratio = $request->carb_ratio;\n $activity->fat_ratio = $request->fat_ratio;\n $activity->save();\n\n return redirect(self::ROUTE);\n }", "public function update_activity_to_done($data,$id_activity) {\n\t\t$this->db->set($data);\n\t\t$this->db->where(\"id_activity\",$id_activity);\n\t\t$this->db->update('board_activity');\n\t}", "public function update(Request $request)\n\t{\n\t\t$out['code'] = 0;\n\t\t$out['msg'] = 'ok';\n\t\t$out['data'] = array();\n\t\t//\n\t\t$ormActivity = new OrmActivity();\n\n\t\t$ormActivity = $ormActivity->find($request->input('id'));\n\t\tif (!$ormActivity) {\n\t\t\t$out['code'] = 1;\n\t\t\t$out['msg'] = '不存在';\n\t\t\treturn $out;\n\t\t}\n\t\tif ($request->input('cover_img')) {\n\t\t\t$ormActivity->cover_img = $request->input('cover_img');\n\t\t}\n\t\tif ($request->input('title')) {\n\t\t\t$ormActivity->title = $request->input('title');\n\t\t}\n\n\t\tif ($request->input('people_count')) {\n\t\t\t$ormActivity->people_count = $request->input('people_count');\n\t\t}\n\n\t\tif ($request->input('postion')) {\n\t\t\t$ormActivity->postion = $request->input('postion');\n\t\t}\n\n\t\tif ($request->input('start_time')) {\n\t\t\t$ormActivity->start_time = $request->input('start_time');\n\t\t}\n\n\t\tif ($request->input('cost')) {\n\t\t\t$ormActivity->cost = $request->input('cost');\n\t\t}\n\n\t\tif ($request->input('apply_start_time')) {\n\t\t\t$ormActivity->apply_start_time = $request->input('apply_start_time');\n\t\t}\n\n\t\tif ($request->input('apply_end_time')) {\n\t\t\t$ormActivity->apply_end_time = $request->input('apply_end_time');\n\t\t}\n\n\t\tif ($request->input('end_time')) {\n\t\t\t$ormActivity->end_time = $request->input('end_time');\n\t\t}\n\n\t\tif ($request->input('apply_type')) {\n\t\t\t$ormActivity->apply_type = $request->input('apply_type');\n\t\t}\n\n\t\tif ($request->input('min_male_count')) {\n\t\t\t$ormActivity->min_male_count = $request->input('min_male_count');\n\t\t}\n\n\t\tif ($request->input('min_female_count')) {\n\t\t\t$ormActivity->min_female_count = $request->input('min_female_count');\n\t\t}\n\n\t\tif ($request->input('introduction')) {\n\t\t\t$ormActivity->introduction = $request->input('introduction');\n\t\t}\n\n\t\tif ($request->input('rule')) {\n\t\t\t$ormActivity->rule = $request->input('rule');\n\t\t}\n\n\t\tif ($request->input('reward')) {\n\t\t\t$ormActivity->reward = $request->input('reward');\n\t\t}\n\n\t\tif ($request->input('points')) {\n\t\t\t$ormActivity->points = $request->input('points');\n\t\t}\n\n\t\tif ($request->input('link_man')) {\n\t\t\t$ormActivity->link_man = $request->input('link_man');\n\t\t}\n\n\t\tif ($request->input('link_mail')) {\n\t\t\t$ormActivity->link_mail = $request->input('link_mail');\n\t\t}\n\n\t\tif ($request->input('link_phone')) {\n\t\t\t$ormActivity->link_phone = $request->input('link_phone');\n\t\t}\n\n\t\tif ($request->input('link_qq')) {\n\t\t\t$ormActivity->link_qq = $request->input('link_qq');\n\t\t}\n\n\t\t$ormActivity->save();\n\n\t\treturn $out;\n\t}", "public function editActivity(Request $request) {\n $validator = Validator::make($request->all(), [\n 'id' => 'required',\n 'title' => 'required|string|max:120',\n 'description' => 'required|string|max:1000',\n 'start_date' => 'required',\n 'end_date' => 'required',\n 'skills' => 'required',\n 'participants' => 'required',\n ]);\n\n if($validator->fails()){\n return response()->json($validator->errors()->toJson(), 400);\n }\n\n try {\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n } else {\n // ONLY EXPERT USER CAN EDIT ACTIVITY\n if (!parent::checkAccess($user->profile_id, 'expert')) {\n return response()->json(['Only EXPERT user can update activity'], 422);\n }\n $activity = Activity::find($request->get('id'));\n $activity->title = $request->get('title');\n $activity->user_id = $user->id;\n $activity->description = $request->get('description');\n $activity->start_date = $request->get('start_date');\n $activity->end_date = $request->get('end_date');\n $activity->skills = json_encode($request->get('skills'));\n $activity->participants = json_encode($request->get('participants'));\n if($activity->save()) {\n return response()->json([\n 'message' => 'Update success',\n 'status' => 'OK'\n ], 200);\n } else {\n return response()->json([\n 'message' => 'Update failed',\n 'status' => 'ERROR'\n ], 422);\n }\n }\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n }", "public function update($id, $name, $email, $avatar);", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $modelFoto = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n\n $foto = UploadedFile::getInstance($model,'use_foto');\n\n if ($foto == ''){\n $model->use_foto = $modelFoto->use_foto;\n }else{\n\n if($modelFoto->use_foto != 'usuario_anonimo.jpg'){\n unlink('img/user/'.$modelFoto->use_foto);\n }\n\n $modelFoto = User::find()->count();\n $foto->saveAs('img/user/'. $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension);\n $model->use_foto = $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension;\n\n }\n\n if($model->rol_id != 2){\n $model ->use_estado = 1;\n //Aqui va codigo borrar el perfil del investigador\n $investigador = new Investigador();\n if($investigador->find()->where(['usu_id'=>$model->id])->count() != 0 ){\n $investigador->find()->where(['usu_id'=>$model->id])->one()->delete();\n }\n\n }\n\n $model -> use_fechaAudit = date('y-m-d H:i:s');\n $model -> use_accion = 'M';\n\n if($model->signup()){\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Registro modificado!</h4>\n El registro se modificó correctamente.\n </div>\n ');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id) {\n //redirect a user if not super admin\n $site_url = Yii::$app->params['yii_url'];\n $upload_url = \"\";\n if($site_url == \"http://dev.digitalvidya.com/assist\") {\n $upload_url - $site_url.\"/uploads/user_image/\";\n } else {\n $upload_url = $site_url . \"/uploads/\";\n }\n if (!Yii::$app->CustomComponents->check_permission('edit_user')){ \n return $this->redirect(['index']);\n }\n $model = DvUsers::find()->where([\"id\"=>$id])->one();\n if (!empty($model->course)) {\n $model->course = explode(',', $model->course);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n if (!empty($model->course)) {\n unset($model->course);\n $model->course = implode(\",\", $_POST['DvUsers']['course']);\n }\n\n if (isset($_POST['usermeta']['day_avail'])) {\n $day_avail = $_POST['usermeta']['day_avail'];\n }\n\n if (!empty($day_avail)) {\n $day_avail = implode(\",\", $_POST['usermeta']['day_avail']);\n }\n\n $model->picture = UploadedFile::getInstance($model, 'picture');\n\n if (!empty($model->picture->baseName)) {\n $model->picture->saveAs('uploads/user_image/img_'.$id.'.'.$model->picture->extension);\n $model->picture = 'img_' . $id . '.' . $model->picture->extension;\n } else { \n unset($model->picture);\n }\n\n //encript pass before save\n $password = $_POST['DvUsers']['password']; \n if (!empty($password)) {\n $model->password = md5($model->password); \n } else {\n unset($model->password);\n }\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($model); die;\n\t\t\tif($_POST['usermeta']['role'] == 4 || $_POST['usermeta']['role'] == 5){\n\t\t\t\t$email = $model->email;\n\t\t\t\t$phone = $_POST['usermeta']['phone'];\n\t\t\t\t$fname = $_POST['DvUsers']['first_name'];\n\t\t\t\t$lname = $_POST['DvUsers']['last_name'];\n\t\t\t\t$fb_link = $_POST['usermeta']['fb_link'];\n\t\t\t\t$linkedin_link = $_POST['usermeta']['linkedin_link'];\n\t\t\t\t$twitter_link = $_POST['usermeta']['twitter_link'];\n\t\t\t\t//$profile_visibility = $_POST['usermeta']['profile_visibility'];\n\t\t\t\tif(isset($_POST['usermeta']['description'])){\n\t\t\t\t\t$desc = $_POST['usermeta']['description'];\n\t\t\t\t}else{\n\t\t\t\t\t$desc = \"\";\n\t\t\t\t}\n\t\t\t\tif($_POST['usermeta']['role'] == 4){\n\t\t\t\t\t$usre_role = 1;\n\t\t\t\t\t$profile_visibility = $_POST['usermeta']['profile_visibility'];\n\t\t\t\t}else{\n\t\t\t\t\t$usre_role = 2;\n\t\t\t\t\t$profile_visibility = 1;\n\t\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t\t // ***************** Start of curl ************************\n\t\t\t \n\t\t\t\t$curl = curl_init();\n\t\t\t\t// Set some options - we are passing in a useragent too here\n\t\t\t\tcurl_setopt_array($curl, [\n\t\t\t\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\t\t\t\tCURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n\t\t\t\t\tCURLOPT_USERAGENT => 'Get course data',\n\t\t\t\t\tCURLOPT_POST => 1,\n\t\t\t\t\tCURLOPT_POSTFIELDS => [\n\t\t\t\t\t\t\n\t\t\t\t\t\t'ta_email' => $email,\n\t\t\t\t\t\t'tm_fname' => $fname,\n\t\t\t\t\t\t'tm_lname' => $lname,\n\t\t\t\t\t\t'tm_phone' => $phone,\n\t\t\t\t\t\t'tm_facebook' => $fb_link,\n\t\t\t\t\t\t'tm_linkedin' => $linkedin_link,\n\t\t\t\t\t\t'tm_twitter' => $twitter_link,\n\t\t\t\t\t\t'tm_description' => $desc,\n\t\t\t\t\t\t'tm_image_url' => $upload_url.'img_'.$id.'.jpg',\n\t\t\t\t\t\t'tm_image_name' => 'img_'.$id.'.jpg',\n 'profile_visibility' => $profile_visibility,\n\t\t\t\t\t\t'user_role' => $usre_role\n\n\t\t\t\t\t]\n\t\t\t\t]);\n\t\t\t\t// Send the request & save response to $resp\n\t\t\t\t$resp = curl_exec($curl);\n\t\t\t\t// Close request to clear up some resources\n\t\t\t\t$resulst = json_decode($resp,true);\n\t\t\t\tcurl_close($curl);\n\t\t\t\t//echo \"<pre>\";\n\t\t\t\t//print_r($resulst); die;\n\t\t\t}\n\t\t\t\n $usermeta = $_POST['usermeta'];\n unset($usermeta['day_avail']);\n\n foreach ($usermeta as $key => $val) {\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$val' WHERE meta_key = '$key' AND uid = '$model->id' \")->execute();\n }\n\n if (isset($_POST['usermeta']['role'])) {\n \t$user_usermeta = $_POST['usermeta']['role'];\n\t if($user_usermeta == '6'){\n\t Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '' WHERE meta_key = 'team' AND uid = '$model->id' \")->execute();\n\t }\n } \n\n if (!empty($day_avail)) {\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$day_avail' WHERE meta_key = 'day_avail' AND uid = '$model->id' \")->execute();\n }\n unset($model->email);\n $model->save(false);\n Yii::$app->session->setFlash('success', 'Profile Updated successfully.');\n if (Yii::$app->CustomComponents->check_permission('all_users')) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $user_id = Yii::$app->getUser()->identity->id;\n return $this->redirect(['view', 'id' => $user_id]);\n }\n } else {\n return $this->render('update', [ 'model' => $model]);\n }\n }", "public function getUserActivityByIdAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if(isset($data['getoperations']) && $activity){\n $operation = new Workapp_Activity();\n $activity->operations = $operation->getActivityRequiredByOperations($activity);\n }\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('no Activity for this user with current activity_id!');\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function putActivity($id, $params)\n {\n $res = $this->db->put_attributes($this->domainActivity, $id, $params);\n $this->logErrors($res);\n return $res->isOK();\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n /** @var EntityForm $EntityForm */\n $EntityForm = new EntityForm(new ActivityDirection());\n\n $model->tags=explode(\", \", $model->tags);\n $img=$model->logo;\n /** Init Activities for Company using relation **/\n $model->activities_ids = $model->activities;\n\n if ($model->load(Yii::$app->request->post())) {\n /** Save activities directions mapping **/\n if ($model->activities_ids) {\n $model->setRelated('activities', $model->activities_ids, true);\n }\n if(UploadedFile::getInstance($model, 'logo'))\n {\n $model->logo=UploadedFile::getInstance($model, 'logo');\n $model->logo->saveAs('../../frontend/web/mt/img/'.$model->logo->baseName.\".\".$model->logo->extension);\n $model->logo=$model->logo->baseName.\".\".$model->logo->extension; \n }\n else\n $model->logo=$img;\n \n if($model->tags)\n $model->tags = implode(\", \", $model->tags);\n \n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'entityForm' => $EntityForm\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n $user = User::find($id);\n if ($request['status'] == 1) {\n $user->name \t = $request['name'];\n $user->user_lname \t = $request['lname'];\n $user->user_status \t = 1;\n $user->user_phone \t = $request['phone'];\n $user->email \t = $request['email'];\n if ($request->password != null) {\n $user->password \t = Hash::make($request->password);\n }\n if ($request->file('profile') != null) {\n $imgprofile = $request->file('profile');\n foreach($imgprofile as $key => $item) {\n if ($user->user_img != 'nopic.png') {\n unlink('local/storage/app/userprofile/'.$user->user_img);\n }\n $name = rand().time().'.'.$item->getClientOriginalExtension();\n $item->storeAs('userprofile', $name);\n $user->user_img = $name;\n }\n }\n $user->save();\n\n // Activity Log\n $log = new activitylog();\n $log->log_user_id = Auth::user()->user_id;\n $log->log_description = \"Updated Account\";\n $log->log_url = URL::full();\n $log->log_sitemap_id = 1;\n $log->log_activeon_id = $id;\n $log->save();\n }\n if ($user->save()) {\n return back()->withSuccess('New Account Has Been Saved!');\n } else {\n return back()->withError('Something Wrong. New Account Can Not Saved!');\n }\n }", "public function updateFacebook($id, $name, $email, $avatar, $profile);", "public function update(Request $request, $id)\n {\n $user = JWTAuth::parseToken()->authenticate();\n $record = $this->albumRepository->find($id);\n $createActivity = false;\n\n if (Gate::forUser($user)->allows('albums-update', $record)) {\n\n //validate\n $validator = Validator::make($request->all(), $this->validations);\n\n if ($validator->fails()) {\n return response()->json([\n 'success'=> false,\n 'errors' => $validator->errors()->all()\n ],400);\n }\n\n // Anything else other than 1 should be false\n if ($request->published != 'true') {\n $record->published = false;\n }\n\n //updata data\n if (!$record->published && $request->published == 'true') {\n $record->published = true;\n $record->created_at = date('Y-m-d H:i:s');\n $createActivity = true;\n }\n\n $record->fill($request->all());\n\n $record->save();\n $songs = $this->albumRepository->findSongs($record);\n\n $album = $this->prepareAlbumData($record, $songs);\n\n if($request->hasFile('image')){\n //delete old file if already exist\n //we only need one at the time\n if($record->image){\n try {\n $record->image->delete();\n } catch(\\Exception $error) {}\n }\n\n $image = $request->file('image');\n\n // Make sure to upload the image to the author's folder\n $author = $user;\n if ($record->user_id != $author->id) {\n $author = $record->author;\n }\n\n $img = $this->createImage($author, $record, $image);\n\n $album['image'] = $this->getFileURL((Object)[\n 'file_id' => $img->id,\n 'name' => $img->name,\n 'path' => $img->path,\n 'public' => true,\n ]);\n }\n\n if($createActivity){\n $activity = new Activity();\n $activity->fill([\n 'action' => 'published-album',\n 'user_id' => $record->user_id,\n 'reference_type' => 'App\\\\Album',\n 'reference_id' => $record->id\n ]);\n $activity->save();\n }\n\n return response()->json([\n 'success' => true,\n 'album' => $album,\n 'message' => 'Album successfully updated'\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied, you can't update this album\"]\n ],403);\n }\n }", "public function update($item_uuid, $activity_uuid)\n {\n $item = Item::where('uuid' ,'=', $item_uuid)->first();\n if(empty($item)) return Response::json([], 404);\n if( ! $this->has_access( $item->collection->project_id ) ) return Response::json([], 401);\n\n $activity = Activity::where('uuid', '=', $activity_uuid)->first();\n $input = ['description' => Input::get('description')];\n\n $activity->update($input);\n $activity = Activity::where('uuid', '=', $activity->uuid)->with('ActivityType', 'User')->first();\n return Response::json($activity, 200);\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "function updateUserController(){\n\t\t\t$this->load->model('User_model');\n\t\t\t$id = $_POST[\"id\"];\n\t\t\t$title = $_POST[\"title\"]; \n\t\t\t$city = $_POST[\"city\"]; \n\t\t\t$country = $_POST[\"country\"];\n\t\t\t$phone = $_POST[\"phone\"];\n\t\t\t$bio = $_POST[\"bio\"];\n\t\t\t$interest = $_POST[\"interest\"];\n\t\t\tif($this->User_model->updateUserModel($id,$title,$city,$country,$phone,$bio,$interest)){\n\t\t\t \t$this->userTimeline($id, 'Bio', 'You updated your Bio and Interests', '');\n\t\t\t\techo 'added';\n\t\t\t}else{\n\t\t\t\techo 'Failed';\n\t\t\t}\n\t\t\t \n\t\t}", "function uploadImageOnTimeline($image)\n{\n global $db;\n $command = \"UPDATE `user_accounts` SET `profilePicture` = ? WHERE `id` = ?\";\n $stmt = $db->prepare($command);\n return $stmt->execute(array($image, $id));\n}", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "private function updateUser () {\n $sql = \"UPDATE users SET avatar = :avatar,\n biography = :biography,\n birthdate = :birthdate,\n email = :email,\n nickname = :nickname,\n location = :location,\n password = :password,\n activated = :activated,\n phone = :phone,\n username = :username,\n website = :website WHERE id_user = :id_user\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':avatar', $this->avatar);\n $query->bindParam(':biography', $this->biography);\n $query->bindParam(':birthdate', $this->birthdate);\n $query->bindParam(':email', $this->email);\n $query->bindParam(':nickname', $this->nickname);\n $query->bindParam(':location', $this->location);\n $query->bindParam(':password', $this->password);\n $query->bindParam(':phone', $this->phone);\n $query->bindParam(':username', $this->username);\n $query->bindParam(':website',$this->website);\n $query->bindParam(':activated',$this->activated);\n $query->bindParam(':id_user',$_SESSION['auth']['id_user']);\n $query->execute();\n }", "public function updateLastActivity($userId = null, $field = 'last_action') {\n\t\tif (!empty($userId)) {\n\t\t\t$this->id = $userId;\n\t\t}\n\t\tif ($this->exists()) {\n\t\t\treturn $this->saveField($field, date('Y-m-d H:i:s', time()));\n\t\t}\n\t\treturn false;\n\t}", "public function updateActById(){\n\t\ttry {\n $stmt=$this->db()->prepare(\"UPDATE trabajador set \n activo=:activo, fecha_baja=:fecha_baja WHERE nif=:nif\");\n\t\t\t$stmt->bindValue(':nif', $this->nif);\n $stmt->bindValue(':activo', $this->activo);\n\t\t\t$stmt->bindValue(':fecha_baja', $this->fecha_baja);\n $_SESSION['errMsg']['error'] = \"Usuario dado de baja\";\n\t\t\t$_SESSION['errMsg']['color']= \"alert-success\";\n\t\t\t$stmt->execute();\n\t\t} catch(PDOException $e) {\n $_SESSION['errMsg']['error'] = \"No se ha podido dar de baja el usuario\";\n\t\t\t$_SESSION['errMsg']['color']= \"alert-danger\";\n }\n }", "public function update(Request $request, $id)\n {\n //\n try {\n $validator = Validator::make($request->all(), [\n 'activity_name' => 'required|unique:budget_activities,activity_name,'.$id,\n 'amount' => 'required|numeric',\n 'status' => 'required',\n 'currency' => 'required',\n 'donor' => 'required',\n 'provision_limit' => 'required|numeric',\n ]);\n if ($validator->fails()) {\n return Response::json(array(\n 'success' => false,\n 'errors' => $validator->getMessageBag()->toArray()\n ), 400); // 400 being the HTTP code for an invalid request.\n } else {\n $activity = BudgetActivity::find($id);\n $activity->activity_name = strtoupper(strtolower($request->activity_name));\n $activity->description = $request->description;\n $activity->amount = $request->amount;\n $activity->currency = $request->currency;\n $activity->remarks = $request->remarks;\n $activity->provision_limit = $request->provision_limit;\n $activity->donor = $request->donor;\n $activity->status = $request->status;\n $activity->updated_by = Auth::user()->username;\n $activity->save();\n return response()->json([\n 'success' => true,\n 'message' => \"<h3><span class='text-info'><i class='fa fa-info'></i> Record updated</span><h3>\"\n ], 200);\n }\n }\n catch (\\Exception $ex)\n {\n return Response::json(array(\n 'success' => false,\n 'errors' => $ex->getMessage()\n ), 400); // 400 being the HTTP code for an invalid request.\n }\n }", "public function testUpdateChallengeActivity()\n {\n }", "public function actionUpdate($id)\n {\n $uid = Yii::$app->user->identity->ID;\n $a = Toko::find()->where(['ID'=>$uid])->one();\n if($id != $a->TOKO_ID){\n return $this->render('/site/page404');\n }else{\n $model = Toko::findOne($id);\n $user = Yii::$app->user->identity->id;\n $user_id = User::findOne($user);\n if ($model->load(Yii::$app->request->post())) {\n $upload = UploadedFile::getInstance($model,'TOKO_FOTO'); \n $toko = Toko::findOne($id);\n if ($upload == NULL) {\n $model->TOKO_FOTO = $toko->TOKO_FOTO;\n $model->save();\n\n }else{\n try{\n unlink($toko->TOKO_FOTO);\n }catch (\\Exception $e){\n }\n $imageName = $model->TOKO_ID; \n $model->TOKO_FOTO = UploadedFile::getInstance($model,'TOKO_FOTO');\n $model->TOKO_FOTO->saveAs('../../frontend/web/toko/'.$imageName.'.'.$model->TOKO_FOTO->extension);\n $model->TOKO_FOTO = $imageName.'.'.$model->TOKO_FOTO->extension;\n $model->save();\n }\n return $this->redirect(['user/index', 'id' => $user_id->ID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n }", "public function actionUpdateProfile($id)\n {\n Url::remember('', 'actions-redirect');\n $user = $this->findModel($id);\n $profile = $user->profile;\n $path = Yii::$app->params['userimagePath']; \n //$oldimage=Yii::$app->basePath . $path . $profile->user_image;\n \n $username=\\backend\\models\\User::find()->select(\"username\")->where(['id'=>$profile['user_id']])->asArray()->one();\n $user_name=$username['username'];\n \n \n\n if ($profile == null) {\n $profile = Yii::createObject(\\backend\\models\\Profile::className());\n $profile->link('user', $user);\n }\n\n $this->performAjaxValidation($profile);\n \n $request=Yii::$app->request->post();\n \n $session = Yii::$app->session;\n // $userPermission= $session->set('userPermission');\n \n if($request)\n {\n $profile->mobile=$request[\"Profile\"][\"mobile\"];\n $profile->phone=$request[\"Profile\"][\"phone\"];\n $profile->fax=$request[\"Profile\"][\"fax\"];\n $image = \\yii\\web\\UploadedFile::getInstance($profile, 'user_image');\n if (isset($image))\n {\n \n if(in_array($image->extension,[ 'png','jpg','jpeg','bmp','gif']))\n {\n $randstring = uniqid();\n $fullpath = Yii::$app->basePath . $path . $randstring. '.' . $image->extension;\n /* if(isset($profile->user_image) && $profile->user_image!=\"noimage.png\" && file_exists($oldimage))\n {\n unlink($oldimage);\n }*/\n $image->saveAs($fullpath);\n $profile->user_image=$randstring. '.' . $image->extension;\n \n //$session->set(\"user_image\", $profile->user_image);\n }\n else\n {\n $error = \"Invalid File Format\";\n return $this->render('_profile', ['profile' => $profile,'user'=> $user, 'error' => $error]);\n }\n }\n \n }\n \n if ($profile->load(Yii::$app->request->post()) && $profile->save()) {\n \n //var_dump($profile->user_image);die;\n $session = Yii::$app->session; \n $userPermission=json_decode($session->get('userPermission'));\n if($userPermission->user_id==$id)\n {\n $userPermission->user_image=$profile->user_image;\n\n $jsonstring= json_encode($userPermission); \n $session->set('userPermission', $jsonstring);\n \n }\n \n Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Profile details have been updated'));\n\n return $this->refresh();\n \n }\n return $this->render('_profile', [\n 'user' => $user,\n 'profile' => $profile,\n ]);\n }", "public function update()\n {\n\n if ($this->param['uid']) {\n $id = $this->param['uid'];\n unset($this->param['uid']); \n\n } else {\n return msg(100, null, '参数错误');\n }\n // return msg(11100, null, $this);\n $ret = $this->model->updateProfile($id, $this->param); \n if ($ret) {\n return msg(200, null, '更新成功');\n } else {\n return msg(100, null, $this->model->getError());\n }\n // if ($this->param['uid']) {\n\n // $id = $this->param['uid'];\n // unset($this->param['uid']);\n // $file = request()->file('image');\n // if($file){\n // $info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');\n // if($info){\n // // 成功上传后 获取上传信息\n // // 输出 jpg\n // echo $info->getExtension();\n // // 输出 20160820/42a79759f284b767dfcb2a0197904287.jpg\n // echo $info->getSaveName();\n // // 输出 42a79759f284b767dfcb2a0197904287.jpg\n // echo $info->getFilename(); \n // }else{\n // // 上传失败获取错误信息\n // echo $file->getError();\n // }\n // }\n // } else {\n // return msg(100, null, '参数错误');\n // }\n // $ret = $this->model->updateProfile($id, $this->param);\n // if ($ret) {\n // return msg(200, null, '更新成功');\n // } else {\n // return msg(100, null, $this->model->getError());\n // }\n }", "public function actionUpdate($id)\n {\n $model = new SignupAdminuser();\n //$adminuser = new AdminUsers();\n $admininfo = User::find()->where(['id' => $id])->one();\n \n if(!empty($admininfo))\n {\n \t$model->username = $admininfo->username;\n \t$model->email = $admininfo->email;\n \t$model->status = $admininfo->status;\n \t$model->role = $admininfo->role;\n \t$model->id = $admininfo->id;\n \n \t$adminuser = AdminUsers::find()->where(['userId' => $admininfo->id])->one();\n \t\n }\n if(!empty($adminuser))\n {\n \t$model->first_name = $adminuser->first_name;\n \t$model->last_name = $adminuser->last_name;\n \t$model->mobile = $adminuser->mobile;\n \t$model->profileImage = $adminuser->profileImage;\t\n }\n \n \n\n if ($model->load(Yii::$app->request->post()) ) {\n \t\n \tif($model->validate())\n \t{\n \t//print_r($model); exit();\n \t$model->profileImage = UploadedFile::getInstance($model,'profileImage');\n \n \t\n \t\t$admininfo->username = $model->username;\n \t\t$admininfo->email = $model->email;\n \t\t$admininfo->status = $model->status ;\n \t\t$admininfo->role = $model->role ;\n \t\t\n \t\t$admininfo->update();\n \t\t$adminuser->first_name = $model->first_name;\n \t //print_r($adminuser->first_name);exit();\n \t\t$adminuser->last_name = $model->last_name;\n \t\t//print_r($adminuser->last_name);exit();\n \t\t$adminuser->mobile = $model->mobile;\n\n \t\t\n \t\t\n \t\tif(!empty($model->profileImage))\n \t\t{\n \t\t\t$imageName = time().$model->profileImage->name;\n \t\t\t$model->profileImage->saveAs('profileImage/'.$imageName );\n \t\t\t$model->profileImage = 'profileImage/'.$imageName;\n \t\t\t$adminuser->profileImage = $model->profileImage;\n \t\t\t \n \t\t}\n \t\t\n \t\t\n \t $adminuser->save();\n \t\t\n \t\t\n \t\tYii::$app->session->setFlash('success', \" Adminuser Updated successfully \");\n \t\t\n \t\treturn $this->redirect(['index']);\n \t}\n \telse{\n \t\t$model->errors;\n \t}\n \t\t\n \t\t\n \t\t\n \t\t//return $this->redirect(['view', 'id' => $model->aduserId]);\n \t\n \t\n \t\n \n }\n $rolesd = $model->getAllRoles();\n $model->roles = $rolesd;\n \n \n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function user_update($id) {\n if ($this->request->is('post')) {\n $data = $this->request->data;\n $id = $data['id'];\n $banner_image = $_FILES['banner_image']['name'];\n if (!empty($banner_image)) {\n $ext = substr(strtolower(strrchr($banner_image, '.')), 1);\n $arr_ext = array(\n 'jpg',\n 'jpeg',\n 'gif',\n 'png',\n );\n if (in_array($ext, $arr_ext)) {\n move_uploaded_file($_FILES[\"banner_image\"][\"tmp_name\"], WWW_ROOT . 'files/uploads/banner/' . $banner_image);\n $data['banner_image'] = $banner_image;\n $update = $this->User->updateUser($id, $data);\n $this->redirect(array(\n 'action' => 'user_dashboard?msg=succesmsg',\n ));\n }\n }else{\n\n $this->redirect(array(\n 'action' => 'user_dashboard?error=error',\n ));\n }\n }\n }", "public function update(User $user, Activity $activity)\n {\n return $activity->creator_id === $user->id;\n }", "public function update(Activity $activity, Request $request)\n {\n $activity->update($request->all());\n\n flash('Activity updated successfully.', 'success');\n\n return redirect()->route('admin.activities.index');\n }", "function bp_activity_action_post_update() {\n\n\t// Do not proceed if user is not logged in, not viewing activity, or not posting\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'post_update', '_wpnonce_post_update' );\n\n\t// Get activity info\n\t$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );\n\n\tif ( ! empty( $_POST['whats-new-post-object'] ) ) {\n\t\t$object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );\n\t}\n\n\tif ( ! empty( $_POST['whats-new-post-in'] ) ) {\n\t\t$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );\n\t}\n\n\t// No activity content so provide feedback and redirect\n\tif ( empty( $content ) ) {\n\t\tbp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );\n\t\tbp_core_redirect( wp_get_referer() );\n\t}\n\n\t// No existing item_id\n\tif ( empty( $item_id ) ) {\n\t\t$activity_id = bp_activity_post_update( array( 'content' => $content ) );\n\n\t// Post to groups object\n\t} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {\n\t\tif ( (int) $item_id ) {\n\t\t\t$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );\n\t\t}\n\n\t// Special circumstance so let filters handle it\n\t} else {\n\t\t$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );\n\t}\n\n\t// Provide user feedback\n\tif ( !empty( $activity_id ) )\n\t\tbp_core_add_message( __( 'Update Posted!', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );\n\n\t// Redirect\n\tbp_core_redirect( wp_get_referer() );\n}", "public function update(Request $request, $id)\n {\n if ($request->hasFile('img')) {\n $fileName = ActivityRecord::all()->where('id', $id)->pluck('img');\n $image_path = public_path(\"\\img\\activity_record\\\\\") . $fileName[0];\n if (File::exists($image_path)) {\n File::delete($image_path);\n }\n //取得檔案名稱\n $file_name = time() . '.' . $request['img']->getClientOriginalExtension();\n $file_name2 = $file_name;\n $request->file('img')->move(public_path(\"/img/activity_record\"), $file_name2);\n DB::table('activity_record')->where('id', $id)->update([\n 'subtitle_id' => $request['subtitle_id'],\n 'name' => $request['name'],\n 'img' => $file_name2,\n ]);\n }else{\n DB::table('activity_record')->where('id', $id)->update([\n 'subtitle_id' => $request['subtitle_id'],\n 'name' => $request['name'],\n ]);\n }\n return redirect()->Route('show.activity_record.form');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if (Yii::$app->user->can('admin') || (Yii::$app->user->id != $model->user_id)) {\n throw new ForbiddenHttpException('You are not allowed to perform this action.');\n }\n\n /*if ($model->user_id !== Yii::$app->user->id) {\n return $this->redirect(['view', 'id' => $id]);\n }*/\n\n $query = SocialMedia::find()->where(['event_id' => $id])->orderBy('id');\n $socialMediaModels = $query->all();\n\n $model->max_num_socialMedia = 20;\n $model->num_socialMedia = intval($query->count());\n\n for ($i = 0; $i < $model->max_num_socialMedia - $model->num_socialMedia; $i++) {\n $socialMediaModels[] = new SocialMedia();\n }\n\n $postData = Yii::$app->request->post();\n\n $old_image = $model->image;\n\n if ($model->load($postData) && $model->validate() && Model::loadMultiple($socialMediaModels, $postData) && Model::validateMultiple($socialMediaModels)) {\n // image\n $image = $model->uploadImage();\n\n if ($image == null) {\n $model->image = $old_image;\n }\n\n if ($model->update() != false) {\n if ($image != null) { // delete old and overwrite\n $model->deleteImage($old_image);\n $image->saveAs($model->getImagePath());\n }\n }\n\n foreach ($socialMediaModels as $socialMediaModel) {\n if ($socialMediaModel->url == '') {\n $socialMediaModel->delete();\n } else {\n $socialMediaModel->event_id = $model->id;\n try {\n $socialMediaModel->save();\n } catch (IntegrityException $e) {\n throw new \\InvalidArgumentException('Url/Hashtag already exists');\n }\n }\n }\n\n // delete cache of this event and create new cache\n Yii::$app->cache->delete('socialmedia' . $id);\n $socialMediaModels = SocialMedia::find()->where(['event_id' => $id])->orderBy('id')->all();\n $this->findSocialMedia($id, $socialMediaModels);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n if (strtotime($model->start_date) != 0) {\n $model->start_date = date('d.m.Y G:i', strtotime($model->start_date));\n }\n if (strtotime($model->end_date) != 0) {\n $model->end_date = date('d.m.Y G:i', strtotime($model->end_date));\n }\n }\n return $this->render('update', ['model' => $model, 'socialMediaModels' => $socialMediaModels]);\n }", "public static function set_activity($doc_id = NULL, $action_type = NULL)\n\t{\n\n\t\t$user = Auth::instance()->get_user();\n\n\t\t$activity = new Model_Activity();\n\t\t$activity\n\t\t\t->set_item_type('files')\n\t\t\t->set_action($action_type)\n\t\t\t->set_item_id($doc_id)\n\t\t\t->set_user_id($user['id'])\n\t\t\t->save();\n\t}", "public function update(UsersEditRequest $request, $id)\n {\n $request->validate([\n 'first_name' => 'required|regex:/^[\\pL\\s]+$/u|max:50',\n 'last_name' => 'required|regex:/^[\\pL\\s]+$/u|max:20',\n 'email' => \"required|email|unique:users,email,$id\",\n 'is_active' => 'required',\n 'password' => 'confirmed|nullable',\n 'photo_id' => 'mimes:jpeg,jpg,png | max:4096 | nullable',\n ]); \n\n $user = User::findOrFail($id);\n $input = $request->all();\n if(!empty($request->password)) {\n $request->validate([\n 'password' => 'confirmed|min:8'\n ]); \n $input['password'] = bcrypt($request->password);\n }\n else{\n $input['password'] = $user->password;\n }\n if($file = $request->file('photo_id')){\n $name = time() . $file->getClientOriginalName();\n $file->move('images', $name);\n $photo = Photo::create(['file'=>$name]);\n $input['photo_id'] = $photo->id;\n }\n \n if($user->is_active == 1){\n $activebefore = 'active';\n }\n else{\n $activebefore = 'not active';\n }\n if($request->is_active == 1){\n $active = 'active';\n }\n else{\n $active = 'not active';\n }\n $first_name = Auth::user()->first_name;\n $last_name = Auth::user()->last_name;\n $message = $first_name . ' ' . $last_name . ' <<UPDATED A USER FROM>> ' . '{' . 'name:' . $user->first_name .' '. \n $user->last_name. ' '.'email:'. $user->email.' ' .'role:'. $user->role->name . ' ' . 'is_active:'. \n $activebefore . '}' . ' <<TO>> ' . '{' . 'name:' . $request->first_name .' '. \n $request->last_name. ' '.'email:'. $request->email. ' ' . 'is_active:'. \n $active . '}';\n Log::info($message);\n $user->update($input);\n Session::flash('success', 'You successfully updated a user');\n return redirect('/admin/users');\n }", "public function update($id, UpdateactivityRequest $request)\n {\n $activity = $this->activityRepository->findWithoutFail($id);\n\n if (empty($activity)) {\n Flash::error('Activity not found');\n\n return redirect(route('activities.index'));\n }\n\n $activity = $this->activityRepository->update($request->all(), $id);\n\n Flash::success('Actividad Modificada.');\n\n return redirect(route('activities.index'));\n }", "public function setExistingActivity($activity, $currentUser)\n {\n $activity->setDateChanged(new \\DateTime());\n $activity->setChangedBy($currentUser);\n $this->activityRepository->storeActivity($activity);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $password_old=$model->password;\n $employee=UserProfile::find()->where(['user_id'=>$id])->one();\n if (!$employee)\n {\n $employee=new UserProfile();\n }\n $photo_name=$employee->photo;\n if ($model->load(Yii::$app->request->post()) && $employee->load(Yii::$app->request->post())) {\n if($password_old!=$model->password)\n {\n $model->password=Yii::$app->getSecurity()->generatePasswordHash($model->password);\n }\n if($model->save()){\n $employee->user_id=$model->id;\n $employee->photo = UploadedFile::getInstance($employee, 'photo');\n if ($employee->photo){ \n $photo_name='profile_'.date('Ymdhis').'.' . $employee->photo->extension; \n $employee->photo->saveAs(\\Yii::$app->basePath.'/web/images/' . $photo_name);\n $employee->photo=$photo_name;\n }else{\n $employee->photo=$photo_name;\n }\n if($employee->save())\n {\n return $this->redirect(['index']);\n }\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'employee'=>$employee\n ]);\n }", "public function actionUpdate($id)\n {\n $modelUser = Yii::$app->user->identity;\n $userId = $modelUser->id;\n $userSuccess = isset($_SESSION['userSuccess']) ? $_SESSION['userSuccess'] : null;\n if( isset($_SESSION['userSuccess']))\n unset($_SESSION['userSuccess']);\n $cameraSuccess = isset($_SESSION['cameraSuccess']) ? $_SESSION['cameraSuccess'] : null;\n if( isset($_SESSION['cameraSuccess']))\n unset($_SESSION['cameraSuccess']);\n $model = $this->findModel($id);\n $modelAccount = Account::getAllQuery()->where(['status' => 1])\n ->andWhere(['role' => \"camera-monitoring-admin\"])\n ->orWhere(['role' => \"camera-technician\"])->all();\n $modelCamera = Camera::getAllQuery()->all();\n $modelMonitoringGroupUser = new MonitoringGroupUser();\n $modelMonitoringGroupCamera = new MonitoringGroupCamera();\n $params = Yii::$app->request->post();\n $paramsOk = $model->load($params) && $model->validate();\n if ($paramsOk) {\n $query = $model->getAllUserQuery($model->id);\n $userDataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n $query = $model->getAllCameraQuery($model->id);\n $cameraDataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n $model->account_id_created_by = $userId;\n $model->update(false);\n $session = Yii::$app->session;\n $session->set('updateSuccess', '1');\n return $this->redirect(['index']);\n }\n $query = $model->getAllUserQuery($model->id);\n // print_r($model);exit;\n $userDataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n $query = $model->getAllCameraQuery($model->id);\n $cameraDataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n return $this->render('update', [\n 'model' => $model,\n 'modelAccount' => $modelAccount,\n 'modelCamera' => $modelCamera,\n 'modelMonitoringGroupUser' => $modelMonitoringGroupUser,\n 'modelMonitoringGroupCamera' => $modelMonitoringGroupCamera,\n 'userDataProvider' => $userDataProvider,\n 'cameraDataProvider' => $cameraDataProvider,\n 'userSuccess'=>$userSuccess,\n 'cameraSuccess'=>$cameraSuccess,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelusers = new Tblusers();\n $old_tags = array();\n $modelChanneltags = Tblchanneltags::find()->where(['channel_id' => $id])->all();\n \n if(!empty($modelChanneltags)) {\n foreach ($modelChanneltags as $modelChanneltag) {\n $tag[]=$modelChanneltag->tag_id;\n }\n $modeltagsData= Tbltags::find()->where(['tag_id' => $tag])->all();\n if(!empty($modeltagsData)) {\n $modeltags = new Tbltags();\n $seletedTags = array();\n foreach($modeltagsData as $t) {\n $seletedTags[] = $t->tag_id;\n }\n $old_tags = $seletedTags;\n $modeltags->tag_id = $seletedTags;\n } else {\n $modelChanneltags = new Tbltags; \n }\n }else{\n $modeltags = new Tbltags();\n }\n\n $oldfile = $model->image;\n $mt = explode(' ', microtime());\n $new = ((int)$mt[1]) * 1000 + ((int)round($mt[0] * 1000));\n $users = Tblusers::find()->all();\n $schedulesArray = ArrayHelper::map($users,'user_id', function ($users, $defaultValue) {\n return $users->username. ' - ' .$users->email;\n });\n if ($model->load(Yii::$app->request->post()) ) {\n $request = Yii::$app->request->post();\n $fileprev = 'uploads/'.$oldfile;\n $imagename = 'channels_Picture_'.$model->user_id.'_'.$new;\n $model->image = UploadedFile::getInstance($model,'image');\n\n if(!empty($model->image)) {\n if($oldfile==\"\"){\n $model->image->saveAs('uploads/'.$imagename.'.'.$model->image->extension);\n $model->image=$imagename.'.'.$model->image->extension;\n }else if(!file_exists($fileprev)){\n $model->image->saveAs('uploads/'.$imagename.'.'.$model->image->extension);\n $model->image=$imagename.'.'.$model->image->extension;\n }else{\n unlink('uploads/'.$oldfile);\n $model->image->saveAs('uploads/'.$imagename.'.'.$model->image->extension);\n $model->image=$imagename.'.'.$model->image->extension;\n }\n }else{\n $model->image = $oldfile;\n }\n $model->time = strtotime($model->time);\n $model->updated_at = time();\n $model->save();\n\n $channel_id = $model['channel_id'];\n $newTags = $request['Tbltags']['tag_id'];\n\n if(!empty($newTags)) {\n foreach($newTags as $tagSelect) {\n // if new tag selected add to database\n if(!in_array($tagSelect,$old_tags)){\n // save tag to database with respect to channel id\n $modelChanneltags = new Tblchanneltags();\n $modelChanneltags->channel_id = $channel_id;\n $modelChanneltags->tag_id = $tagSelect; \n $modelChanneltags->created_at = time();\n $modelChanneltags->updated_at = time(); \n $modelChanneltags->save(); \n }\n } \n } else {\n // delete all if no tags selected \n foreach($old_tags as $otag) {\n // remove it from database w.r.t channel id\n \\Yii::$app\n ->db\n ->createCommand()\n ->delete('TBL_CHANNEL_TAGS', ['channel_id'=>$channel_id,'tag_id'=>$otag])\n ->execute(); \n }\n }\n // remove old tags from database\n if(!empty($old_tags) && !empty($newTags)) {\n foreach($old_tags as $otag) {\n if(!in_array($otag, $newTags)){\n // remove it from database w.r.t channel id\n \\Yii::$app\n ->db\n ->createCommand()\n ->delete('TBL_CHANNEL_TAGS', ['channel_id'=>$channel_id,'tag_id'=>$otag])\n ->execute();\n }\n } \n }\n return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'modelusers' => $modelusers,\n 'schedulesArray' => $schedulesArray,\n 'modeltags' => $modeltags,\n ]);\n }", "public function actionUpdate($id)\n {\n if (Yii::$app->user->isGuest) { \n return Yii::$app->getResponse()->redirect('index.php?r=admin/login');\n } \n else \n {\n\n $model = $this->findModel($id);\n \n if ($model->load(Yii::$app->request->post())) { \n // echo '<pre>'; print_r($model); die;\n // print($model->getOldAttribute('audition_image')); die;\n $model->to_date = $_POST['AuditionData']['to_date'];\n $model->eligibility = $_POST['AuditionData']['eligibility'];\n $model->registration_detail = $_POST['AuditionData']['registration_detail'];\n \n $model->venue = $_POST['AuditionData']['venue'];\n $model->docs_requirement = $_POST['AuditionData']['docs_requirement'];\n $model->youtube_link = $_POST['AuditionData']['youtube_link'];\n $model->facebook_link = $_POST['AuditionData']['facebook_link'];\n $model->twitter_link = $_POST['AuditionData']['twitter_link'];\n $model->instagram_link = $_POST['AuditionData']['instagram_link'];\n if(($model->from_date < $model->to_date) || ($model->from_date == \"\" && $model->to_date == \"\")|| ($model->from_date != \"\" && $model->to_date == \"\")){\n $connection = Yii::$app->getDb();\n $command = $connection->createCommand(\"SELECT audition_image from audition_data where id = $model->id limit 1\");\n $result = $command->queryAll();\n\n\n if($model->from_date != \"\" && $model->to_date == \"\"){\n $model->to_date = $model->from_date;\n }\n if($model->from_date == \"\" && $model->to_date != \"\"){\n Yii::$app->session->setFlash('error', \"From Date is Empty...\");\n //Yii::$app->session->getFlash('error');\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n\n\n if($model->from_date == \"\" && $model->to_date == \"\"){\n $model->from_date = \"Coming Soon\";\n }\n $image = UploadedFile::getInstance($model, 'audition_image');\n // print($image); die;\n if($image != \"\"){\n\n $model->audition_image = $image;\n if (file_exists(Yii::getAlias('@frontend') .\"/web/themes/ikp\". $result[0]['audition_image']) && $result[0]['audition_image'] != \"\") {\n unlink(Yii::getAlias('@frontend') .\"/web/themes/ikp\". $result[0]['audition_image']);\n }\n \n $pic_name = \"/audition_data/\".uniqid();\n //echo '<pre>'; print_r($model->audition_image);die;\n if($model->audition_image){\n $model->audition_image->saveAs(Yii::getAlias('@frontend') .\"/web/themes/ikp\".$pic_name. '.' .$model->audition_image->extension);\n\n $model->audition_image = $pic_name. '.' .$model->audition_image->extension;\n // print($model->audition_image); die;\n }\n }else{\n // echo $model->getOldAttribute('audition_image'); die;\n $model->audition_image = $model->getOldAttribute('audition_image');\n }\n\n if(!$model->save()){\n return $this->render('update', [\n 'model' => $model,\n ]); \n }\n return Yii::$app->getResponse()->redirect('index.php?r=admin/index');\n }else{\n Yii::$app->session->setFlash('error', \"From Date is less then to date....\");\n //Yii::$app->session->getFlash('error');\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n}\n}", "public function updateScreenedPhotoCountMobileAppPic($user,$source,$appPhotos,$editPhotos)\r\n\t{\r\n\t\t$source = strtoupper($source);\r\n\r\n\t\t$sql = \"UPDATE MIS.PHOTO_SCREEN_STATS SET \".$source.\" = \".$source.\" + 1\";\r\n\t\tif($appPhotos)\r\n\t\t\t$sql = $sql.\", \".$source.\"_APPROVE = \".$source.\"_APPROVE + 1\";\r\n\t\telseif($editPhotos)\r\n\t\t\t$sql = $sql.\", \".$source.\"_EDITED = \".$source.\"_EDITED + 1\";\r\n\t\t$sql = $sql.\" WHERE SCREENED_BY = :USER AND DATE = CURDATE()\";\r\n\t\t$res = $this->db->prepare($sql);\r\n\t\t$res->bindValue(\":USER\", $user, PDO::PARAM_STR);\r\n\t\t$res->execute();\r\n\t\tif($res->rowCount()==0)\r\n {\r\n\t\t\t$sql2 = \"INSERT INTO MIS.PHOTO_SCREEN_STATS(\".$source.\",\".$source.\"_APPROVE,\".$source.\"_EDITED,SCREENED_BY,DATE) VALUES (:\".$source.\",:\".$source.\"_APPROVE,:\".$source.\"_EDITED,:USER,CURDATE())\";\r\n\t\t\t$res2 = $this->db->prepare($sql2);\r\n\t\t\t$res2->bindValue(\":USER\", $user, PDO::PARAM_STR);\r\n\t\t\t$res2->bindValue(\":\".$source, 1, PDO::PARAM_INT);\r\n\t\t\tif($appPhotos)\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_APPROVE\", 1, PDO::PARAM_INT);\r\n\t\t\telse\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_APPROVE\", 0, PDO::PARAM_INT);\r\n\t\t\tif($editPhotos)\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_EDITED\", 1, PDO::PARAM_INT);\r\n\t\t\telse\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_EDITED\", 0, PDO::PARAM_INT);\r\n\t\t\t$res2->execute();\r\n\t\t}\r\n\t}", "function updateUser($userId, $image, $password, $email, $phone, $about){\n //TODO Actually implement the function.\n // $dbQuery = \"UPDATE USERS SET \";\n }", "public function delete() {\n if (!isset($this->currentUser)) {\n throw new Exception(\"Not in session. Editing users requires login\");\n }\n if ($this->currentUser->getUser_type()!=usertype::Administrator){\n throw new Exception(\"Not valid user. Editing activity requires Administrator\");\n }\n\n // Get the user object from the database\n $idactivity = $_REQUEST[\"idactivity\"];\n $activity = $this->activityMapper->findById($idactivity);\n\n // Does the user exist?\n if ($activity == NULL) {\n throw new Exception(\"no such activity with id: \".$idactivity);\n }\n\n // Delete the user object from the database\n $images = json_decode($activity->getImage());\n $this->activityMapper->delete($activity);\n\n if($images != NULL){\n for($i=0; $i<count($images); $i++) {\n unlink($images[$i]);\n }\n }\n\n $this->view->setFlash(sprintf(i18n(\"Activity successfully deleted\") . \".\",$activity->getIdactivity()));\n\n $this->view->redirect(\"activities\", \"index\");\n\n }", "public function save($activity) {\r\n\t\t$stmt = $this->db->prepare(\"INSERT INTO activities (nombre, descripcion, dia, hora_inicio, hora_fin, plazas, entrenador) VALUES (?, ?, ?, ?, ?, ?, ?)\");\r\n\t\t$stmt->execute(array($activity->getNombre(), $activity->getDescripcion(), $activity->getDia(), $activity->getHoraInicio(), $activity->getHoraFin(), $activity->getPlazas(), $activity->getEntrenador()));\r\n\t\t$stmt = $this->db->query(\"SELECT MAX(id) FROM activities\");\r\n\t\t$id = $stmt->fetch();\r\n\t\treturn $id;\r\n\t}", "public function actionUpdate($id) {\n $updateModel = $this->loadModel($id);\n $oldStatus = $updateModel->status;\n if (isset($_POST['ArticleModel'])) {\n $isUseOuterUrl = $_POST['isUseOuterUrl']*1;\n if ($isUseOuterUrl=='1' && empty($_POST['ArticleModel']['outer_url'])) {\n $errMsg = '您没有填写url '.$isUseOuterUrl;\n } elseif ($isUseOuterUrl=='0' && empty($_POST['ArticleModel']['content'])) {\n $errMsg = '您没有输入活动详情 '.$_POST['ArticleModel']['content'].$isUseOuterUrl;\n } else {\n $updateModel->attributes = $_POST['ArticleModel'];\n if ($isUseOuterUrl=='1') {\n //$_POST['ArticleModel']['content'] = ' ';\n // 必须有内容 坑爹的yii\n $updateModel->content = '&nbsp;';\n } else {\n //$_POST['ArticleModel']['outer_url'] = '';\n $updateModel->outer_url = '';\n }\n //print_r($_POST);\n //print_r($updateModel->toArray());exit;\n\n //$updateModel->abstract = htmlspecialchars_decode(mb_substr(strip_tags($updateModel->content), 0, 40));\n\n // 查出第一张图片为封面图\n $imgpreg = '<img.*?src=\"(.*?)\">';\n $ret = 0;//preg_match($imgpreg, $updateModel->content, $matched);\n if ($ret) {\n $updateModel->surface_url = $matched[1];\n }\n \n // 未发布不产生url\n //if ($updateModel->status == ArticleModel::STATUS_PUBLISHED) {\n $updateModel->visit_url = $this->createFanghuServerUrl('article/show', array(\n 'id'=>$updateModel->id,\n 'sign'=> $updateModel->makeSign($updateModel->id),\n ));\n\n // 如果是发布 增加统计记录\n //StasticArticleModel::addStastic($updateModel, date('Y-m-d'));\n //} else {\n // $updateModel->visit_url = '';\n //}\n\n if ($updateModel->save()) {\n // 增加操作日志\n ArticleOperLogModel::saveAnOper($updateModel->id, $oldStatus, $updateModel->status);\n\n $this->redirect(array('view', 'id' => $updateModel->id));\n }\n }\n }\n $model = new ArticleModel;\n $arrAttributeLabels = $model->attributeLabels();\n $form = $this->beginWidget('CSmartyValidatorJs', array(\n 'id' => 'actcms-form',\n 'enableClientValidation' => true,\n 'clientOptions' => array(\n 'validateOnSubmit' => false,\n 'validateOnChange' => true,\n ),\n ));\n foreach ($model->FormElements as $attributeName => $value) {\n $form->error($model, $attributeName);\n }\n\n $this->endWidget();\n $js = '';\n Yii::app()->getClientScript()->render($js, 1);\n //render data\n $arrRender = array(\n 'primaryKey'=>'id',\n 'modelName' => 'ArticleModel',\n 'attributes' => $model->getAttributes(),\n 'attributeLabels' => $arrAttributeLabels,\n 'FormElements' => $model->FormElements,\n 'action' => 'Update',\n 'errormsgs' => CHtml::errorSummary($updateModel, '<i class=\"ace-icon fa fa-times\"></i>请更正以下错误'), //报错信息处理\n 'jsShell' => $js,\n 'model' => $updateModel,\n 'dataObj' => $updateModel,\n 'isUseOuterUrl' => $updateModel->outer_url ? 1 : 0,\n 'arrType' => ArticleModel::$ARR_TYPE,\n 'arrStatus' => ArticleModel::$ARR_STATUS,\n 'domain_str' => Yii::app()->params['FanghuServerDomain'],\n );\n\n $this->smartyRender('actcms/update.tpl', $arrRender);\n }", "public function update(Request $request, $id)\n {\n \n $request->validate([\n 'name' => 'required|max:45|string',\n 'nik' => 'required|max:15',\n 'email' => 'required|email',\n 'level' => 'required',\n 'barcode_user' => 'required',\n 'photo' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048'\n ]);\n \n if(empty($request['photo'])){\n $update = User::where('id', $id)->update([\n 'name' => $request['name'],\n 'nik' => $request['nik'],\n 'level' => $request['level'],\n 'email' => $request['email'],\n 'barcode_user' => $request['barcode_user']\n ]);\n }else{\n $photo = date('d-m-Y').'_'.date('h_i_s').'_'.$request['name'].'.'.$request->photo->extension(); \n $update = User::where('id', $id)->update([\n 'name' => $request['name'],\n 'nik' => $request['nik'],\n 'level' => $request['level'],\n 'email' => $request['email'],\n 'barcode_user' => $request['barcode_user'],\n 'photo' => $photo\n ]);\n $request->photo->move(public_path('img\\users'), $photo); \n }\n Alert::success('Berhasil', 'Berhasil Mengedit User');\n return redirect('/users'); \n }", "public function update(Request $request, $id)\n {\n //validation rules\n $rules = [\n 'start_date' => 'required|date',\n 'activity' => 'required|string|min:1',\n 'time' => 'required|numeric',\n 'location' => 'required|string|min:1',\n 'distance' => 'required|numeric'\n ];\n //custom validation error messages\n $messages = [\n '*.required' => 'Please fill out this field.',\n ];\n //First Validate the form data\n $request->validate($rules,$messages);\n \n $activity = Activity::find($id);\n $activity->user_id = Auth::user()->id;\n $activity->date = $request->start_date;\n $activity->location = $request->location;\n // $acitivty->end_date = $request->end_date;\n $activity->type = $request->activity;\n $activity->minutes = $request->time;\n $activity->distance = $request->distance;\n $activity->save();\n\n return redirect()\n ->route('home')\n ->with('status','Successfully updated your ' . $activity->type . ' that is on ' . $activity->date . ' at ' . $activity->location);\n \n }", "function set_business_activity($submit_activities, $activities){\n\t\tif( isset($_POST[$submit_activities]) ){\n\t\t\t$business_activity = $_POST[$activities];\n\t\t\tuser::update_business_activity($business_activity);\n\n\t\t\t\theader(\"location: ../../basic_info.php\");\n\t\t} \t\n\t}", "public function updating(User $user)\n{\n $userBeforeUpdated = $this->userRepository->find($user->id);\n\n $this->userService->trackUserActivity(Auth::id(),User::class, config('constants.TRACK_USER_FIELDS'),\n $userBeforeUpdated, $user);\n}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $photo = $model->photo;\n if ($model->load(Yii::$app->request->post()))\n {\n\n $file = \\yii\\web\\UploadedFile::getInstance($model, 'photo');\n if ($file != null)\n {\n\n\n if ($fileModel = \\mdm\\upload\\FileModel::saveAs($file, ['uploadPath' => '@common/upload']))\n {\n $model->photo = $fileModel->id;\n }\n }\n else\n {\n $model->photo = $photo;\n }\n $model->time = time();\n\n $model->save(false);\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function updateUserPhoto($app) {\n $user = Users::findFirstById($this->request->get('user_id'));\n if ($user) {\n $extension;\n if ($this->request->hasFiles()) {\n //DEVUELVE SI O SI UN ARRAY\n $files = $this->request->getUploadedFiles();\n foreach ($files as $file) {\n $arrayextension = explode('.', $file->getName());\n $extension = $arrayextension[sizeof($arrayextension) - 1];\n if ($extension == 'jpg' || $extension == 'jpeg' || $extension == 'png') {\n $time = time();\n $file->moveTo('files/' . $user->id . $time . '.' . $extension);\n $user->photo = $user->id . $time . '.' . $extension;\n $user->update();\n return array('response' => true, 'user' => $user);\n } else {\n $resultado = array('response' => false, 'message' => 'Formato de la foto no valido');\n }\n }\n }\n } \n }", "public function updateTwitter($id, $name, $email, $avatar, $profile);", "public function actionUpdateUser()\n {\n\n\n if ($model = UserProfile::find()->where(['user_id' => Yii::$app->user->identity->id])->one()) {\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view']);\n\n } else {\n\n return $this->render('update', [\n\n 'model' => $model,\n\n ]);\n }\n\n } else {\n\n return $this->redirect(['create']);\n\n }\n\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// } else {\n// return $this->render('update', [\n// 'model' => $model,\n// ]);\n// }\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n if (!Yii::app()->params['blog_user_auto'])\n $model->scenario = 'bloguser';\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Blog'])) {\n\n $model->attributes = $_POST['Blog'];\n $model->publish_date = (trim($_POST['Blog']['publish_date']) != '' ? date(Yii::app()->params['mysqlDateTimeFormat'], strtotime($_POST['Blog']['publish_date'])) : '');\n $model->updatedon = new CDbExpression('NOW()');\n $model->page_address_identifier = CommonFunctions::getUrlFriendlyString($model->title, $model->tableName(), $id, 'blog_id');\n //Start a transaction in case something goes wrong\n $transaction = $model->dbConnection->beginTransaction();\n try {\n //Save the model to the database\n if ($model->save()) {\n /* $fileurl = $model->blogImgBehavior->FileUrl;\n $filename = substr($fileurl,strrpos($fileurl, \"/\")+1);\n if($filename=='') {\n $filename=$_POST['old_image'];\n }\n CommonFunctions::updateFileField($filename,$id,'blog_id','image',$model->tableName()); */\n $file_name = CUploadedFile::getInstance($model, 'image');\n if ($file_name !== null) {\n $fileurl = $model->blogImgBehavior->FileUrl;\n $filemask = substr($fileurl, strrpos($fileurl, \"/\") + 1);\n CommonFunctions::updateFileField($filemask, $id, 'blog_id', 'image', $model->tableName(), 'image_name_date', $file_name);\n }\n\n $transaction->commit();\n EUserFlash::setSuccessMessage(CommonFunctions::getText(MSG_RECORD_UPDATE_SUCCESS));\n $this->redirect(array('admin'));\n }\n } catch (Exception $e) {\n $transaction->rollback();\n Yii::app()->handleException($e);\n $message = $e->getMessage();\n EUserFlash::setErrorMessage($message);\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function update(Request $request, Actor $actor)\n {\n $actor->firstname = $request->firstname;\n $actor->lastname = $request->lastname;\n $actor->gender = $request->gender;\n $actor->birthdate = $request->birthdate;\n $actor->bio = $request->bio;\n\n if ($request->hasFile('photo')) {\n $file = $request->file('photo');\n $name = time() . '-' . $file->getClientOriginalname();\n $file = $file->move(public_path() . '/images/', $name);\n $actor->photo = $name;\n }\n $actor->save();\n return redirect::to('admin');\n}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if (Yii::$app->request->post()) {\n $data = Yii::$app->request->post();\n $file = $_FILES['file'];\n if(!empty($file['name'])){\n $picurl = $this->ceanza_upload(\"file\");\n $arr = explode('/',$picurl);\n $picurl = '/uploads/'.end($arr);\n $picurl = str_replace('\"','',$picurl);\n $model->img = $picurl;\n }\n $model->username = $data['username'];\n $model->password = $data['password'];\n if(isset($data['area']) && !empty($data['area'])){\n $model->area = $data['area'];\n }\n\n $model->save();\n return $this->redirect(['update', 'id' => $model->uid]);\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\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 editDetailAction() {\r\n $status = true;\r\n $error = false;\r\n if (!$this->_helper->requireAuth()->setAuthParams('sesvideo_chanelphoto', null, 'edit')->isValid()) {\r\n $status = false;\r\n $error = true;\r\n }\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $_POST['photo_id']);\r\n if ($status && !$error) {\r\n $values['title'] = $_POST['title'];\r\n $values['description'] = $_POST['description'];\r\n $values['location'] = $_POST['location'];\r\n //update location data in sesbasic location table\r\n if ($_POST['lat'] != '' && $_POST['lng'] != '') {\r\n $dbGetInsert = Engine_Db_Table::getDefaultAdapter();\r\n $dbGetInsert->query('INSERT INTO engine4_sesbasic_locations (resource_id, lat, lng , resource_type) VALUES (\"' . $_POST['photo_id'] . '\", \"' . $_POST['lat'] . '\",\"' . $_POST['lng'] . '\",\"sesvideo_chanelphoto\")\tON DUPLICATE KEY UPDATE\tlat = \"' . $_POST['lat'] . '\" , lng = \"' . $_POST['lng'] . '\"');\r\n }\r\n $db = $photo->getTable()->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->setFromArray($values);\r\n $photo->save();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n $status = false;\r\n $error = true;\r\n }\r\n }\r\n echo json_encode(array('status' => $status, 'error' => $error));\r\n die;\r\n }", "public function updateCampaign($params)\r\n {\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->scenario = 'update';\n \n// if (\\Yii::$app->user->can('updatePost', ['post' => $model])) {\n// die('own');\n// }\n \n $oldFile1 = $model->getImageFile($model->image1);\n $oldFile2 = $model->getImageFile($model->image2);\n $oldFile3 = $model->getImageFile($model->image3);\n $oldFile4 = $model->getImageFile($model->image4);\n $oldFile5 = $model->getImageFile($model->image5);\n $oldFile6 = $model->getImageFile($model->image6);\n $oldFile7 = $model->getImageFile($model->image7);\n $oldFile8 = $model->getImageFile($model->image8);\n $oldFile9 = $model->getImageFile($model->image9);\n $oldImage1 = $model->image1;\n $oldImage2 = $model->image2;\n $oldImage3 = $model->image3;\n $oldImage4 = $model->image4;\n $oldImage5 = $model->image5;\n $oldImage6 = $model->image6;\n $oldImage7 = $model->image7;\n $oldImage8 = $model->image8;\n $oldImage9 = $model->image9;\n \n $model->img2 = 0;\n $model->img3 = 0;\n $model->img4 = 0;\n $model->img5 = 0;\n $model->img6 = 0;\n $model->img7 = 0;\n $model->img8 = 0;\n $model->img9 = 0;\n \n if ($model->load(Yii::$app->request->post())) {\n $image1 = $model->uploadImage(1);\n $image2 = $model->uploadImage(2);\n $image3 = $model->uploadImage(3);\n $image4 = $model->uploadImage(4);\n $image5 = $model->uploadImage(5);\n $image6 = $model->uploadImage(6);\n $image7 = $model->uploadImage(7);\n $image8 = $model->uploadImage(8);\n $image9 = $model->uploadImage(9);\n \n // revert back if image not valid\n if($image1 === FALSE){\n $model->image1 = $oldImage1;\n }\n if($image2 === FALSE){\n if($model->img2 == 1):\n if(is_file($oldFile2)){\n unlink($oldFile2);\n }\n $model->image2 = \"\";\n else:\n $model->image2 = $oldImage2;\n endif;\n }\n if($image3 === FALSE){\n if($model->img3 == 1):\n if(is_file($oldFile3)){\n unlink($oldFile3);\n }\n $model->image3 = \"\";\n else:\n $model->image3 = $oldImage3;\n endif;\n }\n if($image4 === FALSE){\n if($model->img4 == 1):\n if(is_file($oldFile4)){\n unlink($oldFile4);\n }\n $model->image4 = \"\";\n else:\n $model->image4 = $oldImage4;\n endif;\n }\n if($image5 === FALSE){\n if($model->img5 == 1):\n if(is_file($oldFile5)){\n unlink($oldFile5);\n }\n $model->image5 = \"\";\n else:\n $model->image5 = $oldImage5;\n endif;\n }\n if($image6 === FALSE){\n if($model->img6 == 1):\n if(is_file($oldFile6)){\n unlink($oldFile6);\n }\n $model->image6 = \"\";\n else:\n $model->image6 = $oldImage6;\n endif;\n }\n if($image7 === FALSE){\n if($model->img7 == 1):\n if(is_file($oldFile7)){\n unlink($oldFile7);\n }\n $model->image7 = \"\";\n else:\n $model->image7 = $oldImage7;\n endif;\n }\n if($image8 === FALSE){\n if($model->img8 == 1):\n if(is_file($oldFile8)){\n unlink($oldFile8);\n }\n $model->image8 = \"\";\n else:\n $model->image8 = $oldImage8;\n endif;\n }\n if($image9 === FALSE){\n if($model->img9 == 1):\n if(is_file($oldFile9)){\n unlink($oldFile9);\n }\n $model->image9 = \"\";\n else:\n $model->image9 = $oldImage9;\n endif;\n }\n \n if($model->save()){\n // upload jika image nya valid\n \n if($image1 !== FALSE){\n if(is_file($oldFile1)){\n unlink($oldFile1);\n }\n $path1 = $model->getImageFile($model->image1);\n $image1->saveAs($path1);\n }\n if($image2 !== FALSE){\n if(is_file($oldFile2)){\n unlink($oldFile2);\n }\n $path2 = $model->getImageFile($model->image2);\n $image2->saveAs($path2);\n }\n if($image3 !== FALSE){\n if(is_file($oldFile3)){\n unlink($oldFile3);\n }\n $path3 = $model->getImageFile($model->image3);\n $image3->saveAs($path3);\n }\n if($image4 !== FALSE){\n if(is_file($oldFile4)){\n unlink($oldFile4);\n }\n $path4 = $model->getImageFile($model->image4);\n $image4->saveAs($path4);\n }\n if($image5 !== FALSE){\n if(is_file($oldFile5)){\n unlink($oldFile5);\n }\n $path5 = $model->getImageFile($model->image5);\n $image5->saveAs($path5);\n }\n if($image6 !== FALSE){\n if(is_file($oldFile6)){\n unlink($oldFile6);\n }\n $path6 = $model->getImageFile($model->image6);\n $image6->saveAs($path6);\n }\n if($image7 !== FALSE){\n if(is_file($oldFile7)){\n unlink($oldFile7);\n }\n $path7 = $model->getImageFile($model->image7);\n $image7->saveAs($path7);\n }\n if($image8 !== FALSE){\n if(is_file($oldFile8)){\n unlink($oldFile8);\n }\n $path8 = $model->getImageFile($model->image8);\n $image8->saveAs($path8);\n }\n if($image9 !== FALSE){\n if(is_file($oldFile9)){\n unlink($oldFile9);\n }\n $path9 = $model->getImageFile($model->image9);\n $image9->saveAs($path9);\n }\n \n \n return $this->redirect(['view', 'id' => $model->id]);\n }else{\n \n }\n \n \n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $photo_name=$model->photo;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->photo = UploadedFile::getInstance($model, 'photo');\n if ($model->photo){ \n $photo_name='home_'.date('Ymdhis').'.' . $model->photo->extension; \n $model->photo->saveAs(\\Yii::$app->basePath.'/web/images/' . $photo_name);\n $model->photo=$photo_name;\n }else{\n $model->photo=$photo_name;\n }\n $model->user_id=Yii::$app->user->id;\n if($model->save())\n {\n Yii::$app->session->setFlash('yes',Yii::t('app','Edited successfully.'));\n return $this->redirect(['index']);\n }\n \n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function updateBio($params)\n {\n $bio = $this->filterPost ('bio');\n if (!isNull ($bio))\n {\n Core::getBdd ()->update (\n array (\"bio\" => $bio), 'c_user', array (\"id\" => $_SESSION['muffin_id']));\n echo \"1\";\n }\n else\n {\n echo \"1\";\n }\n }", "public function createUserActivityAction()\n {\n $data = $this->getRequestData();\n if (isset($data['title'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/activities/' . $user->getKey() . \"-activities\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-activities\");\n $folder->setParentId(3);\n $folder->save();\n }\n\n $activity = new Object_Activity();\n $activity->setCreator($user);\n $activity->setTitle($data['title']);\n $activity->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : \"\");\n $activity->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $activity->setPublished(true);\n $activity->setParentId($folder->getId());\n if (!$activity->save()) {\n $this->setErrorResponse('cannot save Activity object');\n }\n } else {\n $this->setErrorResponse('title is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function updatePhoto()\n {\n //Intenta subir la foto que viene en el campo 'photo'\n if ($photo = $this->uploadPhoto('photo')) {\n //Modifica el campo photo del usuario y lo intenta actualizar\n $this->photo = $photo;\n return $this->update();\n }\n }", "public function updateAction()\n {\n if (!$this->_request->isPost()) {\n $this->_redirect($this->_helper->url('index'));\n }\n\n $id = $this->getRequest()->getParam('id');\n\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($id);\n\n if (!$model->update($this->_request->getPost(), $id)) {\n $form = $model->getForm();\n $form->setAction($this->_helper->url('update', null, null, array('id' => $id)));\n\n $this->view->photo = $photo;\n $this->view->photoForm = $form;\n return $this->render('edit');\n }\n $this->_redirect($this->_helper->url('edit', null, null, array('id' => $id)));\n }", "public function update(Request $request, $id)\n {\n $ad = $this->validate(request(), [\n 'title' => 'required|max:200',\n 'text' => 'required|max:200',\n 'user_id' => 'required', \n ]);\n $ad = Ad::find($id);\n $photo = 'images/no_photo.png';\n if( $request->hasFile('photo') ) {\n $img = $request->file('photo');\n $filename = time() . '.' . $img->getClientOriginalExtension();\n $photo = $img->move('images', $filename);\n } \n $data = $request->all();\n $data['photo'] = $photo;\n $ad->update($data);\n\n return redirect('/ads');\n }", "public function actionUpdate($id)\n {\n $this->layout = 'candidate';\n $model = $this->findModel($id);\n $model->scenario = 'request';\n\n if ($model->load(Yii::$app->request->post()) ) {\n //print_r((Yii::$app->request->post()));exit;\n //$model->profile_summary = Yii::$app->request->post()->profile_summary;\n $file = UploadedFile::getInstance($model, 'resume');\n if($file){ \n \n $model->resume = $id.'.'.$file->extension;\n // print_r($file);exit;\n \n if($model->save(false))\n {\n $file->saveAs('uploads/'.$model->resume);\n }\n }\n \n else $model->save(false);\n return $this->redirect(['view', 'id' => $model->candidate_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "function setActivityStatus($activityId,$status) \n {\n return $this->instance->setActivityStatus($activityId,$status);\n }", "public function addActivity($data);", "public function updateUserProfilePicture(Request $request)\n {\n $data= Validator::make($request->all(), [\n 'id' => 'required',\n 'avatar' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n if ($data->fails()) {\n return response()->json([\n 'status' => 400,\n 'message' => 'All fields are required',\n 'data'=> []\n ], 400);\n }\n\n if($request->id != $request->userID){\n return response()->json([\n 'status' => 400,\n 'message' => 'Not authorized to carry out this action',\n 'data'=> []\n ], 400);\n }\n\n $name = $request->id.\".jpg\";\n $path = Storage::disk('public')->putFileAs('avatars', $request->file('avatar'), $name, 'public');\n\n User::find($request->id)->update([\n 'pictureUrl' => Storage::disk('public')->url('avatars/'.$name)\n ]);\n $user = User::find($request->id);\n $user->followers = Follow::where('userId', $user->id)->count();\n $user->following = Follow::where('followedBy', $user->id)->count();\n $user->recipes = Recipe::where('userId', $user->id)->count();\n $user->saveCount = Favorite::where('userId', $user->id)->where('commentId', null)->count();\n return response()->json([\n 'status' => 200,\n 'message' => 'User account has been updated',\n 'data' => [\n // User::find($request->id)->only('id', 'name', 'email', 'phoneNumber','bio', 'pictureUrl'),\n $user\n ]\n ], 200);\n }", "public function update()\n {\n $userId = Helper::getIdFromUrl('user');\n\n // Save post data in $user\n $user = $_POST;\n \n // Save record to database\n UserModel::load()->update($user, $userId);\n\n View::redirect('user/' . $userId);\n }", "public function actionEdit($username = '')\n\t{\n \n Yii::app()->theme='frontend';\n\t\t$model = $this->loadUser();\n\t\t$profile=$model->profile;\n\t\t\n\t\t// ajax validator\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='edit-form')\n\t\t{\n \n\t\t\techo UActiveForm::validate(array($model,$profile));\n\t\t\tYii::app()->end();\n\t\t}\n if(empty($_POST['Profile']['photo']) && !empty($_FILES['photoimg']['name']))\n {\n $this->actionimageupload();\n return;\n //exit;\n }\n\t\t\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$profile->attributes=$_POST['Profile'];\n \n $profile->photo = $_POST['Profile']['photo'];\n \n\t\t\tif($model->validate()&&$profile->validate()) {\n\t\t\t\t$model->save();\n\t\t\t\t$profile->save();\n\t\t\t\tYii::app()->user->setFlash('profileMessage',UserModule::t(\"Changes is saved.\"));\n\t\t\t\t$this->redirect(array('/user/profile'));\n\t\t\t} else $profile->validate();\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t'profile'=>$profile,\n\t\t));\n\t}", "public function activityAction() {\n\tif($this->_getParam('id',false)){\n\t$activities = new PrimaryActivities();\n\t$this->view->activities = $activities->getActivityDetails($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "function editTour($oTour) {\n $oConnection = DbController::instance();\n $oConnection->execute(\"\n UPDATE TOUR\n SET TOUR.name = '{$oTour->getSName()}', TOUR.imagePath='{$oTour->getSImagePath()}', TOUR.comment='{$oTour->getSComment()}'\n WHERE TOUR.id = {$oTour->getIId()};\n \");\n}", "function Update_audit_trail_Stmt (){\n\nif (isset($_POST[\"Update_audit_trail\"])) {\n\n\n// Defining Variables for audit_trail Update SQL Statement \n\n$user_count=$_POST['user_count'];\n$user_id=$_POST['user_id'];\n$transaction_date=$_POST['transaction_date'];\n$activity=$_POST['activity'];\n$UpdateSQLaudit_trail = \" UPDATE audit_trail SET \n\nuser_count='$user_count',user_id='$user_id',transaction_date='$transaction_date',activity='$activity' WHERE user_count='$user_count'\";\n// END of Update SQL Statement for audit_trail\n\n\n$Result_update = mysql_query($UpdateSQLaudit_trail) or die(mysql_error());} //End If\n}", "function interestedIn_update() {\n global $user_id;\n if (isset($_POST['intereses'])) {\n update_user_meta( $user_id, 'interesado_actividades', $_POST['intereses'] );\n }\n}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $oldmodel = $this->findModel($id);\n $model->password='';\n if ($model->load(Yii::$app->request->post()))\n {\n if(isset($_FILES['User']['name']['image']) && $_FILES['User']['name']['image'] != null)\n {\n if($oldmodel->image_path != '' && $oldmodel->image_path != null && file_exists(Yii::getAlias('@webroot').'/'.$oldmodel->image_path))\n {\n unlink(Yii::getAlias('@webroot').\"/\".$oldmodel->image_path);\n }\n $new_image['name'] = $_FILES['User']['name']['image'];\n $new_image['type'] = $_FILES['User']['type']['image'];\n $new_image['tmp_name'] = $_FILES['User']['tmp_name']['image'];\n $new_image['error'] = $_FILES['User']['error']['image'];\n $new_image['size'] = $_FILES['User']['size']['image'];\n\n $name = Yii::$app->common->normalUpload($new_image, Yii::$app->params['userimage']);\n $model->image_path = $name;\n }\n if(isset($model->password) && $model->password!=null)\n {\n $model->password=md5($model->password);\n }\n else {\n $model->password=$oldmodel->password;\n }\n $model->u_by = Yii::$app->user->id;\n $model->u_date = time();\n if($model->save()){\n $msg=\"User has been successfully updated\";\n $flash_msg = \\Yii::$app->params['msg_success'].$msg.\\Yii::$app->params['msg_end'];\n \\Yii::$app->getSession()->setFlash('flash_msg', $flash_msg);\n return $this->redirect(['index']);\n }\n else{\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\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()))\n { \n $model->avatar = UploadedFile::getInstance($model, 'avatar');\n if ($model->avatar !== null) \n {\n $model->profile_image = $model->id . '.' . $model->avatar->extension;\n }\n else\n {\n $model->profile_image = User::findOne($model->id)->profile_image;\n } \n \n if ($model->save())\n {\n $dest = Yii::getAlias('@webroot/images/blog');\n if ($model->avatar !== null)\n { \n $model->avatar->saveAs($dest . '/' . $model->id . '.' . $model->avatar->extension);\n }\n \n Yii::$app->session->setFlash('updateMessage', 'Your profile has been updated.');\n return $this->redirect(['/profile', 'id' => $id]);\n }\n else\n {\n Yii::$app->session->setFlash('updateMessage', 'Your profile has not been updated.');\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n else\n {\n return $this->render('update', [\n 'model' => $model,\n ]);\n } \n }", "public function actionUpdate($id)\n\t{\n \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 $path= realpath(Yii::app()->basePath . '/../images/profile/');\n $thumbpath=realpath(Yii::app()->basePath . '/../images/profile/thumb/');\n\t\tif(isset($_POST['Users']))\n\t\t{ \n\t\t\t$model->attributes=$_POST['Users'];\n if(!empty($_FILES[\"Users\"][\"name\"][\"profile_image\"])){\n // Upload doctor image\n $old_image = $_POST['oldimage'];\n $uploadedFile=CUploadedFile::getInstance($model,'profile_image');\n \n $filename=explode(\".\", $uploadedFile);\n $fileext = $filename[count($filename) - 1];\n $newfilename = time() . \".\" . $fileext;\n \n $model->profile_image = $newfilename;\n $_POST['Users'][\"profile_image\"] = $newfilename;\n if(!empty($uploadedFile)){\n $uploadedFile->saveAs($path.\"/\".$newfilename);\n $image = new EasyImage($path.\"/\".$newfilename);\n $image->resize(250,250);\n $image->save($thumbpath.\"/\".$newfilename);\n /**\n * @desc : Delete existing images\n */\n if (file_exists($path . $old_image)) {\n @unlink($path . $old_image);\n }\n }\n }else{\n $model->profile_image = $_POST['oldimage'];\n }\n $model->attributes=$_POST['Users'];\n $model->password = base64_encode($_POST['Users'][\"password\"]);\n if($model->save())\n $this->redirect(array('view','id'=>$model->user_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($id)\n {\n \n $model = $this->findModel($id);\n $this->checkPermissionByModelsUserId($model->user_id);\n\n if ($model->load(Yii::$app->request->post())) {\n /*check if the file is uploaded*/\n if($model->imageFile = UploadedFile::getInstance($model, 'imageFile')){\n /* check if the model has 'photo' attribute */\n $oldPhoto = $model->photo ? $model->photo : false;\n }\n if($model->save()) {\n if(isset($oldPhoto) && $oldPhoto != false) {\n /* remove old photo */\n $this->deleteFile($oldPhoto);\n } \n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n $reqModel = Yii::app()->getRequest()->getPost('Task');\n\n $user = new UserTask();\n\n $defaultUsers = array('user_id' => array());\n $assocUsers = UserTask::model()->findAllByAttributes(array('task_id' => $id));\n foreach ($assocUsers as $u)\n array_push($defaultUsers['user_id'], $u->user_id);\n\n $reqUser = Yii::app()->getRequest()->getPost('UserTask', $defaultUsers);\n $user->attributes = $reqUser;\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if ($reqModel !== null) {\n $model->attributes = $reqModel;\n if ($model->save()) {\n if ($reqUser !== null) {\n $user_ids = $reqUser['user_id'];\n $newUsers = UserTask::merge($model->id, $user_ids);\n $this->_sendAssociationNotification($newUsers, $model->id);\n $this->_sendEmailAssociationNotification($newUsers, $model->id);\n }\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.update.success.{id}', array('{id}' => $model->calc_id)));\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'user' => $user,\n ));\n }", "public function update(Request $request, User $user)\n {\n $validate = $request->validate([\n 'name' => ['required', 'string', 'max:255'],\n 'src' => ['image'],\n 'description' => ['required', 'string','max:1000'],\n ]);\n if ($request->email != $user->email) {\n $validate = $request->validate([\n 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],\n ]);\n $user->email = $request->email;\n }\n if($request->file('src')){\n Storage::delete('public/img/team'.$user->src);\n Storage::put('public/img/team',$request->file('src'));\n $user->src = $request->file('src')->hashName();\n };\n $user->name = $request->name;\n $user->description = $request->description;\n if ($request->role_id) {\n $user->role_id = $request->role_id;\n }\n $user->save();\n if($request->job_title_id){\n $user->job_titles()->sync($request->job_title_id);\n }\n\n return redirect('/admin/users/'.$user->id);\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function update(Request $request, Photo $photo)\n {\n //\n }", "public function update(Request $request, Photo $photo)\n {\n //\n }", "function updateUserProfilePicture($id, $image)\n{\n global $db;\n $command = \"UPDATE `user_accounts` SET `profilePicture` = ? WHERE `id` = ?\";\n $stmt = $db->prepare($command);\n return $stmt->execute(array($image, $id));\n}", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|max:200|unique:photos,title,' . $id,\n 'category_id' => 'required',\n 'file' => 'nullable|mimes:jpeg,jpg',\n\n ]);\n if ($validator->fails()) {\n alert()->warning('Validation Error', 'Error');\n return redirect()->back()->withErrors($validator)->withInput();\n }\n $logo = $this->uploadSliderImage($request);\n $photo = new Photo();\n $data = [\n 'title' => $request->title,\n 'image' => $logo ?? $request->old_image,\n 'visibility' => $request->status,\n ];\n $photo->where('id', $id)->update($data);\n alert()->success('Photo Updated', 'Successfully!');\n return redirect()->route('photo.index');\n }" ]
[ "0.70262873", "0.66264784", "0.6598882", "0.65296197", "0.6370587", "0.6274456", "0.62340695", "0.61932397", "0.6112222", "0.6042295", "0.6002894", "0.596621", "0.592717", "0.585048", "0.57960767", "0.5794807", "0.57939065", "0.5792251", "0.5789131", "0.57452285", "0.57373226", "0.57359284", "0.57310843", "0.56774586", "0.5674645", "0.56333923", "0.55148804", "0.5514822", "0.55112916", "0.5500265", "0.5470814", "0.546296", "0.54614586", "0.5450896", "0.5430668", "0.5418472", "0.5415835", "0.54009575", "0.5396928", "0.5394859", "0.53790486", "0.53773075", "0.53678024", "0.5366003", "0.5360456", "0.53473073", "0.5343275", "0.5319663", "0.53186554", "0.5314082", "0.53097135", "0.5308177", "0.5297555", "0.5290686", "0.52803725", "0.5255957", "0.5254397", "0.5250965", "0.5240748", "0.52393997", "0.5236646", "0.5229265", "0.5220244", "0.5218603", "0.52176726", "0.52174413", "0.52165514", "0.5213513", "0.5200639", "0.5199155", "0.51789004", "0.5177882", "0.5172758", "0.51685554", "0.5165083", "0.5162423", "0.5156426", "0.5153146", "0.5136216", "0.5126942", "0.512687", "0.51252073", "0.5121755", "0.5120736", "0.511989", "0.5116042", "0.51146334", "0.5113265", "0.51058096", "0.51037705", "0.51020527", "0.5097746", "0.50957716", "0.509547", "0.50948405", "0.50928414", "0.5085137", "0.5085137", "0.5081183", "0.5078517" ]
0.76159763
0
this methos allows user to add photo to objects ['photo']['name'], ['photo']['content'] and type is mandatory fields
public function addPhotoAction(){ $data = $this->getRequestData(); $types = array('activity', 'operation', 'people'); if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){ $user = Object_User::getById($this->getDeviceSession()->getUserId()); $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']); if (!$folder) { switch($data['type']){ case 'activity': $fid = 3; break; case 'operation': $fid = 4; break; case 'people': $fid = 7; break; } $folder = new Object_Folder(); $folder->setKey($user->getKey() . "-" . $data['type']); $folder->setParentId($fid); $folder->save(); } $asset = new Asset_Image(); $asset->setCreationDate(time()); $asset->setUserOwner(1); $asset->setUserModification(1); $asset->setParentId($folder->getId()); $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . "-" . time())); $asset->setData(base64_decode($data['content'])); if(!$asset->save()){ $this->setErrorResponse('cannot save photo!'); } } else { $this->setErrorResponse('photo and type is mandatory for this request!'); } $this->_helper->json(array('photo' => $asset->getId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function addItems(\\Media\\Entity\\Photo\\PhotoBase $item);", "public function addPhoto()\n\t{\n\t\t// check if any key in request is of error type\n\t\tif ($this->request->hasKey(ErrorEnum::ERROR))\n\t\t{\n\t\t\t// setting general error message and view style for a template\n\t\t\t$this->view->add_new_photo_message_class = ErrorEnum::ERROR;\n\t\t\t$this->view->add_new_photo_message = MessageBundle::getMessage('form.validation.field.addphoto.noimage.exists');\n\t\t\t\n\t\t\tif ($this->request->hasKey(ErrorEnum::FILENOIMAGE))\n\t\t\t{\n\t\t\t\t$this->view->add_new_photo_message = MessageBundle::getMessage('form.validation.field.addphoto.filenoimage');\n\t\t\t}\n\t\t}\n\t\t$this->view->add_to_existing_album = $this->helper->getExistingAlbumsToForm();\n\t\t$this->view->show('profile_gallery_add');\n\t}", "public function store(Request $request)\n {\n /*foreach ($request->photos as $photo)\n {\n if ($photo->extension() !== 'jpeg')\n {\n dd($photo->extension());\n }\n }\n\n $photo = $request->except('_token');\n\n $type = HotelPhotoType::where('name', $photo['type_name'])->first();\n $photo['type_id'] = $type->id;\n\n if($photo['type_name'] == 'main')\n {\n unset($photo['type_name']);\n $file = $photo['photos'][0];\n unset($photo['photos']);\n $photo['img'] = $file->getClientOriginalName();\n\n $required_width = $type->width;\n $required_height = $type->height;\n list($current_width, $current_height) = getimagesize($file);\n\n if($required_width != $current_width || $required_height != $current_height)\n {\n if($required_width > $current_width || $required_height > $current_height)\n {\n dd('выбранное изобржение меньше нужных размеров');\n } else {\n $photo['optimized'] = false;\n }\n } else {\n $photo['optimized'] = true;\n }\n\n $type->photos()->create($photo);\n } else {\n unset($photo['type_name']);\n $file = $photo['photos'][0];\n unset($photo['photos']);\n $photo['img'] = $file->getClientOriginalName();\n\n $required_width = $type->width;\n $required_height = $type->height;\n list($current_width, $current_height) = getimagesize($file);\n\n if($required_width != $current_width || $required_height != $current_height)\n {\n if($required_width > $current_width || $required_height > $current_height)\n {\n dd('выбранное изобржение меньше нужных размеров');\n } else {\n $photo['optimized'] = false;\n }\n } else {\n $photo['optimized'] = true;\n };\n }*/\n\n //dd($photo);\n\n //$type->photos()->create($photo);\n\n $hotel = Hotel::find($request->hotel_id);\n\n $photo_type = HotelPhotoType::find($request->type_id);\n\n /*foreach ($data['photos'] as $photo)\n {\n if($photo->extension() == 'jpeg')\n {\n $arr['img'] = $photo->getClientOriginalName();\n $arr['hotel_id'] = $data['hotel_id'];\n $arr['optimized'] = false;\n $hotel->photos()->create($arr);\n\n $photo->move('public/img/photo', $arr['img']);\n }\n }*/\n\n $array = $request->except('photos');\n\n $file = $request->photos;\n $array['img'] = $hotel->slug . '_' . $photo_type->name . '.jpg';\n\n $file->move(env('DIR_IMG') . 'photo/', $array['img']);\n\n $delete = $hotel->photos()->where('type_id', $request->type_id)->delete();\n //dd($delete);\n\n $hotel->photos()->create($array);\n \n return redirect(route('hotels.show', $hotel->id));\n }", "public function upload_photo(){\n $sql=\"INSERT INTO photos \";\n $sql.=\"(name,size,type,date,img_navigacija_id) VALUES ('{$this->name}',$this->size,'{$this->type}',NOW(),2)\";\n self::$connect->query($sql);\n\n\n }", "private function _add_photo(){\n global $db;\n\n $photo_name = $db->quote($this->_photo_name);\n $photo_caption = $db->quote($this->_photo_caption);\n $file_name = $db->quote($this->_file_name);\n $file_type = $db->quote($this->_file_type);\n\n $sql = \"SELECT * FROM photos WHERE file_name = \".$file_name.\" LIMIT 1\";\n\n // if photo with file name $file_name is not present in database, insert into database\n if(!$db->query1($sql)->rowCount()){\n $sql = \"INSERT INTO photos (\";\n $sql .= \"photo_name, photo_caption, file_name, file_size, file_type, user_id\";\n $sql .= \") VALUES ( \";\n $sql .= $photo_name .\", \". $photo_caption .\", \". $file_name.\", \". $this->_file_size .\", \". $file_type.\",\" .$this->_user_id;\n $sql .= \")\";\n try {\n //adding photo to db\n $db->exec($sql);\n return \"Photo with name \".$photo_name.\" added, query Successful.\";\n } catch (Exception $e) {\n throw $e;\n }\n }\n else{\n throw new Exception(\"The file name \".$file_name. \" alrady exists\");\n }\n }", "public function addPhoto(Request $request) {\n\n // Log::info($request->all());\n \n if(Input::hasFile('file') && Input::file('file')->isValid() && !is_null($request->id))\n {\n\n $file = Input::file('file');\n\n $extension = $file->getClientOriginalExtension(); \n\n $fileName = str_random(10) .'.'. $extension;\n\n $clientMimeType = $file->getClientMimeType();\n\n if(!preg_match(\"/^(image).+$/\", $clientMimeType)) {\n Log::info(\"error not an image \". $clientMimeType);\n return response()->json([\"error\" => \"Not an Image\"], 200);\n }\n\n $original = config('image.profile.original.path') . $fileName;\n\n \\Storage::disk('public')->put( $original , file_get_contents( $file->getRealPath()) );\n \n //persist the record to the db\n $photo = new Photo();\n $photo->property_id = $request->id;\n $photo->url = $original;\n $photo->save();\n\n return response()->json([\"url\" => $original], 200);\n }\n \n return response()->json([\"error\" => \"No File Selected\"], 504);\n }", "private function uploadPhoto()\n {\n try\n {\n \n $request = $_POST;\n\n //check if user logged in\n if(!userid())\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n //check if title provided\n if( !isset($request['photo_title']) || $request['photo_title']==\"\")\n throw_error_msg(\"photo_title not provided\");\n else\n $insert_array['photo_title'] = mysql_clean($request['photo_title']);\n\n //check if description provided\n if( !isset($request['photo_description']) || $request['photo_description']==\"\")\n throw_error_msg(\"photo_description not provided\");\n else\n $insert_array['photo_description'] = mysql_clean($request['photo_description']);\n\n //check if tags provided\n if(!isset($request['photo_tags']) || $request['photo_tags']==\"\")\n throw_error_msg(\"photo_tags not provided\");\n else\n $insert_array['photo_tags'] = mysql_clean($request['photo_tags']);\n\n //check if collection provided\n if(!isset($request['collection_id']) || $request['collection_id']==\"\")\n throw_error_msg(\"collection_id not provided\");\n elseif(!is_numeric($request['collection_id']))\n throw_error_msg('invalid collection_id');\n else\n $insert_array['collection_id'] = mysql_clean($request['collection_id']);\n\n if(!isset($_FILES['photo_file']))\n throw_error_msg(\"photo file not provided\");\n\n $info = pathinfo($_FILES['photo_file']['name']);\n \n $extension = strtolower($info['extension']);\n\n $tmp_file = FILES_DIR.'/temp/temp_photo_'.time().'.'.$extension;\n \n @move_uploaded_file($_FILES['photo_file']['tmp_name'], $tmp_file);\n\n $photo_upload_url = BASEURL.\"/actions/photo_uploader.php\";\n\n $post_array['plupload'] = 'yes';\n $post_array['name'] = $_FILES['photo_file']['name'];\n $post_array['file'] = '@'.$tmp_file;\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$photo_upload_url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $server_output = curl_exec ($ch);\n\n curl_close ($ch);\n \n $output = json_decode($server_output,true);\n\n if(isset($output['error']))\n {\n throw_error_msg( $output['error'] ) ;\n }\n else\n {\n //get ouput \n /*$insert_array['filename'] = $output['filename'];\n \n $insert_array['folder'] = createDataFolders(PHOTOS_DIR);*/\n $post_insert_array['insertPhoto'] = 'yes';\n $post_insert_array['photo_title'] = $insert_array['photo_title'];\n $post_insert_array['photo_description'] = $insert_array['photo_description'];\n $post_insert_array['photo_tags'] = $insert_array['photo_tags'];\n $post_insert_array['collection_id'] = $insert_array['collection_id']; \n $post_insert_array['file_name'] = $output['file_name'];\n $post_insert_array['title'] = $info['filename']; //$_FILES['photo_file']['name'];\n $post_insert_array['ext'] = $output['extension'];\n $post_insert_array['userid'] = userid();\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$photo_upload_url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_insert_array);\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $server_output = curl_exec ($ch);\n\n curl_close ($ch);\n \n $output = json_decode($server_output,true);\n \n if(isset($output['success']))\n {\n global $cbphoto;\n\n $photo = $cbphoto->get_photo($output['photoID']);\n $cbphoto->collection->add_collection_item($photo['photo_id'],$photo['collection_id']);\n \n $photo_details = format_photos( array($photo) );\n }\n else\n {\n throw_error_msg( $output['error'] ) ; \n }\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $photo_details);\n $this->response($this->json($data));\n } \n \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n } \n }", "function add_photo($photo, $gallery) {\n\n $photo_post = array();\n $photo_post['post_title'] = $photo['title'];\n $photo_post['post_content'] = '';\n $photo_post['post_type'] = 'attachment';\n $photo_post['post_status'] = 'publish';\n $photo_post['post_author'] = $this->flickr_author;\n $photo_post['post_category'] = array($this->flickr_category, );\n $photo_post['post_mime_type'] = 'image/jpeg'; //assuming jpeg, is this ok?\n $photo_post['post_parent'] = $gallery['pageid'];\n if ($photo['url_o']) {\n $photo_post['guid'] = $photo['url_o']; //magically linking the photo\n } else {\n $photo_post['guid'] = $photo['url_m']; //for some reason url_o isnt always available\n }\n \n //$postid = wp_insert_post($photo_post);\n $postid = wp_insert_attachment($photo_post);\n /* Update metadata now */\n $this->set_metadata($postid, $photo);\n\n //now tag with mediatags\n wp_set_object_terms($postid, array($gallery['mediatag']), MEDIA_TAGS_TAXONOMY);\n\n //and we should be done. Horay!\n}", "public function make_a_photo()\n {\n $product = factory(Product::class, 1)->create();\n\n $file = new UploadedFile(\n 'C:\\Users\\Admin\\Projects\\whimsical\\storage\\test\\test_file.jpg',\n 'test_file.jpg',\n 'jpg',\n 'null',\n 'null',\n true\n );\n\n $this->assertTrue(file_exists($file->path()), 'Test file does not exist');\n\n $product->addPhoto($product, $file);\n\n }", "protected function _actionAdd($context)\n\t{\t\n\t\t$data = $context->data;\t\t\n\t\t$file = KRequest::get('files.file', 'raw');\n\t\t$content = @file_get_contents($file['tmp_name']);\n\t\t$filesize = strlen($content);\n\t\t$uploadlimit = $this->_max_upload_limit * 1024 * 1024; \n\t\t\n\t\t$exif = (function_exists('exif_read_data')) ? @exif_read_data($file['tmp_name']) : array();\n\n\t\tif($filesize == 0)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('File is missing');\t\n\t\t\t\n\t\t return;\n\t\t}\n\t\t\n\t\tif($filesize > $uploadlimit)\n\t\t{\n\t\t throw new LibBaseControllerExceptionBadRequest('Exceed maximum size');\t\n\n\t\t return;\n\t\t}\n\n\t\t$orientation = 0;\n\t\t\n\t\tif(!empty($exif) && isset($exif['Orientation']) )\n {\n $orientation = $exif['Orientation']; \n }\t\t\n\t\t\n\t\t$data['portrait'] = array('data'=>$content,'rotation'=>$orientation,'mimetype'=>isset($file['type']) ? $file['type'] : null);\t\t\t\t\n \n\t\t$photo = $this->actor->photos->addNew($data);\t\n\t\t\n\t\t$photo->setExifData($exif);\n\t\t\n\t\t$photo->save();\n\t\t\n\t\t$this->setItem($photo);\n\t\t\n\t\t$this->getResponse()->status = KHttpResponse::CREATED;\n\t\t\n if($photo->body && preg_match('/\\S/',$photo->body))\n {\n $context->append(array( \n 'story' => array('body'=>$photo->body)\n )); \n }\n\n\t\treturn $photo;\n\t}", "public function save(Photo $photo);", "public function store($id, AddPhotoRequest $request)\n {\n $property = Property::find($id);\n\n if($property->photos()->count() === 10) {\n\n return response()->json([\n \"Property cannot have more than 10 photos\"\n ], 403);\n \n }\n\n $photo = $request->file('photo');\n\n try {\n\n (new AddPhotoToProperty($property, $photo))->saveToImgur();\n\n } catch(\\Exception $e) {\n\n return $e->getMessage();\n }\n\n \n\n }", "private function addProductPhotos(array $request){\n\n if(array_key_exists('photos', $request)){\n \n foreach($request['photos'] as $photos){\n\n $photo = new Photo();\n\n $photoProduct = Product::where('name', $request['name'])->get();\n $path = $photos->store('/storage/products');\n $filename = basename($path);\n $extension = $photos->getClientOriginalExtension();\n \n $photo->product_id = $photoProduct[0]->id; \n $photo->path = $filename;\n $photo->extension = $extension;\n\n $photo->save();\n }\n }\n }", "public function addPhoto($value)\n {\n $this->photos[] = $value;\n }", "public function actionCreate()\n\t{\n\t\t$model=new Photo;\n\t\tif(isset($_POST['Photo']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Photo'];\n if (!empty($_POST['Photo']['subcategoryArr']))\n $model->subcategory = implode(\",\", $_POST['Photo']['subcategoryArr']);\n if (!empty($_POST['Photo']['sizesArr']) && $_POST['Photo']['size'] == 1)\n $model->sizes = implode(\",\", $_POST['Photo']['sizesArr']);\n if (!empty($_POST['Photo']['colorArr']))\n $model->color = implode(\",\", $_POST['Photo']['colorArr']);\n\t\t\tif($model->save()){\n\t\t\t\t$this->redirect('/admin/photo/create');\n }\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function add_image_post() {\n $itemId = $this->input->post('item_id');\n $uploadResult= $this->upload();\n if ($uploadResult['upload'] === 'ok') {\n $fileData = $uploadResult['fileData'];\n $updatePayload = array(\n 'photo' => $fileData['file_name']\n );\n $res = $this->model->update($itemId, $updatePayload);\n return $this->response(\n array(\n \"status\" => \"ok\",\n \"result\" => $res\n ),\n parent::HTTP_ACCEPTED\n );\n\n }else{\n return $this->response(\n array( 'status' => 'UPLOADING FAILED', \n 'code' => '200', \n 'message' => $uploadResult['err']), \n parent::HTTP_BAD_GATEWAY );\n }\n }", "public function add_image() {\n\t $this->use_layout=false;\n\t $this->page = new $this->model_class(Request::get('id'));\n\t\t$this->join_name = \"images\";\n\t if(Request::post(\"id\")) {\n\t\t $this->image = new WildfireFile(Request::post('id'));\n\t\t $this->image->join_order = Request::post('order');\n\t\t $this->page->images = $this->image;\n\t }\n\t}", "public function addPhoto($username, AddProfilePhotoRequest $request) {\n\n // Set $photo to the fromFile() function,\n // and get the $requested file which is set to 'photo',\n // and upload it using the upload function().\n // -- 'photo' comes from the <script> tags in profile/index.blade.php.\n\n // Create a new photo instance from a file upload.\n $photo = ProfilePhoto::fromFile($request->file('photo'))->upload();\n\n // Set User::loacatedAt() in (User Model)\n // = to the username, and add the photo.\n // -- Find the user and add the Profile Photo.\n User::locatedAt($username)->addProfilePhoto($photo);\n\n }", "public function store(Request $request)\n {\n if($file = $request->file('photo_id')) {\n\n\n $name = time() . $file->getClientOriginalName();\n\n\n $file->move('images', $name);\n\n $photo = Photo::create(['file'=>$name]);\n\n\n\n $input['photo_id'] = $photo->id;\n\n $input['name'] = $request->name;\n\n //$input['type_id'] = $request->type_id;\n\n\n\n\n }\n\n\n Ground::create($input);\n\n\n Session::flash('created_ground','The ground has been added.');\n return redirect('/admin/grounds');\n\n\n }", "public function store(){\n $validateactualite = $this->validate([\n 'titre'=>'required',\n 'sous_titre'=>'required',\n 'descri'=>'required'\n ]);\n $this->validate([\n 'photo'=>'required'\n ]);\n $record = actualite::create($validateactualite);\n $this->photo->storePubliclyAs('public/actualite/', $record->id.'.png');\n //$this->photos[$index]->storePubliclyAs('public/galleries/', $data->id.'.png' );\n session()->flash('message', 'actualite enregistré avec succès');\n $this->emit('Added');\n $this->dispatchBrowserEvent('Added');\n $this->resetFields();\n }", "public function setPhoto(Photo $photoObject);", "function add() {\n\t\t$this->account();\n\t\tif (!empty($this->data)) {\n\t\t\t$this->Album->create();\n $data['Album'] = $this->data['Album'];\n\t\t\t$data['Album']['images']=$_POST['userfile'];\n\t\t\tif ($this->Album->save($data['Album'])){\n\t\t\t\t$this->Session->setFlash(__('Thêm mới danh mục thành công', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Thêm mơi danh mục thất bại. Vui long thử lại', true));\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function add(){\n $errors = false;\n $sdate = date('Y-m-d H:i:s');\n $dtime = time();\n\n if(!empty($_POST)){\n $artiste_hash = 'artiste+' . md5(uniqid());\n if(!empty($_FILES['fichier']['name'])){\n $art_photo = $_FILES['fichier']['name'];\n $path = ROOT . '/public/medias/images/interviews/';\n $ext = substr($art_photo, strpos($art_photo,'.'), strlen($art_photo)-1);\n $allowed = array('.jpeg','.jpg','.png','.GIF','.JPEG','.JPG','.PNG','.GIF');\n $art_photo = $_FILES[\"fichier\"][\"name\"] = $dtime . 'iphoto' . uniqid() . rand(1,99999) . $ext;\n $filename = $art_photo;\n if(!in_array($ext, $allowed)){\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Oops, l'extension de ce fichier n'est pas pris en compte !</div><?php\n }else{\n if(!is_writable($path)){\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Oops, vous n'avez pas accès à ce dossier !</div><?php\n }else{\n if(move_uploaded_file($_FILES['fichier']['tmp_name'],$path.$filename)){\n $naissdate = $_POST['annee'] . '-' . $_POST['mois'] . '-' . $_POST['jour'];\n $result = $this->Artiste->create([\n 'pseudo' => $_POST['pseudo'],\n 'noms' => $_POST['noms'],\n 'annee' => $naissdate,\n 'photo' => $filename,\n 'bio' => $_POST['biographie'],\n 'genre_id' => $_POST['genre'],\n 'artiste_hash' => $artiste_hash,\n 'dtime' => $dtime,\n 'sdate' => $sdate\n ]);\n if($result){\n $errors = true;\n }\n }else{\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Oops, Impossible d'uploader ce fichier !</div><?php\n }\n }\n }\n }else{\n ?><div class=\"alert alert-warm\"><span class=\"fa fa-ban\" ></span> Vous devez choisir un fichier (.mp4) !</div><?php\n }\n }\n\n $form = new DafstyleForm($_POST);\n\n $this->loadModel('Genre');\n $genres = $this->Genre->extractThis('id', 'titre');\n\n $this->render('admin.artistes.add', compact('form', 'genres', 'errors'));\n }", "public function addPhoto($type, $type_id, $restaurant_id, $url, $text, $status, $points, $user_id)\n {\n if (!$type) {\n throw new \\Exception('Invalid type for photos');\n }\n\n if (!$type_id) {\n throw new \\Exception('Invalid type_id ID for photos');\n }\n\n if (!$restaurant_id) {\n throw new \\Exception('Invalid restaurant_id for photos');\n }\n\n if (!$url) {\n throw new \\Exception('Invalid URL for photos');\n }\n\n if (!$text) {\n throw new \\Exception('Invalid text for photos');\n }\n\n if (!$status) {\n throw new \\Exception('Invalid status for photos');\n }\n\n if (!$points) {\n throw new \\Exception('Invalid points for photos');\n }\n\n if (!$user_id) {\n throw new \\Exception('Invalid user_id for photos');\n }\n\n try {\n $this->type = $type;\n $this->type_id = $type_id;\n $this->restaurant_id = $restaurant_id;\n $this->url = $url;\n $this->text = $text;\n $this->status = $status;\n $this->points = $points;\n $this->user_id = $user_id;\n $this->save();\n } catch (\\Exception $e) {\n throw $e;\n }\n }", "public function store(StoreUpdateTourRequest $request)\n {\n\n dd('OK');\n\n /*\n $request->validate([\n 'name' => 'required|min:3|max:255',\n 'description' => 'required|min:10|max:10000',\n 'photo' => 'required|image'\n ]);*/\n\n\n if($request->photo->isValid()){\n //$request->file('photo')->store('products/teste')\n //dd($request->photo->store('tours'));\n $nameFile = $request->name . '.' . $request->photo->extension(); \n\n dd($request->photo->storeAs('tours', $nameFile));\n }\n }", "public function postPicture(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n// $path,$desc,$tag\r\n $path=$_POST['path'];\r\n $desc=$_POST['content'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addPicture($path,$desc,$tag);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function add_pic() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['add_pic']) && !empty($_POST['add_pic'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if ($this->_model->addPicture($_POST['picture'])) {\n $this->_model->setFlash(\"add_success\", \"Photo ajoutée avec succès!\");\n $this->redirect(\"/montage\");\n }\n }\n }\n $this->_model->setFlash(\"add_error\", \"Erreur lors de l'ajout de votre photo!\");\n $this->redirect(\"/montage\");\n }", "public function addPhoto($paramsPhoto)\n {\n return DB::table('photos')->insert(\n [\n 'photos_link' => trim(strip_tags($paramsPhoto['link'])),\n 'album_id' => trim(strip_tags($paramsPhoto['albumId'])),\n ]\n ); }", "public function add(){\n $uploaded_image = Input::file('image_file_actual');\n $allowedTypes = array(\"image/jpeg\", \"image/png\", \"image/jpg\");\n \n \tif( !Input::hasFile('image_file_actual') ){\n return $this->jsonResponse(\"error\", \"No image provided\", Input::get('callback'));\n \t}\n if( !in_array($uploaded_image->getMimeType(),$allowedTypes) ){\n return $this->jsonResponse(\"error\", \"Uploaded invalided file type\", Input::get('callback'));\n }\n \t\n $image = new Image;\n $image->user_id = isset(Auth::user()->id) ? Auth::user()->id : \"guest\";\n $image->id = strtoupper(str_random(\"5\"));\n\twhile( isset(Image::find($image->id)->file) ){\n\t\t$image->id = strtoupper(str_random(\"5\"));\n\t}\n $imageName = $image->id . \".\" . $uploaded_image->getClientOriginalExtension();\t\n\t$image->file = URL::asset('images/'.$imageName);\n $image->rating = 0;\n $image->raters_count = 0;\n \n if(!$image->save()){\n return $this->jsonResponse(\"error\", \"Cannot add image\", Input::get('callback'), $image->errors());\n }\n \t\n $uploaded_image->move(public_path('images'), $imageName);\n \n if(!empty(Auth::user()->id)){\n $user = User::find(Auth::user()->id);\n $user->uploaded_count = $user->uploaded_count + 1;\n $user::$rules['password'] = '';\n if(!$user->updateUniques()){\n return $this->jsonResponse(\"error\", \"Unable to increase upload_count of user\", Input::get('callback'), $user->errors());\n }\n }\n \n return $this->jsonResponse(\"ok\", \"Succesfully added image\", Input::get('callback'), $image);\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'titre' => 'required',\n 'description' => 'required',\n 'lieuDeDepart' => 'required',\n 'duree' => 'required',\n \n 'photo' => 'image|nullable|max:1999'\n ]);\n \n // Handle File Upload\n if($request->hasFile('photo')){\n // Get filename with the extension\n $filenameWithExt = $request->file('photo')->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $request->file('photo')->getClientOriginalExtension();\n // Filename to store\n $fileNameToStore= $filename.'_'.time().'.'.$extension;\n // Upload Image\n $path = $request->file('photo')->storeAs('public/photo', $fileNameToStore);\n\n /* // Handle File Upload\n if($request->hasFile('photo')){\n // Get filename with the extenion\n \n $fileNameWithExt = $request->file('photo')->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($fileNameWithExt, PATHINFO_FILENAME);\n //Get Just ext\n $extension = $request->file('photo')->getClientOriginalExtension();\n // Filename To Store\n $fileNameToStore = $filename.'_'.time().'.'.$extension;\n // UploadBernex Image\n $path = $Bernex request->file('photo')->storeAs('public/photo', $fileNameToStore); */\n \n } else { \n $fileNameToStore = 'noimage.jpg'; \n } \n \n\n\n // Create Post\n $promo = new Promo;\n $promo->titre = $request->input('titre');\n $promo->description = $request->input('description');\n $promo->lieuDeDepart = $request->input('lieuDeDepart');\n $promo->duree = $request->input('duree');\n $promo->pourFamille = $request->input('pourFamille')||false;\n $promo->photo = $fileNameToStore;\n $promo->save(); \n\n return redirect('/promos')->with('success', 'Promenade Created'); \n\n }", "private function addData()\n {\n $data=new Image();\n $file =Input::file('gallery');\n $image_name=time().\"-gallery-\".$file->getClientOriginalName();\n $file->move(public_path().'/upload',$image_name);\n $data->image=$image_name;\n $data->save();\n return true;\n }", "function add_image_to_object($obj_type, $obj_id, $img_id)\n{\n /* $row = db_get_item_by_query('SELECT `order` FROM object_images WHERE obj_type = \"' .\n strtok($obj_type, \" \") . '\" AND obj_id = ' . (int)$obj_id .\n ' ORDER BY `order` DESC');\n\n $last_order = $row['order'] ? $row['order'] : 0;*/\n\n $r= db()->insert('object_images', array(\n 'obj_type' => strtok($obj_type, \" \"),\n 'obj_id' => (int)$obj_id,\n 'img_id' => (int)$img_id));\n return $r;\n}", "public function store(Request $request)\r\n {\r\n //validujemo\r\n //validujemo\r\n $this->validate($request, [\r\n 'title' => 'required',\r\n 'ingredients' => 'required',\r\n 'description' => 'required',\r\n 'photo' => 'required'\r\n]);\r\n\r\n$cover = $request->file('photo');\r\n $extension = $cover->getClientOriginalExtension();\r\n Storage::disk('public')->put($cover->getFilename().'.'.$extension, File::get($cover));\r\n \r\n\r\n\r\n// upisujemo u bazu\r\n$recipe = new Recipe;\r\n$recipe->user_id = auth()->user()->id;\r\n$recipe->title = $request->input('title'); // vracamo ime iz input\r\n$recipe->ingredients = $request->input('ingredients'); \r\n$recipe->description = $request->input('description');\r\n$recipe->photo = $cover->getFilename().'.'.$extension;\r\n\r\n// cuvamo poruku\r\n$recipe->save();\r\n\r\nreturn redirect('/dashboard')->with('success', 'Dodat recept! Bice prikazan kada ga odobri admin.');\r\n// moze redirect i u('/contacts/create') da ostanem na istu stranu\r\n }", "function dialogue_add_user_picture_fields(stdClass &$user) {\n global $PAGE;\n\n $user->fullname = fullname($user);\n $userpic = new user_picture($user);\n $imageurl = $userpic->get_url($PAGE);\n $user->imageurl = $imageurl->out();\n if (empty($user->imagealt)) {\n $user->imagealt = get_string('pictureof', '', $user->fullname);\n }\n return;\n}", "public function uploadPhoto($id = null){\n //are posted to the server.\n $this->viewBuilder()->setLayout('ext_file_upload');\n\n $path_parts = pathinfo($_FILES['photo']['name']);\n $unique = time();\n $dest = WWW_ROOT.\"img/nas/\".$unique.'.'.$path_parts['extension'];\n $dest_www = \"/cake3/rd_cake/webroot/img/nas/\".$unique.'.'.$path_parts['extension'];\n\n //Now add....\n $data['id'] = $this->request->getData('id');\n $data['photo_file_name'] = $unique.'.'.$path_parts['extension'];\n\n $uploadEntity = $this->{$this->main_model}->newEntity($data);\n if($this->{$this->main_model}->save($uploadEntity)){\n move_uploaded_file ($_FILES['photo']['tmp_name'] , $dest);\n $json_return['id'] = $uploadEntity->id;\n $json_return['success'] = true;\n $json_return['photo_file_name'] = $unique.'.'.$path_parts['extension'];\n }else{\n $message = 'Error';\n $json_return['errors'] = $this->JsonErrors->entityErros($uploadEntity, $message);\n $json_return['message'] = array(\"message\" => __('Problem uploading photo'));\n $json_return['success'] = false;\n }\n $this->set('json_return',$json_return);\n }", "public function actionAddPhoto()\n {\n $form = new HomeImageForm();\n if ($form->load(Yii::$app->request->post()) && $form->validate()) {\n try {\n $this->service->create($form);\n Yii::$app->session->setFlash('success','Успешно загружено. Ожидайте модерацию' );\n return $this->redirect(['index']);\n }catch (\\RuntimeException $e) {\n Yii::$app->session->setFlash('danger', $e->getMessage());\n }\n }\n\n return $this->render('create', [\n 'model' => $form,\n ]);\n\n }", "function photosets_addPhoto ($photoset_id, $photo_id) {\n\t\t$response = $this->execute(array('method' => 'flickr.photosets.addPhoto', 'photoset_id' => $photoset_id, 'photo_id' => $photo_id), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function checkPhoto(Resource $model)\n {\n if (rhas('photo')) {\n $photo = photos()->create();\n $data = [];\n if (rhas('coordinates')) {\n \t$data['location'] = parser()->pointFromCoordinates(input('coordinates'));\n }\n $data['photo_uuid'] = $photo->uuid;\n $data['photo_url'] = config('storage.path') . 'photos/' . $photo->photo_url;\n $model->update($data);\n $model->photos()->attach($photo->uuid);\n }\n\n }", "public function add(){\n // TODO\n // Validar que sea imagen\n // Validar que solo admins puedan mover esto\n\n // Verificamos que sea un envio por POST\n\t\tif ($this->request->is('post')) {\n $this->Game->create();\n if ($this->Game->saveWithOptionalFile($this->request, $this->Session,\n array(\n 'fileColumnName' => 'thumbnail',\n 'fileInputName' => 'game_logo',\n 'fileOptional' => false,\n )\n )){\n $this->redirect(array('action' => 'index'));\n }\n }\n\t}", "public function photo(){\n }", "public function addPhoto($file){\r\n\t\t$XMLObject = $this->getXMLObject();\r\n\t\tif($uid = $this->access->getUserId()){\r\n\t\t\t$img = new Image($file);\r\n\t\t\tif($img->isImage()){\r\n\t\t\t\t$w = $img->getWidth();\r\n\t\t\t\t$h = $img->getHeight();\r\n\t\t\t\t$d = $img->getDimensions($w, $h);\r\n\t\t\t\t$query = 'INSERT INTO blog_photos (user_id, width, height) VALUES ('.(int)$uid.', '.$d['width'].', '.$d['height'].')';\r\n\t\t\t\tif(DB::query($query)){\r\n\t\t\t\t\t$bln_success = FALSE;\r\n\t\t\t\t\t$pid = DB::insertId();\r\n\t\t\t\t\t//create image:\r\n\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_THUMB, MAX_PHOTO_WIDTH_THUMB, Utils::getPhotoPath($uid,$pid,'thumb','blog'))){//Thumb\r\n\t\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_MEDIUM, MAX_PHOTO_HEIGHT_MEDIUM, Utils::getPhotoPath($uid,$pid,'medium','blog'))){//Medium\r\n\t\t\t\t\t\t\tif($img->output(MAX_PHOTO_WIDTH_LARGE, MAX_PHOTO_HEIGHT_LARGE, Utils::getPhotoPath($uid,$pid,'large','blog'))){//Large\t\r\n\t\t\t\t\t\t\t\t$bln_success = TRUE;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(!$bln_success){\r\n\t\t\t\t\t\t$this->removePhoto($pid);\r\n\t\t\t\t\t\tparent::throwError($img->errorNo, $img->errorMessage);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else $this->throwError(7);\r\n\t\t\t}else parent::throwError($img->errorNo, $img->errorMessage);\r\n\t\t\t$img->destroy();\r\n\t\t}else $this->throwError(10);\r\n\t\treturn $XMLObject;\r\n\t}", "public function store(Request $request)\n {\n\n\n $validator = Validator::make($request->all(),\n [\n \n 'photos[]' => ['mimes:jpg,bmp,png'],\n 'file' => ['max:50120'],\n 'attachments' => ['max:3'],\n 'photos.*' => ['mimes:jpeg,jpg,png,gif','max:5120'],\n ],\n [\n 'photos.*.mimes' => '*Vienas iš failų nėra nuotrauka.',\n 'photos.max' => '*Galite turėti ne daugiau 10 nuotraukų.',\n 'photos.*.max' => '*Viena nuotrauka turi neviršyti 5MB.',\n 'photos.image' => '*Visi failai turi būti nuotraukos',\n 'file' => '*Nuotraukos dydis turi neviršyti 5MB '\n ]);\n if ($validator->fails()) {\n $request->flash();\n return redirect()->back()->withErrors($validator);\n }\n\n $item = new Item();\n $item->name = $request->name;\n $item->price = $request->price;\n $item->description = $request->description;\n $item->quantity = $request->quantity;\n $item->category_id = $request->category_id;\n $item->discount = $request->discount;\n $item->manufacturer = $request->manufacturer;\n $item->status = 0;\n if(isset($request->show)){\n $item->status = 10;\n }\n $item->save();\n $category = Category::find($request->category_id);\n foreach ($category->parameters as $parameter) {\n $item->parameters()->attach($parameter,['data' => $request->input($parameter->id)]);\n\n\n }\n\n if ($request->has('photos')) {\n foreach ($request->file('photos') as $photo) {\n // var_dump($photo);\n $img = Image::make($photo); //bitu kratinys, be jokios info\n $fileName = Str::random(5).'.jpg';// random sugalvojau\n $folder = public_path('images/items'); \n $img->resize(1200, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $img->save($folder.'/big/'.$fileName, 80, 'jpg');\n\n // $img = Image::make($photo);\n $img->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $img->save($folder.'/small/'.$fileName, 80, 'jpg');\n $photo = new Photo();\n $photo->name = $fileName;\n $photo->item_id = $item->id;\n $photo->save();\n }\n }\n\n return redirect()->route('category.map',$request->category_id);\n }", "public function storeProfile(Request $request)\n {\n //Add new post\n $this->validate($request, [\n 'titre' => 'required|string|max:60',\n 'description' => 'required|string|max:500',\n\n\n ]);\n\n $post = new Post;\n $post->titre = $request->titre;\n $post->description = $request->description;\n $post->personne_id = auth()->id();\n\n if ($post->save()) {\n $post->postProfil()->create();\n if (strcmp($request->img_one, \"undefined\") != 0) {\n $this->validate($request, [\n 'img_one' => ' nullable|image|mimes:jpeg,png,jpg,gif,svg,JPG,PNG,JPEG,GIF,SVG',\n ]);\n $this->uploadsImg($request->img_one, $post);\n }\n if (strcmp($request->img_two, \"undefined\") != 0) {\n $this->validate($request, [\n 'img_two' => ' nullable|image|mimes:jpeg,png,jpg,gif,svg,JPG,PNG,JPEG,GIF,SVG',\n ]);\n $this->uploadsImg($request->img_two, $post);\n }\n if (strcmp($request->img_three, \"undefined\") != 0) {\n $this->validate($request, [\n 'img_three' => ' nullable|image|mimes:jpeg,png,jpg,gif,svg,JPG,PNG,JPEG,GIF,SVG',\n ]);\n $this->uploadsImg($request->img_three, $post);\n }\n if (strcmp($request->img_fore, \"undefined\") != 0) {\n $this->validate($request, [\n 'img_fore' => ' nullable|image|mimes:jpeg,png,jpg,gif,svg,JPG,PNG,JPEG,GIF,SVG',\n ]);\n $this->uploadsImg($request->img_fore, $post);\n }\n $post = PostResource::collection(Post::where('id', '=', $post->id)->get());\n return $post;\n } else\n return response('Post profile is not created', 409);\n }", "public function store(ItemsCreateRequest $request)\n {\n\n $input = $request->all();\n\n\n if($file = $request->file('photo_id')){\n\n $name = $file->getClientOriginalName();\n\n $file->move('images', $name);\n\n $photo = Photo::create(['file'=>$name]);\n\n $input['photo_id'] = $photo->id;\n }\n\n Item::create($input);\n\n return redirect('/admin/items');\n\n\n\n\n }", "public function setPhotoData($body) {\n\t\t$cnt = count($body['photos']['photo']);\n\t\t$num = rand(0, $cnt-1);\n\t\t$this->photo = $body['photos']['photo'][$num];\n\t}", "public function store(Request $request)\n {\n\n if ( $request->documento != null){\n $hasObjecto = Objecto::where('num_documento',$request->documento )->first();\n if ( $hasObjecto){\n $request->session()->flash('warning', 'Foi encontrada uma correspondência deste objecto!');\n return redirect()->route('site.objecto.form');\n }\n }\n $nameFile = null;\n dd( $request->all()); \n \n if ($request->hasFile('foto') && $request->file('foto')->isValid()) {\n $name = uniqid(date('HisYmd'));\n $extension = $request->foto->extension();\n $nameFile = \"{$name}.{$extension}\";\n $upload = $request->foto->storeAs('objectos', $nameFile);\n\n if (!$upload) {\n }\n\n $pessoa = new Pessoa();\n $pessoa->nome = $request->nome;\n $pessoa->telefone = $request->telefone;\n $pessoa->save();\n\n $localizacao = new Localizacao();\n $localizacao->bairro = $request->bairro;\n $localizacao->descricao = $request->localDescricao;\n $localizacao->municipio_id = $request->municipio;\n $localizacao->save();\n\n $objecto = new Objecto();\n $objecto->num_documento = $request->documento;\n $objecto->descricao = $request->objDescricao;\n $objecto->estado = $request->estado;\n $objecto->tipo_objecto_id = $request->tipo;\n $objecto->pessoa_id = $pessoa->id;\n $objecto->localizacao_id = $localizacao->id;\n $objecto->save();\n\n $foto = new Imagem();\n $foto->objecto_id = $objecto->id;\n $foto->descricao = $request->objDescricao;\n $foto->imagem = $nameFile;\n $foto->save();\n \n $request->session()->flash('success', 'Registado com sucesso!');\n\n dd( $objecto );\n\n return redirect()->route('painel.categorias.create');\n }\n }", "public function store(Request $request)\n {\n // $validatedData = $request->validate([\n // 'fullname' => 'required|max:255',\n // 'title' => 'required|max:255',\n // 'profile' => 'required',\n // 'photo' => 'image|mimes:jpeg,png,jpg,gif,svg',\n // 'cover' => 'image|mimes:jpeg,png,jpg,gif,svg',\n\n // ]);//\n\n $validatedData = $this->validating($request);\n\n $photo = $this->upload($request, 'photo');\n $cover = $this->upload($request, 'cover');\n\n $person = new Person;\n $person->fullname = $request->fullname;\n $person->stage_name = $request->stage_name;\n $person->title = $request->title;\n $person->profile = $request->profile;\n $person->website = $request->website;\n $person->mobile = $request->mobile;\n $person->facebook = $request->facebook;\n $person->twitter = $request->twitter;\n $person->youtube = $request->youtube;\n $person->instagram = $request->instagram;\n $person->photo = $photo;\n $person->cover = $cover;\n\n $person->save();\n return redirect()->route('person.edit', $person->id)->with('success', 'Record saved successfully');\n // return back()->with('success', 'Record saved successfully');\n\n\n dd($cover, $photo);\n\n\n }", "public function addPhoto($id, Request $request)\n {\n $this->validate($request, [\n 'photo' => 'required|mimes:jpg,jpeg,png,bmp'\n ]);\n\n $photo = $this->makePhoto($request->file('photo'));\n\n //Save and associate photo with PhotoSession\n PhotoSession::findOrFail($id)->addPhoto($photo);\n }", "public function actionPhoto()\n {\n $Employee = Employee::getEmployee(Yii::app()->user->id);\n if($Employee != NULL)\n { \n $direccion = \"themes/metronic/img/profile/\".Yii::app()->user->name. \"/\";\n\n if(file_exists($direccion))\n {\n if(isset($_FILES[\"myfile\"]))\n {\n $ret = array();\n $error = $_FILES[\"myfile\"][\"error\"];\n if(!is_array($_FILES[\"myfile\"][\"name\"]))\n { //single file\n $fileName = uniqid() . '-' . $_FILES[\"myfile\"][\"name\"];\n move_uploaded_file($_FILES[\"myfile\"][\"tmp_name\"], $direccion . $fileName);\n $Employee->image_rute = $direccion.$fileName;\n if($Employee->save())\n { \n $namephoto[]='successUpdate'; \n $namephoto[]=$direccion.$fileName; \n echo json_encode($namephoto); \n }\n else\n { \n $namephoto[]='imageRuteFail'; \n $namephoto[]=$direccion.$fileName; \n echo json_encode($namephoto);\n }\n }\n }\n }\n else\n {\n mkdir($direccion, 0700);\n if(isset($_FILES[\"myfile\"]))\n {\n $ret = array();\n $error = $_FILES[\"myfile\"][\"error\"];\n if(!is_array($_FILES[\"myfile\"][\"name\"]))\n { //single file\n $fileName = uniqid() . '-' . $_FILES[\"myfile\"][\"name\"];\n move_uploaded_file($_FILES[\"myfile\"][\"tmp_name\"], $direccion . $fileName);\n $Employee->image_rute = $direccion.$fileName;\n if($Employee->save())\n {\n $namephoto[]='successNew'; \n $namephoto[]=$direccion.$fileName; \n echo json_encode($namephoto); \n }\n else\n { \n $namephoto[]='imageRuteFail'; \n $namephoto[]=$direccion.$fileName; \n echo json_encode($namephoto);\n }\n }\n }\n }\n }\n else\n {\n echo json_encode('dataFail');\n }\n }", "public function setPhoto($photo, $subject, $needToUplode = false,$params=array()) {\n\t\ttry {\n\n\t\t\tif ($photo instanceof Zend_Form_Element_File) {\n\t\t\t\t$file = $photo->getFileName();\n\t\t\t} else if (is_array($photo) && !empty($photo['tmp_name'])) {\n\t\t\t\t$file = $photo['tmp_name'];\n\t\t\t} else if (is_string($photo) && file_exists($photo)) {\n\t\t\t\t$file = $photo;\n\t\t\t} else {\n\t\t\t\tthrow new Group_Model_Exception('invalid argument passed to setPhoto');\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t}\n\n\t\t$imageName = $photo['name'];\n\t\t$name = basename($file);\n\t\t$path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'temporary';\n\n\t\t$params = array(\n\t\t\t'parent_type' => 'sitepage_page',\n\t\t\t'parent_id' => $subject->getIdentity()\n\t\t);\n\n\t\t// Save\n\t\t$storage = Engine_Api::_()->storage();\n\n\t\t// Resize image (main)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file)\n\t\t\t\t->resize(720, 720)\n\t\t\t\t->write($path . '/m_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Resize image (profile)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file)\n\t\t\t\t->resize(200, 400)\n\t\t\t\t->write($path . '/p_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Resize image (normal)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file)\n\t\t\t\t->resize(140, 160)\n\t\t\t\t->write($path . '/in_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Resize image (icon)\n\t\t$image = Engine_Image::factory();\n\t\t$image->open($file);\n\n\t\t$size = min($image->height, $image->width);\n\t\t$x = ($image->width - $size) / 2;\n\t\t$y = ($image->height - $size) / 2;\n\n\t\t$image->resample($x, $y, $size, $size, 48, 48)\n\t\t\t\t->write($path . '/is_' . $imageName)\n\t\t\t\t->destroy();\n\n\t\t// Store\n\t\t$iMain = $storage->create($path . '/m_' . $imageName, $params);\n\t\t$iProfile = $storage->create($path . '/p_' . $imageName, $params);\n\t\t$iIconNormal = $storage->create($path . '/in_' . $imageName, $params);\n\t\t$iSquare = $storage->create($path . '/is_' . $imageName, $params);\n\n\t\t$iMain->bridge($iProfile, 'thumb.profile');\n\t\t$iMain->bridge($iIconNormal, 'thumb.normal');\n\t\t$iMain->bridge($iSquare, 'thumb.icon');\n\n\t\t// Remove temp files\n\t\t@unlink($path . '/p_' . $imageName);\n\t\t@unlink($path . '/m_' . $imageName);\n\t\t@unlink($path . '/in_' . $imageName);\n\t\t@unlink($path . '/is_' . $imageName);\n\n\t\t// Update row\n\t\tif (empty($needToUplode)) {\n\t\t\t$subject->modified_date = date('Y-m-d H:i:s');\n\t\t\t$subject->save();\n\t\t}\n\n\t\t// Add to album\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\t$photoTable = Engine_Api::_()->getItemTable('sitepage_photo');\n\t\tif(isset($params['album_id']) && !empty($params['album_id']))\n\t\t{\n\t\t\t$album = Engine_Api::_()->getItem('sitepage_album', $params['album_id']);\n\t\t\tif(!$album->toArray())\n\t\t\t{\n\t\t\t\t$album = $subject->getSingletonAlbum();\n\t\t\t\t$album->owner_id = $viewer->getIdentity();\n\t\t\t\t$album->save();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$album = $subject->getSingletonAlbum();\n\t\t\t$album->owner_id = $viewer->getIdentity();\n\t\t\t$album->save();\n\t\t}\n\t\t$photoItem = $photoTable->createRow();\n\t\t$photoItem->setFromArray(array(\n\t\t\t'page_id' => $subject->getIdentity(),\n\t\t\t'album_id' => $album->getIdentity(),\n\t\t\t'user_id' => $viewer->getIdentity(),\n\t\t\t'file_id' => $iMain->getIdentity(),\n\t\t\t'collection_id' => $album->getIdentity()\n\t\t));\n\t\t$photoItem->save();\n\n\t\treturn $subject;\n\t}", "public function uploadImage()\r\n {\r\n /*\r\n * Response codes\r\n * 000 - Нет ошибок\r\n * 001 - Нет данных\r\n * 002 - Ошибка получения параметров файла\r\n * 003 - Ошибка получения пути файла\r\n * 004 - Ошибка перемещения файла\r\n * 005 - Требования не соблюдены\r\n * 006 - Нет папки салона\r\n */\r\n if (isset($_POST) &&\r\n isset($_FILES) &&\r\n array_key_exists('upload', $_FILES) &&\r\n count($_FILES['upload']) > 0 &&\r\n array_key_exists('slug', $_POST) &&\r\n array_key_exists('img_name', $_POST) &&\r\n array_key_exists('type', $_POST)\r\n ) {\r\n $type = $_POST['type'];\r\n if ($this->authentication->has_permission($type . '_upload')) {\r\n $img_name = $_POST['img_name'];\r\n $tmpFilePath = $_FILES['upload']['tmp_name'][0];\r\n $tmpFileType = $_FILES['upload']['type'][0];\r\n $tmpFileExtension = pathinfo($_FILES['upload']['name'][0], PATHINFO_EXTENSION);\r\n $tmpFileSize = $_FILES['upload']['size'][0];\r\n $tmpImageInfo = getimagesize($_FILES['upload']['tmp_name'][0]);\r\n if (array_key_exists('img_slug', $_POST)) {\r\n $fileParams = $this->FieldsModel->getFile($_POST['img_slug'], $_POST['img_slug']);\r\n } else {\r\n $fileParams = $this->FieldsModel->getFile($type, $img_name);\r\n }\r\n if ($fileParams) {\r\n if (\r\n $tmpFileType != $fileParams['mime'] ||\r\n $tmpImageInfo['mime'] != $fileParams['mime'] ||\r\n $tmpFileExtension != $fileParams['ext'] ||\r\n $tmpFileSize > $fileParams['max_size'] ||\r\n $tmpImageInfo[0] > $fileParams['max_width'] ||\r\n $tmpImageInfo[0] < $fileParams['min_width'] ||\r\n $tmpImageInfo[1] > $fileParams['max_height'] ||\r\n $tmpImageInfo[1] < $fileParams['min_height']\r\n ) {\r\n if ($tmpFileExtension === 'svg') {\r\n //Do nothing\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не удовлетворяет требованиям.', 'code' => '005', 'fileparams' => $fileParams));\r\n return;\r\n }\r\n }\r\n // Make sure we have a file path\r\n if ($tmpFilePath != '') {\r\n // Setup new file path\r\n if (!file_exists('./media/' . $_POST['type'] . '/' . $_POST['slug'] . '/')) {\r\n mkdir('./media/' . $_POST['type'] . '/' . $_POST['slug']);\r\n //echo json_encode(array('status' => 'fail', 'message' => 'Салон не сконфигурирован. Обратитесь к поставщику услуг.', 'code' => '006'));\r\n //return;\r\n }\r\n $newFilePath = './media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n // Upload the file into the temp dir\r\n if (move_uploaded_file($tmpFilePath, $newFilePath)) {\r\n // Create path to update image in frontend\r\n $path = base_url() . 'media/' . $_POST['type'] . '/' . $_POST['slug'] . '/' . $_POST['img_name'] . '.' . $tmpFileExtension;\r\n echo json_encode(array('status' => 'ok', 'message' => 'Изображение загружено.', 'code' => '000', 'path' => $path));\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '004'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '003'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '002'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, у вас нет прав!', 'code' => '999'));\r\n }\r\n } else {\r\n echo json_encode(array('status' => 'fail', 'message' => 'Изображение не загружено, попробуйте еще раз!', 'code' => '001'));\r\n }\r\n }", "public function upload($model = null, $model_id = null)\n {\n //ini_set(\"memory_limit\", \"100000M\");\n \n \n\n if (isset($this->params['gallery_id']) && !empty($this->params['gallery_id'])) {\n $document = $this->Document->findById($this->params['gallery_id']);\n $conteo= count ($document['Archivo']);\n //var_dump($document);exit;\n \n\n $logarchivo = array();\n foreach ($document['Archivo'] as $archivo) { \n //echo \"<PRE>\"; var_dump($archivo); echo \"</PRE>\";\n $logarchivo['LogArchivo']['archivo_id']=$archivo['id'];\n $logarchivo['LogArchivo']['name']=$archivo['name'];\n $logarchivo['LogArchivo']['path']=$archivo['path'];\n $logarchivo['LogArchivo']['size']=$archivo['size'];\n $logarchivo['LogArchivo']['document_id']=$archivo['document_id'];\n $logarchivo['LogArchivo']['main_id']=$archivo['main_id'];\n $logarchivo['LogArchivo']['caption']=$archivo['caption'];\n $logarchivo['LogArchivo']['style']=$archivo['style'];\n $logarchivo['LogArchivo']['order']=$archivo['order'];\n $logarchivo['LogArchivo']['modified']=$archivo['modified'];\n $logarchivo['LogArchivo']['created']=$archivo['created'];\n /*$logarchivo['LogArchivo']['styles']['small']=$archivo['styles']['small'];\n $logarchivo['LogArchivo']['styles']['medium']=$archivo['styles']['medium'];\n $logarchivo['LogArchivo']['styles']['large']=$archivo['styles']['large'];*/\n //$logarchivo['LogArchivo']['link']=$archivo['link'];\n // var_dump($album['Picture']['0']);exit;\n \n \n }\n //var_dump($document);exit;\n \n\n } else {\n # If the gallery doesnt exists, create a new one and redirect back to this page with the\n # gallery_id\n $document = $this->Document->init($model, $model_id);\n $logarchivo = array();\n $logarchivo['LogDocument']['document_id']=$document['Document']['id'];\n $logarchivo['LogDocument']['title']=$document['Document']['title'];\n $logarchivo['LogDocument']['default_name']=$document['Document']['default_name'];\n $logarchivo['LogDocument']['path']=$document['Document']['path'];\n $logarchivo['LogDocument']['model']=$document['Document']['model'];\n $logarchivo['LogDocument']['model_id']=$document['Document']['model_id'];\n $logarchivo['LogDocument']['tags']=$document['Document']['tags'];\n $logarchivo['LogDocument']['status']=$document['Document']['status'];\n $logarchivo['LogDocument']['created']=$document['Document']['created'];\n $logarchivo['LogDocument']['modified']=$document['Document']['modified'];\n // var_dump($document);var_dump($logarchivo);exit;\n $this->LogDocument->save($logarchivo);\n \n\n # Redirect back to this page with an document ID\n $this->redirect(\n array(\n 'action' => 'upload',\n 'gallery_id' => $document['Document']['id'],\n 'model_id'=>$model_id\n )\n );\n \n }\n \n\n $files = $document['Archivo'];\n // echo \"<PRE>\"; var_dump($logarchivo); echo \"</PRE>\";exit;\n //$this->LogArchivo->save($logarchivo);\n $this->set(compact('model', 'model_id', 'document', 'files'));\n }", "public function addImage(User $user)\n {\n //\n }", "public function store(Request $request, $photo)\n {\n $file = $request->file('file');\n if($file){\n $ext = $file->getClientOriginalExtension();\n $height = Image::make($file)->height();\n $width = Image::make($file)->width();\n $original = Image::make($file)->fit($width, $height)->encode($ext, 70);\n $thumb1 = Image::make($file)->fit(250, 200)->encode($ext, 70);\n $thumb2 = Image::make($file)->fit(1200, 600)->encode($ext, 70);\n $path = \"noticia/\" . date('Y/m/d/') . 'fotos/';\n $this->storage->put($path. 'original-' . $file->hashName(), $original);\n $this->storage->put($path. '250x200-'. $file->hashName(), $thumb1);\n $this->storage->put($path. '1200x600-'. $file->hashName(), $thumb2);\n $hashname = $file->hashName();\n }\n $record = new PhotoArticle;\n $record->path = $path;\n $record->image = $hashname;\n $record->article_id = $photo;\n $record->save();\n\n return response()->json([\n 'initialPreview' => ['/storage/'.$path. 'original-' . $hashname],\n 'initialPreviewConfig' => [\n ['key' => $record->id, 'exif' => $this->storage->path($path. 'original-' . $hashname)]\n ]\n ]);\n }", "function image_attachment_fields_to_save($post, $attachment)\n {\n }", "public function addSignature(Request $request)\n{\n // Form validation\n $request->validate([\n \n 'profile_image' =>'|image|mimes:jpeg,png,jpg,gif|max:2048'\n ]);\n\n // Get current user\n $user =User::findOrFail(2);\n // Set user name\n \n \n\n // Check if a profile image has been uploaded\n if ($request->has('profile_image')) {\n // Get image file\n $image = $request->file('profile_image');\n // Make a image name based on user name and current timestamp\n $name = Str::slug($request->input('lastname')).'_'.time();\n // Define folder path\n $folder = '/uploads/pictures/';\n // Make a file path where image will be stored [ folder path + file name + file extension]\n $filePath = $folder . $name. '.' . $image->getClientOriginalExtension();\n // Upload image\n $this->uploadOne($image, $folder, 'public', $name);\n // Set user profile image path in database to filePath\n $user->profile_image = $filePath;\n }\n // Persist user record to database\n $user->save();\n\n // Return user back and show a flash message\n return redirect()->back()->with(['success' => 'Signature ajoutée avec succès.']); \n}", "public function store(Request $request)\n {\n if (!Auth::check()) {\n return redirect()->back();\n }\n\n\n $input = $request->all();\n\n $validator = Validator::make($request->all(), [\n 'label' => 'string|min:3',\n 'description' => 'string|nullable',\n 'image' => 'required|image|file'\n ]);\n\n // validate inputs\n if ($validator->fails()) {\n Session::flash('error', 'Kindly check your inputs and try again!');\n return redirect()->back()\n ->withErrors($validator->errors())\n ->withInput($request->all());\n } else {\n try {\n // get dimensions\n $data = getimagesize($request->image);\n $width = $data[0];\n $height = $data[1];\n $type = $data[2];\n $attr = $data[3];\n\n // store\n $input['file'] = $this->getBaseUrl() . $this->uploadFile($request->image, 'media-photos');\n $input['published'] = $request->published == 'true' || true ? 1 : 0;\n $input['dimension'] = $width . ',' . $height;\n $input['slug'] = $input['file'];\n $input['name'] = !isset($input['name']) || $input['name'] == '' ? date('Y') . \"_\" . $request->image->getClientOriginalName() : $input['name'];\n $input['user_id'] = Auth::user()->id;\n $photo = Media::create($input);\n\n // redirect\n toast('success', 'Image Upload Successful!');\n return $this->index(new Request(['search' => '']));\n } catch (\\Throwable $th) {\n Session::flash('error', 'Process failed!');\n return back()->withErrors($th->getMessage());\n }\n }\n }", "public function store(PhotoCreateRequest $request)\n {\n DB::beginTransaction();\n $photo = $this->createPhotoInstance($request->all());\n $photo->owner()->associate(auth()->user());\n $photo->save();\n\n $photo->location()->save(\n new PhotoLocation($request->only('location'))\n );\n\n $tags = $this->createTags(explode(',', $request->tags));\n\n $photo->tags()->sync($tags->pluck('id')->toArray());\n\n // Execute processing to external photo: download, apply geocoding...\n dispatch(new ProcessingExternalPhoto($photo));\n\n DB::commit();\n\n // 201\n return $photo;\n }", "function add_img_tour($type,$item,$file){\n\tif($type == 'belarus'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus.json';\n\t}\n\tif($type == 'belarus_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus_pref.json';\n\t}\n\tif($type == 'foreigners'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners.json';\n\t}\n\tif($type == 'foreigners_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners_pref.json';\n\t}\n\t$exItem = explode('%',$item);\n\t$type = $exItem[0];\n\t$tour = (int)$exItem[1];\n\t$object = json_decode(file_get_contents($patch));\n\t$object_item = $object[0]->$type;\n\t$folder = $object_item[$tour]->img;\n\tdo{\n\t\t$img = randomName(10);\n\t\t$extension = explode('.',$file['name']);\n\t\t$imgName = $img.'.'.$extension[1];\n\t} while(file_exists('../../'.$folder.'/'.$imgName));\n\tmove_uploaded_file($file['tmp_name'], '../../'.$folder.'/'.$imgName);\n\treturn true;\n}", "public function create_comment_object($photo_id,$author=\"Anonymous\",$body=\"\"){\n\n if(!empty($photo_id) && !empty($author) && !empty($body)){\n global $database;\n $comment= new Comment();\n $comment->photo_id=(int)$photo_id;\n $comment->author=$author;\n $comment->body=\"$body\";\n $properties=$comment->getCleanAssArrOfObjPro();\n\n $sql=\"INSERT INTO \".static::$db_table.\"(\".implode(\",\",array_keys($properties)).\")\";\n $sql.=\"VALUES ('\".implode(\"','\",array_values($properties)).\"')\";\n if($database->query($sql)){\n $comment->id= $database->insertId();\n\n return true;\n\n }else{\n\n return false;\n }\n } else{\n\n return false;\n }\n\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'titre' => 'required',\n \n 'auteur' => 'required',\n 'genre' => 'required',\n 'date_achat' => 'required',\n 'date_parution' => 'required',\n 'date_parution' => 'required',\n 'langue_livre' => 'required',\n 'isbn' => 'required',\n 'nbr_pages' => 'required',\n 'annee' => 'required',\n ]);\n $photo = $request->file('photo');\n \n if(isset($photo))\n {\n// make unipue name for image\n $currentDate = Carbon::now()->toDateString();\n $imageName = $slug.'-'.$currentDate.'-'.uniqid().'.'.$photo->getClientOriginalExtension();\n\n if(!Storage::disk('public')->exists('livre'))\n {\n Storage::disk('public')->makeDirectory('livre');\n }\n\n $livreImage = Image::make($photo)->resize(1600,1066)->save();\n Storage::disk('public')->put('livre/'.$imageName,$livreImage);\n\n } else {\n $imageName = \"default.png\";\n }\n $livre = new Livre();\n $livre->user_id = Auth::id();\n $livre->title = $request->title;\n $livre->date_achat = $request->date_achat;\n $livre->date_parution = $request->date_parution;\n $livre->langue_livre = $request->langue_livre;\n $livre->annee = $request->annee;\n $livre->isbn = $request->isbn;\n $livre->nbr_pages = $request->nbr_pages;\n $livre->photo = $imageName;\n $livre->save();\n\n $livre->genres()->attach($request->genres);\n $livre->auteur()->attach($request->auteur);\n\n return response()->json(['livre'=> $livre],200);\n }", "public function store(StoreProfileRequest $request)\n {\n \n \n try{\n \n $type = $request->type == 'c' ? 'cover/':'photo/';\n $folder = 'public/front/profile/'.$type;\n $path = UploadPhoto($folder,$request->path, $type);\n \n PhotoProfile::create([\n 'type' => $request->type ,\n 'profile_id' => $request->profile_id,\n 'path' => $path,\n ]);\n\n return back()->with('message','create new photo');\n \n }\n catch(\\Exception $ex){\n DB::rollback();\n return back()->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n \n\n }", "private function validatePhoto()\n {\n if (empty($this->photo['name'])) {\n $this->updateEditProfile();\n } else {\n $formatNamePhoto = new \\Module\\administrative\\Models\\helper\\AdmsFormatCharacter();\n $this->dados['imagem'] = $formatNamePhoto->formatCharacters($this->photo['name']);\n $uploadImg = new \\Module\\administrative\\Models\\helper\\AdmsUploadImgRed();\n $uploadImg->uploadImd(\n $this->photo,\n 'assets/image/user/' . $_SESSION['userId'] . '/',\n $this->dados['imagem'],\n 150,\n 150\n );\n if ($uploadImg->getResult()) {\n $deleteImg = new \\Module\\administrative\\Models\\helper\\AdmsDeleteImg();\n $deleteImg->deleteImage('assets/image/user/' \n . $_SESSION['userId'] . '/' . $this->imgageOld);\n $this->updateEditProfile();\n } else {\n $this->result = false;\n }\n }\n }", "function uploadObject();", "public function store(Request $request)\n {\n try {\n $item = Product::create([\n 'user_id' => Auth::id(),\n 'category_id' => $request->category_id,\n 'name' => $request->name,\n 'short_text' => $request->short_text,\n 'description' => $request->description,\n 'img' => (isset($request->img) ? file_store($request->img, 'assets/uploads/photos/product_img/', 'photo_') : null),\n ]);\n\n if (isset($request->property_value)) {\n foreach ($request->property_value as $key => $property_value) {\n if ($property_value) {\n $pp = ProductProperty::create([\n 'product_id' => $item->id,\n 'property_id' => $request->property_id[$key],\n 'value' => $property_value\n ]);\n }\n }\n }\n\n if (isset($request->photo)) {\n foreach ($request->photo as $key => $photo) {\n if (isset($photo) and $photo) {\n $ph = new Photo();\n $ph->path = file_store($photo, 'assets/uploads/photos/product_photos/', 'photo_');\n $item->photo()->save($ph);\n }\n }\n }\n\n return redirect()->route('product.index')->with('flash_message', 'با موفقیت انجام شد');\n }catch (\\Exception $e){\n return redirect()->back()->withInput()->with('err_message', 'خطایی رخ داده است، لطفا مجددا تلاش نمایید');\n }\n }", "public function addSitePhoto(Request $request)\n {\n // to write the code which upload Site photo\n }", "public function onUserProfilePhotoUpload($event)\n {\n\t\tif(Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album'))\n\t\t\treturn;\n $payload = $event->getPayload();\n if( empty($payload['user']) || !($payload['user'] instanceof Core_Model_Item_Abstract) ) {\n return;\n }\n if( empty($payload['file']) || !($payload['file'] instanceof Storage_Model_File) ) {\n return;\n }\n $viewer = $payload['user'];\n $file = $payload['file'];\n // Get album\n $table = Engine_Api::_()->getDbtable('albums', 'sesalbum');\n $album = $table->getSpecialAlbum($viewer, 'profile');\n $photoTable = Engine_Api::_()->getDbtable('photos', 'sesalbum');\n $photo = $photoTable->createRow();\n $photo->setFromArray(array(\n 'owner_type' => 'user',\n 'owner_id' => Engine_Api::_()->user()->getViewer()->getIdentity()\n ));\n $photo->save();\n $photo->setPhoto($file);\n $photo->album_id = $album->album_id;\n $photo->save();\n if( !$album->photo_id ) {\n $album->photo_id = $photo->getIdentity();\n $album->save();\n }\n $auth = Engine_Api::_()->authorization()->context;\n $auth->setAllowed($photo, 'everyone', 'view', true);\n $auth->setAllowed($photo, 'everyone', 'comment', true);\n $auth->setAllowed($album, 'everyone', 'view', true);\n $auth->setAllowed($album, 'everyone', 'comment', true);\n $event->addResponse($photo);\n }", "function addData($conn){\n $sql=\"INSERT INTO student (studentName, bithDate,address,photoName)\n VALUES ('\".$_POST['studentName'].\"', '\".$_POST['birthDate'].\"', '\".$_POST['address'].\"','photos/\".$_FILES['photo']['name'].\"')\";\n if (mysqli_query($conn, $sql)) {\n echo \"<h3>Create Student Successfully</h3>\";\n uploadPhoto();\n } else {\n echo \"Error: \" . $sql . \"<br>\" . mysqli_error($conn);\n }\n}", "function _photo_gallery_content_default_fields() {\n $fields = array();\n\n // Exported field: field_gallery\n $fields[] = array(\n 'field_name' => 'field_gallery',\n 'type_name' => 'photo',\n 'display_settings' => array(\n 'weight' => '-1',\n 'parent' => '',\n 'label' => array(\n 'format' => 'hidden',\n ),\n 'teaser' => array(\n 'format' => 'hidden',\n 'exclude' => 1,\n ),\n 'full' => array(\n 'format' => 'hidden',\n 'exclude' => 1,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'token' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'nodereference',\n 'required' => '1',\n 'multiple' => '0',\n 'module' => 'nodereference',\n 'active' => '1',\n 'referenceable_types' => array(\n 'gallery' => 'gallery',\n 'front' => 0,\n 'lyrics' => 0,\n 'page' => 0,\n 'photo' => 0,\n 'story' => 0,\n 'image' => 0,\n ),\n 'advanced_view' => '--',\n 'advanced_view_args' => '',\n 'widget' => array(\n 'node_link' => array(\n 'teaser' => 0,\n 'full' => 1,\n 'title' => 'Add Photo',\n 'hover_title' => '',\n 'destination' => 'node',\n ),\n 'fallback' => 'select',\n 'edit_fallback' => NULL,\n 'label' => 'gallery',\n 'weight' => '-1',\n 'description' => '',\n 'type' => 'nodereference_url',\n 'module' => 'nodereference_url',\n ),\n );\n\n // Exported field: field_image\n $fields[] = array(\n 'field_name' => 'field_image',\n 'type_name' => 'photo',\n 'display_settings' => array(\n 'weight' => 0,\n 'parent' => '',\n 'label' => array(\n 'format' => 'hidden',\n ),\n 'teaser' => array(\n 'format' => 'hidden',\n 'exclude' => 1,\n ),\n 'full' => array(\n 'format' => 'image_plain',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'image_plain',\n 'exclude' => 0,\n ),\n 'token' => array(\n 'format' => 'image_plain',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'png gif jpg jpeg',\n 'file_path' => 'gallery',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'max_resolution' => '0',\n 'min_resolution' => '0',\n 'alt' => 'Texcentrics',\n 'custom_alt' => 1,\n 'title' => 'Texcentrics Photo',\n 'custom_title' => 1,\n 'title_type' => 'textfield',\n 'default_image' => NULL,\n 'use_default_image' => 0,\n 'label' => 'image',\n 'weight' => 0,\n 'description' => '',\n 'type' => 'imagefield_widget',\n 'module' => 'imagefield',\n ),\n );\n\n // Translatables\n array(\n t('gallery'),\n t('image'),\n );\n\n return $fields;\n}", "public function store(Request $request, $id)\n {\n try {\n $photo = new \\App\\Photo;\n $validator = $photo->validate($request->file());\n if ($validator->fails()) {\n $validationStr = '';\n foreach ($validator->errors()->getMessages() as $k => $error) {\n foreach ($error as $err) {\n $validationStr .= $err .'<br/>';\n }\n \n }\n return response()->json($validationStr, 400, [], JSON_UNESCAPED_UNICODE);\n }\n $roomPhoto = new \\App\\Photo;\n $photo = $request->file('photo');\n $roomID = $request->input('roomID');\n $filename = $photo->getClientOriginalName();\n $name = pathinfo($filename, PATHINFO_FILENAME); // file\n $ext = pathinfo($filename, PATHINFO_EXTENSION); // jpg\n \n $uploadPath = \\Config::get('copenhagen.uploadsPath') .'/';\n $path = \\Config::get('copenhagen.rooms.url');// . '/' . $roomID; \n\n if (\\File::exists(public_path(). $path .'/'. $filename))\n {\n $name = $name .'_'. time();\n $filename = $name .'.'.$ext;\n }\n\n if ($photo->move(public_path(). $path, $filename)) {\n $dir = public_path(). $path . '/';\n $sizes = \\Config::get('copenhagen.rooms.image.sizes');\n $images = array(\n 'orig' => $path .'/'. $filename\n );\n foreach ($sizes as $key => $size) {\n $img = \\Image::make($dir. $filename)->fit($size['width'], $size['height']);\n $_n = $name. '_'. $size['width'] .'x'. $size['height'] .'.'. $ext;\n $images[$key] = $path .'/'. $_n;\n $img->save($dir.$_n);\n }\n\n \n $roomPhoto->file = $images;\n $roomPhoto->default = 0;\n \n $room = \\App\\Room::findOrFail($id);\n \n $room->photos()->save($roomPhoto);\n \n\n $photos = $room->photos()->get();\n foreach($photos as $i => $photo) {\n $photos[$i]['file'] = $photo->file;\n }\n return response()->json($photos, 200, [], JSON_UNESCAPED_UNICODE);\n } else {\n return response()->json('failed', 400);\n }\n\n } catch(\\Exception $e) {\n \\Log::info('ERROR: '.$e->getMessage());\n return response()->json('Oops! Error please report to administrator.', 400, [], JSON_UNESCAPED_UNICODE);\n }\n }", "public function create($data,$user_id,$photo){\n $customer = new Customer();\n $customer->name = strip_tags($data['name']);\n $customer->address = strip_tags($data['address']);\n $customer->fonction = strip_tags($data['fonction']);\n $customer->wilaya = strip_tags($data['wilaya']);\n $customer->commune = strip_tags($data['commune']);\n $customer->type = $data['type'];\n $customer->photo=$photo;\n $customer->id = $user_id;\n $customer->save();\n }", "public function store(ImageUploadRequest $request)\n {\n $profile = new Profile();\n \n $profile->id = Auth::user()->id;\n $profile->gender = $request->gender;\n $profile->address = $request->address;\n $profile->dob = $request->dob;\n $profile->phone_number = $request->phone_number;\n $profile->school_name = $request->school_name;\n // $profile->user_id = User::find(1)->id;\n $profile->user_id = Auth::user()->id;\n\n\n\n //your_photo upload\n $myArray =explode('@', Auth::user()->email);\n $your_photo = 'your_photo_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->your_photo->getClientOriginalExtension();\n $request->your_photo->move(public_path('/images/your_photos'), $your_photo);\n $profile->your_photo = $your_photo;\n\n //citizenship_front upload\n $citizenship_front = 'citizenship_front_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->citizenship_front->getClientOriginalExtension();\n $request->citizenship_front->move(public_path('/images/citizenship_fronts'), $citizenship_front);\n $profile->citizenship_front = $citizenship_front;\n\n //citizenship_back upload\n $citizenship_back = 'citizenship_back_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->citizenship_back->getClientOriginalExtension();\n $request->citizenship_back->move(public_path('/images/citizenship_backs'), $citizenship_back);\n $profile->citizenship_back = $citizenship_back;\n\n //marksheet_photo upload\n $marksheet_photo = 'marksheet_photo_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->marksheet_photo->getClientOriginalExtension();\n $request->marksheet_photo->move(public_path('/images/marksheet_photos'), $marksheet_photo);\n $profile->marksheet_photo = $marksheet_photo;\n\n //saving interests by implode function:\n if($request->has('interest')){\n $stringOfInterest = implode(',', $request->input('interest'));\n $profile->interest = 'Academic,'.$stringOfInterest;\n }\n else{\n $profile->interest = \"Academic\";\n }\n \n //saving interests\n // $input = $request->all();\n // $input['interest'] = $request->input('interest');\n // $profile->interest = $input['interest'];\n \n\n $profile->save();\n \n $user = User::findOrFail(Auth::user()->id);\n $user->profile_id = Auth::user()->id;\n $user->save();\n\n return redirect()->route('home')->withStatus('Profile info added!');\n\n\n }", "public function postNewImage(Request $request)\n {\n $this->validate($request, [\n 'photo' => 'required|image',\n ]);\n }", "public function insertImageToDb() \n {\n }", "public function addPhoto($idMember, $title, $description, $url, $lat, $lng, $status){\n $sql = 'INSERT INTO photos(memberId, name, description, url, lat, lng, status, date_added) VALUES(?, ?, ?, ?, ?, ?, ?, NOW())';\n $this->executeQuery($sql, array($idMember, $title, $description, $url, $lat, $lng, $status));\n }", "public function store(PictureRequest $request)\n {\n //\n $id = Auth()->user()->id;\n $validatedData = $request->validated();\n $data = [\n \"user_id\" => $id,\n \"title\" => $validatedData[\"title\"],\n \"photos\" => $validatedData[\"photos\"],\n \"photoCount\" => count($validatedData[\"photos\"]),\n \"photoTag\" => Str::slug($validatedData[\"title\"])\n ];\n\n Picture::create($data);\n\n return response()->json([\n \"status\" => \"success\",\n \"status_code\" => StatusCodes::SUCCESS,\n \"message\" => \"Photos uploaded successfully\",\n \"data\" => array(\n \"user_id\" => $data[\"user_id\"],\n \"title\" => $data[\"title\"],\n \"photos\" => $data[\"photos\"]\n )\n ],StatusCodes::SUCCESS);\n }", "public function store(Request $request)\n {\n\n\n \n\n $photos = $request->file('photos');\n if ($photos) {\n $inc = 0;\n foreach($photos as $photo){\n $inc++;\n $blog_image = new NewsImage();\n $image_name = Auth::user()->id.time().$inc.'.'.$photo->getClientOriginalExtension();\n\n\n $image_full_name = $image_name;\n $destination_path = 'uploads/newsimages/';\n $image_url = $destination_path . $image_full_name;\n $success = $photo->move($destination_path, $image_full_name);\n if ($success) {\n \n $blog_image->photos = $image_url;\n }\n $blog_image->news_id = $request->news_id;\n $blog_image->save();\n }\n }\n\n return back();\n\n\n }", "public static function putImages($model, $images, $path, $type, $quantity)\n {\n $images = (array) $images;\n $number = $model->media()->get()->count();\n $difference = null;\n $limitedImgs = null;\n\n if($number < $quantity)\n {\n $difference = $quantity - $number;\n // dd($images);\n $limitedImgs = array_slice($images,0,$difference);\n\n foreach ($limitedImgs as $key => $image) \n {\n $img = Image::make($image->getRealPath());\n\n $img->resize(800, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $image_name = $key. '-' .time().'.'.$image->getClientOriginalExtension();\n\n /*\n ** check if directory exists\n ** if not, create it\n */\n $directory = public_path('/uploads/'. $path);\n if (!file_exists($directory)) \n {\n File::makeDirectory($directory, $mode = 0777, true, true); \n }\n if($directory)\n {\n /*\n ** Save image\n */\n $img->save(public_path('/uploads/'. $path . '/' .$image_name));\n }\n\n $model->media()->create([\n 'id' => (string) Uuid::generate(4),\n 'media_key' => $type,\n 'media_value' => $image_name,\n ]);\n }\n\n // $cover = $model->media()->where('image_key', 'cover')->first();\n\n // if(!$cover)\n // {\n // $model->media()->first()->update(['image_key' => 'cover']);\n // }\n \n }\n else{\n \\Session::flash('msg', trans('session.you_uploaded_max_img_number'));\n return back();\n }\n \n }", "public function store(Request $request) {\n // Validates inputs as required\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required',\n 'photo' => 'required|image|max:1999|'\n ]);\n\n /* GET PHOTO */\n //Get full file\n $fileNameWithExt = $request->file('photo')->getClientOriginalName();\n // Get file name\n $fileName = pathinfo($fileNameWithExt, PATHINFO_FILENAME);\n //Get file extension\n $fileExt = $request->file('photo')->getClientOriginalExtension();\n // Compose final file\n $fileToUpload = $fileName . '_' . time() . '.' . $fileExt;\n // Upload image\n $path = $request->file('photo')->storeAs('public/photos/'.$request->input('album_id'), $fileToUpload);\n\n /* MAKE NEW ALBUM */\n $photo = new Photo;\n $photo->album_id = $request->input('album_id');\n $photo->title = $request->input('title');\n $photo->description = $request->input('description');\n $photo->size = $request->file('photo')->getClientSize();\n $photo->photo = $fileToUpload;\n $photo->save();\n\n return redirect('/albums/'.$request->input('album_id'))->with('success', 'Photo Uploaded');\n }", "private function saveNewImg($type,$type_id){\n\n if (Yii::$app->request->post('Imgnew') && isset($_FILES['Imgnew'])){\n $imgs = Yii::$app->request->post('Imgnew');\n //ex($imgs);\n $files = (isset($_FILES['Imgnew']['name'])) ? $_FILES['Imgnew']['name'] : [];\n\n\n foreach ($files as $num => $file_name){\n\n //if ((int)$imgs[$num]['img_0']['valid'] == 1){\n\n $imgOrg = $this->saveOriginalNew($num,$type,$type_id);\n\n\n //mine list size Image\n // create&set model\n // resize img\n\n if ( $imgOrg != null ){\n\n $img = new Img();\n $img->alt = $imgs[$num]['alt'];\n $img->title = $imgs[$num]['title'];\n $img->width = (int)$imgs[$num]['width'];\n $img->height = (int)$imgs[$num]['height'];\n $img->size = $imgs[$num]['size'];\n $img->watermark = (isset($imgs[$num]['watermark'])) ? (int)$imgs[$num]['watermark'] : 0;\n $img->resize =(isset($imgs[$num]['resize'])) ? (int)$imgs[$num]['resize'] : 0;\n $img->harshness =(isset($imgs[$num]['harshness'])) ? (int)$imgs[$num]['harshness'] : 0;\n\n\n\n $img->crop_x = (int)$imgs[$num]['crop_x'];\n $img->crop_y = (int)$imgs[$num]['crop_y'];\n\n $img->crop_width = (int)$imgs[$num]['crop_width'];\n $img->crop_height = (int)$imgs[$num]['crop_height'];\n\n $img->wrap_width = (int)$imgs[$num]['wrap_width'];\n $img->wrap_height = (int)$imgs[$num]['wrap_height'];\n\n // $img->ord = (int) $imgs[$num]['ord'];\n\n\n if ($img->resize)\n if ( (! $img->width || ! $img->height) ){\n $size =explode('_', $img->size);\n if (count( $size )){\n $img->width = (int)$size[0];\n $img->height = (int)$size[1];\n }\n\n }\n\n $this->resizeImg($imgOrg,$img,$type,$type_id);\n }\n // }\n\n }\n }\n\n $this->saveImgLinks($type_id,$type);\n }", "public function store(Request $request)\n{\n \n \n $data = $request->all();\n if ($logo = $request->file('logo')) {\n $image_name = $logo->getRealPath();\n // Cloudinaryへアップロード\n Cloudder::upload($image_name, null);\n list($width, $height) = getimagesize($image_name);\n // 直前にアップロードした画像のユニークIDを取得します。\n $publicId = Cloudder::getPublicId();\n // URLを生成します\n\n //インスタンス作成\n \n $photo = new Photo;\n\n \n //Inputタグのname属性がonamaeの場合 $request->onamae で値を受け取る\n //モデルインスタンスのname属性に代入\n \n $photo->post_id = Auth::id();\n $photo->name = $publicId;\n \n\n //saveメソッドが呼ばれると新しいレコードがデータベースに挿入される\n $postcard->save();\n\n $logoUrl = Cloudder::secureShow($publicId, [\n 'width' => $width,\n 'height' => $height\n ]);\n\n }\n return view('postcards.create');\n }", "public function store()\n {\n $inputs = Input::all();\n\n $validator = $this->photoGallery->validate($inputs);\n if ($validator->fails()) {\n return redirect(PREFIX.'/multicms/pages/gallery/photoCreate')->withErrors($validator)->withInput();\n }\n\n if (Input::hasFile('cover_pic')) {\n $directory = base_path() . '/uploads/gallery';\n $originalName = InputHelpers::cleanURL(Input::file('cover_pic')->getClientOriginalName());\n $fileName = uniqid() .'.'.Input::file('cover_pic')->getClientOriginalExtension();\n $fileNameDir = $directory . '/' . $fileName;\n $image = Image::make(Input::file('cover_pic'));\n $image->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $image->save($fileNameDir, 100);\n $inputs['cover_pic'] = $fileName;\n }\n\n // Store the gallery details\n\n if($this->photoGallery->add($inputs))\n {\n $data['msgSuccess'] =\"Gallery added.\";\n return redirect(PREFIX.'/multicms/pages/gallery')->withErrors($data);\n }\n else\n {\n $data['msgError'] =\"Could not add gallery.\";\n return redirect(PREFIX.'/multicms/pages/gallery')->withErrors($data);\n } \n \n\n\n }", "public function store(Request $request)\n {\n $data = $request->all();\n // dd($data);\n //validation\n $request->validate([\n \"title\" => \"required|max:255\",\n \"street\" => \"required\",\n \"metropolis\" => \"required\",\n \"country\" => \"required\",\n \"zip_code\" => \"required|max:10\",\n \"description\" => \"max:400\",\n \"rooms_number\" => \"required|integer\",\n \"beds_number\" => \"required|integer\",\n \"bathrooms_number\" => \"required|integer\",\n \"flat_image\" => \"required|image\",\n \"square_meters\" => \"required|integer\",\n \"latitude\" => \"required|between:-90,90\",\n \"longitude\" => \"required|between:-180,180\",\n \"active\" => \"boolean\"\n ]);\n\n //indirizzo di salvataggio dell'immagine e creo cartella \"images\" dove salvo le immagini uploadate\n $path = Storage::disk(\"public\")->put(\"images\", $data[\"flat_image\"]);\n\n //creo nuovo oggetto di tipo Proprietà\n $newProperty = new Property;\n\n $newProperty->user_id = Auth::id();\n $newProperty->title = $data[\"title\"];\n $newProperty->street = $data[\"street\"];\n $newProperty->metropolis = $data[\"metropolis\"];\n $newProperty->country = $data[\"country\"];\n $newProperty->description = $data[\"description\"];\n $newProperty->rooms_number = $data[\"rooms_number\"];\n $newProperty->beds_number = $data[\"beds_number\"];\n $newProperty->bathrooms_number = $data[\"bathrooms_number\"];\n $newProperty->flat_image = $path;\n $newProperty->square_meters = $data[\"square_meters\"];\n $newProperty->latitude = $data[\"latitude\"];\n $newProperty->longitude = $data[\"longitude\"];\n if(isset($data[\"active\"])){\n $newProperty->active = $data[\"active\"];\n };\n\n //salvataggio\n $newProperty->save();\n\n if (isset($data[\"extras\"])) {\n $newProperty->extras()->sync($data[\"extras\"]);\n }\n\n //redirect verso nuova pagina (show)\n return redirect()->route(\"admin.properties.show\", $newProperty);\n }", "private function createThumbs() {\n if (preg_match('/image/', $this->mime_type)) {\n Thumb::add($this->id);\n }\n }", "public function store(Request $request)\n {\n // validation user \n $request->validate(\n [\n 'propic_url' => 'required|image',\n 'bio' => 'required|max:500',\n 'service' => 'required|max:300',\n 'phone' => 'nullable|numeric',\n 'avg_hourly_rate' => 'required|numeric|between:0,99.99',\n 'specs' => 'required'\n ]\n );\n // \n\n // assegno ai campi del form creati l'id dello user \n $users = Auth::user();\n $data = $request->all();\n $data['user_id'] = $users->id;\n // \n // creo un nuovo record nella tabella UserDetail \n $newUserDetail = new UserDetail();\n\n // aggiungiamo la img_url alla cartella storage\n $new_pic = Storage::put('propics', $data[\"propic_url\"]);\n $data[\"propic_url\"] = $new_pic;\n\n // riempo il record con i data e salvo i dati \n $newUserDetail->fill($data);\n $newUserDetail->save();\n // \n // attacco all'utente le specializzazioni\n $users->specializations()->attach($data['specs']);\n\n // lo rimando sulla index che lo manda sulla /admin/home\n return redirect()->route('admin.user.index')->with('add_details', 'Complimenti bootanico hai compleato il tuo profilo!');\n }", "public function agregar(Request $request) \n {\n \n $responsable = new Responsable;\n $responsable->nombre = $request->get('nombre');\n $responsable->apellidos = $request->get('apellidos');\n $responsable->tel = $request->get('tel');\n $responsable->desc = $request->get('desc');\n \n $responsable->id_photo = 0;\n \n $responsable->save();\n \n $new_id = $responsable->id;\n ///////////\n \n //////// Guardar imagen si existe\n \n $curfile = $request->file('image');\n \n\n \n if ($curfile) \n {\n $imageName = $curfile->getClientOriginalName();\n $filesize = $curfile->getSize();\n $filetype = $curfile->getMimeType();\n \n\n $file_save_folder = \"uploaded_folder\".DIRECTORY_SEPARATOR.\"fotos_responsables\".DIRECTORY_SEPARATOR.\"$new_id\".DIRECTORY_SEPARATOR;\n \n $curPath = public_path($file_save_folder);\n \n if (!file_exists($curPath))\n {\n \n if (mkdir($curPath)){\n \n }\n else {\n Session::flash('error', 'No se agrego la fotografia'); \n return redirect('responsables');\n }\n }\n \n $curfile->move($curPath, $imageName);\n\n $responsable_foto = new Responsable_Fotos;\n $responsable_foto->id_responsable=$new_id;\n $responsable_foto->archivo = $imageName;\n $responsable_foto->type = $filetype;\n $responsable_foto->size = $filesize;\n $responsable_foto->save();\n \n \n \n \n \n \n \n }\n \n \n Session::flash('success', 'Datos Agregados correctamente'); \n return redirect('responsables');\n }", "public function store(Request $request)\n {\n $files = $request->image;\n $rules = [\n 'name' => 'required|string|min:3',\n 'price' => 'required|numeric',\n 'description' => 'required|string|min:3',\n 'caracteristiques' => 'required|string|min:3',\n 'stock' => 'required|numeric|min:1',\n 'colors.*' => 'nullable|numeric|exists:colors,id',\n 'category_id' => 'required|numeric|exists:categories,id',\n 'type_id' => 'required|numeric|exists:types,id',\n ];\n $validator = Validator::make($request->all(), $rules);\n if (!isset($files)) {\n $validator->addFailure('image', 'required');\n } elseif (isset($files) && sizeof($files) > 5) {\n $validator->addFailure('image', 'max_image');\n }\n\n $images = [];\n $allowedMimeTypes = ['image/jpeg', 'image/png', 'image/jpg'];\n if (is_object($files)) {\n foreach ($files as $file) {\n if (is_file($file) && in_array(mime_content_type($file->getPathName()), $allowedMimeTypes)) {\n $options = [\"resize\" => [\"width\" => \"800\", \"height\" => \"568\"], \"quality\" => \"60%\", \"upsize\" => true, \"thumbnails\" => [[\"name\" => \"cropped\", \"crop\" => [\"width\" => \"265\", \"height\" => \"300\"]]]];\n $name = $this->handleImage($file, 'phones', $this->arrayToObject($options));\n $images[] = $name;\n } else {\n $validator->addFailure('image', 'image');\n break;\n }\n\n }\n }\n $validator->validate();\n\n $phone = Phone::query()->create([\n 'name' => $request->name,\n 'slug' => str_slug($request->name),\n 'price' => $request->price,\n 'description' => $request->description,\n 'caracteristiques' => $request->caracteristiques,\n 'stock' => $request->stock,\n 'status' => false,\n 'category_id' => $request->category_id,\n 'type_id' => $request->type_id,\n 'user_id' => auth()->user()->id,\n 'image' => json_encode($images)\n ]);\n $phone->colors()->sync($request->input('colors'));\n flash('Téléphone ajouté avec succès')->success();\n return redirect()->back();\n }", "function addImage($imagename){\n\t$table = 'stjohn_image';\n\t// $imagename = $_POST['imagename'];\n\n\t$image = array('imagename'=>\"'$imagename'\");\n\n\t$keys = array_keys($_POST);\n\n\t$image['mid'] = $_SESSION['mid'];\n\t\n\tif(in_array('did', $keys)){\n\t\t$image['did'] = $_POST['did'];\n\t}\n\tif(in_array('abid', $keys)){\n\t\t$image['abid'] = $_POST['abid'];\n\t}\n\tif(in_array('meetid', $keys)){\n\t\t$image['meetid'] = $_POST['meetid'];\n\t}\n\n\t// print_r($image);\n\t// echo \"<br/>\\n\";\n\n\treturn insert($table, $image);\n}", "function bodyAdd($request){\r\n global $context;\r\n $data= new $this->model;\r\n foreach($data->fields as $key=>$field){\r\n if($field['type']!='One2many' && $field['type']!='Many2many' ){\r\n $data->data[$key]=$request->body[$key];\r\n }\r\n }\r\n\r\n if(!$data->insert()){\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n }\r\n if($request->isAjax()) return json_success(\"Save Success !!\".$data->error,$data);\r\n\r\n\r\n redirectTo($context->controller_path.\"/all\");\r\n }", "public function store(Request $request)\n {\n\n// $imageName = time() . '-' . preg_match_all('/data\\:image\\/([a-zA-Z]+)\\;base64/',$request->photo,$matched).'.jpg';\n $imageName = time() . '.' . explode('/',explode(':', substr($request->photo, 0, strpos($request->photo, ';')))[1])[1];\n \\Image::make($request->photo)->save(public_path('/assets/uploaded_images/'). $imageName);\n// dd($imageName);\n\n $contact = new Contact();\n $contact->name = $request->name;\n $contact->email = $request->email;\n $contact->position = $request->position;\n $contact->company = $request->company;\n $contact->phone = $request->phone;\n $contact->subject = $request->subject;\n $contact->photo = $imageName;\n $contact->save();\n }", "public function save(){\n\n // Authenticate as admin\n $user = User::fetch_by_session();\n if($user === false) return $this->zajlib->json(['status'=>'error', 'message'=>'Your user session has expired!']);\n if($user->data->admin != 'admin') return $this->zajlib->json(['status'=>'error', 'message'=>'Your user account does not have rights to perform this action!']);\n\n // Fetch the photo\n $photo = Photo::fetch($_POST['id']);\n $photo->set_with_data($_POST, ['name', 'alttext', 'caption']);\n $photo->save();\n\n return $this->zajlib->json(['status'=>'ok']);\n }", "public function store(Request $request)\n {\n //\n // return $request->all();\n $post = $request->all();\n // return $post;\n\n if( $name = $request->file('photo_id')){\n $name = $request->file('photo_id');\n // return $name;\n $name->move('images', $name);\n\n $photo = Photo::create(['file' => $name]);\n\n $post['photo_id'] = $photo->id;\n }else{\n return 'not woorking';\n }\n Post::create($post);\n return redirect('/admin/post');\n }", "function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = \\false)\n {\n }", "public function uploadPhoto($currentAlbumId, $currentUserID, $photoName, $shortDescription, $placeTaken, $selectedCategories, $writtenTags, $photoFile, $titlePhoto,$users){\n\n $insertedPhotoId = 'nothing to upload';\n\n // upload photo to server\n if (!empty($photoFile)){\n\n foreach($photoFile as $file) {\n $destinationPath = 'uploads/albums/'.$currentAlbumId;\n\n //creates album directory if not exist\n if(!is_dir('uploads'))\n mkdir('uploads', 0777, true);\n if(!is_dir('uploads/albums'))\n mkdir('uploads/albums', 0777, true);\n if(!is_dir('uploads/albums/'.$currentAlbumId))\n mkdir('uploads/albums/'.$currentAlbumId, 0777, true);\n\n $filename = $file->getClientOriginalName();\n $extension = $file->getClientOriginalExtension();\n if ($extension == 'jpeg') {\n $extension = 'jpg';\n }\n $fileSize = $file->getSize();\n\n if($extension == 'jpeg' || $extension == 'jpg' || $extension == 'bmp' || $extension == 'png' || $extension == 'gif')\n if($fileSize <= 1024*1024*10){\n //make: if this albumId exist in albums table do this insert\n $isAlbumIdExist = DB::select('select album_id from albums where album_id = ?', array($currentAlbumId));\n if($isAlbumIdExist){\n //upload photo in database\n $insertedPhotoId = DB::table('photos')->insertGetId(\n array('photo_name' => $photoName,\n 'photo_short_description' => $shortDescription,\n 'photo_taken_at' => $placeTaken,\n 'album_id' => $currentAlbumId,\n 'user_id' => $currentUserID,\n 'photo_size' => $fileSize\n )\n );\n\n UserAction::add('Photo \"' . $photoName . '\" was uploaded');\n\n $explodedTags = preg_replace(\"/[^\\w\\ _]+/\", '', $writtenTags); // strip all punctuation characters, news lines, etc.\n $explodedTags = preg_split(\"/\\s+/\", $explodedTags); // split by left over spaces\n $tagLine = \"\";\n for($i=0; $i<sizeOf($explodedTags); $i++)\n $tagLine = $tagLine.$explodedTags[$i].\", \";\n $tagLine = substr($tagLine, 0, -2);\n\n DB::insert('insert into photo_tags (photo_id, tags) values (?,?)', array($insertedPhotoId, $tagLine));\n\n\n\n $upload_success = $file->move($destinationPath, $insertedPhotoId.\".\".$extension);\n if($upload_success){\n //makes photo thumb\n $fileForThumb = $destinationPath.\"/\".$insertedPhotoId.\".\".$extension;\n App::make('phpthumb')\n ->create('resize', array($fileForThumb, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", $insertedPhotoId.\"_thumb.\".$extension);\n\n DB::update('update photos set\n photo_destination_url = ?,\n photo_thumbnail_destination_url = ?\n where photo_id = ?',\n array(\n $destinationPath.\"/\".$insertedPhotoId.\".\".$extension,\n $destinationPath.\"/\".$insertedPhotoId.\"_thumb.\".$extension,\n $insertedPhotoId));\n }\n\n //add categories\n for($i = 0; $i < sizeOf($selectedCategories); $i++){\n $catId = DB::select('select * from categories where category_name = ?', array($selectedCategories[$i]));\n if($catId)\n DB::table('photo_categories')->insert(\n array(\n 'photo_id' => $insertedPhotoId,\n 'category_id' => $catId[0]->category_id,\n )\n );\n }\n //add users\n $ob = new User();\n foreach($users as $user){\n if($user != \"\"){\n $usId = $ob->getUserNameById($user);\n $photoP = DB::insert('insert into photo_people (photo_id, user_id) values (?,?)',array($insertedPhotoId,$usId));\n }\n }\n\n //-----------------Editing album title photo data---------------------//\n //if 'make uploaded photo to title album photo' property is selected\n if($titlePhoto){\n\n //gets old title url\n $titlePhoto = DB::table('albums')->where('album_id', $currentAlbumId)->get();\n\n //if album exist\n if($titlePhoto != null){\n\n //deletes old title photo if exists from directory\n $oldAlbumTitlePhoto = null;\n $oldAlbumTitlePhoto = $titlePhoto[0]->album_title_photo_url;\n if($oldAlbumTitlePhoto != null ){\n if(is_file($oldAlbumTitlePhoto))\n File::delete($oldAlbumTitlePhoto);\n }\n //deletes old title photo thumb if exists from directory\n $oldAlbumTitlePhotoThumb = null;\n $oldAlbumTitlePhotoThumb = $titlePhoto[0]->album_title_photo_thumb_url;\n if($oldAlbumTitlePhotoThumb != null )\n if(is_file($oldAlbumTitlePhotoThumb))\n File::delete($oldAlbumTitlePhotoThumb);\n }\n\n //gets current photo url\n $newTitlePhoto = DB::table('photos')->where('photo_id', $insertedPhotoId)->get();\n if($newTitlePhoto){\n\n //photo\n $photo = null;\n $photo = $newTitlePhoto[0]->photo_destination_url;\n if($photo != null ){\n if(is_file($photo)){\n $photoExtension = File::extension($photo);\n $newPhoto = $destinationPath.\"/title_\".$currentAlbumId.\".\".$photoExtension;\n File::copy($photo, $newPhoto);\n $photo = $newPhoto;\n }\n }\n\n //thumb\n $photoThumb = null;\n $photoThumb = $newTitlePhoto[0]->photo_thumbnail_destination_url;\n if($photoThumb != null){\n if(is_file($photoThumb)){\n $thumbExtension = File::extension($photoThumb);\n $newPhotoThumbUrl = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$thumbExtension;\n File::copy($photoThumb, $newPhotoThumbUrl);\n $photoThumb = $newPhotoThumbUrl;\n }\n }\n else if($photoThumb == null && is_file($photo) != null){\n App::make('phpthumb')\n ->create('resize', array($photo, 200, 200, 'adaptive'))\n ->save($destinationPath.\"/\", \"title_\".$currentAlbumId.\"_thumb.\".$photoExtension);\n $photoThumb = $destinationPath.\"/title_\".$currentAlbumId.\"_thumb.\".$photoExtension;\n }\n\n //insert uploaded/unuploaded files to database\n DB::table('albums')\n ->where('album_id', $currentAlbumId)\n ->update(array(\n 'album_title_photo_url' => $photo,\n 'album_title_photo_thumb_url' => $photoThumb\n ));\n }\n }\n }\n }\n }\n }\n return $insertedPhotoId;\n }", "private function insertMediaObject($data_array) {\n }", "protected function validatePhoto(){\n\n $extension = $this->type;\n\n if( !empty($extension)){\n if($extension != 'image/jpeg' && $extension != 'image/png' && $extension != 'image/jpg'){\n $this->errors_on_upload[] = \"Your file should be .jpeg, .jpg or .png\";\n }\n }\n\n if($this->size > Config::MAX_FILE_SIZE){\n $this->errors_on_upload[] = \"Your picture shouldn't be more than 10 Mb\";\n }\n\n if($this->error != 0 && $this->error != 4) { //0 means no error, so if otherwise, display a respective message, 4 no files to upload, we allow that\n $this->errors_on_upload[] = $this->upload_errors_array[$this->error];\n }\n\n }", "public function store(Request $request, $group)\n {\n $this->validate($request, [\n\n \"photo\" => \"image|max:1999\",\n \"description\" => \"required\"\n\n ]);\n\n if($request->hasFile(\"photo\")) \n {\n\n //getting the photo \n\n $photo = $request->file(\"photo\");\n\n //get filename with the extension\n $filenameWithExt = $photo->getClientOriginalName();\n // get just the filename\n\n \n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n \n\n //get extentsion\n $extension = $photo->getClientOriginalExtension();\n\n // create new filename\n $filenameToStore = $filename. \"_\" .time().\".\".$extension;\n \n //upload image\n $original_path = $photo->storeAs(\"public/photos/groups/group\".$request->input(\"group_id\"), $filenameToStore);\n // $resize_path = $photo->storeAs(\"public/photos/group\".$request->input(\"group_id\").\"/dashboard\", $filenameToStore);\n\n // //resize for the dashboard\n // $public_resized = storage_path(\"app/public/photos/group\".$request->input(\"group_id\").\"/dashboard/\". $filenameToStore);\n // $img = Image::make($public_resized)->resize(100,100);\n // $img->save($public_resized);\n }\n\n // Create photo in DB\n \n\n $photo = Photo::create([\n \"group_id\" => $request->input(\"group_id\"),\n \"user_id\" => Auth::id(),\n \"description\" => $request->input(\"description\"),\n \"photo\" => $filenameToStore,\n ]);\n Post::create([\n \"photo_id\" => $photo->id,\n \"group_id\" => $request->input(\"group_id\"),\n ]);\n\n return redirect(action(\"GroupController@show\", [\"id\" => $request->input(\"group_id\")]))->with(\"success\", \"Photo Uploaded\");\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function setPhoto($photo)\n {\n // First checking for extension validity, including default value - default values are set before we approach setting ones passed by data array\n if(!in_array($photo, $this->extensions)) {\n // If extension is invalid we throw descriptive exception\n throw new Exception('Extension specified is not valid');\n }\n // if photo extension equals default value it's final value (which will be the path) is set to defined default value\n if($photo == self::DEFAULT_TEXT) {\n $this->_values['photo'] = self::PHOTO_FOLDER . self::DEFAULT_IMAGE;\n } else {\n // If everything is right and we got extension of the file from the database, we are setting up a link to photo\n $this->_values['photo'] = self::PHOTO_FOLDER . $this->_values['id'] . \".\" . $photo;\n }\n }", "public function create()\n {\n $path = request()->file('photo')->store('testing');\n return response()->json(['path' => $path], 200);\n }" ]
[ "0.6600722", "0.6484956", "0.64442134", "0.6429595", "0.64045495", "0.6287845", "0.6282814", "0.6253326", "0.6192385", "0.6132469", "0.6119883", "0.6119076", "0.6106683", "0.60597444", "0.60495067", "0.6022437", "0.60190725", "0.5949225", "0.59177136", "0.5894779", "0.5888295", "0.5885331", "0.58844155", "0.58763564", "0.5870366", "0.58663356", "0.58419377", "0.5840595", "0.5785602", "0.57817614", "0.5775439", "0.5774066", "0.573994", "0.5733396", "0.5727044", "0.5725247", "0.57231486", "0.5718293", "0.57023656", "0.5690929", "0.5685404", "0.56802845", "0.5679154", "0.56734294", "0.5673278", "0.56705153", "0.5663545", "0.5659132", "0.56490475", "0.56380856", "0.563779", "0.5634526", "0.5633705", "0.5616672", "0.56072545", "0.5599216", "0.5583694", "0.5576878", "0.5570969", "0.55664766", "0.5565326", "0.55650985", "0.55613977", "0.5558622", "0.55586183", "0.55569994", "0.55569965", "0.55519867", "0.5528453", "0.5524529", "0.5515273", "0.5512037", "0.55108523", "0.5508453", "0.5505915", "0.5497213", "0.54962724", "0.5487715", "0.54781425", "0.5474584", "0.54734284", "0.5460739", "0.5453829", "0.5452019", "0.5444301", "0.54367346", "0.54347974", "0.5429449", "0.5428628", "0.5428519", "0.54266727", "0.542487", "0.54142004", "0.5412492", "0.5412148", "0.5408337", "0.5404767", "0.5404601", "0.5404601", "0.54036444" ]
0.73788947
0
this methos allows user to add video to operation object ['video']['name'], ['video']['content'] is mandatory fields
public function addVideoAction(){ $data = $this->getRequestData(); if(isset($data['video']['name']) && isset($data['video']['content'])){ $user = Object_User::getById($this->getDeviceSession()->getUserId()); $folder = Asset_Folder::getByPath('/video/operation/'.$user->getKey().'-video'); if (!$folder) { $folder = new Object_Folder(); $folder->setKey($user->getKey() . "-video"); $folder->setParentId(6); $folder->save(); } $asset = new Asset_Video(); $asset->setCreationDate(time()); $asset->setUserOwner(1); $asset->setUserModification(1); $asset->setParentId($folder->getId()); $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . "-" . time())); $asset->setData(base64_decode($data['content'])); if(!$asset->save()){ $this->setErrorResponse('cannot save video!'); } } else { $this->setErrorResponse('video is mandatory for this request!'); } $this->_helper->json(array('video' => $asset->getId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addVideo(VideoMedia $video);", "function insertVideo() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $auth = $this->getAuthorization();\n $video = json_decode($_POST['json'], true);\n\t $userId = $video['user_id'];\n\n if (!$this->validateAuthorization($userId, $auth)) {\n $this->response('', 406);\n }\n\n if (!isset($_FILES['upfile']['error']) || is_array($_FILES['upfile']['error'])) {\n $this->response(json_encode(array(\"Error\" => 'Invalid parameters')), 400);\n }\n\n // You should also check filesize here. \n if ($_FILES['upfile']['size'] > 100000000000) {\n $this->response(json_encode(array(\"Error\" => 'Exceeded filesize limit.')), 400);\n }\n \n $videoFileType = pathinfo($_FILES['upfile']['name'],PATHINFO_EXTENSION);\n \n if (!in_array($videoFileType, array(\"mp4\", \"wmv\"))) {\n $this->response(json_encode(array(\"Error\" => \"Invalid file format.\")), 400);\n }\n\n $filePath = '../video/' . $_FILES['upfile']['name'];\n\n if ($_FILES['upfile']['name'] == \"\" or file_exists($filePath) ) {\n $this->response(json_encode(array(\"Error\" => $_FILES['upfile']['name'])), 400);\n }\n \n if (!move_uploaded_file($_FILES['upfile']['tmp_name'], $filePath)) {\n $this->response(json_encode(array(\"Error\" => \"Failed to move uploaded file.\")), 400);\n }\n\n $video['path_of_video'] = $filePath;\n $columns = 'user_id, title, description, path_of_video';\n $values = $userId . ',\\'' . $video['title'] . '\\',\\'' . $video['description'] . '\\',\\'' . $video['path_of_video'] . \"'\";\n $query = \"insert into videos(\". $columns . \") VALUES(\". $values . \");\";\n\t error_log($query);\n \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Video Posted.\", \"data\" => $video);\n $this->response(json_encode($success),200);\n }", "public function addVideo(Request $request)\n {\n try{\n if (!empty($request)) {\n $validateData = Validator::make($request->all(),[\n 'title' => 'required',\n 'asset_type' => 'required',\n 'slug' => 'required',\n 'short_description' => 'required|max:520',\n 'description' => 'required',\n 'content_type' => 'required'\n ]);\n\n if ($validateData->fails()) {\n $messages = $validateData->errors()->all();\n return APIResponse('201', 'Validation errors.', $messages);\n }\n\n $video_data = VideoContent::where('title', '=', $request->get('title'))->first();\n \n if ($video_data) {\n return APIResponse('201', 'Data already present in the database.');\n }\n\n $photoURL = '';\n if ($request->hasFile('thumbnail_image')) {\n $file = $request->file('thumbnail_image');\n $folderpath = 'bcci/videos/';\n $result = uploadFileToS3($file, $folderpath, '');\n $photoURL = $result['ObjectURL'] ?? '';\n }\n \n $videoUrl = '';\n if ($request->hasFile('video_url')) {\n $file = $request->file('video_url');\n $folderpath = 'Input/';\n $result = uploadFileToS3($file, $folderpath, 'video');\n $videoUrl = $result['ObjectURL'] ?? '';\n }\n \n $videoCount = AssetsCount::all();\n if (isset($videoCount)) {\n $videosCount = $videoCount[0]['video_count'] + 1;\n }\n\n $videoContent = new VideoContent();\n $videoContent->ID = $videosCount;\n $videoContent->title = $request->get('title');\n $videoContent->short_description = $request->get('short_description'); \n $videoContent->description = $request->get('description');\n $videoContent->video_duration = $request->get('video_duration'); // duration and video-duration is same \n $videoContent->match_id = $request->get('match_id');\n $videoContent->content_type = $request->get('content_type'); //type and content-type is same\n $videoContent->video_scope = $request->get('video_scope');\n $videoContent->video_url = $videoUrl; \n $videoContent->match_formats = $request->get('match_formats');\n $videoContent->keywords = $request->get('keywords'); \n $videoContent->created_date = $request->get('created_date');\n $videoContent->publish_date = $request->get('publish_date');\n $videoContent->publish_by = $request->get('publish_by'); // publishFrom and publish by is same\n $videoContent->meta_languages = $request->get('meta_languages');\n $videoContent->langauge = $request->get('langauge');\n $videoContent->asset_type = $request->get('asset_type');\n $videoContent->expiry_date = $request->get('expiry_date'); \n $videoContent->total_viewcount = $request->get('total_viewcount'); \n $videoContent->titleslug = $request->get('titleslug');\n $videoContent->varients = $request->get('varients'); \n $videoContent->views_count = $request->get('views_count'); \n $videoContent->comments = $request->get('comments'); //comments and commentson is same\n $videoContent->platform = $request->get('platform'); \n $videoContent->current_status = $request->get('current_status');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->thumbnail_image= $photoURL; // thumbnail image nad thumbnail is same\n $videoContent->video_status = 'pending';\n $videoContent->location = $request->get('location');\n $videoContent->titleUrlSegment = $request->get('titleUrlSegment');\n $videoContent->subtitle = $request->get('subtitle');\n $videoContent->titleTranslations = $request->get('titleTranslations');\n $videoContent->coordinates = $request->get('coordinates');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->publishTo = $request->get('publishTo');\n $videoContent->mediaId = $request->get('mediaId');\n $videoContent->references = $request->get('references');\n $videoContent->closedCaptioned = $request->get('closedCaptioned');\n $videoContent->status = true;\n $videoContent->save();\n\n $totalCount = AssetsCount::where('ID', 1)->update(['video_count' => $videosCount]);\n if ($videoContent) {\n $response = APIResponse('200', 'Data has been added successfully.');\n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.'); \n }\n \n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n } \n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n\n return $response;\n }", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function postVideo(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n $video_url=$_POST['video_url'];\r\n $video_img_path=$_POST['video_img_path'];\r\n $title=$_POST['video_title'];\r\n $desc=$_POST['content'];\r\n $embed_value=$_POST['video_embed_value'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addVideo($video_url,$video_img_path,$title,$desc,$tag,$embed_value);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function add() {\n if ($this->GdataAuth->isAuthorized()) {\n if (!empty($this->data)) {\n $this->YouTubeVideo->set($this->data);\n if ($this->YouTubeVideo->validates() && $this->YouTubeVideo->save($this->data)) {\n $this->Session->setFlash('It worked!');\n $this->redirect(array());\n }\n }\n // Set official you tube categories and access control options to populate\n // form fields\n $this->set('categories', $this->YouTubeVideo->categories());\n foreach ($this->YouTubeVideo->accessControls as $accessControl => $options) {\n $this->set(Inflector::pluralize($accessControl), array_combine($options, $options));\n }\n }\n }", "public function post_addvideo()\r\n\t\t{\r\n\t\t\t$retArr = array();\r\n\t\t\t// Scaffolding Code For Single:\r\n\t\t\t$retArr = $this->obj->getBasics();\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "function media_upload_video()\n {\n }", "public function postContributedVideoAction() {\n\t\t$userSession= new Container('fo_user');\n\t\t$request\t= $this->getRequest();\n\t\t\n\t\tif(!isset($userSession->userSession['_id']) || trim($userSession->userSession['_id']) == '') {\n\t\t\techo '-1';\n\t\t\tdie();\n\t\t}\n\t\t\n\t\tif($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\t\n\t\t\tif(isset($formData['contribute_video_url']) && $formData['contribute_video_url'] != '' && \n\t\t\t\tisset($formData['contribute_video_title']) && $formData['contribute_video_title'] != '' && \n\t\t\t\tisset($formData['contribute_video_category']) && $formData['contribute_video_category'] != '') {\n\t\t\t\t$formData['_id']\t\t\t\t= new \\MongoId();\n\t\t\t\t$formData['user_id']\t\t\t= $userSession->userSession['_id'];\n\t\t\t\t$formData['media_title']\t\t= $formData['contribute_video_title'];\n\t\t\t\t$formData['media_title_lower']\t= strtolower($formData['contribute_video_title']);\n\t\t\t\t$formData['media_category']\t\t= $formData['contribute_video_category'];\n\t\t\t\t$formData['media_description']\t= $formData['contribute_video_desc'];\n\t\t\t\t$formData['media_url']\t\t\t= $formData['contribute_video_url'];\n\t\t\t\t$formData['media_tags']\t\t\t= $formData['contribute_video_tags'];\n\t\t\t\t\n\t\t\t\t$youtubeUrl\t= parse_url($formData['media_url'], PHP_URL_QUERY);\n\t\t\t\tparse_str($youtubeUrl, $params);\n\t\t\t $videoId\t= $params['v'];\n\t\t\t\t$feedURL\t= 'https://gdata.youtube.com/feeds/api/videos/' . $videoId;\n\t\t\t\t$entry\t\t= \\simplexml_load_file($feedURL);\n\t\t\t\tif($entry === false) {\n\t\t\t\t\t$time\t= '0';\n\t\t\t\t} else {\n\t\t\t\t\t$video\t= $this->parseVideoEntry($entry);\n\t\t\t\t\t$time\t= sprintf(\"%0.2f\", $video->length/60);\n\t\t\t\t}\n\t\t\t\tif($time <= 10) {\n\t\t\t\t\t$formData['media_length']\t= $time;\n\t\t\t\t\t$results\t= $this->contributeVideo($formData);\n\t\t\t\t\techo \"1\";\t//\tSuccess\n\t\t\t\t} else {\n\t\t\t\t\techo \"3\";\t// Time exceeded\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"0\";\t//\timproper request\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\timproper request\n\t\t}\n\t\treturn $this->getResponse();\n\t}", "public function addVideo($title,$videoID,$streamID=\"vimeoSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $thumb=\"thumbnail\", $frame=\"image-frame\"){\n $this->videoList[] = new cVideo($title,$videoID,$streamID,$hdID,$sdID,$mobileID,$thumb,$frame);\n }", "public function createVideo($data)\n {\n return $this->performRequest('POST','/videos', $data);\n }", "public function uploadVideo(){\n\t\t$this->log('<videos.uploadVideo>', 'debug');\n\t\t\n\t\tif(!$this->request->is('post')){\n\t\t\t$this->log('wrong HTML form method ...', 'debug');\n\t\t\treturn;\n\t\t}\n\t\t//HTML Form method is valid\n\t\t$error = '';\n\t\t$video_id = '';\n\t\t$message = '';\n\t\t\n\t\t$db = $this->Video->getDataSource();\n\t\t$db->begin();\n\t\ttry{\n\t\t\t//Checking resource video object ...\n\t\t\n\t\t\tif(!isset($this->request->data['Video']['video'])){\n\t\t\t\t$error = __('No video resource found in request');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$errorFlag = $this->request->data['Video']['video']['error'];\n\t\t\tif($errorFlag){\n\t\t\t\t$error = __('Upload failed due to internal Server error');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$name = $this->request->data['Video']['video']['name'];\n\t\t\t$size = $this->request->data['Video']['video']['size'];\n\t\t\t$tmp_name = $this->request->data['Video']['video']['tmp_name'];\n\t\t\n\t\t\t$this->loadModel('Video');\n\t\t\n\t\t\t$this->Video->create();\n\t\t\n\t\t\tif(!file_exists($tmp_name)){\n\t\t\t\t$error = __('Invalid tmp file');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\tif($size > 3145728){//size > 3MB\n\t\t\t\t$error = __('Video file is too large');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$im = file_get_contents($tmp_name);\n \t\t\t$imdata = base64_encode($im);\n\t\t\tif(!$imdata){\n\t\t\t\t$error = __('Unable to encode the uploaded file ');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\t\t\t\t\n\t\t\t$this->Video->data['Video']['vid_name'] = $name;\n\t\t\t$codec = $this->Video->getVideoCodec($tmp_name);\n\t\t\t$this->Video->data['Video']['vid_mime_type'] = $codec;\n\t\t\t$this->Video->data['Video']['vid_data'] = $imdata;\n\t\t\t$date = new DateTime();\n\t\t\t$now = $date->getTimestamp();\n\t\t\t$this->Video->data['Video']['vid_created'] = $now;\n\t\t\t\n\t\t\tif(!$this->Video->save($this->Video->data)){\n\t\t\t\t$error = __(\"Unable to save the video data\");\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$video_id = $this->Video->id;\n\t\t\t$message = __('Video has been successfully uploaded');\n\t\t\t$message = htmlentities($message, ENT_QUOTES);\n\t\t\t$db->commit();\n\t\t}catch(Exception $e){\n\t\t\t$db->rollback();\n\t\t\t$this->log($e->getMessage());\n\t\t\tif(!$error)\n\t\t\t\t$error = __(AppModel::$DEFAULT_ERROR_MESSAGE);\n\t\t}\n\t\t\t\n\t\t$this->set('error', $error);\n\t\t$this->set('video_id', $video_id);\n\t\t$this->set('message', $message);\n\t\t$this->layout = 'empty';\n\t\t\n\t\t\n\t\t$this->log('</videos.uploadVideo>', 'debug');\n\t}", "public function createVideo();", "public function store()\n {\n // Validate input\n $this->validate($this->request, [\n 'title' => 'required',\n 'description' => 'required',\n 'order_number' => 'required|integer|unique:videos',\n 'embed_code' => 'required',\n 'access_name' => 'required',\n ]);\n\n $this->video->create([\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'order_number' => $this->request->input('order_number'),\n 'embed_code' => $this->request->input('embed_code'),\n 'slug' => str_slug($this->request->input('title'), '-'),\n 'access_name' => $this->request->input('access_name')\n ]);\n\n return redirect('videos/all')->withSuccessMessage('Video added');\n }", "public function actionCreate()\n {\n $model = new Video();\n \n $post = Yii::$app->request->post();\n if ($post) { \n// $file = UploadedFile::getInstance($model, 'file'); \n// $path = Yii::$app->basePath. \"/../frontend/web/\";\n// $filePath = Yii::$app->basePath. \"/../frontend/web/videos/\";\n \n// if ($file) {\n// $filename = \"videos/\" . time() . rand(1,1000) . '.' . $file->getExtension();\n// $path = $path . $filename;\n \n// if(!file_exists($filePath)){\n// mkdir($filePath);\n// }\n// $file->saveAs($path);\n $url = $path = Yii::$app->params['uploadsUrl'].$post['Video']['video'];\n $header_array = get_headers($url, true);\n $size = $header_array['Content-Length']; \n \n $post['Video']['video'] = $post['Video']['video'];\n $post['Video']['filesize'] = $size;\n $post['Video']['ext'] = explode('.', basename($post['Video']['video']))[1];\n $post['Video']['is_complete'] = '1';\n $post['Video']['product_id'] = empty($post['Video']['product_id']) ? '' : join(',', $post['Video']['product_id']);\n// }\n\n if ($model->load($post) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n\n if ($videoFile->move(public_path(\"uploads/videos/\"),$videoName) && $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName)){\n $video = new Video();\n $video->title = ucfirst($request->input('title'));\n $video->subtitle = ucfirst($request->input('subtitle'));\n $video->description = ucfirst($request->input('description'));\n $video->duration = \"1:00\";\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n $video->video = asset(\"uploads/videos/$videoName\");\n $video->user_id = Auth::id();\n $video->save();\n $video->categories()->attach($category->id);\n\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n $video->tags()->attach($tag->id);\n }\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was added successfully !!\");\n }\n return redirect()->back();\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not store the video\");\n\n if($video){\n $video->categories()->detach();\n $video->delete();\n }\n\n Log::warning(\"Can not upload Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function executeEditVideo(sfWebRequest $request)\n {\n // Shut off Chrome's poorly designed XSS filtering that clobbers perfectly legitimate iframe embed submissions\n // http://code.google.com/p/chromium/issues/detail?id=98787\n $this->getResponse()->setHttpHeader('X-XSS-Protection', '0');\n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n if ($item)\n {\n $this->forward404Unless($item->userHasPrivilege('edit'));\n }\n $this->item = $item;\n $embed = false;\n $parameters = $request->getParameter('a_media_item');\n \n if ($parameters)\n {\n $files = $request->getFiles('a_media_item');\n \n $this->form = new aMediaVideoForm($item);\n \n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff the\n // file, title, tags and description widgets\n $result = $this->form->classifyEmbed($parameters['embed']);\n if (isset($result['thumbnail']))\n {\n $thumbnail = $result['thumbnail'];\n if ((!isset($parameters['title'])) && (!isset($parameters['tags'])) && (!isset($parameters['description'])) && (!isset($parameters['credit'])))\n {\n $parameters['title'] = $result['serviceInfo']['title'];\n // We want tags to be lower case, and slashes break routes in most server configs. \n $parameters['tags'] = str_replace('/', '-', aString::strtolower($result['serviceInfo']['tags']));\n $parameters['description'] = aHtml::textToHtml($result['serviceInfo']['description']);\n $parameters['credit'] = $result['serviceInfo']['credit'];\n }\n }\n }\n\n // On the first pass with a youtube video we just make the service's thumbnail the\n // default thumbnail. We don't force them to use it. This allows more code reuse\n // (Moving this after the bind is necessary to keep it from being overwritten) \n if (isset($thumbnail))\n {\n $this->convertServiceThumbnailToFileUpload($thumbnail, $parameters);\n }\n \n $this->form->bind($parameters, $files);\n \n do\n {\n // first_pass forces the user to interact with the form\n // at least once. Used when we're coming from a\n // YouTube search and we already technically have a\n // valid form but want the user to think about whether\n // the title is adequate and perhaps add a description,\n // tags, etc.\n if (($this->hasRequestParameter('first_pass')) ||\n (!$this->form->isValid()))\n {\n break;\n }\n $thumbnail = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($thumbnail)\n {\n $object->preSaveFile($thumbnail->getTempName());\n }\n $this->form->save();\n \n if ($thumbnail)\n {\n $object->saveFile($thumbnail->getTempName());\n }\n \n if (aMediaTools::isSelecting())\n {\n return $this->redirect('aMedia/multipleAdd?id=' . $object->id);\n }\n\n return $this->redirect(\"aMedia/resumeWithPage\");\n } while (false);\n }\n return $this->renderTemplate();\n }", "public function create()\n\t{\n\t\t$object = Request::getString('content', '', 'post');\n\n\t\t// Check if valid youtube or kaltura video\n\t\t// @FIXME: we need a safer way!\n\t\tif (preg_match('/<iframe(.*?)src=\"([^\"]+)\"([^>]*)>(.*?)<\\/iframe>/si', $object, $matches))\n\t\t{\n\t\t\tif (stristr($matches[2], 'youtube'))\n\t\t\t{\n\t\t\t\t$this->asset['title'] = 'New YouTube video';\n\t\t\t}\n\t\t\telse if (stristr($matches[2], 'vimeo'))\n\t\t\t{\n\t\t\t\t$this->asset['title'] = 'New Vimeo video';\n\t\t\t}\n\t\t\telse if (stristr($matches[2], 'blip'))\n\t\t\t{\n\t\t\t\t$this->asset['title'] = 'New Blip.tv video';\n\t\t\t}\n\t\t\telse if (stristr($matches[2], 'kaltura'))\n\t\t\t{\n\t\t\t\t$this->asset['title'] = 'New Kaltura video';\n\t\t\t}\n\t\t}\n\t\telseif (preg_match('/\\<script[\\s]+(type=\"text\\/javascript\")?[\\s]*src=\"http[s]*\\:\\/\\/cdnapi(sec)?\\.kaltura\\.com/is', $object))\n\t\t{\n\t\t\t$this->asset['title'] = 'New Kaltura video';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 'Content did not match the pre-defined filter for an object');\n\t\t}\n\n\t\t$this->asset['type'] = (!empty($this->asset['type'])) ? $this->asset['type'] : 'video';\n\t\t$this->asset['subtype'] = (!empty($this->asset['subtype'])) ? $this->asset['subtype'] : 'embedded';\n\t\t$this->asset['content'] = $object;\n\n\t\t// Return info\n\t\treturn parent::create();\n\t}", "public function uploadAction() {\n if (isset($_GET['ul']) || isset($_FILES['Filedata']))\n return $this->_forwardCustom('upload-video', null, null, array('format' => 'json'));\n\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->form = $form = new Sitereview_Form_Reviewvideo();\n\n if (!$this->getRequest()->isPost()) {\n if (null !== ($video_id = $this->_getParam('video_id'))) {\n $form->populate(array(\n 'video' => $video_id\n ));\n }\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $video = $form->saveValues();\n }", "public function addVideoAnalytics($video){\n $ip = '';\n $videoAnalyticsData = array();\n /** This is call to the helper method to the get the IP address */\n $ip = getIPAddress();\n /** This is call to a method to get the current logged in user country based on the IP */\n $getcurrentIPLocation = Location::get($ip);\n $getcurrentIPLocationFlag = (isset($getcurrentIPLocation->countryName))?$getcurrentIPLocation->countryName:'unknown';\n /** Call to method to get the platform (Web, ios or android) of the request */\n $platform = getPlatform();\n $customerId = (!empty(authUser()->id))?authUser()->id:0;\n $videoAnalyticsData = [\n 'video_id'=>$video->id,\n 'video_title'=>$video->title,\n 'customer_id' => $customerId,\n 'country' => $getcurrentIPLocationFlag,\n 'platform' => $platform,\n ];\n /** Set validator to check if all the parameters exist needed for video analytics */\n $validator = Validator::make($videoAnalyticsData, [\n 'video_id' => 'required|integer',\n 'video_title' => 'required|string',\n 'customer_id' => 'required|integer',\n 'country' => 'required|string',\n 'platform' => 'required|string',\n ]);\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n foreach($messages as $message){\n app('log')->error(' ###File : VideoTrait.php ##Message : The video analytics insertion failed ' .' #Error : ' . $message[0]);\n }\n }else{\n $videoAnalytic = new VideoAnalytic();\n try{\n $videoAnalytic->fill($videoAnalyticsData);\n return ($videoAnalytic->save())?true:false;\n }\n catch(Exception $e) {\n app('log')->error(' ###File : VideoTrait.php ##Message : The video analytics insertion failed ' .' #Error : ' . $e->getMessage());\n }\n }\n return false;\n }", "public function create_video() {\n $args = array (\n 'labels' => array(\n 'name' => __( 'Videos' ),\n 'singular_name' => __( 'Videos' ),\n 'add_new' => __( 'Add Video' ),\n 'add_new_item' => __( 'Add New Video' ),\n 'edit_item' => __( 'Edit Video' ),\n 'new_item' => __( 'Add New Video' ),\n 'view_item' => __( 'View Video' ),\n 'search_items' => __( 'Search Videos' ),\n 'not_found' => __( 'No Videos Found' ),\n 'not_found_in_trash' => __( 'No Videos found in trash. ' )\n\t ),\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-format-video',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => true,\n 'menu_position' => 20,\n 'supports' => array('title', 'thumbnail', 'editor'),\n );\n register_post_type('video', $args);\n }", "protected function findOrAddVideo($info)\n {\n $mediaId = null;\n $slug = null;\n\n if (!isset($info['title']))\n {\n $info['title'] = 'Imported video';\n }\n $slug = aTools::slugify((!empty($info['title'])) ? $info['title'] : ((!empty($info['service_url'])) ? $info['service_url'] : md5($info['embed'])));\n\n $result = $this->sql->query('SELECT id FROM a_media_item WHERE slug = :slug', array('slug' => $slug));\n if (isset($result[0]['id']))\n {\n $mediaId = $result[0]['id'];\n } else\n {\n $mediaItem = new aMediaItem();\n foreach ($info as $key => $value)\n {\n if ($key !== 'tags')\n {\n $mediaItem[$key] = $value;\n }\n }\n if (empty($mediaItem['title']))\n {\n $mediaItem->setTitle($slug);\n }\n else\n {\n $mediaItem->setTitle($info['title']);\n }\n $mediaItem->setSlug($slug);\n $mediaItem->setType('video');\n $service = null;\n if ($mediaItem->service_url)\n {\n $service = aMediaTools::getEmbedService($mediaItem->service_url);\n }\n if ($service)\n {\n $id = $service->getIdFromUrl($mediaItem->service_url);\n if ($service->supports('thumbnail'))\n {\n $filename = $service->getThumbnail($id);\n if ($filename)\n {\n // saveFile can't handle a nonlocal file directly, so\n // copy to a temporary file first\n $bad = isset($this->failedMedia[$filename]);\n if (!$bad)\n {\n $tmpFile = aFiles::getTemporaryFilename();\n try\n {\n if (!copy($filename, $tmpFile))\n {\n throw new sfException(sprintf('Could not copy file: %s', $src));\n }\n if (!$mediaItem->saveFile($tmpFile))\n {\n throw new sfException(sprintf('Could not save file: %s', $src));\n }\n } catch (Exception $e)\n {\n $this->failedMedia[$filename] = true;\n }\n aFiles::unlink($tmpFile);\n }\n }\n }\n }\n $this->sql->fastSaveMediaItem($mediaItem);\n if (count($info['tags']))\n {\n $this->sql->fastSaveTags('aMediaItem', $mediaItem->id, $info['tags']);\n }\n $mediaId = $mediaItem->id;\n $mediaItem->free(true);\n }\n return $mediaId;\n }", "public function addVideo($title, $vID, $sID=\"vimSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $type=\"Generic\", $thumb=\"tn\", $frame=\"fr-img\", $ro_dir=\"Director\", $ro_dp=\"DP\", $ro_cam=\"Camera\", $ro_ed=\"Editor\", $desc=\"Long description\"){\n $this->videoList[] = new cShowcaseVideo($title, $vID, $sID, $hdID, $sdID, $mobileID, $type, $thumb, $frame, $ro_dir, $ro_dp, $ro_cam, $ro_ed, $desc);\n }", "function add()\n {\n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n //them moi vao csdl\n if($this->video_model->create($data))\n {\n $this->session->set_flashdata('message', 'Thêm thành công');\n }else{\n $this->session->set_flashdata('message', 'Không thêm được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/add';\n $this->load->view('admin/main', $this->data);\n }", "public function postCreate()\n\t{\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Create a new video \n $user = Auth::user();\n\n // Update the video data\n $this->video->link = Input::get('link');\n $this->video->description = Input::get('description');\n $this->video->user = Input::get('user');\n\n // Was the video created?\n if($this->video->save())\n {\n // Redirect to the new video page\n return Redirect::to('admin/videos/' . $this->video->id . '/edit')->with('success', Lang::get('admin/videos/messages.create.success'));\n }\n\n // Redirect to the video video create page\n return Redirect::to('admin/videos/create')->with('error', Lang::get('admin/videos/messages.create.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/create')->withInput()->withErrors($validator);\n\t}", "public function custom_video( $data ) {\r\n\t\t// Get a new video object.\r\n\t\t$video = Videos\\Models\\Custom_Video::get();\r\n\r\n\t\t// Setup required properties.\r\n\t\t$video->video_type = 'custom';\r\n\t\t$video->author = get_current_user_id();\r\n\t\t$video->video_title = $this->get_value( 'video_title', $data );\r\n\t\t$video->video_slug = $this->get_value( 'video_slug', $data );\r\n\t\t$video->video_duration = $this->get_value( 'video_duration', $data );\r\n\t\t$video->video_host = $this->get_value( 'video_host', $data, 'youtube' );\r\n\t\t$video->video_url = $this->get_value( 'video_url', $data );\r\n\t\t$video->video_start = $this->get_value( 'video_start', $data, false );\r\n\t\t$video->video_end = $this->get_value( 'video_end', $data, false );\r\n\t\t$video->video_start_time = $this->get_value( 'video_start_time', $data );\r\n\t\t$video->video_end_time = $this->get_value( 'video_end_time', $data );\r\n\r\n\t\t// Create or update video.\r\n\t\t$video_id = $video->save();\r\n\r\n\t\t// Send error response.\r\n\t\tif ( $video->is_error() ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Upload thumb.\r\n\t\tif ( ! empty( $data['import_thumb'] ) && ! empty( $data['thumbnail']['url'] ) ) {\r\n\t\t\t$thumb_id = $this->upload_thumb(\r\n\t\t\t\t$data['thumbnail']['url'],\r\n\t\t\t\t$this->get_value( 'video_title', $data ),\r\n\t\t\t\t$video_id\r\n\t\t\t);\r\n\r\n\t\t\tif ( ! empty( $thumb_id ) ) {\r\n\t\t\t\t// Get the new video object.\r\n\t\t\t\t$video = Videos\\Controller::get()->get_video( $video_id );\r\n\r\n\t\t\t\t// Set the thumbnail.\r\n\t\t\t\t$video->set_thumbnail( $thumb_id );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $video_id;\r\n\t}", "public function testVideo()\n {\n $video =new Video();\n $video->setPath('test');\n $this->assertSame('test', $video->getPath());\n $video->setTrick(new Trick());\n $this->assertNotEmpty($video->getTrick());\n $this->assertEquals(null, $video->getId());\n }", "public function store(StoreVideoRequest $request)\n {\n //Input received from the request\n $data=$request->all();\n $rules=[\n 'video' =>'mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:100040|required'];\n $validator = Validator($data,$rules);\n\n\n $row = new Video;\n $input = $request->all();\n\n $file = $request->file('file');\n\n $attr = array(\n 'file' => 'File',\n\n );\n $rules = array(\n 'file' => 'required|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:100040',\n );\n\n $this->validate($request, $rules);\n $validator = Validator::make($input, $rules);\n $validator->setAttributeNames($attr);\n\n $fileName = $file->getClientOriginalName();\n $uploaded = Storage::putFileAs('public/video', $request->file('file'), $fileName);\n\n\n if($uploaded){\n\n $row->video_name = $fileName;\n $row->title = $request->get('title');\n $row->created_at = Carbon::now();\n $row->save();\n\n }\n $topic = 'test';\n\n fcm()\n ->toTopic(\"test\") // $topic must an string (topic name)\n ->notification([\n 'title' => 'New video has been added ',\n 'body' => 'Check it!!',\n ])\n ->send();\n\n\n //return with successfull message\n return new RedirectResponse(route('admin.videos.index'), ['flash_success' => trans('alerts.backend.videos.created')]);\n }", "public function video()\n {\n /***** Checks Video for UPLOAD *****/\n if(!empty($_FILES['video']['name']))\n {\n $video = array\n (\n 'upload_path' => 'uploads/videos',\n 'allowed_types' => 'mp4|avi|wmv|mov|mpg|mpeg|3gp',\n 'max_size' => '10000',\n 'file_name' => $_FILES['video']['name']\n );\n $this->load->library('upload',$video);\n $this->upload->initialize($video);\n\n if($this->upload->do_upload('video'))\n {\n $uploadData = $this->upload->data();\n $uploaded_video = $uploadData['file_name'];\n }else{\n $Response = array('message' => $this->upload->display_errors(), 'status' => false);\n echo json_encode($Response);\n }\n }else{\n //$uploaded_video = '';\n $Response = array('message' => 'Choose a Video to upload', 'status' => false);\n echo json_encode($Response);\n }\n // prepare video array for insert\n $dataVideo = array\n (\n 'complaint_type_id' => $this->input->post('complaint_type_id'),\n 'signup_id' => $this->input->post('signup_id'),\n 'complaints_status_id'=> 2,\n 'latitude' => $this->input->post('latitude'),\n 'longitude' => $this->input->post('longitude'),\n 'description' => $this->input->post('description'),\n 'video' => $uploaded_video,\n 'dated' => date('Y-m-d')\n );\n if(isset($uploaded_video))\n {\n $insert = $this->Complaintsmodel->InsertDB($dataVideo);\n if($insert)\n {\n $Response = array('message' => 'Complaint is done!', 'status' => true, 'data'=>$insert); \n echo json_encode($Response);\n }\n else\n {\n $Response = array('message' => 'Sorry, Try again!', 'status' => false);\n echo json_encode($Response);\n }\n }\n }", "public function savevideoAction()\n {\n $response = $this->getResponse();\n\n $dm = $this->getDocumentService();\n $successModel = new SuccessModel();\n\n $data = $this->params()->fromPost();\n $result = $successModel->saveNewVideo($dm, $data);\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function postVideo($obj,$id){\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildPostUrl());\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t\tcurl_setopt($crl, CURLOPT_POSTFIELDS, $obj); \n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t\t$decoded = json_decode($result);\n\t\t$this->videoPath = $decoded->uri;\n\t\t$this->addTag($id);\n\t}", "public function add(string $access_token, array $params = [], int $apiTokenType = VKApiTokenTypes::USER)\n\t{\n\t\treturn $this->request->post('video.add', $access_token, $params, $apiTokenType);\n\t}", "public function addVideo( OpenGraphProtocolVideo $video ) {\n\t\t$video_url = $video->getURL();\n\t\tif ( empty($video_url) )\n\t\t\treturn;\n\t\t$video->removeURL();\n\t\t$value = array( $video_url, array($video) );\n\t\tif ( ! isset( $this->video ) )\n\t\t\t$this->video = array( $value );\n\t\telse\n\t\t\t$this->video[] = $value;\n\t\treturn $this;\n\t}", "public function contributeVideo($formdata) {\n\t\t$conn\t\t= $this->connect();\n\t\t$userSession= new Container('fo_user');\n\t\t$collection\t= $conn->snapstate->media;\n\t\tif(isset($userSession->userSession['_id']) && $userSession->userSession['_id'] != '' && isset($userSession->userSession['user_group']) && $userSession->userSession['user_group'] == CONTRIBUTOR_GROUP_ID) {\n\t\t\t$query\t\t= array('_id'\t\t\t\t=> $formdata['_id'],\n\t\t\t\t\t\t\t\t'user_id'\t\t\t=> (string)$formdata['user_id'],\n\t\t\t\t\t\t\t\t'media_url'\t\t\t=> $formdata['media_url'],\n\t\t\t\t\t\t\t\t'media_title'\t\t=> $formdata['media_title'],\n\t\t\t\t\t\t\t\t'media_title_lower'\t=> $formdata['media_title_lower'],\n\t\t\t\t\t\t\t\t'media_description'\t=> $formdata['media_description'],\n\t\t\t\t\t\t\t\t'media_category'\t=> $formdata['media_category'],\n\t\t\t\t\t\t\t\t'media_length'\t\t=> $formdata['media_length'],\n\t\t\t\t\t\t\t\t'media_status'\t\t=> '1',\n\t\t\t\t\t\t\t\t'media_approved'\t=> '1',\n\t\t\t\t\t\t\t\t'approved_user_id'\t=> (string)$formdata['user_id'],\n\t\t\t\t\t\t\t\t//'date_approved'\t\t=> date('m/d/Y H:i:s'),\n\t\t\t\t\t\t\t\t'date_approved'\t\t=> time(),\n\t\t\t\t\t\t\t\t//'date_added'\t\t=> date('m/d/Y H:i:s')\n\t\t\t\t\t\t\t\t'date_modified'\t\t=> time(),\n\t\t\t\t\t\t\t\t'date_added'\t\t=> time()\n\t\t\t\t\t\t\t\t);\n\t\t\t$results\t= $collection->insert($query);\n\t\t} else if(isset($userSession->userSession['_id']) && $userSession->userSession['_id'] != '') {\n\t\t\t$query\t\t= array('_id'\t\t\t\t=> $formdata['_id'],\n\t\t\t\t\t\t\t'user_id'\t\t\t=> (string)$formdata['user_id'],\n\t\t\t\t\t\t\t'media_url'\t\t\t=> $formdata['media_url'],\n\t\t\t\t\t\t\t'media_title'\t\t=> $formdata['media_title'],\n\t\t\t\t\t\t\t'media_title_lower'\t=> $formdata['media_title_lower'],\n\t\t\t\t\t\t\t'media_description'\t=> $formdata['media_description'],\n\t\t\t\t\t\t\t'media_category'\t=> $formdata['media_category'],\n\t\t\t\t\t\t\t'media_length'\t\t=> $formdata['media_length'],\n\t\t\t\t\t\t\t'media_status'\t\t=> '1',\n\t\t\t\t\t\t\t'media_approved'\t=> '2',\n\t\t\t\t\t\t\t'approved_user_id'\t=> '',\n\t\t\t\t\t\t\t'date_approved'\t\t=> '',\n\t\t\t\t\t\t\t'date_modified'\t\t=> time(),\n\t\t\t\t\t\t\t//'date_added'\t\t=> date('m/d/Y H:i:s')\n\t\t\t\t\t\t\t'date_added'\t\t=> time()\n\t\t\t\t\t\t\t);\n\t\t\t$results\t= $collection->insert($query);\n\t\t}\n\t\t\n\t\t// Tags insertion\n\t\tif(isset($userSession->userSession['_id']) && $userSession->userSession['_id'] != '' && isset($formdata['media_tags']) && is_array($formdata['media_tags']) && count($formdata['media_tags']) > 0) {\n\t\t\t$collection\t= $conn->snapstate->media_tags;\n\t\t\tforeach($formdata['media_tags'] as $key => $value) {\n\t\t\t\t$document\t= array('media_id'\t=> (string)$formdata['_id'], \n\t\t\t\t\t\t\t\t\t'user_id'\t=> (string)$userSession->userSession['_id'],\n\t\t\t\t\t\t\t\t\t'tag_id'\t=> $value);\n\t\t\t\t$results\t= $collection->insert($document);\n\t\t\t}\n\t\t}\n\t}", "public function createAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n // Upload video\n if (isset($_GET['ul']) || (isset($_FILES['Filedata']) && !empty($_FILES['Filedata']['name']))) {\n return $this->_forwardCustom('upload-review-video', null, null, array('format' => 'json'));\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n }\n //GET LISTING ID\n $this->view->listing_id = $listing_id = $this->_getParam('listing_id');\n $this->view->listing_singular_uc = ucfirst($this->_listingType->title_singular);\n\n $this->view->listingtype_id = $listingtype_id = $this->_listingType->listingtype_id;\n\n //ACTIVE TAB\n $this->view->TabActive = \"video\";\n\n //GET CONTENT ID\n $this->view->content_id = $content_id = $this->_getParam('content_id');\n\n $sitereviewModHostName = str_replace('www.', '', strtolower($_SERVER['HTTP_HOST']));\n\n //GET SITEREVIEW OBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n\n //GET VIEWER INFO\n $viewer = Engine_Api::_()->user()->getViewer();\n\n $videos = array();\n $type_video = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview.show.video');\n if (Engine_Api::_()->sitereview()->enableVideoPlugin() && !empty($type_video)) {\n $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 1);\n } elseif (empty($type_video)) {\n $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 0);\n }\n\n $this->view->allowed_upload_video = Engine_Api::_()->sitereview()->allowVideo($sitereview, $viewer, count($videos));\n if (empty($this->view->allowed_upload_video)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n $viewer_id = $viewer->getIdentity();\n\n //VIDEO UPLOAD PROCESS\n $this->view->imageUpload = Engine_Api::_()->sitereview()->isUpload();\n\n $this->view->can_edit = $canEdit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n\n //FORM GENERATON\n $this->view->form = $form = new Sitereview_Form_Video();\n if ($this->_getParam('type', false))\n $form->getElement('type')->setValue($this->_getParam('type'));\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues('url');\n return;\n }\n $insert_action = false;\n Engine_Api::_()->getApi('settings', 'core')->setSetting('sitereview.video.utility.type', convert_uuencode($sitereviewModHostName));\n\n //GET FORM VALUES\n $values = $form->getValues();\n$this->view->clear_cache = true;\n $values['owner_id'] = $viewer_id;\n\n //VIDEO CREATION PROCESS\n $videoTable = Engine_Api::_()->getDbtable('videos', 'sitereview');\n\n $db = $videoTable->getAdapter();\n $db->beginTransaction();\n try {\n \n if ($values['type'] == 3) {\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->_getParam('id'));\n } else {\n// if (empty($values['Filename'])) {\n// $this->view->status = false;\n// $this->view->error = Zend_Registry::get('Zend_Translate')->_('No file');\n// return;\n// }\n if ((!isset($_FILES['Filedata']) && !empty($_FILES['Filedata']['name']))) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid Upload') . print_r($_FILES, true);\n return;\n }\n\n if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name'])) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid Upload') . print_r($_FILES, true);\n return;\n }\n\n $illegal_extensions = array('php', 'pl', 'cgi', 'html', 'htm', 'txt');\n if (in_array(pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION), $illegal_extensions)) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid Upload');\n return;\n }\n $viewer = Engine_Api::_()->user()->getViewer();\n $values['owner_id'] = $viewer->getIdentity();\n\n $params = array(\n 'owner_type' => 'user',\n 'owner_id' => $viewer->getIdentity()\n );\n $sitereview_video = Engine_Api::_()->sitereview()->createSitereviewvideo($params, $_FILES['Filedata'], $values);\n $sitereview_video->owner_id = $viewer->getIdentity();\n $sitereview_video->save();\n $this->view->status = true;\n $this->view->name = $_FILES['Filedata']['name'];\n $this->view->code = $sitereview_video->code;\n $this->view->video_id = $sitereview_video->getIdentity();\n\n $sitereview_video->save();\n }\n } else {\n $sitereview_video = $videoTable->createRow();\n }\n\n $sitereview_video->setFromArray($values);\n $sitereview_video->listing_id = $this->_getParam('listing_id');\n $sitereview_video->save();\n\n $params = $sitereview->main_video;\n\n //THUMBNAIL CREATION\n $thumbnail = $this->handleThumbnail($sitereview_video->type, $sitereview_video->code);\n $ext = ltrim(strrchr($thumbnail, '.'), '.');\n $thumbnail_parsed = @parse_url($thumbnail);\n\n if (@GetImageSize($thumbnail)) {\n $valid_thumb = true;\n } else {\n $valid_thumb = false;\n }\n\n if ($valid_thumb && $thumbnail && $ext && $thumbnail_parsed && in_array($ext, array('jpg', 'jpeg', 'gif', 'png'))) {\n $tmp_file = APPLICATION_PATH . '/temporary/link_' . md5($thumbnail) . '.' . $ext;\n $thumb_file = APPLICATION_PATH . '/temporary/link_thumb_' . md5($thumbnail) . '.' . $ext;\n $src_fh = fopen($thumbnail, 'r');\n $tmp_fh = fopen($tmp_file, 'w');\n stream_copy_to_stream($src_fh, $tmp_fh, 1024 * 1024 * 2);\n $image = Engine_Image::factory();\n $image->open($tmp_file)\n ->resize(120, 240)\n ->write($thumb_file)\n ->destroy();\n\n try {\n $thumbFileRow = Engine_Api::_()->storage()->create($thumb_file, array(\n 'parent_type' => $sitereview_video->getType(),\n 'parent_id' => $sitereview_video->getIdentity()\n ));\n\n //REMOVE TEMP FILES\n @unlink($thumb_file);\n @unlink($tmp_file);\n } catch (Exception $e) {\n \n }\n $information = $this->handleInformation($sitereview_video->type, $sitereview_video->code);\n $sitereview_video->duration = $information['duration'];\n $sitereview_video->photo_id = $thumbFileRow->file_id;\n $sitereview_video->status = 1;\n $sitereview_video->save();\n\n //INSERT NEW ACTION ITEM\n $insert_action = true;\n }\n\n if ($values['ignore'] == true) {\n $sitereview_video->status = 1;\n $sitereview_video->save();\n $insert_action = true;\n }\n\n //COMMENT PRIVACY\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'everyone');\n $auth_comment = \"everyone\";\n $commentMax = array_search($auth_comment, $roles);\n foreach ($roles as $i => $role) {\n $auth->setAllowed($sitereview_video, $role, 'comment', ($i <= $commentMax));\n }\n\n //TAG WORK\n if (!empty($values['tags'])) {\n $tags = preg_split('/[,]+/', $values['tags']);\n $sitereview_video->tags()->addTagMaps($viewer, $tags);\n }\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n $db->beginTransaction();\n try {\n if ($insert_action && $sitereview_video->search == 1 && time() >= strtotime($sitereview->creation_date)) {\n $owner = $sitereview_video->getOwner();\n $actionTable = Engine_Api::_()->getDbtable('actions', 'activity');\n $action = $actionTable->addActivity($owner, $sitereview, 'sitereview_video_new_listtype_' . $sitereview->listingtype_id);\n if ($action != null) {\n $actionTable->attachActivity($action, $sitereview_video);\n }\n }\n\n $actionTable = Engine_Api::_()->getDbtable('actions', 'activity');\n foreach ($actionTable->getActionsByObject($sitereview_video) as $action) {\n $actionTable->resetActivityBindings($action);\n }\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n if ($canEdit) {\n return $this->_gotoRouteCustom(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $content_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $content_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n }", "public function store(Request $request)\n { \n\n $request->validate([\n 'name' => 'required'\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n\n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video = Video::create([\n\n 'name' => $request->name,\n 'date_public' => $request->date_public,\n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se creó con éxito');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'judul_video' => 'required',\n 'status' => 'required',\n 'foto_iklan' => 'image|mimes:mp4,mov,ogg,3gp,avi,wmv|max:1000',\n ]);\n if($request->hasFile('video')){\n // Get filename with the extension\n $filenameWithExt = $request->file('video')->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $request->file('video')->getClientOriginalExtension();\n // Filename to store\n $fileNameToStore= $filename.'_'.time().'.'.$extension;\n // Upload Image\n $path = $request->file('video')->storeAs('public/video', $fileNameToStore);\n } else {\n $fileNameToStore = 'novideo.mp4';\n }\n\n $ivideo = new Iklanvideo;\n $ivideo->judul_video = $request->judul_video;\n $ivideo->status = $request->status;\n $ivideo->video = $fileNameToStore;\n $ivideo->save();\n Session::flash(\"flash_notification\", [\n \"level\" => \"success\",\n \"message\" => \"Successfully added data\"\n ]);\n return redirect()->route('datavideo.index');\n }", "public function store(VideoRequest $request)\n\t{\t\n\t\t$resource = new Resource;\n //dump($request->all());\n\t\t$category_id = $request->input('category_id');//栏目\n $title = rtrim($request->input('title'));//标题\n $content = rtrim($request->input('content'));//内容\n\t\t$path = rtrim($request->input('path'));//视频存放路径\n\t\t$duration = rtrim($request->input('duration'));//视频时长\n\t\t$author = rtrim($request->input('author'));//作者\n $size = $request->input('size');//视频大小\n\t\t\n\t\t//视频,封面公共名字部分\n $name = time().$this->nrand();\n\n //创建文件夹用来存放上传文件\n $dirname = date('Y-m-d' , time());\n if(!is_dir(base_path('public/uploads/videos/'.$dirname))) {\n mkdir(base_path('public/uploads/videos/'.$dirname,0777));\n }\n\n //获取图片\n $cover = $request->file('cover');\n\t\t\n\t\t//$size = $cover->getClientSize();//视频大小\n \n\t\tif($cover->isValid()) {\n //dd($cover->getMimeType());\n switch($cover->getMimeType()){\n case 'image/jpeg':\n $ext = '.jpeg';\n break;\n case 'image/jpg':\n $ext = '.jpg';\n break;\n case 'image/png':\n $ext = '.png';\n break;\n default:\n return back()->withInput()->with('notify_error' , '图片类型不符!');\n }\n $name_cover = $name.$ext;\n\n $cover->move(base_path('public/uploads/videos/'.$dirname) , $name_cover);\n $resource->cover = '/uploads/videos/'.$dirname.'/'.$name_cover;\n }\n\t\t\n $resource->title = $title;\n $resource->content = $content;\n\t\t$resource->path = $path;\n\t\t$resource->duration = $duration;\n\t\t$resource->size = $size;\n\t\t$resource->category_id = $category_id;\n\t\t$resource->type_id = 1;\n\t\t$resource->user_id = Auth::user()->id;\n\t\t$resource->author = $author;\n\t\t\n\t\tif(!$resource->save()) {\n\t\t\treturn back()->withInput()->with('notify_error' , '添加失败!');\n\t\t}\n\t\t\n\t\t$id = Resource::where('path' , $path)->first()->id;\n\t\t\n\t\t//这里是添加提示消息\n\t\t$this->record('create',$id,1);\n\t\t\n\t\treturn redirect('donkey/admin/video/index')->with('notify_success' , '添加成功!');\n \n //获取视频文件\n\n\t}", "public function video_add($id)\n {\n $data['content'] = Content::findorfail($id);\n\n $data['page_title'] = 'Content Add';\n return view('client.content.video_add', $data);\n }", "public function store(VideoRequest $request)\n {\n $request->validated();\n\n parse_str( parse_url( $request->url, PHP_URL_QUERY ), $array_param_video );\n if (empty($array_param_video)) {\n\n return redirect()->back()->with('error', 'URL digitada não é válida!');\n\n }else{\n $video = new Videos;\n $video->titulo = $request->titulo;\n $video->descricao = $request->descricao;\n $video->url = $array_param_video['v'];\n $video->save();\n return redirect()->back()->with('message', 'Cadastro efetuado com sucesso!');\n\n }\n }", "function type_url_form_video()\n {\n }", "public function updateVideo(Request $request, $id)\n {\n try {\n $video = VideoContent::where('ID', '=' ,(int) $id)->first();\n if (!$video) {\n return APIResponse('201', 'No videos found.');\n }\n\n $validateData = Validator::make($request->all(),[\n 'title' => 'required',\n 'asset_type' => 'required',\n 'slug' => 'required',\n 'short_description' => 'required|max:520',\n 'description' => 'required',\n 'content_type' => 'required'\n ]);\n\n if ($validateData->fails()) {\n $messages = $validateData->errors()->all();\n return APIResponse('201', 'Validation errors.', $messages);\n }\n\n $photoURL = '';\n if ($request->hasFile('thumbnail_image')) {\n $file = $request->file('thumbnail_image');\n $folderpath = 'bcci/videos/';\n $result = uploadFileToS3($file, $folderpath, '');\n $photoURL = $result['ObjectURL'] ?? '';\n }\n\n $videoUrl = '';\n if ($request->hasFile('video_url')) {\n $file = $request->file('video_url');\n $folderpath = 'Input/';\n $result = uploadFileToS3($file, $folderpath, 'video');\n $videoUrl = $result['ObjectURL'] ?? '';\n }\n\n $dataArr = [\n 'title' => $request->get('title'),\n 'short_description' => $request->get('short_description'), \n 'description' => $request->get('description'),\n 'match_id' => $request->get('match_id'), \n 'video_duration' => $request->get('video_duration'), \n 'content_type' => $request->get('content_type'), \n 'video_scope' => $request->get('video_scope'),\n 'video_url' => $videoUrl,\n 'match_formats' => $request->get('match_formats'),\n 'keywords' => $request->get('keywords'),\n 'published_by' => $request->get('published_by'),\n 'publish_date' => $request->get('publish_date'), \n 'meta_languages' => $request->get('meta_languages'), \n 'langauge' => $request->get('langauge'),\n 'asset_type' => $request->get('asset_type'),\n 'expiry_date' => $request->get('expiry_date'),\n 'total_viewcount' => $request->get('total_viewcount'),\n 'titleslug' => $request->get('titleslug'), \n 'varients' => $request->get('varients'), \n 'views_count' => $request->get('views_count'), \n 'comments' => $request->get('comments'),\n 'platform' => $request->get('platform'),\n 'thumbnail_image' => $photoURL,\n 'current_status'=> $request->get('current_status'),\n 'lastModified'=> $request->get('lastModified'),\n 'video_status'=> $request->get('video_status'),\n 'location'=> $request->get('location'),\n 'titleUrlSegment'=> $request->get('titleUrlSegment'),\n 'subtitle'=> $request->get('subtitle'),\n 'titleTranslations'=> $request->get('titleTranslations'),\n 'coordinates'=> $request->get('coordinates'),\n 'lastModified'=> $request->get('lastModified'),\n 'publishTo'=> $request->get('publishTo'),\n 'mediaId'=> $request->get('mediaId'),\n 'references'=> $request->get('references'),\n 'closedCaptioned'=> $request->get('closedCaptioned'),\n 'status'=> true\n ];\n\n $updated = VideoContent::where('ID', (int) $id)->update($dataArr);\n\n if ($updated) {\n $response = APIResponse('200', 'Video has been updated successfully.');\n }\n else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n }\n\n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n return $response;\n }", "public function add_video(){\n\t\t$this->load->view('admin/video_gallery/add_video');\n\t}", "public function storeVideo(Request $request)\n {\n $this->validate($request,array(\n 'title' => 'required',\n 'video_category_id' => 'required',\n 'video' => 'required|mimes:mp4'\n ));\n\n $video = new Video;\n\n $video->title = $request->title;\n $video->video_category_id = $request->video_category_id;\n\n if ($request->hasFile('video')) {\n $file = $request->file('video');\n $filename = time().'.'.$file->getClientOriginalName();\n /*$location = public_path('file/'.$filename);\n Storage::put($filename,file_get_contents($file));*/\n\n $location = public_path('file/'.$filename);\n Storage::disk('file')->put($filename, file_get_contents($file));\n //Storage::disk('public')->put($filename, file_get_contents($file));\n $video->video = $filename;\n\n }\n\n $video->save();\n\n if($video->save()){\n return redirect()->back()->with('success','Video saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Video is not saved.');\n }\n \n }", "public function addMedia(Event $event){\n $request = $event->getParam('request');\n $operation = $request->getOperation();\n $em = $this->getServiceLocator()->get('Omeka\\EntityManager');\n $entity = $event->getParam('entity');\n\n\n if ($operation == 'create'){\n\n $item_id = $entity->getItem()->getId();\n\n $team_resources = $em->getRepository('Teams\\Entity\\TeamResource')->findBy(['resource'=>$item_id]);\n foreach($team_resources as $team_resource):\n $team = $team_resource->getTeam();\n $tr = new TeamResource($team, $entity);\n $em->persist($tr);\n endforeach;\n $em->flush();\n\n\n }\n\n }", "public function insert(Request $request)\n {\n $video_type = $request->input('video_type');\n $video_url = $request->input('video_url');\n $price = $request->input('price');\n $video = $request->input('video');\n //dd($request->video);\n\n if($request->hasFile('video'))\n {\n //echo \"video\";\n $file = $request->file('video');\n $filename = $file->getClientOriginalName();\n // $path = public_path().'/uploaded_videos/';\n $path = storage_path('uploaded_videos');\n $file->move($path, $filename);\n }\n\n $data = array('video_type'=>$video_type, 'video_url'=>$video_url, 'price'=>$price, 'video'=>$filename,'users_id'=>Session::get('id'));\n DB::table('video_uploaded')->insert($data);\n $value = Session('key', 'You are successfully added all fields');\n return back()->with('success',$value);\n \n }", "public function store(Request $request)\n {\n $rules = [\n 'name' => 'required|string',\n 'especialidad' => 'required|string',\n 'tema' => 'required|string',\n 'video_types_id' => 'required|string',\n 'resumen' => 'required|string',\n 'contenido' => 'required|string',\n 'fecha' => 'required',\n 'lugar' => 'required|string',\n 'duracion' => 'required|string',\n 'url' => 'required|string',\n 'tipo_licencia' => 'required|string',\n 'keys' => 'nullable|string',\n 'competitor' => 'required|array',\n ];\n\n $messages = [\n 'name.required' => 'El nombre del vídeo es requerido',\n 'especialidad.required' => 'La especialidad del vídeo es requerida',\n 'tema.required' => 'El tema del vídeo es requerido',\n 'video_types_id.required' => 'El tipo de vídeo es requerido',\n 'resumen.required' => 'El resumen de vídeo es requerido',\n 'contenido.required' => 'El contenido de vídeo es requerido',\n 'fecha.required' => 'La fecha de ejecución del vídeo es requerida',\n 'lugar.required' => 'El lugar de vídeo es requerido',\n 'duracion.required' => 'La duración de vídeo es requerida',\n 'url.required' => 'La url de vídeo es requerida',\n 'tipo_licencia.required' => 'El tipo de licencia es requerido',\n 'competitor.required' => 'Los participantes son requeridos',\n ];\n\n $this->validate($request, $rules, $messages);\n\n $competitors = $request->input('competitor');\n\n $request->merge([\n 'url' => str_replace(\"watch?v=\", \"embed/\", $request->input('url'))\n ]);\n\n $video = Video::create($request->except(['competitor']));\n\n foreach ($competitors as $key => $item) {\n $competitor = [\n 'user_id' => $item['user_id'],\n 'video_id' => $video->id,\n 'competitor_type_id' => $key\n ];\n Competitor::create($competitor);\n }\n\n /*$user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();*/\n\n $videos = Video::all();\n return redirect('videos');\n }", "public function create_video( $data ) {\r\n\t\t// Get a new video object.\r\n\t\tif ( 'default' === $data['video_type'] ) {\r\n\t\t\t$video_id = $this->default_video( $data );\r\n\t\t} else {\r\n\t\t\t$video_id = $this->custom_video( $data );\r\n\t\t}\r\n\r\n\t\t// Queue playlists.\r\n\t\t$this->link_playlists( $data, $video_id );\r\n\r\n\t\t/**\r\n\t\t * Action hook to fire after default video is imported.\r\n\t\t *\r\n\t\t * @param int $video_id Video ID.\r\n\t\t * @param array $data Video data.\r\n\t\t *\r\n\t\t * @since 1.8.1\r\n\t\t */\r\n\t\tdo_action( 'wpmudev_vids_after_import_video', $video_id, $data );\r\n\t}", "public function store(VideoRequest $request)\n {\n if($request->file('video')->isValid()){\n $model = new Video;\n $vidName = 'video'.time().'.'.$request->file('video')->getClientOriginalExtension();\n $model->video = $vidName;\n $model->title = $request->get('title');\n $model->description = $request->get('description');\n $model->save();\n $request->file('video')->move(base_path().'/public/upload/videos/',$vidName);\n Session::flash('flash_message','Video Posted!');\n return redirect('admin/videos'); \n }else{\n Session::flash('flash_message','Video File is not valid!');\n }\n }", "public function addVideo()\n {\n $getAllVideoCategory = VideoCategory::all();\n return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory);\n }", "public function composeUploadAction() {\n\n //GET VIEWER INFO\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if (!$viewer->getIdentity()) {\n $this->_redirect('login');\n return;\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid method');\n return;\n }\n\n $video_title = $this->_getParam('title');\n $video_url = $this->_getParam('uri');\n $video_type = $this->_getParam('type');\n $composer_type = $this->_getParam('c_type', 'wall');\n\n $code = $this->extractCode($video_url, $video_type);\n // check if code is valid\n // check which API should be used\n if ($video_type == 1) {\n $valid = $this->checkYouTube($code);\n }\n if ($video_type == 2) {\n $valid = $this->checkVimeo($code);\n }\n\n if ($valid) {\n $db = Engine_Api::_()->getDbtable('videos', 'sitereview')->getAdapter();\n $db->beginTransaction();\n\n try {\n $information = $this->handleInformation($video_type, $code);\n // create video\n $table = Engine_Api::_()->getDbtable('videos', 'sitereview');\n $video = $table->createRow();\n $video->title = $information['title'];\n $video->description = $information['description'];\n $video->duration = $information['duration'];\n $video->owner_id = $viewer->getIdentity();\n $video->code = $code;\n $video->type = $video_type;\n $video->save();\n\n // Now try to create thumbnail\n $thumbnail = $this->handleThumbnail($video->type, $video->code);\n $ext = ltrim(strrchr($thumbnail, '.'), '.');\n $thumbnail_parsed = @parse_url($thumbnail);\n\n $tmp_file = APPLICATION_PATH . '/temporary/link_' . md5($thumbnail) . '.' . $ext;\n $thumb_file = APPLICATION_PATH . '/temporary/link_thumb_' . md5($thumbnail) . '.' . $ext;\n\n $src_fh = fopen($thumbnail, 'r');\n $tmp_fh = fopen($tmp_file, 'w');\n stream_copy_to_stream($src_fh, $tmp_fh, 1024 * 1024 * 2);\n\n $image = Engine_Image::factory();\n $image->open($tmp_file)\n ->resize(120, 240)\n ->write($thumb_file)\n ->destroy();\n\n $thumbFileRow = Engine_Api::_()->storage()->create($thumb_file, array(\n 'parent_type' => $video->getType(),\n 'parent_id' => $video->getIdentity()\n ));\n\n // If video is from the composer, keep it hidden until the post is complete\n if ($composer_type)\n $video->search = 0;\n\n $video->photo_id = $thumbFileRow->file_id;\n $video->status = 1;\n $video->save();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n // make the video public\n if ($composer_type === 'wall') {\n // CREATE AUTH STUFF HERE\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n foreach ($roles as $i => $role) {\n $auth->setAllowed($video, $role, 'view', ($i <= $roles));\n $auth->setAllowed($video, $role, 'comment', ($i <= $roles));\n }\n }\n\n $this->view->status = true;\n $this->view->video_id = $video->video_id;\n $this->view->photo_id = $video->photo_id;\n $this->view->title = $video->title;\n $this->view->description = $video->description;\n $this->view->src = $video->getPhotoUrl();\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Video posted successfully');\n } else {\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('We could not find a video there - please check the URL and try again.');\n }\n }", "public function editVideo(Request $request)\n {\n\n $editVideo = UploadVideo::where(\"id\", $request->id)->first();\n $editVideo->content_title = ucfirst($request->title);\n if ($request->active) {\n $editVideo->active_status = 1;\n } else {\n $editVideo->active_status = 0;\n }\n\n $editVideo->save();\n }", "public function materiVideoStore()\n {\n // $dataEnd = end($dataExplode);\n $this->validate(request(), [\n 'nama' => 'required',\n 'deskripsi' => 'required',\n 'link' => 'required'\n ]);\n\n // Materi::create([\n // 'user_id' => request('user_id'),\n // 'kelas_id' => request('kelas_id'),\n // 'nama' => request('nama'),\n // 'jenis' => request('jenis'),\n // 'status' => request('status'),\n // 'deskripsi' => request('deskripsi'),\n // 'link' => $dataEnd\n // ]);\n\n Materi::createMateriVideo();\n\n return back()->with('success');\n }", "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'video' => 'required',\n ]);\n\n $input['video'] = time() . '.' . $request->video->getClientOriginalExtension();\n $request->video->move(public_path('videos-gallery'), $input['video']);\n\n if (Auth::check()) {\n $input['name'] = $request->name;\n $input['public'] = 1;\n $input['fk_owner'] = Auth::id();\n $input['author'] = Auth::user()->name;\n\n Video::create($input);\n\n return redirect()->route('videos.index')->with('success', 'Video created successfully.');\n }\n\n return redirect()->route('videos.index')->with('warning', 'You must be connected.');\n }", "public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }", "public function update(Request $request, $id)\n {\n\n try{\n\n $video = Video::find($id);\n\n $video->title = $request->input('title');\n $video->subtitle = $request->input('subtitle');\n $video->description = $request->input('description');\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n $video->tags()->detach(); //we need time to attach again this is why this line is here and not inmeduatly bedore attach tags\n $video->categories()->detach();\n if($request->hasFile('thumbnail')){\n $thumbnailFile = $request->file('thumbnail');\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName);\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n }\n if($request->hasFile('video')){\n $videoFile = $request->file('video');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $videoFile->move(public_path(\"uploads/videos/\"),$videoName);\n $video->video = asset(\"uploads/videos/$videoName\");\n\n }\n $video->categories()->attach($category->id);\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n\n $video->tags()->attach($tag->id);\n }\n $video->save();\n\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was updated successfully !!\");\n return redirect()->back();\n\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not update the video\");\n Log::warning(\"Can not update Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n\n }", "public function createApiFormUrls($title)\n {\n $developerKey = Mage::getStoreConfig('productvideo_youtube_api/youtube_api/productvideo_gmail_developerkey');\n $applicationId = 'Video uploader v2';\n $authenticationURL= 'https://www.google.com/accounts/ClientLogin';\n try{\n $httpClient = Zend_Gdata_ClientLogin::getHttpClient(\n $username = Mage::getStoreConfig('productvideo_youtube_api/youtube_api/productvideo_gmail_email'),\n $password = Mage::getStoreConfig('productvideo_youtube_api/youtube_api/productvideo_gmail_password'),\n $service = 'youtube',\n $client = null,\n $source = 'store', // a short string identifying your application\n $loginToken = null,\n $loginCaptcha = null,\n $authenticationURL);\n }\n catch(exception $e){\n print 'You cannot be authenticated, please provide valid Gmail account information in System->Configuration->Youtube Api';\n die();\n }\n $httpClient->setHeaders('X-GData-Key', 'key='. $developerKey);\n $videoTitle = $title;\n $videoDescription= $title;\n $videoCategory= 'Howto';\n\n $youTubeService = new Zend_Gdata_YouTube($httpClient);\n $newVideoEntry = new Zend_Gdata_YouTube_VideoEntry();\n\n $newVideoEntry->setVideoTitle($videoTitle);\n $newVideoEntry->setVideoDescription($videoDescription);\n\n //make sure first character in category is capitalized\n $videoCategory = strtoupper(substr($videoCategory, 0, 1))\n . substr($videoCategory, 1);\n $newVideoEntry->setVideoCategory($videoCategory);\n\n // uncomment to add video tags to a video\n //$videoTagsArray = explode(' ', trim($videoTags));\n //$newVideoEntry->setVideoTags(implode(', ', $videoTagsArray));\n\n $tokenHandlerUrl = 'https://gdata.youtube.com/action/GetUploadToken';\n try {\n $tokenArray = $youTubeService->getFormUploadToken($newVideoEntry, $tokenHandlerUrl);\n } catch (Zend_Gdata_App_HttpException $httpException) {\n print 'ERROR ' . $httpException->getMessage()\n . ' HTTP details<br /><textarea cols=\"100\" rows=\"20\">'\n . $httpException->getRawResponseBody()\n . '</textarea><br />';\n return;\n } catch (Zend_Gdata_App_Exception $e) {\n $e->getMessage();\n return;\n }\n $tokenValue = $tokenArray['token'];\n $postUrl = $tokenArray['url'];\n $urls = array(\"postUrl\" => $postUrl , \"token\" => $tokenValue);\n\n return $urls;\n }", "public function addVideo(\\videoViewer\\Entities\\Video $vid)\n {\n $opt = new \\stdClass();\n $opt->seriesName = $vid->getSeries()->getName();\n $opt->videoId = $vid->getId();\n $opt->season = $vid->getSeasonNumber();\n $opt->episode = $vid->getEpisodeNumber();\n $opt->episodeName = $vid->getEpisodeName();\n $this->watched[]=$opt;\n }", "public function updateVideo(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'title' => 'required',\n 'category' => 'required',\n 'video' => 'mimes:mp4'\n ));\n\n $id = $request->id;\n $video = Video::find($id);\n $video->title = $request->title;\n $video->video_category_id = $request->category;\n\n if ($request->hasFile('video')) {\n $file = $request->file('video');\n $filename = time().'.'.$file->getClientOriginalName();\n /*$location = public_path('file/'.$filename);\n Storage::put($filename,file_get_contents($file));*/\n\n $location = public_path('file/'.$filename);\n Storage::disk('file')->put($filename, file_get_contents($file));\n //Storage::disk('public')->put($filename, file_get_contents($file));\n $video->video = $filename;\n\n }\n $video->save();\n Session::flash('success','Video Updated succcessfully.');\n return redirect()->back()->with('workout',$video);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function store(VideoRequest $request)\n {\n $data = $request->all();\n $data['image'] = ($request->file('image') && $request->file('image')->isValid()) ? $this->saveImage($request) : '';\n Video::create($data);\n flash('Create video success!', 'success');\n return redirect('admin/videos');\n }", "public function add_media() {\n $user_id = $this->session->userdata('user_id');\n $pujat = date(\"Y-m-d H:i:s\");\n $errors = \"\";\n\n $media = array(\n 'media_title' => $this->input->post('media_title'),\n 'media_description' => $this->input->post('media_description'),\n 'media_tags' => $this->input->post('media_tags'),\n 'media_address' => $this->input->post('media_address'),\n 'media_uploaded' => $user_id,\n 'media_date' => $pujat\n );\n $insert_id = $this->media_model->register_media($media);\n\n //Write a image on a file\n if (!empty($_FILES['thumbnail']['tmp_name'])) {\n $config['upload_path'] = 'img';\n $config['allowed_types'] = 'jpg';\n $config['file_name'] = $insert_id;\n $config['overwrite'] = TRUE;\n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n if (!$this->upload->do_upload('thumbnail')) {\n $errors .= \"Errores al subir el archivo - \";\n } else {\n $errors .= \"Archivo subido con éxito - \";\n }\n }\n\n //Write a video on a file\n if (!empty($_FILES['video']['tmp_name'])) {\n $config['upload_path'] = 'videos';\n $config['allowed_types'] = 'mp4';\n $config['file_name'] = $insert_id;\n $config['overwrite'] = TRUE;\n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n if (!$this->upload->do_upload('video')) {\n $errors .= \"Errores al subir el archivo - \";\n } else {\n $errors .= \"Archivo subido con éxito - \";\n }\n }\n\n if ($insert_id > 0) {\n $errors .= \"Registro añadido con éxito\";\n } else {\n $errors .= \"Ningún registro añadido\";\n }\n $valors = array();\n $this->load->view(\"admin.php\", array(\"data\" => $valors, \"error\" => $errors));\n }", "function linkVideo(){\n \n $vid = uniqid();\n $ar = array('id' => $vid, 'web_id' => WEB_ID, 'video_url' => $_POST['vurl'], 'video_name' => $_POST['name'], 'video_disc' => $_POST['disc'], 'type' => 'YouTube', 'category'=>$_POST['cats']);\n \n $this->db->insert('video_library', $ar);\n \n \n }", "public function run()\n {\n $video = [\n [\n 'id' => 1,\n 'source' => 'youtube',\n 'code' => 'zvziUZQCd-I',\n 'title' => 'iPhone 12中國銷量佳!華為出新機迎戰 躲禁令傳囤大量台積電晶片|非凡財經新聞|20201023',\n ],\n [\n 'id' => 2,\n 'source' => 'youtube',\n 'code' => 'A70caQprTO4',\n 'title' => '顧客轉買低價NB 英特爾Q3營收年減4% 盤後股價大跌近1成|非凡財經新聞|20201023',\n ],\n ];\n\n Video::insert($video);\n }", "public function store(Request $request)\n {\n $this->validate(request(), [\n 'title' => 'required|max:250',\n 'type' => 'required',\n 'description' => 'required',\n 'image' => 'required|mimes:jpeg,png,bmp',\n 'path' => 'required|mimes:avi,mp4,.mov,wmv',\n 'price' => 'required',\n ]);\n\n $file = $request->file('image');\n if ($request->hasFile('image')) {\n $imageUrl = $this->uploadImage($file);\n }\n $file1 = $request->file('path');\n if ($request->hasFile('path')) {\n $sourceUrl = $this->uploadSource($file1);\n }\n $video = Video::create(array_merge($request->all(), ['image' => $imageUrl], ['path' => $sourceUrl]));\n \n return redirect('admin/video/create');\n }", "public function process()\n\t{\n\t\tPhpfox::isUser(true);\n\t\tPhpfox::getUserParam('video.can_upload_videos', true);\n\t\t\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$this->template()->assign('sCustomVideoHash', Phpfox::getService('video')->addCustomHash());\n\t\t}\n\n\t\tif (defined('PHPFOX_IS_HOSTED_SCRIPT'))\n\t\t{\n\t\t\tif (Phpfox::getService('video')->getOnCloudLimit())\n\t\t\t{\n\t\t\t\treturn Phpfox_Error::display('Monthly video limit reached.');\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_1')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\n\t\t$sModule = $this->request()->get('module', false);\n\t\t$iItem = $this->request()->getInt('item', false);\t\t\n\t\t\n\t\t$aCallback = false;\n\t\tif ($sModule !== false && $iItem !== false && Phpfox::hasCallback($sModule, 'getVideoDetails'))\n\t\t{\t\t\t\n\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_2')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\tif (($aCallback = Phpfox::callback($sModule . '.getVideoDetails', array('item_id' => $iItem))))\n\t\t\t{\t\t\t\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['breadcrumb_title'], $aCallback['breadcrumb_home']);\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['title'], $aCallback['url_home']);\t\n\t\t\t\tif ($sModule == 'pages' && !Phpfox::getService('pages')->hasPerm($iItem, 'video.share_videos'))\n\t\t\t\t{\n\t\t\t\t\t$sPhrase = Phpfox::getPhrase('video.unable_to_view_this_item_due_to_privacy_settings');\n\t\t\t\t\tif ( ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase'))){ eval($sPlugin); }\n\t\t\t\t\treturn Phpfox_Error::display($sPhrase);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sPhrase = '';\n\t\t\t\t\tif ( ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase_2'))){ eval($sPlugin); }\n\t\t\t\t\tif (!empty($sPhrase))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn Phpfox_Error::display($sPhrase);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tif (($aVals = $this->request()->get('val')))\n\t\t{\n\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_3')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\tif (($iFlood = Phpfox::getUserParam('video.flood_control_videos')) !== 0)\n\t\t\t{\n\t\t\t\t$aFlood = array(\n\t\t\t\t\t'action' => 'last_post', // The SPAM action\n\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t'field' => 'time_stamp', // The time stamp field\n\t\t\t\t\t\t'table' => Phpfox::getT('video'), // Database table we plan to check\n\t\t\t\t\t\t'condition' => 'user_id = ' . Phpfox::getUserId(), // Database WHERE query\n\t\t\t\t\t\t'time_stamp' => $iFlood * 60 // Seconds);\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\t\t\t \t\t\t\n\t\t\t\t// actually check if flooding\n\t\t\t\tif (Phpfox::getLib('spam')->check($aFlood))\n\t\t\t\t{\n\t\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('video.you_are_sharing_a_video_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());\t\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\tif (Phpfox_Error::isPassed())\n\t\t\t{\t\t\t\n\t\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_4')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\t\tif (Phpfox::getService('video.grab')->get($aVals['url']))\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif ($iId = Phpfox::getService('video.process')->addShareVideo($aVals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$aVideo = Phpfox::getService('video')->getForEdit($iId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Phpfox::getService('video.grab')->hasImage())\n\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\tif (isset($aVals['module']) && isset($aVals['item']) && Phpfox::hasCallback($aVals['module'], 'uploadVideo'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$aCallback = Phpfox::callback($aVals['module'] . '.uploadVideo', $aVals['item']);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($aCallback !== false)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->url()->send($aCallback['url_home'], array('video', $sTitle), Phpfox::getPhrase('video.video_successfully_added'));\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\t$this->url()->permalink('video', $aVideo['video_id'], $aVideo['title'], true, Phpfox::getPhrase('video.video_successfully_added'));\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$this->url()->send('video.edit.photo', array('id' => $aVideo['video_id']), Phpfox::getPhrase('video.video_successfull_added_however_you_will_have_to_manually_upload_a_photo_for_it'));\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\t$sModule = (isset($aVals['module']) ? $aVals['module'] : false);\n\t\t\t$iItem = (isset($aVals['item']) ? $aVals['item'] : false);\n\t\t}\n\t\t\n\t\t$sMethod = Phpfox::getParam('video.video_enable_mass_uploader') && $this->request()->get('method','') != 'simple' ? 'massuploader' : 'simple';\n\t\t$sMethodUrl = str_replace(array('method_simple/','method_massuploader/'), '',$this->url()->getFullUrl()) . 'method_' . ($sMethod == 'simple' ? 'massuploader' : 'simple') . '/';\t\t\t\t\n\t\n\t\tif (Phpfox::isMobile())\n\t\t{\n\t\t\t$sMethod = 'simple';\n\t\t}\n\t\t\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$aVideoServers = Phpfox::getParam('video.convert_servers');\n\t\t\t$sCustomServerUrl = $aVideoServers[rand(0, (count($aVideoServers) - 1))];\n\t\t\t$this->template()->assign('sVideoServerUrl', $sCustomServerUrl);\n\t\t}\t\t\n\t\t\n\t\tif ($sMethod == 'massuploader')\n\t\t{\n\t\t\t$iMaxFileSize = (Phpfox::getUserParam('video.video_file_size_limit') === 0 ? null : ((Phpfox::getUserParam('video.video_file_size_limit') / 1) * 1048576));\n\t\t\tif (Phpfox::isModule('photo'))\n\t\t\t{\n\t\t\t\t$this->template()->setPhrase(array('photo.you_can_upload_a_jpg_gif_or_png_file'));\n\t\t\t}\n\n\t\t\t// video.video_array_support\n\t\t\t$sVideoFormats = '*.mpg; *.mpeg; *.wmv; *.avi; *.mov; *.flv';\n\t\t\t$sVideoNames = 'Video files (mpg, mpeg, wmv, avi, mov or flv)';\n\t\t\tif (Phpfox::getParam('video.upload_for_html5'))\n\t\t\t{\n\t\t\t\t$sVideoFormats = '';\n\t\t\t\tforeach ((array) Phpfox::getParam('video.video_array_support') as $sFormat => $sType)\n\t\t\t\t{\n\t\t\t\t\t$sVideoFormats .= '*.' . $sFormat . '; ';\n\t\t\t\t}\n\t\t\t\t$sVideoFormats = trim(trim($sVideoFormats), ';');\n\t\t\t\t$sVideoNames = $sVideoFormats;\n\t\t\t}\n\n\t\t\t$this->template()->setPhrase(array(\t\t\t\t\t\t\t\n\t\t\t\t\t\t'core.name',\n\t\t\t\t\t\t'core.status',\n\t\t\t\t\t\t'core.in_queue',\n\t\t\t\t\t\t'core.upload_failed_your_file_size_is_larger_then_our_limit_file_size',\n\t\t\t\t\t\t'core.more_queued_than_allowed'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->setHeader(array(\n\t\t\t\t'massuploader/swfupload.js' => 'static_script',\n\t\t\t\t'massuploader/upload.js' => 'static_script',\n\t\t\t\t'<script type=\"text/javascript\">\n\t\t\t\t\t// document.domain = \"\";\n\t\t\t\t\t$oSWF_settings =\n\t\t\t\t\t{\n\t\t\t\t\t\tobject_holder: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \\'swf_video_upload_button_holder\\';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\n\t\t\t\t\t\tdiv_holder: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \\'swf_video_upload_button\\';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\n\t\t\t\t\t\tget_settings: function()\n\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\tswfu.setUploadURL(\"' . (isset($sCustomServerUrl) ? $sCustomServerUrl : $this->url()->makeUrl('video.frame')) . '\");\n\t\t\t\t\t\t\tswfu.setFileSizeLimit(\"'.$iMaxFileSize .' B\");\n\t\t\t\t\t\t\tswfu.setFileUploadLimit(1);\n\t\t\t\t\t\t\tswfu.setFileQueueLimit(1);\n\t\t\t\t\t\t\tswfu.customSettings.flash_user_id = '.Phpfox::getUserId() .';\n\t\t\t\t\t\t\tswfu.customSettings.sHash = \"'.Phpfox::getService('core')->getHashForUpload().'\";\n\t\t\t\t\t\t\tswfu.setFileTypes(\"' . $sVideoFormats . '\",\"' . $sVideoNames . '\");\n\t\t\t\t\t\t\tswfu.atFileQueue = function()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(\\'#js_upload_actual_inner_form\\').slideUp();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\\'#js_video_form :input\\').each(function(iKey, oObject)\n\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\tswfu.addPostParam($(oObject).attr(\\'name\\'), $(oObject).val());\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</script>',\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$aMenus = array();\t\t\n\t\tif (Phpfox::getParam('video.allow_video_uploading') || Phpfox::getParam('video.vidly_support'))\n\t\t{\n\t\t\t$aMenus[$this->url()->makeUrl('video.add')] = Phpfox::getPhrase('video.file_upload');\n\t\t}\n\t\t$aMenus[$this->url()->makeUrl('video.add.url')] = Phpfox::getPhrase('video.paste_url');\n\t\t\n\t\tif (!empty($sModule))\n\t\t{\n\t\t\tforeach ($aMenus as $sUrl => $sPhrase)\n\t\t\t{\n\t\t\t\tunset($aMenus[$sUrl]);\n\t\t\t\t\n\t\t\t\t$aMenus[$sUrl . 'module_' . $sModule . '/item_' . $iItem . '/'] = $sPhrase;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$bIsVideoUploading = false;\n\t\tif ((Phpfox::getParam('video.allow_video_uploading') || Phpfox::getParam('video.vidly_support')) && $this->request()->get('req3') != 'url')\n\t\t{\n\t\t\t$bIsVideoUploading = true;\n\t\t}\n\t\t\n\t\t$this->template()->buildPageMenu('js_upload_video', $aMenus, null, true);\n\t\t\n\t\tif (Phpfox::getParam('video.video_upload_service'))\n\t\t{\n\t\t\tPhpfox::getService('video.process')->createVidlyToken();\n\t\t\t$aVidlyParams = array(\n\t\t\t\t'phrases' => array(\n\t\t\t\t\t'select_video' => Phpfox::getPhrase('video.select_video')\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->template()->assign('sVidlyParams', urlencode(json_encode($aVidlyParams)));\n\t\t\t$this->template()->setHeader('<script type=\"text/javascript\">$Behavior.checkOnVideo = function(){setInterval(\"$(\\'#js_video_form\\').ajaxCall(\\'video.checkOnVideo\\');\", 5000);}</script>');\n\t\t}\n\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$this->template()->setHeader('<script type=\"text/javascript\">document.domain = \"' . Phpfox::getParam('video.convert_js_parent') . '\";</script>');\n\t\t}\n\t\t\n\t\t$this->template()->setTitle(Phpfox::getPhrase('video.upload_share_a_video'))\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('video.video'), ($aCallback === false ? $this->url()->makeUrl('video') : $aCallback['url_home_photo']))\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('video.upload_share_a_video'), ($aCallback === false ? $this->url()->makeUrl('video.add') : $this->url()->makeUrl('video.add', array('module' => $sModule, 'item' => $iItem))), true)\n\t\t\t->setFullSite()\t\t\t\n\t\t\t->assign(array(\n\t\t\t\t\t'sModule' => $sModule,\n\t\t\t\t\t'iItem' => $iItem,\t\t\t\t\n\t\t\t\t\t'sMethod' => $sMethod,\n\t\t\t\t\t'sMethodUrl' => $sMethodUrl,\n\t\t\t\t\t'bIsVideoUploading' => $bIsVideoUploading\t\n\t\t\t\t)\n\t\t\t)\n\t\t\t->setHeader('cache', array(\n\t\t\t\t\t'upload.js' => 'module_video',\n\t\t\t\t\t'video.js' => 'module_video'\n\t\t\t\t)\n\t\t\t);\n\t}", "public function addOffreVideo($data)\n {\n $offrevid = new OffreVideo($data['nom'], $data['description'], $data['prix'], $data['devise'], $data['duree'], $data['image'], $data['etat'], $data['remise'], $data['nbre_videos']);\n\n try {\n\n\n $offrevid = self::$documentManager->merge($offrevid);\n self::$documentManager->flush();\n\n\n } catch (Exception $e) {\n echo 'Exception reçue : ', $e->getMessage(), \"\\n\";\n }\n\n return $offrevid;\n }", "protected function _prepareForm()\n {\n $global_helper = $this->helper('drecomm_productvideo/global');\n $videoModel = Mage::getModel('drecomm_productvideo/video');\n $productModel = Mage::getModel('catalog/product')->load($this->getRequest()->getParam('productid'));\n $productName = $productModel->getName();\n $videoModel->load($this->_videoId);\n $videoUrl = $videoModel->getUrl();\n $videoFormat = $global_helper->getVideoFormat($videoUrl);\n $videoFormat == 'youtube' ?\n $embedded = '<iframe width=\"460\" height=\"215\"\n src=\"http://www.youtube.com/embed/'.str_replace(\" [uploaded]\",\"\",$global_helper->getYoutubeVideoId($videoUrl)).'\"\n frameborder=\"0\" allowfullscreen>\n </iframe>'\n :\n $embedded = '<iframe width=\"500\" height=\"281\"\n src=\"http://player.vimeo.com/video/'.$global_helper->getVimeoVideoId($videoUrl).'\"\n frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen>\n </iframe>';\n\n if ($this->getRequest()->getParam('upload'))\n {\n $apiUrls = $global_helper->createApiFormUrls($productName);\n $status = $_GET['status'];\n $code = $_GET['code'];\n $id = $_GET['id'];\n\n if(isset($status))\n {\n $code = $code;\n $id = $id;\n }\n $uploadResponse = $global_helper->uploadResponse($status,$code,$id);\n $postUrl = $apiUrls['postUrl'];\n $tokenValue = $apiUrls['token'];\n $nextUrl = Mage::helper(\"adminhtml\")->getUrl(\"*/video/new/\", array(\n 'productid' => $this->_productId , \"upload\" => \"true\"));\n $uploadStatus = isset($_GET['status']) ? $_GET['status'] : null ;\n\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $postUrl.'?nexturl='.$nextUrl,\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ));\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => Mage::helper('checkout')->__('Video Information'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($videoModel->getId())\n {\n $fieldset->addField('videoid', 'hidden', array(\n 'name' => 'videoid',\n ));\n }\n $fieldset->addField('productId', 'hidden', array(\n 'name' => 'productId',\n ));\n $fieldset->addField('url', 'hidden', array(\n 'name' => 'url',\n ));\n\n $fieldset->addField('file', 'file', array(\n 'name' => 'file',\n 'label' => Mage::helper('checkout')->__('Video file'),\n 'title' => Mage::helper('checkout')->__('Video Url'),\n 'required' => false,\n 'onchange' => \"onChange(document.getElementById('file').value)\",\n 'after_element_html' => '\n <input name=\"token\" type=\"hidden\" value=\"'.$tokenValue.'\"/>\n <button id=\"uploadButton\"\n title=\"Save Video\" type=\"button\"\n class=\"scalable save\"\n onclick=\"changeDivVisibility();submit();\"\n style=\"\"><span><span><span>upload</span></span></span>\n </button>\n <p id=\"uploadStatus\" style=\"display:none\">'.$uploadStatus.'</p>\n <script>setUrl();</script>\n <div id=\"uploading\" style=\"display:none\">\n <p class=\"loader\" id=\"loading_mask_loader\">\n <img src=\"'.$this->getSkinUrl('images/ajax-loader-tr.gif') .'\" alt=\"'.Mage::helper('adminhtml')->__('Loading...').'\"/>\n <br/>'.Mage::helper('adminhtml')->__('Uploading, please wait...').'</p>\n </div>'\n ,\n ));\n\n if(isset($_GET['id']))\n {\n $fieldset->addField('saveupload', 'hidden', array(\n 'name' => 'saveupload',\n 'after_element_html' =>'\n <script>window.location=\"'.$this->getUrl('*/video/save', array\n (\n 'form_key' => Mage::getSingleton('core/session')->getFormKey(),\n 'videoid' => $this->_videoId,\n 'productid' => $this->_productId,\n 'url' => $_GET['id'],\n 'upload' => 'true',)\n ).'\";$j(\"#uploading\").css(\"display\", \"block\");</script>\n '\n ));\n }\n $form->setValues($videoModel->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n }\n else\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save',\n array(\n 'videoid' => $this->_videoId,\n 'productid' => $this->_productId\n )),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ));\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => Mage::helper('checkout')->__('Url'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($videoModel->getId())\n {\n $fieldset->addField('videoid', 'hidden', array(\n 'name' => 'videoid',\n ));\n }\n\n $fieldset->addField('productId', 'hidden', array(\n ));\n\n $fieldset->addField('url', 'text', array(\n 'name' => 'url',\n 'label' => Mage::helper('checkout')->__('Video Url'),\n 'title' => Mage::helper('checkout')->__('Video Url'),\n 'required' => false,\n 'after_element_html' => '\n </br><small> use a valid vimeo or youtube url</small>\n <div id=\"loading-mask\" style=\"display:none\">\n <p class=\"loader\" id=\"loading_mask_loader\">\n <img src=\"'.$this->getSkinUrl('images/ajax-loader-tr.gif') .'\" alt=\"'.Mage::helper('adminhtml')->__('Loading...').'\"/>\n <br/>'.Mage::helper('adminhtml')->__('Please wait...').'</p>\n </div>\n ',\n ));\n\n if ($videoModel->getId())\n {\n $fieldset->addField('embed', 'hidden', array(\n 'name' => 'embed',\n 'after_element_html' => '<br><br>'.$embedded\n ));\n }\n\n $form->setValues($videoModel->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n }\n\n return parent::_prepareForm();\n }", "public function postCreate2()\n\t{\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Create a new video \n $user = Auth::user();\n\n // Update the video data\n $this->video->link = Input::get('link');\n $this->video->description = Input::get('description');\n $this->video->user = Input::get('user');\n\n // Was the video created?\n if($this->video->save())\n {\n // Redirect to the new video page\n return Redirect::to('videos/v')->with('success', Lang::get('user/user.user_video_created'));\n }\n\n // Redirect to the video video create page\n return Redirect::to('admin/videos/create')->with('error', Lang::get('admin/videos/messages.create.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/create')->withInput()->withErrors($validator);\n\t}", "public function hasVideo() {}", "function add_group_video($vid, $gid, $update_group = false) {\n global $db, $cbvid;\n $group = $this->get_details($gid);\n $video = $cbvid->get_video_details($vid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (!$video)\n e(lang(\"class_vdo_del_err\"));\n elseif ($video['userid'] != userid())\n e(lang(\"you_cant_add_this_vdo\"));\n elseif ($this->is_group_video($vid, $gid))\n return false;\n else {\n if (!$this->is_active_member(userid(), $group['group_id'])) {\n $approved = \"no\";\n e(lang(\"your_video_send_in_modetation\"), \"w\");\n }\n else\n $approved = \"yes\";\n\n $db->insert(tbl($this->gp_vdo_tbl), array(\"videoid\", \"group_id\", \"userid\", \"approved\"), array($vid, $gid, userid(), $approved));\n e(lang(\"video_added\"), \"m\");\n if ($update_group)\n $this->update_group_videos_count($gid);\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required',\n \n 'body' => 'required',\n ]);\n \n \n Video::create($request->all());\n Session::flash('create_video','The user has been successful!!!');\n return back();\n \n // return $request->all();\n }", "public function actionCreate()\n {\n $model = new TbYoutube();\n\n if ($model->load(Yii::$app->request->post())){\n // $model->yt_thumbnailURL\n //echo $model->yt_watchURL;\n $data = Yii::$app->video->getData($model->yt_watchURL);\n \n// echo \"<pre>\";\n// print_r($data);\n// exit();\n $delimiter='&list=';\n @list($a,$list)= @explode($delimiter, $model->yt_watchURL);\n \n $model->yt_vid = $data->id.($list?'?list='.$list:'');\n $model->yt_title = $data->snippet->title;\n $model->yt_description = $data->snippet->description;\n $model->yt_author = $data->snippet->channelTitle;\n $model->yt_thumbnailURL = $data->snippet->thumbnails->medium->url;\n \n if($model->save()) { \n return $this->redirect(['update', 'id' => $model->yt_id]);\n }else{\n print_r($model->getErrors());\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function postVideo(Request $request)\n {\n $videoid = $request->get('videoid');\n $entityManager = $this->getDoctrine()->getManager();\n if ($videoid)\n $video = $entityManager->getRepository(Video::class)->findOneBy(['id' => $videoid]);\n else\n $video = new Video();\n $form = $this->createForm(VideoType::class, $video);\n $form->handleRequest($request);\n $user = $this->getUser();\n $video->setUsername($user->getUsername());\n if ($form->isSubmitted() && $form->isValid())\n {\n $video->setCreatedate(new \\DateTime());\n $entityManager->persist($video);\n $entityManager->flush();\n\n return $this->redirectToRoute('videos_page');\n }\n $this->addFlash('error', 'The video was not upload!');\n return $this->render('Member/video_new.html.twig');\n }", "public function actionCreate()\n {\n $form = new VideoForm();\n if(\\Yii::$app->request->isPost)\n {\n $form->load(Yii::$app->request->post());\n\n $form->file = UploadedFile::getInstance($form,'file');\n\n if($form->file && $form->validate())\n {\n $new_name = date('YmdHis', time()) . rand(0, 999). '.' . $form->file->getExtension();\n $new_path = 'static/upload/video/' . $new_name;\n if ($form->file->saveAs($new_path)) {\n $model = new Video();\n $model->attributes = [\n 'name' => $new_name,\n 'file' => $new_path,\n 'size' => $form->file->size,\n 'type' => $form->file->type,\n 'created_at' => $form->created_at,\n 'author' => $form->author,\n 'description' => $form->description,\n ];\n\n if ($model->save()) {\n return $this->redirect(['index']);\n } else {\n unlink($new_path);\n }\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $form,\n ]);\n }", "public function actionVideo()\n {\n $title = '微站设置/视频设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('video',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Video;\n\n $this->performAjaxValidation($model, 'video-form');\n\n\t\tif(isset($_POST['Video']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Video'];\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 video_details(Request $request) {\n\n $validator = Validator::make(\n $request->all(),\n array(\n 'video_id'=>'required|exists:live_videos,id',\n ));\n\n if ($validator->fails()) {\n\n // Error messages added in response for debugging\n\n $errors = implode(',',$validator->messages()->all());\n\n $response_array = ['success' => false,'error_messages' => $errors,'error_code' => 101];\n\n } else {\n\n $currency = Setting::get('currency');\n\n $model = LiveVideo::select('title', 'description', 'amount', DB::raw(\"'$currency' as currency\"), 'id as video_id')->where('id',$request->video_id)->first();\n\n if($model) {\n\n $request->request->add(['broadcast_type' => $model->broadcast_type, 'virtual_id' => $model->virtual_id, 'live_video_id' => $model->live_video_id]);\n\n $model->mobile_live_streaming_url = Helper::get_mobile_live_streaming_url($request);\n }\n\n $response_array = ['success' => true,'data' => $model];\n\n\n }\n\n return response()->json($response_array);\n\n }", "public function store(Request $request)\n {\n $video = new Video();\n $validator = Validator::make($request->all(), $video->rules);\n if ($validator->fails())\n {\n return $this->message('error', 'Please fill all required fields.');\n }\n \n Video::create($request->all());\n\n return $this->message('success', 'New video has been added.');\n }", "function addvideo($name, $category, $length)\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\n\t\t$result ='';\n\n\t\tif(!($stmt = $mysqli->prepare(\"INSERT INTO videoinventory (name, category, length) VALUES (?,?,?)\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!($stmt->bind_param(\"ssi\", $name, $category, $length))){\n\t\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!$stmt->execute()) {\n\t\t\t$result = \"Execute failed: \" . $mysqli->error;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$result='success';\n\t\t}\t\t\n\t\t$stmt->close();\t\n\t\treturn $result;\n\t}", "public function add($params)\n {\n $wallpostEntity = new \\App\\Repository\\wallpostRepo($this->em);\n $wallpost_obj = $wallpostEntity->getRowObject(['id', $params['wallpost_id']]);\n //Todo: Change $obj to sensable name.\n $obj = new wallpost_videos;\n $obj->setVideosWallpost($wallpost_obj);\n $obj->setName($params['name']);\n $this->em->persist($obj);\n $this->em->flush();\n return $obj;\n }", "public function insert_video($arr_data){\n\n\t\treturn $this->db->insert($this->_table,$arr_data);\n\n\t}", "public function addEditData(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$config = array(\n\t\t\t\tarray(\n\t 'field' => 'title',\n\t 'label' => 'Title',\n\t 'rules' => 'required|trim|min_length[2]|max_length[12]'\n\t ),\n\t array(\n\t 'field' => 'link',\n\t 'label' => 'Link',\n\t 'rules' => 'required|trim'\n\t )\n\t ); \n\t\t\t\n\t\t\t$this->form_validation->set_rules($config);\n\t\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t\t//$this->addedit();\n\t\t\t\t$this->session->set_flashdata('errors', validation_errors());\n\t\t\t\t$id= $this->input->post('id');\n\t\t\t\tif($id==''){\n\t\t\t\t\tredirect('admin/video/add-edit-video');\n\t\t\t\t}else{\n\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$id= $this->input->post('id');\n\t\t\t\tif($id==''){\n\t\t\t\t\t$data = array(\n\t\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t\t'link' => $this->input->post('link'),\n\t\t\t\t\t);\n\t\t\t\t\t$result = $this->VideoModel->insertVideo($data);\n\t\t\t\t\tif($result == TRUE){\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Successfully Added.');\n\t\t\t\t\t\tredirect('admin/video');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('err_message', 'This Video already exist');\n\t\t\t\t\t\tredirect('admin/video');\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$data = array(\n\t\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t\t'link' => $this->input->post('link'),\n\t\t\t\t\t'id' => $this->input->post('id'),\n\t\t\t\t\t);\n\t\t\t\t\t$result = $this->VideoModel->updateVideo($data);\n\t\t\t\t\tif($result == TRUE){\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Successfully Updated.');\n\t\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t\t\t//echo 'ok'; die;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Not Updated.');\n\t\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function testInsertPlaylistAndVideo()\n {\n // Insert a playlist into the DB\n $playlist = new playlist($this->user->getId(), \"test-title\",\n \"test-description\", \"test-subject\", \"test-topic\");\n $id = $playlist->insertPlaylist();\n $this->assertNotFalse($id);\n\n // Retrieve the playlist from the DB\n $fetchedPlaylist = Playlist::getPlaylistById($id);\n\n // Verify that we actually got our playlist back\n $this->assertInstanceOf(Playlist::class, $fetchedPlaylist);\n $this->assertEquals($playlist->getUser(), $fetchedPlaylist->getUser());\n\n // Insert a video into the playlist\n $video = $playlist->insertVideo($this->video1id);\n $this->assertNotFalse($video);\n }", "public function store(Request $request)\n {\n // dd($output);\n $validator = Validator::make(\n $request->all(), \n [\n 'title' => 'required', ],\n [\n 'title.required' => 'メールアドレスが間違っています。',\n ]\n );\n if(strtotime($request->start_date) > strtotime($request->end_date)) {\n $validator->after(function ($validator) {\n $validator->errors()->add('end_date.format', '終了日が開始日より大きい');\n });\n }\n if ($validator->fails()) {\n return redirect(route('push.videos.create'))\n ->withErrors($validator)\n ->withInput();\n }\n\n $data = $request->all();\n // dd($data);\n unset($data['_token']);\n unset($data['thumbnail']);\n unset($data['thumbnail_detail']);\n unset($data['video_create']);\n unset($data['banner']);\n unset($data['slider']);\n if(@$data['related'][0]) {\n $data['related_videos_1'] = @$data['related'][0];\n }\n if(@$data['related'][1]) {\n $data['related_videos_2'] = @$data['related'][1];\n }\n if(@$data['related'][2]) {\n $data['related_videos_3'] = @$data['related'][2];\n }\n // $data['type'] = 1;\n unset($data['related']);\n // dd($data);\n $rs = Video::insertGetId($data);\n // $catehhs = ChannelCategory::where('channel_id',$request->channel_id)->get();\n // $client = new SocketIO('visoftech.com', 9001);\n // $client->setQueryParams([\n // 'token' => 'edihsudshuz',\n // 'id' => '8780',\n // 'cid' => '344',\n // 'cmp' => 2339\n // ]);\n // foreach ($catehhs as $key => $value) {\n // $association[] = $value->category_id;\n // }\n // $data[\"statusCode\"] = 0;\n // $data[\"message\"] = \"\"; \n // $data[\"data\"] = [\n // 'type' => 0,\n // 'association' => $association,\n // ];\n // $rsu = json_encode($data);\n // $success = $client->emit('notify', $rsu);\n if($rs) {\n if($request->thumbnail){\n $path = '/storage/app/'.@$request->file('thumbnail')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->thumbnail = $path;\n $vd->save();\n }\n if($request->thumbnail_detail){\n $path = '/storage/app/'.@$request->file('thumbnail_detail')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->thumbnail_detail = $path;\n $vd->save();\n }\n if($request->banner){\n $path = '/storage/app/'.@$request->file('banner')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->banner = $path;\n $vd->save();\n }\n if($request->video_create){\n $partvd = $request->video_create->path();\n // dd($partvd);\n $folder = md5(date('Y-m-d H:i:s:u'));\n $store_p = 'TVpro/videos/'.$folder.'/';\n\n $path_up = '/storage/app/'.@$request->file('video_create')->store($store_p);\n $path = '/storage/app/TVpro/videos/'.$folder.'/playlist.m3u8';\n $video = str_replace('/storage/app/TVpro/videos/'.$folder.'/', '' , $path_up);\n $video = str_replace('/', '' , $video);\n $video = str_replace($folder, '' , $video);\n // \n $cd = '/var/www/html/storage/app/'.$store_p;\n chmod($cd, 0777);\n\n $command = 'cd '.$cd.' ; /usr/local/bin/bin/ffmpeg -y -i '.$video.' -r 25 -g 25 -c:a libfdk_aac -b:a 128k -c:v libx264 -preset veryfast -b:v 1600k -maxrate 1600k -bufsize 800k -s 640x360 -c:a libfdk_aac -vbsf h264_mp4toannexb -flags -global_header -f ssegment -segment_list playlist.m3u8 -segment_list_flags +live-cache -segment_time 5 output-%04d.ts; sudo chmod -R 777 '.$cd.'; rm '.$cd.$video;\n exec($command.\" 2>&1\", $output);\n\n $vd = Video::find($rs);\n $vd->video = $path;\n $vd->save();\n\n }\n if($request->pdf){\n $path = '/storage/app/'.@$request->file('pdf')->store('TVpro/pdf');\n $vd = Video::find($rs);\n $vd->pdf = $path;\n $vd->save();\n }\n if($request->slider){\n foreach (@$request->slider as $key => $image) {\n $image = '/storage/app/'.$image->store('TVpro/images');\n Slider::insert([\n 'video_id'=>$rs,\n 'image'=>$image\n ]);\n }\n }\n $nofis = Video::find($rs);\n $hiephoi = ChannelCategory::where('channel_id', $nofis->channel_id)->pluck('category_id');\n // foreach ($hiephoi as $keyhh => $valuehh) {\n // # code...\n // }\n $title = 'マイチャンネルに新たなコンテンツが追加されました。';\n $body = $nofis->title;\n $push_data = [\n 'title' => $title,\n 'body' => $body,\n 'type' => 2,\n 'association_id' => $hiephoi,\n 'video_id' => $nofis->id,\n 'content_type' => $nofis->type,\n 'thumbnail_detail' => $nofis->thumbnail_detail\n ];\n\n $users = User::with(['devices'])\n ->whereHas('mypage_channel', function($qr)use($data){\n $qr->where('channel_id', $data['channel_id']);\n })\n ->has('devices')\n ->get();\n\n if(count($users)) {\n foreach ($users as $key => $value) {\n if($value->content) {\n $content_p = json_decode($value->content);\n }else{\n $content_p = [];\n }\n if (array_search($nofis->id, $content_p) == false && array_search($nofis->id, $content_p) !== 0) {\n $content_p[] = $nofis->id;\n }\n \n $datacontent = ['content'=>json_encode(array_merge($content_p))];\n User::where('id', $value->id)->update($datacontent);\n\n foreach ($value->devices as $keyd => $valued) {\n foreach ($hiephoi as $keyhh => $valuehh) {\n $push_data['association_id'] = $valuehh;\n notification_push($valued->token, $title, $push_data, $body);\n }\n \n }\n }\n }\n\n return redirect(route('push.videos.index'));\n }else{\n return back();\n }\n }", "public function create()\n {\n // If request is a post\n if ($this->request->is('post')) {\n // Make a new Entity\n $cvs = $this->Cvs->newEntity();\n // get extention from video\n $ext = substr(strtolower(strrchr($this->request->data['video']['name'], '.')), 1);\n $arr_ext = array(\"mp3\", \"mp4\", \"wma\");\n // set a random new video name\n $setNewFileName = time() . \"_\" . rand(000000, 999999);\n\n // if ext uploaded is in allowed arr_ext\n if (in_array($ext, $arr_ext)) {\n // place video in videos map\n move_uploaded_file(($this->request->data['video']['tmp_name']), WWW_ROOT . '/videos/' . $setNewFileName . '.' . $ext);\n // set the new filename in public $video\n $this->video = $setNewFileName . '.' . $ext;\n }\n else {\n $this->Flash->set('Alleen MP4 bestanden zijn toegestaan!', ['key' => 'cv-error', 'params' => ['class' => 'alert alert-success']]);\n }\n\n $cvs = $this->Cvs->patchEntity($cvs, $this->request->data);\n // set user_id to user_id where u logged in with\n $cvs->user_id = $this->Auth->user('id');\n // set video path to the path in $video\n $cvs->video = $this->video;\n\n // if able to save, save the entity in database\n if ($this->Cvs->save($cvs)) {\n $this->Flash->set('De CV is succesvol opgeslagen!', ['key' => 'cv-success', 'params' => ['class' => 'alert alert-success']]);\n return $this->redirect(['action' => 'index']);\n }\n else {\n $this->Flash->set('Er ging iets mis! Controleer of alle velden correct ingevuld zijn.', ['key' => 'cv-error', 'params' => ['class' => 'alert alert-danger']]);\n }\n }\n\n // if user is company, redirect\n if ($this->Auth->user('account_type') === 1) {\n return $this->redirect(['controller' => 'Dashboard', 'action' => 'index']);\n }\n\n // get all the categories and set them in $categories\n $categories = $this->Cvs->Categories->find('list', ['keyField' => 'id', 'valueField' => 'category']);\n\n // set all objects\n $this->set(compact('cvs', 'categories', 'competences'));\n }", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function store(CreateVideoAPIRequest $request)\n {\n $input = $request->all();\n\n $video = $this->videoRepository->create($input);\n\n return $this->sendResponse($video->toArray(), 'Video saved successfully');\n }", "public function run()\n {\n Video::create([\n 'id'=>1,\n 'titulo'=>'Pasaje, Cantón de tesoros escondidos',\n 'descripcion'=>'¿Nunca has sentido que te falta algo?. Todos llegamos a ese punto en el que necesitamos algo que nos haga conectar con una parte nueva de nosotros, que aún no conocíamos. Y Pasaje, es el lugar para encontrarlo.',\n 'url'=>'https://www.youtube.com/watch?v=unCVTkXNYUU&t',\n \n\n ]);\n\n \n }", "public function createVideoRequest($body = null)\n {\n $resourcePath = '/video';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // For model (json/xml)\n if (isset($body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($body));\n } else {\n $httpBody = $body;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem,\n ];\n }\n }\n\n // For HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // For HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($queryParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (! empty($this->config->getAccessToken())) {\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 = ObjectSerializer::buildQuery($queryParams);\n\n return new Request(\n 'POST',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function store(Request $request)\n {\n //\n $request->validate([\n 'title' => 'required'\n ]);\n\n $video = new Video();\n $video->title = $request->get('title');\n \n /*\n $file = $request->file('video');\n $name = $file->getClientOriginalName();\n while( file_exists(\"uploaded_videos/\".$name) )\n {\n $name = $name.str_random(6);\n }\n $file->move('uploaded_videos', $name);\n\n $video->path = $name;\n */\n $path = Storage::disk('public')->put(self::VIDEO, $request->file('video'));\n $video->path = $path;\n\n $video->save();\n\n return redirect()->route('list');\n }", "public function saveVideo(Request $request) {\n $remote_connection = $this->remote_connection;\n\n $session = $request->input('session');\n $room_type = $request->input('room_type');\n $room_name = $request->input('room_name');\n $stream = $request->input('stream');\n $rec_dir = $request->input('rec_dir');\n\n $video_extension = '.webm';\n $audio_extension = '.ogg';\n\n $video_url = $rec_dir . '/' . $session . '-' . $stream . '-final' . $video_extension;\n $audio_url = $rec_dir . '/' . $session . '-' . $stream . $audio_extension;\n\n $video_room = VideoRoom::where('session_id', $session)->first();\n\n $video_id = $video_room->id;\n\n $video_details = json_encode(array('video_id' => $video_id, 'video' => $video_url, 'audio' => $audio_url), JSON_FORCE_OBJECT);\n\n //For Main video\n //$convert_to_webm_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/' . $session . '-' . $stream . '-video.mjr /var/www/html/recordings/' . $session . '-' . $stream . '-video.webm';\n //$convert_to_ogg_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/' . $session . '-' . $stream . '-audio.mjr /var/www/html/recordings/' . $session . '-' . $stream . '-audio.ogg';\n //$merge_webm_and_ogg_command = 'ffmpeg -i /var/www/html/recordings/' . $stream . '.webm -i /var/www/html/recordings/' . $stream . '.ogg -c:v copy -c:a libvorbis -strict experimental /var/www/html/recordings/' . $stream . '-final.webm';\n //$merge_webm_and_ogg_command = 'ffmpeg -i /var/www/html/recordings/' . $session . '-' . $stream . '-video.webm -i /var/www/html/recordings/' . $session . '-' . $stream . '-audio.ogg -c:v copy -shortest /var/www/html/recordings/' . $session . '-' . $stream . '-final.webm';\n\n //For Screenshare video\n //$convert_screenshare_to_webm_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/screenshare-'. $session .'-'. $stream .'-video.mjr /var/www/html/recordings/screenshare-'. $session . '-' . $stream . '-video.webm';\n //Execute main video scripts\n //$remote_connection->exec($convert_to_webm_command . ';' . $convert_to_ogg_command . ';' . $merge_webm_and_ogg_command);\n //$remote_connection->exec($merge_webm_and_ogg_command);\n //Execute main video scripts\n //$remote_connection->exec($convert_screenshare_to_webm_command);\n //$check_if_screenshare_exists = '[ -f /var/www/html/recordings/' . $session . '-screenshare-' . $stream . '-video.mjr ] && echo \"File exists\" || echo \"File doesn not exist\"';\n //$file_exists = $remote_connection->exec($check_if_screenshare_exists);\n //if ($file_exists === 'File exists') {\n //}\n\n return $video_details;\n }", "public function create()\n {\n return view('Admin.Videos.add');\n }", "public function store(Request $request)\n {\n $thumbnail = 'http://img.youtube.com/vi/' . $request->thumbnail . '/mqdefault.jpg';\n //dd($thumbnail);\n $datas = new Video();\n $datas->video_title = $request->title;\n $datas->user_id = Auth::user()->id;\n $datas->id_category = $request->category;\n $datas->video_url = $request->urlnew;\n $datas->content = $request->area;\n $datas->key = $request->thumbnail;\n $datas->thumbnail = $thumbnail;\n\n $datas->save();\n\n return redirect()->route('video.index')->withErrors(['success' => 'Success create Video']);\n\n }", "public function create()\n {\n return view('admin.datavideo.create');\n }", "function add_videos_meta_box() {\n \tadd_meta_box(\n \t\t'y_link', // $id\n \t\t'ID Video', // $title\n \t\t'display_video_fields_meta_box', // $callback\n \t\t'videos', // $screen\n \t\t'normal', // $context\n \t\t'high' // $priority\n \t);\n }", "public function setVideoOther($attributes = []);", "public function store(VideoFormRequest $request)\n {\n $dataForm = $request->all();\n\n if(valid_file($request))\n {\n $upload = upload_file($request, 'videos');\n\n if($upload){\n $dataForm['file'] = $upload;\n }\n }\n\n $video = $this->video->create($dataForm)->id;\n\n if(!$video) return redirect('/admin/videos')->with('fail', 'Falha ao salvar o vídeo!');\n\n return redirect('/admin/videos')->with('success', 'Vídeo criado com sucesso!');\n }" ]
[ "0.7003941", "0.6797731", "0.67373866", "0.66958344", "0.6591785", "0.6539878", "0.65351987", "0.6465075", "0.6430036", "0.624857", "0.6234362", "0.62240374", "0.6220478", "0.62021315", "0.6183848", "0.61804575", "0.61738443", "0.61617935", "0.61135674", "0.61085194", "0.6107767", "0.60669726", "0.6006178", "0.6000173", "0.59927493", "0.5989945", "0.59891874", "0.5986664", "0.5970133", "0.5965288", "0.5963146", "0.5961934", "0.5951104", "0.5946657", "0.5932575", "0.592956", "0.5927762", "0.5923981", "0.5911185", "0.59018546", "0.58937865", "0.5890117", "0.58826876", "0.5853728", "0.5852465", "0.58503675", "0.58491474", "0.5834188", "0.58027005", "0.5790096", "0.57880074", "0.5769073", "0.5766739", "0.57661635", "0.57649153", "0.57649153", "0.5754576", "0.5750461", "0.5743922", "0.5735709", "0.572999", "0.57194257", "0.5711201", "0.5709701", "0.5708658", "0.57048136", "0.57020485", "0.57004213", "0.56897086", "0.56869596", "0.5679943", "0.5667086", "0.56611043", "0.56557167", "0.5654635", "0.56393063", "0.56252855", "0.56161445", "0.5609198", "0.560537", "0.5604683", "0.56000125", "0.5598471", "0.55886835", "0.5585133", "0.5583844", "0.55816007", "0.5578942", "0.55785704", "0.5567481", "0.5566616", "0.55608207", "0.5557826", "0.55518204", "0.55518097", "0.55365", "0.5520034", "0.5513269", "0.5507459", "0.55053854" ]
0.77207166
0
get list of user todos
public function getUserTodosAction() { $todo = new Workapp_Todo(); $this->_helper->json($todo->getTodoList(array('user_id' => $this->getDeviceSession()->getUserId()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listUserTodos() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\t\t// only show todos if user has access\n\t\tif($page->validatePath(\"/janitor/admin/todo\")) {\n\t\t\t\n\t\t\t$IC = new Items();\n\t\t\t$model = $IC->typeObject(\"todo\");\n\t\t\t$todos = $IC->getItems(array(\"itemtype\" => \"todo\", \"where\" => \"todo.priority = 20\", \"user_id\" => session()->value(\"user_id\"), \"extend\" => array(\"tags\" => true)));\n\n\t\t\t$_ .= '<div class=\"todos\">';\n\t\t\t$_ .= '<h2>TODOs</h2>';\n\n\t\t\tif($todos) {\n\t\t\t\t$_ .= '<ul class=\"todos\">';\n\t\t\t\tforeach($todos as $todo) {\n\t\t\t\t\t$_ .= '<li class=\"todo todo_id:'.$todo[\"id\"].'\">';\n\t\t\t\t\t\t$_ .= '<h3>'.stringOr($HTML->link($todo[\"name\"], \"/janitor/admin/todo/edit/\".$todo[\"id\"], array(\"target\" => \"_blank\")), $todo[\"name\"]).'</h3>';\n\t\t\t\t\t\t$_ .= $this->tagList($todo[\"tags\"]);\n\t\t\t\t\t$_ .= '</li>';\n\t\t\t\t}\n\t\t\t\t$_ .= '</ul>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ .= '<p>No TODOs</p>';\n\t\t\t}\n\n\t\t\t$_ .= '</div>';\n\t\t}\n\n\t\treturn $_;\n\t}", "public function getUserTodos()\n {\n return $this->userTodos;\n }", "public function index()\n {\n return auth()->user()->todos()->orderBy('priority', 'DESC')->get();\n }", "function listTodos() {\n $results = array();\n $results['todos'] = Todo::getListForUser( User::getLoggedInUser() );\n require( TEMPLATE_PATH . \"/listTodos.php\" );\n}", "public function listarTodos_get(){\n $data = $this->Aluno->getAlunos();\n $this->response($data, REST_Controller::HTTP_OK);\n \n }", "public function get_todos_autores()\n {\n return $this->userRepo->get_todos_autores();\n }", "public function todos(Request $request) {\n\t\t// Get user session\n\t\t$user = Session::get('user');\n\n\t\t// Get the active to-do lists of the user\n\t\t$todos = Todo::where('creator_id', $user->id)->orderBy('updated_at', 'desc')->get();\n\n\t\t// Get the archived to-do lists of the user\n\t\t$archives = Todo::withTrashed()->whereNotNull('deleted_at')->where('creator_id', $user->id)->orderBy('updated_at', 'desc')->get();\n\n\t\treturn View::make('todos')->with(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'page' => 'Todos',\n\t\t\t\t\t\t\t\t\t\t\t\t'todos' => $todos,\n\t\t\t\t\t\t\t\t\t\t\t\t'archives' => $archives\n\t\t\t\t\t\t\t\t\t\t\t));\n\t}", "public function getList($user);", "public function index()\n {\n $todos = Todo::orderBy('created_at')->get();\n\n return $todos;\n }", "public function getTodoData(){\n $id = Auth::user()->id;\n\n return TodoList::latest('updated_at')->where('cid', $id)->get();\n }", "public function index()\n {\n $user = \\Auth::user();\n $todos = Todo::where('user_id', $user->id)->orderBy('created_at', 'DESC')->get();\n\n return new TodosResource($todos);\n }", "function Todos(){\n\t\t\t\treturn $this->todos;\n\t\t\t}", "public function index()\n {\n $user = auth('api')->user('id');\n // Get todos\n $todos = $user->todos;\n // return collection of todos as a resource\n return TodoResource::collection($todos);\n }", "public function todos($id = null)\n {\n $indexing = $this->indexing->findOrFail($id);\n $todos = new TodosResource($indexing->todos()->with(['agent:id,username,name'])->orderBy('id', 'desc')->paginate(50));\n return response($todos, Response::HTTP_OK);\n }", "public function actionAddTodoList()\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$items = array();\n\t\t$userObj = new Users();\n\t\t$items = $userObj->getAllUsers();\n\t\t\n\t\t$result = array();\n\t\t$this->renderPartial('addTodoList', array('data'=>$items));\n\t}", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n var_dump($this->getUser());\n //die();\n if ((false === $this->get('security.context')->isGranted('ROLE_ADMIN'))) {\n //filter about user\n //var_dump($this->getUser()->getId());\n $entities = $em->getRepository('ToDoToDoBundle:Todoitems')->findByUserId($this->getUser()->getId());\n }\n else\n {\n $entities = $em->getRepository('ToDoToDoBundle:Todoitems')->findAll();\n }\n return $this->render('ToDoToDoBundle:Todoitems:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function todos()\n\t{\n\t\t$todosTodo = Auth::user()->todos()->where('done', 0)->latest()->get();\n\n\t\t$todosDone = Auth::user()->todos()->where('done', 1)->latest()->get();\n\n\t\treturn view('pages.todos', compact('todosTodo', 'todosDone'));\n\t}", "public function index(Request $request)\n {\n $user_id = $request->user()->id;\n\n $todos = $this->repository->where('user_id', $user_id)->get();\n\n// $todos = Todo::where('user_id', $user_id)->get();\n return response()->json(['message' => \"Retrieved successfully\", 'todos' => $todos]);\n }", "public function listarTodos(){\n\t\t\n\t\t$sql = 'SELECT * FROM itempedido';\n\t\t$consulta = $this->conn->prepare($sql);\n\t\t$consulta->execute();\n\t\treturn ($consulta->fetchAll(PDO::FETCH_ASSOC));\n\t}", "public function getTodoList($options)\r\n {\r\n $todos = new Object_Todo_List();\r\n $tods = array();\r\n if (isset($options['user_id'])) {\r\n $todos->setCondition('Creator__id = ?', array($options['user_id']));\r\n }\r\n\r\n foreach ($todos as $todo) {\r\n $tods[] = $todo;\r\n }\r\n\r\n return $tods;\r\n }", "public function listarTodos(){\r\n\t\t$sql = 'SELECT * FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$resultado = $consulta->execute();\r\n\t\treturn ($resultado->fetchAll(PDO::FETCH_ASSOC));\r\n\t}", "public function index()\n {\n $user = Auth::user();\n\n $user->load('collaboratingTodos','ownerTodo');\n\n return view('index',compact('user'));\n }", "public function getUsersList()\n {\n }", "function listar_todos(){\n $result = $this->ComplementosModel->listar_todos();\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function index()\n\t{\n\t\treturn Todo::all();\n\t}", "public function index()\n {\n $ts = auth()->user()->todos()->get();\n return view('todo.index', ['todos' => $ts]);\n }", "public function listarTodos(){\r\n\t\tinclude(\"../config/conexao.php\");\r\n\t\t$sql = 'SELECT * FROM cliente';\r\n\t\t$consulta = $pdo->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t\treturn ($consulta->fetchAll(PDO::FETCH_ASSOC));\r\n\t}", "public function index()\n {\n $todos = $this->manager->all($this->auth->user());\n\n $response = $this->response->collection($todos, new TodoTransformer);\n\n return $response;\n }", "public function userList() \n { \n $user = User::get(); \n return response([ 'data' => ToArray::collection($user), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "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 getTodos(){\n\t\t\t$this->db->query(\"SELECT * FROM generos\");\n\t\t\treturn $this->db->fetchAll();\n\t\t}", "public function getUserTodoByIdAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json($todo);\n }", "public function mostrarTodosUsuarios()\n {\n return response()->json(Usuario::all());\n }", "public function index()\n {\n return ToDoListResource::collection(ToDoList::with('toDoItems')->get());\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function index( Request $request ){\n\n $where = [];\n $user = $request->user();\n\n $where[ 'user_id' ] = $user->id;\n\n $hideCompleted = $request->get( 'hideCompleted' );\n\n\n $articles = Todo::where( $where );\n\n if( $hideCompleted !== null ) {\n $articles->where( 'completed', 0 );\n }\n\n// dd( $articles->toSql() );\n return TodoResources::collection( $articles->paginate( $request->get( 'per_page' ) ? : 10 ) );\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function index ()\n {\n return ToDo::all();\n }", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function index()\n {\n $user_id=auth()->user()->id;\n $user= User::find($user_id);\n $todos=$user->todos;\n $todos= $todos->sortByDesc('startTime');\n // $todos->all();\n return view('home')->with('todos',$todos);\n }", "public function lista() { // Aqui define o ação: /users/lista\n $usuarios = new Users(); // Aqui carrega o model: Users\n $dados['usuarios'] = $usuarios->getUsuarios();\t\n if(isset($_GET['id']) && !empty($_GET['id'])) {\t\n $this->loadTemplate('user_contact', $dados);\n }else { $this->loadTemplate('users_list', $dados);\n }\n }", "public function index()\n {\n $tipousuarios = TipoUsuario::all();\n return $tipousuarios;\n }", "public function listAction()\n {\n $user = $this->get('security.context')->getToken()->getUser();\n $em = $this->getDoctrine()->getManager();\n\n $tasks = $em->getRepository('STMSBundle:Task')->findBy(array('user' => $user));\n\n $normalizer = new GetSetMethodNormalizer();\n $normalizer->setIgnoredAttributes(array('user'));\n $normalizer->setCallbacks(array('date' => function ($dateTime) {\n return $dateTime->format(\"Y-m-d\");\n }));\n\n $serializer = new Serializer(array($normalizer), array(new JsonEncoder()));\n\n $json = $serializer->serialize($tasks, 'json');\n\n $response = new Response($json);\n $response->headers->set('Content-Type', 'application/json');\n\n return $response;\n }", "public function index()\n {\n $users = $this->repository->all($columns = ['*']);\n return $this->success($users, trans('messages.users.getListSuccess'));\n }", "public function admin_users_list(){\n \n //$tasks = Task::find(2)->Task()->User()->get();\n //$users = $tasks->user;\n $users = User::get();\n //dd($users);\n //$tasks = Task::with('user')->get();\n //echo $tasks->user()->username;\n //dd($tasks);\n return view('admin.users', array(\n 'users' => $users\n ));\n //['tasks' => Task::with('user')->get()]);\n }", "public static function TraerTodos():array;", "function getUsers(){\n }", "function getUsers(){\n }", "public function admin_tasks_list(){\n \n //$tasks = Task::find(2)->Task()->User()->get();\n //$users = $tasks->user;\n $tasks = Task::with('user')->get();\n $users = User::get();\n //dd($users);\n //$tasks = Task::with('user')->get();\n //echo $tasks->user()->username;\n //dd($tasks);\n return view('admin.task', array(\n 'tasks' => $tasks,\n 'users' => $users\n ));\n //['tasks' => Task::with('user')->get()]);\n }", "public function todos(){\n $salon = salon::select(\"id\",\"nombre\",\"precio\")->where(\"estado\",\"=\",\"activo\")->get();\n return ['data' => $salon];\n }", "public function index()\n {\n $archived = !! Input::get('archived');\n $lists = Todo::allLists($archived);\n\n $return = array(\n 'lists' => array(),\n );\n\n foreach ($lists as $listId)\n {\n $list = Todo::get($listId, $archived);\n $return['lists'][] = array(\n 'name' => $listId,\n 'title' => $list->title(),\n 'subtitle' => $list->get('subtitle'),\n 'isArchived' => $list->isArchived(),\n 'numNextActions' => $list->taskCount('next'),\n 'numNormal' => $list->taskCount('todo'),\n 'numCompleted' => $list->taskCount('done'),\n );\n }\n return Response::json($return);\n }", "public function index()\n {\n return $this->user->all();\n }", "public function index()\n {\n $this->user_list();\n }", "public function index()\n {\n //qui ritorno l'elenco delle liste\n //return TodoList::paginate(20);\n $lists = TodoList::paginate(20);\n return $this->getResult($lists->toArray());\n }", "public function getUserList(){\n\t\t$this->load->database();\n\t\t$eventlist = $this->db->query(\"SELECT * FROM user \");\n\t\treturn $eventlist;\n\t}", "public function index($id)\n {\n $todos = User::with('todos')->find($id);\n return $todos; //Esto retorna Json\n\n //with('metodo_relacion')\n\n //->todos retorna la data\n //->todos() retorna la relacion (para guardar y borrar etc)\n //return view('todos.index', compact('todos')); Esto manda a renderizar a la vista.\n\n //compact crea un arreglo asociativo: 'todos' => $todos; etc.\n //Para pasar las variables del controlador a la vista.\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "public function listarUsuarios()\n {\n $usuarios = Usuarios::all();\n\n return $usuarios;\n }", "public function userLists()\n {\n\n try {\n if (isset($_REQUEST['AuthToken'])) {\n $AuthToken = $_REQUEST['AuthToken'];\n } else {\n $AuthToken = '';\n }\n if (!Master::check_master_token($AuthToken)) {\n return response([\n 'message' => \"Token Expired\",\n 'status' => 'TokenExpired'\n ], 400);\n }\n\n $offset = ($_GET['page'] - 1) * $_GET['per_page'];\n $sort_field = (isset($_GET['sort_field'])) ? $_GET['sort_field'] : \"id\";\n $sort_order = (isset($_GET['sort_order'])) ? $_GET['sort_order'] : \"desc\";\n\n $data = array();\n $data_count = 0;\n\n if (Schema::hasTable('admin_users')) {\n $sql = DB::table('admin_users');\n //search conditions\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $sql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data = $sql->offset($offset)->limit($_GET['per_page'])->orderBy($sort_field, $sort_order)->get();\n\n //count of total tasks\n $csql = DB::table('admin_users');\n //search conditions for count\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $csql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data_count = $csql->count();\n }\n\n //response\n return response([\n 'message' => \"\",\n 'pgData' => $data,\n 'totalRows' => $data_count,\n ], 200);\n } catch (Exception $e) {\n return response([\n 'message' => $e->getMessage()\n ], 400);\n }\n }", "public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}", "public function index(Request $request)\n {\n $user = $request->user();\n return $user->tasks;\n }", "public function index()\n {\n $user = User::all();\n return $this->sendResponse($user, 'Lista de usuarios', 200);\n }", "public function userList($id)\n {\n return app(UserList::class)($id);\n }", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "public function listarUsuariosAction(){\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usuario = $em->getRepository('TheClickCmsAdminBundle:Usuarios')->findAll();\n\t\treturn $this->render('TheClickCmsAdminBundle:Default:listarUsuarios.html.twig', array('usuario' => $usuario));\n\t}", "public function index()\n {\n // get all\n $users = Utilisateur::all();\n return $users;\n }", "public function listofUser()\n {\n return view('Admin.ShowallUser');\n }", "public function index()\n {\n $this->userlist();\n }", "public function listar(){\n $user = \\Auth::user();\n $usuario = \\Auth::user()->rol;\n DB::select('call logs(\"'.$user->name.'\", \"Listar\", \"'.$usuario.'\")');\n if($user->rol != \"Administrador\"){\n $users = User::where('activo', '1')->paginate(5);\n }else if($user->rol == \"Administrador\"){\n $users = User::paginate(5);\n }\n return view('user.listar', [\n 'users' => $users\n ]);\n }", "public function listausuarios(){\n $user = Usuario::with('rol')->paginate(15);\n $lista_usuarios = compact('user'); \n\n return $this->sendResponse($lista_usuarios, 'Listado de usuarios devueltos con éxito');\n\n }", "public function seleccionarTodos();", "public function index()\n {\n $usuarios = dev_Usuario::get();\n return $usuarios;\n }", "public function index()\n {\n $result = $this->todoService->all();\n $activeTodo = [];\n\n if (isset($result['status']) && $result['stutus'] == 404) {\n return response()->json($result, 404);\n }\n\n foreach ($result as $value) {\n if (!isset($value['archived_at']) || $value['archived_at'] === null) {\n array_push($activeTodo, $value);\n }\n }\n\n return response()->json(['status' => 'success', 'type' => 'Todo Collection', 'data' => $activeTodo], 200);\n }", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "public function listUsers()\n {\n $users = $this->apiHeaderNav();\n return view('user.userListAll',['data'=>$users]);\n }", "public function getList() {\n\t\t$this->request = array('uri' => array('path' => 'users.json'));\n\n\t\treturn $this->find('all');\n\t}", "public function reponseUserList()\n {\n //Inseri LOGs com faker names na base de dados\n $faker = Faker::create();\n Logs::create([\n \"logname\" => $faker->name()\n ]);\n\n //Retorna JSON com todos os registros dos Alunos\n return response()\n ->json(Alunos::all());\n }", "public function todos()\n {\n //$pres=Prescription::all();\n $pres= Prescription::where('medico_id', Auth::user()->id)->get();\n return view('Prescriptions.todos',[\"prescripciones\"=>$pres]);\n }", "public function index()\n {\n $todoList = Todo::all();\n return compact('todoList');\n }", "public function index()\n {\n return $this->users->getAll('first_name', 'asc', ['departments', 'sectors', 'meta']);\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public function getItems() {\n\t\treturn User::all();\n\t}", "public function findTodosLosUsuarios()\n {\n $em = $this->getEntityManager();\n \n $consulta = $em->createQuery('SELECT u FROM UsuarioBundle:Usuario u');\n \n return $consulta->getResult();\n }", "public function index()\n {\n $todos = Todo::query()->latest('id')->get();\n\n return TodoResource::collection($todos);\n }", "public function index()\n {\n $tiposUsuarios = TipoUsuario::all();\n\n return $this->showAll($tiposUsuarios);\n }", "public function encontrarTodos() {\n return $this->getEntityManager()->getRepository($this->getEntity())->findAll();\n }", "public function user_lists(){\n return get_instance()->ecl('Instance')->mod('lists', 'user_lists', [get_instance()->ecl('Instance')->user(),'email']);\n }", "function list_user()\n {\n return DB::table(\"users\")->get(); \n }", "function listUsers() {\n return $this->users;\n }", "public function index()\n {\n //\n $users = User::all();\n\n return $users;\n }", "public function users_list()\n \t{\t\n \t\t$all_users_details = User::where(['deleted' => '0'])->orderBy('id','DESC')->get();\n // print_r($all_users_details);die;\n \t\treturn view('Admin.Users.users_list',compact('all_users_details'));\n \t}", "public function index()\n {\n $users = User::all();\n }", "public function users_list() {\n return response()->json(User::latest()->get());\n }" ]
[ "0.8056402", "0.7914587", "0.7273658", "0.7210066", "0.712779", "0.70923865", "0.7048307", "0.68337005", "0.6778222", "0.6766845", "0.6732916", "0.67270947", "0.67027307", "0.66668785", "0.66663194", "0.6661228", "0.6632829", "0.6624996", "0.66184264", "0.6602267", "0.65583026", "0.65569097", "0.65129673", "0.65088415", "0.6494012", "0.64911115", "0.64762324", "0.64751095", "0.646716", "0.64492005", "0.64374214", "0.63988465", "0.63448966", "0.63252616", "0.6321953", "0.6305104", "0.6304718", "0.62990355", "0.62929463", "0.6289339", "0.6289339", "0.6289339", "0.62883073", "0.62862074", "0.6260786", "0.62577057", "0.6247257", "0.6246328", "0.62331843", "0.62214637", "0.6216846", "0.61991733", "0.61991733", "0.6198633", "0.61983943", "0.6195896", "0.61932105", "0.61848456", "0.61847943", "0.6183813", "0.61747974", "0.6173241", "0.617316", "0.61698806", "0.6157259", "0.61461407", "0.6145974", "0.61389834", "0.61263174", "0.61261415", "0.6117859", "0.6116866", "0.6114303", "0.6112707", "0.61107737", "0.61099315", "0.61078244", "0.61027473", "0.60989034", "0.60975116", "0.60958445", "0.6094627", "0.60858697", "0.6085517", "0.60786974", "0.60764265", "0.6074554", "0.6073788", "0.6071951", "0.6071111", "0.6070888", "0.6070402", "0.60645324", "0.6064128", "0.6058028", "0.6057938", "0.60537934", "0.6046288", "0.60389996", "0.603839" ]
0.7988103
1
returns user tod by todo_id todo_id mandatory field
public function getUserTodoByIdAction() { /** @var Object_Todo $todo */ $data = $this->getRequestData(); if (isset($data['todo_id'])) { $todo = Object_Todo::getById($data['todo_id']); if (!$todo) { $this->setErrorResponse('no Todo with this todo_id!'); } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) { $this->setErrorResponse('no Todo for this user with current todo_id!'); } } else { $this->setErrorResponse('todo_id is mandatory field for this request!'); } $this->_helper->json($todo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function todoAffectedTo()\n {\n return $this->belongsTo('App\\User', 'affectedTo_id');\n }", "public function getTodo_id()\n {\n return $this->todo_id;\n }", "public function getTodoId(): Uuid {\n\t\treturn $this->todoId;\n\t}", "function Todo() {\n\t\t$query_string = Request::$GET;\n\t\t$global_string = $this->buildQuery($query_string);\n\n\t\t// we only want to do this is we have a valid, single user. \n\t\t$show_ical = FALSE;\n\n\t\t//Display User select tool if user has admin permissions\n\t\t$globalUser = '';\n\t\tif ($this->User->HasModuleItemAccess('administration', CU_ACCESS_ALL, CU_ACCESS_READ)) {\n\n\t\t\t// $actualUserID = $this->User->ID;\n\t\t\t// try to get a imitation user form the request string.\n\t\t\t$userID = Request::get('userID', Request::R_INT);\n\n\t\t\t// userID can be 'all'\n\t\t\tif (($userID == null) && (Request::get('userID') == 'all'))\n\t\t\t{\n\t\t\t\t$userID = 'all';\n\t\t\t}\n\n\t\t\t// else, check if we have a imitation user in the session object.\n\t\t\tif (!$userID) {\n\t\t\t $userID = $this->Session->Get('springboardID');\n\t\t\t}\n\t\t\t\n\t\t\t// Create Temp user for creating correct permissions\n\t\t\tif ($userID) {\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\n\t\t\t\tif ($userID == 'all')\n\t\t\t\t{\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->ID = null;\n\t\t\t\t} else {\n\t\t\t\t\t$show_ical = TRUE;\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->Initialise($userID, $this->DB);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->TempUser->ID = $this->User->ID;\n\t\t\t\t$userID = $this->User->ID;\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t}\n\t\t\t\n\t\t\t$globalUser = '<label>' . MSG_USER_TO_SHOW . '</label>'\n\t\t\t\t\t\t.'<select name=\"UserID\" class=\"TaskUpdate_dd\" id=\"userToShowFilter\">';\n\n\t\t\t$SQL = sprintf(SQL_GET_USER_LIST);\n\t\t\t$userList = $this->DB->Query($SQL);\n\t\t\tif ($userList) {\n\t\t\t\t// first add in a \"All users option\"\n\t\t\t\t$globalUser .= '<option value=\"all\"'\n\t\t\t\t. (($this->TempUser->ID == null) ? ' selected' : '') . '>'\n\t\t\t\t. MSG_SHOW_ALL . '</option>';\n\t\t\t \n\t\t\t\tfor ($i = 0; $i < count($userList); $i++) {\n\t\t\t\t\t$globalUser .= '<option value=\"' . $userList[$i]['ID'] . '\"'\n\t\t\t\t\t. ($this->TempUser->ID == $userList[$i]['ID'] ? ' selected' : '') . '>'\n\t\t\t\t\t. $userList[$i]['FirstName'].' '.$userList[$i]['LastName'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$globalUser .= '</select>';\n\t\t\t$tmplDash['globalUser'] = $globalUser;\n\n\t\t} else {\n\t\t\t// don't allow non-admins to edit the user they view for.\n\t\t\t$tmplDash['globalUser'] = '';\n\t\t\t$userID = $this->User->ID;\n\t\t\t$show_ical = TRUE;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t}\n\n\t\t$filter_array = array('mytasks','owed','all');\n\t\t$filter_display = array(MSG_MINE,MSG_OWED,MSG_ALL);\n\t\tfor ($i = 0, $filteroptions = null, $filtercount = count($filter_array); $i < $filtercount; $i++) \n\t\t{\n\t\t\t$filteroptions .= sprintf('<option value=\"%s\" %s>%s</option>', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_array[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($_GET['action'] == $filter_array[$i]) ? ' SELECTED' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_display[$i]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['showfilter'] = '<label>'.MSG_SHOW_THESE_TASKS.'</label>'\n\t\t\t.'<select id=\"showTheseTasksFilter\">'.$filteroptions.'</select>';\n\n\t\t$range_array = array('all' => '{MSG_ALL}', \n\t\t\t\t\t\t\t\t\t\t\t\t'lastweek' => '{MSG_LAST_WEEK}', \n\t\t\t\t\t\t\t\t\t\t\t\t'thisweek' => '{MSG_THIS_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'nextweek' => '{MSG_NEXT_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'today' => '{MSG_TODAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'yesterday' => '{MSG_YESTERDAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'lastmonth' => '{MSG_LAST_MONTH}',\n\t\t\t\t\t\t\t\t\t\t\t\t'thismonth' => '{MSG_THIS_MONTH}', \n\t\t\t\t\t\t\t\t\t\t\t\t'nextmonth' => '{MSG_NEXT_MONTH}'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\tforeach($range_array as $key => $value) \n\t\t{\n\t\t\t$rangeoptions .= sprintf('<option value=\"%s\" %s>%s</option>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$key, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($key == $query_string['show']) ? 'selected' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['period'] = '<label>'.MSG_PERIOD_TO_SHOW.'</label>\n\t\t\t\t\t\t\t <select id=\"periodToShowFilter\">'.$rangeoptions.'</select>';\n\n\t\t$URI = split (\"index\\.php\",Request::server(SCRIPT_NAME_VAR));\n\t\t// Create validity key\n\t\t\n\t\tif ($show_ical == TRUE)\n\t\t{\n\t\t $this->KeyUser =& new User();\n\t\t $this->KeyUser->Initialise($userID, $this->DB);\n\t\t $key = substr(md5($this->KeyUser->Fullname . $this->KeyUser->PasswordHash), 2, 8);\n\t\t $modAction[] = '<a href=\"webcal://' . Request::server(SERVER_NAME_VAR) . $URI[0] . 'system/ical_springboard.php?show=' . $query_string['show'] \n\t\t\t. '&completed=' . $query_string['completed'] \n\t\t\t. '&action=' . $query_string['action'] \n\t\t\t. '&key=' . $key \n\t\t\t. '&userid=' . $userID . '\">'.MSG_SYNC_TO_ICAL.'</a>';\n\t\t}\n\n\t\t$modAction[] = '<a id=\"dash-toggler\" href=\"#\" onclick=\"toggleDash(); return false;\">'.MSG_SHOW_DASH.'</a>';\n\t\t$this->setDash($this->getTemplate(\"dashBlock\", $tmplDash));\n\n\t\t// pick whether to show completed or active\n\t\t$completed = (isset($query_string['completed']) && ($query_string['completed'] == 1));\n\t\tif ($completed)\n\t\t{\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard\">'.MSG_VIEW_ACTIVE.'</a>';\n\t\t} else {\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard&completed=1\">'.MSG_VIEW_COMPLETED.'</a>';\n\t\t}\n\n\t\t$this->CreateTabs('todo');\n\t\t$tmpl['tasklist'] = $this->TaskList($query_string['action'], $userID);\n\n\t\t// Emulate the task view screen.\n\t\tif (Request::get('taskid', Request::R_INT)) {\n\t\t\tResponse::addToJavascript('auto_open_task', TRUE);\n\t\t\tResponse::addToJavascript('item_ids', array(\n\t\t\t\t'project_id' => Request::get('projectid', Request::R_INT),\n\t\t\t\t'task_id' => Request::get('taskid', Request::R_INT),\n\t\t\t\t'comment_id' => Request::get('commentid', Request::R_INT),\n\t\t\t));\n\t\t}\n\n\t\t// this is here to keep template happy.\n\t\t// remove when we are sure that nobody else calls the todo template.\n\t\t$tmpl['script'] = ''; \n\n\t\t$this->setTemplate('todo', $tmpl);\n\n\t\t$this->SetModule(MSG_TODO, $modAction);\n\t\t$this->Render();\n\t}", "public function todoAffectedBy()\n {\n return $this->belongsTo('App\\User', 'affectedBy_id');\n }", "public function users_telem($id,$tipo){\n $sql=\"SELECT * FROM users_phone_numbers WHERE type = $tipo AND user_id=$id\";\n //echo $sql.\"<br>\";\n $resultado=$this->consultar($sql);\n return $resultado;\n }", "public function show($todo)\n {\n return $this->sendSuccessResponseWithData($todo->load(\"user\"));\n }", "public function view(User $user, Todo $todo)\n {\n return !$todo->isPrivate()\n || ($todo->created_by === $user->id);\n }", "public function getIdUserTask()\n {\n return $this->id_user;\n }", "public function owner(User $user, Task $task){\n return $user->id === $task->user_id; //validar que sea el mismo dueño de esa informacion.\n }", "protected function getUserId() {}", "protected function getUserId() {}", "public function getEventOwnerUser($id)\n {\n $user = User::findOrFail($id);\n if(count($user) > 0){\n\n return $user;\n\n }else{\n\n return false;\n }\n\n }", "public function deleteUserTodoAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $todo->getCreator()->getId()) {\n $todo->setPublished(false);\n if (!$todo->save()) {\n $this->setErrorResponse('cannot delete Todo object!');\n }\n } else {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "function getUser($orderId){\r\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commerce_orders','uid = \\''.$orderId.'\\'');\r\n\t $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\t $res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','fe_users','uid = \\''.$row['cust_fe_user'].'\\'');\r\n\t $user = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2);\r\n\t return $user;\r\n\r\n\t}", "public function getUser($id = null);", "function get_user_to_edit($user_id)\n {\n }", "public function getUserId($id=NULL)\n\t{\n\t\t$result = Yii::app()->db->createCommand()\n \t->select('*')\n \t->from($this->tableName())\n \t \t->where('id=:id', array(':id'=>$id))\t\n \t \t->queryRow();\n\t\t\n\t\treturn $result;\n\t}", "public function delete(User $user, Todo $todo)\n {\n return !$todo->isPrivate()\n || ($todo->created_by === $user->id);\n }", "function getUserById($user_id)\n\t{\n\t\t$user_info = false;\n\t\t\n\t\tif (is_numeric($user_id) && $user_id>0) {\n\t\t\t$this->db->where(array( 'id' => $user_id, 'activated' => 1));\n\t\t\t$query = $this->db->get($this->table_name);\n\t\t\t$num_rows = $query->num_rows();\n\t\t\tif ($num_rows == 1) {\n\t\t\t\t$users_info = $query->result();\n\t\t\t\t$user_info = $users_info[0];\n\n\t\t\t} elseif ($num_rows > 2) {\n\t\t\t\t// ---------------------------------------- \n\t\t\t\t// @TODO mandar un correo de aviso.\n\t\t\t\t// ----------------------------------------\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $user_info;\n\t}", "abstract protected function getUserId() ;", "public function get_user_id();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getTodoData(){\n $id = Auth::user()->id;\n\n return TodoList::latest('updated_at')->where('cid', $id)->get();\n }", "public function getUserTodos()\n {\n return $this->userTodos;\n }", "public function getUserByID($id)\n {\n return $this->db->get_where('temp_user', array('id' => $id));\n }", "public function userId($user);", "function get_user_id(){\n return $this->user_id;\n }", "public function TruckerUserDetails($user_id=\"\"){\n\t\t\t$trudets = $this->db->prepare(\"SELECT * FROM users WHERE status = :status AND id =:id \");\n\t\t\t$trudets->execute(array(\"status\"=>1,\"id\"=>$user_id));\n\t\t\t$row = $trudets->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row; \n\t\t}", "public function getUser($id);", "public function getTodo(): Todo\n {\n return $this->todo;\n }", "public function createUserTodoAction()\n {\n $data = $this->getRequestData();\n if (isset($data['todo_type'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/todo/' . $user->getKey() . \"-todo\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-todo\");\n $folder->setParentId(30);\n $folder->save();\n }\n $todo = new Object_Todo();\n $todo->setCreator($user);\n $todo->setTodo_type($data['todo_type']);\n $todo->setText(isset($data['text']) ? $data['text'] : \"\");\n $todo->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . time()));\n $todo->setPublished(true);\n $todo->setParentId($folder->getId());\n if (!$todo->save()) {\n $this->setErrorResponse('cannot save Todo object!');\n }\n } else {\n $this->setErrorResponse('todo_type is mandatory field for this request!');\n }\n\n $this->_helper->json($todo);\n }", "public function edit(ToDo $toDo)\n {\n //\n }", "public function selectUser($item){\r\n $stmt = self::$con->prepare(\"SELECT * FROM users WHERE (id = :item_id || email = :item_id)\");\r\n $stmt->execute(array(\r\n \":item_id\" => $item\r\n ));\r\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\r\n return $results;\r\n }", "public function show(ToDo $toDo)\n {\n //\n }", "public function getId_user(){\n return $this->id_user;\n }", "function getTodo($id)\n {\n $todo = $this->todoRepository->getTodo($id);\n if(!$todo) {\n throw new RecordNotFoundException(\"Todo not found for id \" . $id);\n }\n\n return $todo;\n }", "function listUserTodos() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\t\t// only show todos if user has access\n\t\tif($page->validatePath(\"/janitor/admin/todo\")) {\n\t\t\t\n\t\t\t$IC = new Items();\n\t\t\t$model = $IC->typeObject(\"todo\");\n\t\t\t$todos = $IC->getItems(array(\"itemtype\" => \"todo\", \"where\" => \"todo.priority = 20\", \"user_id\" => session()->value(\"user_id\"), \"extend\" => array(\"tags\" => true)));\n\n\t\t\t$_ .= '<div class=\"todos\">';\n\t\t\t$_ .= '<h2>TODOs</h2>';\n\n\t\t\tif($todos) {\n\t\t\t\t$_ .= '<ul class=\"todos\">';\n\t\t\t\tforeach($todos as $todo) {\n\t\t\t\t\t$_ .= '<li class=\"todo todo_id:'.$todo[\"id\"].'\">';\n\t\t\t\t\t\t$_ .= '<h3>'.stringOr($HTML->link($todo[\"name\"], \"/janitor/admin/todo/edit/\".$todo[\"id\"], array(\"target\" => \"_blank\")), $todo[\"name\"]).'</h3>';\n\t\t\t\t\t\t$_ .= $this->tagList($todo[\"tags\"]);\n\t\t\t\t\t$_ .= '</li>';\n\t\t\t\t}\n\t\t\t\t$_ .= '</ul>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ .= '<p>No TODOs</p>';\n\t\t\t}\n\n\t\t\t$_ .= '</div>';\n\t\t}\n\n\t\treturn $_;\n\t}", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "public function user_to(){\n return $this->belongsTo('App\\User', 'user_to_id');\n }", "public function authorize()\n {\n $todo = $this->user()->todos()->find($this->route('todo'));\n return $todo;\n }", "public function getTel_user()\r\n {\r\n return $this->tel_user;\r\n }", "public function taskOwner()\n {\n return $this->belongsTo('App\\User', 'super_id');\n }", "public function user() {\n // A task belongs to a user\n return $this->belongsTo('User');\n }", "public function __construct(TodoId $todo_id, int $user_id, string $todo)\n {\n $this->todo_id = $todo_id;\n $this->user_id = $user_id;\n $this->todo = $todo;\n }", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "function get_tnc($iduser,$idtnc = NULL){\n if ($iduser != NULL and $idtnc == NULL){\n $this->_db->where(\"IDEmployee\",$iduser); \n }\n else if ($iduser != NULL and $idtnc != NULL){\n $this->_db->where(\"IDEmployee\",$iduser);\n $this->_db->where(\"IDCourse\",$idtnc);\n }\n return $this->_db->get($this->_tbl2);\n }", "public function user($user)\n {\n return $this->users()->where('user_id',$user->id)->first();\n }", "protected function getById($todoId){\n $sql = 'SELECT * FROM todos WHERE id=? ' ;\n $stmt = $this->conn->prepare($sql);\n $stmt->execute([$todoId]);\n\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $results;\n }", "function getUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$query = $this->db->get('usuarios');\n\t\tif($query->num_rows() > 0) return $query;\n\t\telse return NULL;\n\t}", "function get_userid() {\n return $this->userid;\n }", "public function getIduser()\n {\n return $this->iduser;\n }", "public function getUserId()\n {\n }", "public static function findByJTI($id)\n {\n /** @var User $user */\n if (self::tableName() == '{{%user}}'){ // 中台SSO,不需要access_token_expired_at\n $user = static::find()->where([\n '=', 'id', $id\n ])\n ->andWhere([\n '=', 'status', self::STATUS_ACTIVE\n ])->one();\n }else{ // 微信端仍旧需要\n $user = static::find()->where([\n '=', 'id', $id\n ])\n ->andWhere([\n '=', 'status', self::STATUS_ACTIVE\n ])->one();\n// ->andWhere([\n// '>', 'access_token_expired_at', new Expression('NOW()') // 微信端使用,即永不过期,因为不会做判断\n// ])->one();\n }\n\n return $user;\n }", "public function selectViaId($id){\n$sql = \"SELECT id, login, email, password, id_droits FROM utilisateurs WHERE id = :id\";\n$stmt = $this->pdo->prepare($sql);\n$stmt->execute([\n 'id' => $id\n]);\n$userid = $stmt->fetch(PDO::FETCH_ASSOC);\nif(!$userid)\n{\n return false;\n}\n else\n {\n return $userid;\n }\n}", "public function getOneTask()\r\n\t{\r\n\t\ttry {\r\n\t\t\t$sql = \"SELECT id, title, task, status FROM todo_list WHERE id = :task_id\";\r\n\t\t\t$stmt = $this->db->prepare($sql);\r\n\t\t\t$data = [\r\n\t\t\t\t'task_id' => $this->_taskID\r\n\t\t\t];\r\n\t\t\t$stmt->execute($data);\r\n\t\t\t$result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\r\n\t\t\treturn $result;\r\n\t\t} catch (Exception $err) {\r\n\t\t\tdie(\"Oh noes! There's an error in the query! \" . $err);\r\n\t\t}\r\n\t}", "public function get_user_note_by_only_noteID($note_id,$user_id, $validate=true){\n $sql = 'select * from notes AS N';\n $sql .=' JOIN notes_subject AS S';\n $sql .=' ON S.note_id =' .\"'\".self::$database->escape_string($note_id) .\"'\";\n $sql .=' AND N.note_id = S.note_id JOIN notes_tag AS T ON T.note_id = '.\"'\". self::$database->escape_string($note_id) .\"' \";\n // login user can not access notes of other users\n if($validate){\n $sql .='WHERE N.access_type =' . \"'Public' \";\n $sql .='OR N.user_id =' . \"'\".h($user_id).\"'\";\n }\n // echo $sql;\n return static::find_by_sql($sql);\n}", "public function getUserId(): ?string;", "public function autorPedido()\n {\n return $this->belongsTo(User::class, 'user_id'); // FK de esta tabla\n }", "public function getUserTodosAction()\n {\n $todo = new Workapp_Todo();\n $this->_helper->json($todo->getTodoList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "public static function get_user($user_id);", "public static function getTicketOwner($user_id)\n {\n return static::where('id', $user_id)->firstOrFail();\n }", "public function get_todos_autores()\n {\n return $this->userRepo->get_todos_autores();\n }", "public function tampilUser()\n {\n return $this->db->get('tb_user');\n }", "function get_user_details($id)\n {\n $this->db->where('id', $id);\n\n $result = $this->db->get('member');\n\n if($result->num_rows() == 1){\n return $result->row(0);\n } else {\n return false;\n }\n }", "public function getId_user()\n {\n return $this->id_user;\n }", "public function getId_user()\n {\n return $this->id_user;\n }", "public function getId_user()\n {\n return $this->id_user;\n }", "public function getId_user()\n {\n return $this->id_user;\n }", "public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}", "public function getUserId(): string;", "public function getUserforOrder(Order $order){\n \n //return Order::find($id)->user;\n return $order->user()->firstOrFail();\n }", "public function getTo() {\n return $this->user_to;\n }", "public function getUserById($id) {\n\t\t\n\t}", "public function get($id) {\n $user = \\Auth::user();\n $task = Task::find($id);\n $list = Todolist::find($task->list_id);\n\n if ($task != null) {\n if ($user->id != $list->user_id) {\n return response('Unauthorized', 401);\n }\n\n return response()->json([\n 'id' => $task->id,\n 'list_id'=> $task->list_id,\n 'description' => $task->description,\n 'position' => $task->position,\n 'state' => $task->state,\n 'comment' => $task->comment,\n 'color' => $task->color,\n 'created_at' => $task->created_at,\n 'updated_at' => $task->updated_at\n ]);\n } else {\n return response('Not found', 404);\n }\n }", "public function addUser($task_id)\n\t{\n\t\t$result = array();\n\n\t\t$task_id = (int) $task_id;\n\t\t$user_id = (int) Input::get('user_id', 0);\n\t\t$user_role_id = (int) Input::get('user_role_id', 0);\n\t\t$user_payed_hours = Input::get('user_payed_hours', 0);\n\n\t\t$result['status'] = Task::addUserToTask($task_id, $user_id, $user_role_id, $user_payed_hours);\n\n\t\t// Get user info and create an HTML form to edit user relation to project\n\t\t$user = RedmineUser::GetById($user_id);\n\t\t$user->user_role_id = $user_role_id;\n\t\t$user->payed_hours = $user_payed_hours;\n\n\t\t// Get user roles\n\t\t$user_roles = UserRole::allForSelect();\n\n\t\t// Get roles with percents (we will ban them if frontend)\n\t\t$persentable_roles = array();\n\n\t\tforeach (UserRole::all() as $role)\n\t\t{\n\t\t\tif ($role->percents)\n\t\t\t{\n\t\t\t\t$persentable_roles[] = $role->id;\n\t\t\t}\n\t\t}\n\n\t\t$view = View::make('tasks.user_to_project_form')\n\t\t\t->with('user', $user)\n\t\t\t->with('persentable_roles', $persentable_roles)\n\t\t\t->with('user_roles', $user_roles);\n\n\t\t// Set output\n\t\t$result['user'] = $user;\n\t\t$result['view'] = htmlentities($view, ENT_COMPAT, 'UTF-8');\n\n\t\treturn json_encode($result);\n\t}", "public function getUserTasks($id){\n\t\t$sql = \"SELECT $this->tableUserTask.id_task,task.title, task.description,$this->tableUserTask.assignment_date,$this->tableUserTask.completed FROM {$this->tableUserTask} JOIN task ON $this->tableUserTask.id_task = task.id_task JOIN user ON $this->tableUserTask.id_user = user.id_user WHERE user.id_user='{$id}'\";\n\t\t$query = mysqli_query($this->conn,$sql);\n\t\tif($query){\n\t\t\treturn mysqli_fetch_all($query,MYSQLI_ASSOC);\n\t\t}else{\n\t\t\techo \"No tasks assigned\";\n\t\t}\n\t}", "public function getUserByID($id)\n {\n return $this->db->get_where('inm_user', array('id' => $id));\n }", "public function update(User $user, Todo $todo)\n {\n return !$todo->isPrivate()\n || ($todo->created_by === $user->id);\n }", "function getItemById($id)\n {\n $this->db->select('*');\n $this->db->from('tbl_userinfo');\n $this->db->where('userid', $id);\n $query = $this->db->get();\n $result = $query->result();\n if (count($result) == 0) $result[0] = NULL;\n return $result[0];\n }", "public function getCreatedBy();", "public function getCreatedBy();", "public function getCreatedBy();", "public function getCreatedBy();", "public function user($id)\n {\n return $this->where('user_id', $id);\n }", "public function getUserIdWithUsername($id);", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'user_id'])->inverseOf('waitingLists');\n }", "function cicleinscription_get_user_by_id($userid){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('id'=>$userid));\n}", "public function tampilUserTerakhir()\n {\n $this->db->order_by('id_user','DESC');\n return $this->db->get('tb_user',1);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }" ]
[ "0.64641213", "0.61610526", "0.60444146", "0.60310143", "0.6009618", "0.5909782", "0.5900353", "0.58215904", "0.5676802", "0.56255317", "0.55897796", "0.55897796", "0.55533993", "0.55531055", "0.5549822", "0.55489194", "0.55291456", "0.5506294", "0.5485635", "0.548079", "0.5475973", "0.5472008", "0.54619944", "0.54619944", "0.54619944", "0.54619944", "0.54619944", "0.54619944", "0.54619944", "0.54619944", "0.54619944", "0.54549646", "0.5450992", "0.5441392", "0.54393524", "0.54259783", "0.54191685", "0.541415", "0.5396124", "0.5388299", "0.53823", "0.5377578", "0.5376805", "0.5376118", "0.535965", "0.5352124", "0.53379744", "0.53377634", "0.5320976", "0.5312168", "0.531095", "0.53088224", "0.530752", "0.5293914", "0.5289668", "0.52737707", "0.527252", "0.5263546", "0.5258337", "0.52531666", "0.52504134", "0.52442515", "0.523851", "0.5231614", "0.52225137", "0.52153534", "0.5201429", "0.51953685", "0.5184466", "0.5183278", "0.51770324", "0.5176459", "0.517192", "0.51716197", "0.51716197", "0.51716197", "0.51716197", "0.51705694", "0.51646364", "0.5158681", "0.5155586", "0.5149902", "0.51388067", "0.5136644", "0.51334614", "0.513293", "0.51316196", "0.51298475", "0.5128069", "0.5128069", "0.5128069", "0.5128069", "0.51275945", "0.51256317", "0.5125228", "0.5121591", "0.51203024", "0.51169115", "0.51169115", "0.51169115" ]
0.6935469
0
delete user todos by todo_id todo_id mandatory field
public function deleteUserTodoAction() { /** @var Object_Todo $todo */ $data = $this->getRequestData(); if (isset($data['todo_id'])) { $todo = Object_Todo::getById($data['todo_id']); if (!$todo) { $this->setErrorResponse('no Todo with this todo_id!'); } elseif ($this->getDeviceSession()->getUserId() == $todo->getCreator()->getId()) { $todo->setPublished(false); if (!$todo->save()) { $this->setErrorResponse('cannot delete Todo object!'); } } else { $this->setErrorResponse('no Todo for this user with current todo_id!'); } } else { $this->setErrorResponse('todo_id is mandatory field for this request!'); } $this->_helper->json(array('deleted' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function forceDelete(User $user, Todo $todo)\n {\n //\n }", "public function deleteTodo ($id) {\n $user = Auth::user();\n $todo = Todo::where('user_id', $user->id)->where('id', $id)->first();\n if ($todo->exists()) {\n $todo->delete();\n\n return response()->json([\n \"status\" => \"200\",\n \"success\" => \"Todo Deleted Successfully\",\n // \"data\" => Todo::where('user_id', $user->id)->get()\n ], 201);\n } else {\n return response()->json([\n \"status\" => \"404\",\n \"error\" => \"Could Not Found\",\n ], 404);\n }\n }", "public function delete(User $user, Todo $todo)\n {\n return !$todo->isPrivate()\n || ($todo->created_by === $user->id);\n }", "public function delete($user){\n }", "public function delete($usuario_has_hojaruta);", "function deleteTodo() {\n\n $results = array();\n $results['errorReturnAction'] = \"listTodos\";\n $results['errorMessage'] = \"To-do not found. Please try again.\";\n\n if ( isset( $_POST['confirm'] ) ) {\n\n // User has confirmed deletion: delete the to-do\n if ( !checkAuthToken() ) return;\n\n if ( $todo = Todo::getById( (int)$_POST['todoId'] ) ) {\n if ( $todo->userId == User::getLoggedInUser()->id ) {\n $todo->delete();\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n \n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } else {\n\n // User has not confirmed deletion yet: display the confirm dialog\n if ( $results['todo'] = Todo::getById( (int)$_GET['todoId'] ) ) {\n if ( $results['todo']->userId == User::getLoggedInUser()->id ) {\n require( TEMPLATE_PATH . \"/deleteTodo.php\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n }\n}", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public function delete($user)\n {\n\n }", "public function destroy(ToDo $toDo)\n {\n //\n }", "public function destroy(ToDo $toDo)\n {\n //\n }", "function deleteUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$this->db->delete('usuarios');\n\t}", "public function delete_user($user);", "function deleteItem(&$errorMsg, $userInput)\n {\n $query='DELETE FROM todos WHERE id=:id';\n $stmt = $this->dbConnection->prepare($query);\n $stmt->bindValue(':id', $userInput, PDO::PARAM_INT);\n $stmt->execute();\n }", "public function destroy($id) //passar o id do item + o id_user\n {\n //\n }", "public function delete(User $user, Tasks $id)\n {\n\n if($user->id == $id->user_id){\n return true;\n }\n else{\n return false;\n }\n\n }", "public function delete(User $user, Evento $evento)\n {\n //\n }", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function delete()\n {\n $user = new Task();\n $attributes = $this->request->body();\n\n if( $user->setAttributes($attributes)->delete() ) {\n // return ['status' => 'success']; // for ajax\n header(\"Location: /task/index\");\n exit;\n }\n\n return ['status' => 'cannot delete'];\n }", "public function actionDelete($user_id, $id)\n {\n if (!Yii::$app->user->can('seeAllNotes')) $user_id=Yii::$app->user->getId() ;\n\n if (Yii::$app->user->can('deleteNote')){\n $this->findModel($user_id, $id)->delete();\n\n return $this->redirect(['index']);}else return $this->goBack();\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "function delete_usuario($user_id)\n {\n return $this->db->delete('usuarios',array('user_id'=>$user_id));\n }", "public function deleteUser($id){\n$sql = \"DELETE FROM utilisateurs WHERE id = :id\";\n $stmt= $this->pdo->prepare($sql);\n $stmt->execute([\n 'id' => $id\n ]);\n}", "function delete_tipo_usuario($id)\n {\n return $this->db->delete('tipo_usuario',array('id'=>$id));\n }", "public function deleted_user_action($id) {\r\n $this->db->delete_by_user_id($id);\r\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function delete(User $user, Status $task_status)\n {\n return Auth::check();\n }", "public static function setDeleteUser($request,$id){\r\n\t\t// Obtem o feedback do banco de dados pelo id\r\n\t\t$obUser = EntityUser::getUserById($id);\r\n\r\n\t\t//VALIDANDO A INSTANCIA\r\n\t\tif(!$obUser instanceof EntityUser){\r\n\t\t\t$request->getRouter()->redireect('/admin/users');\r\n\t\t}\r\n\r\n\t\t//Exclui o deedback\r\n\t\t$obUser->excluir();\r\n\r\n\t\t\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users?status=deleted');\r\n \t}", "public function delete(){\n $this->delete_from('task');\n }", "public function destroy(Todoitem $todoitem, $id)\n {\n $todo = Todoitem::where('id', $id)->delete();\n }", "public function deleteuser($context, $local)\r\n {\r\n $id = $context->getpar('id','');\r\n $user = $context->load('users', $id);\r\n R::trash($user);\r\n $local->addval('state', 'User has been deleted');\r\n $context->divert('/managestaff');\r\n }", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function delete(User $user)\n {\n //\n }", "public function delete(){\n $this->update(['deleted_by', Auth::user()->id]);\n return parent::delete();\n }", "public function deleteUser($userId);", "public function delete($user_id) {\n if ($_POST){\n #brisanje vrednosti\n #redirekcija na listu\n \n $confirmed = filter_input(INPUT_POST, 'confirmed', FILTER_SANITIZE_NUMBER_INT);\n \n if ($confirmed == 1){\n $res = HomeModel::delete($user_id);\n if ($res){\n Misc::redirect('homepage');\n } else {\n $this->setData('message', 'Došlo je do greške prilikom brisanja korisnika.');\n }\n }\n }\n \n $user = HomeModel::getById($user_id);\n $this->setData('korisnik', $user);\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function delete($id = NULL){\n if($id != NULL){\n $this->Usuarios_model->deleteUsuario($id);\n redirect(base_url().\"administrador/usuarios\");\n }\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}", "public function delete(User $user, Grupo $grupo)\n {\n //\n }", "function delete($id = null) {\n\n\t\t/**\n\t\t * Check if maintenance is on.\n\t\t * Call the \"Maintenance\" component to check.\n\t\t */\n\t\t$this->Maintenance->check();\n\n\t\t/**\n\t\t * If $id is not set an error message is displayed.\n\t\t * $id = The user ID\n\t\t */\n\t\tif (!$id) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user.', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t/**\n\t\t * Check if the user try to delete an another user.\n\t\t * If yes, the user is redirect to the index page.\n\t\t */\n\t\telseif ($id != $this->Auth->user('id')) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user.', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\n\t\t/**\n\t\t * Delete the user.\n\t\t * Redirect the user to logout page.\n\t\t */\n\t\tif ($this->User->del($id)) {\n\t\t\t$this->Session->setFlash(__d('core', 'The user has been deleted.', true));\n\t\t\t$this->redirect(array('action' => 'logout'));\n\t\t}\n\n\t}", "static public function delete(){\n\n\t\tinclude ($GLOBALS['PATH'] . '/classes/requests/users/DeleteRequest.php');\n\n\t\t$requests = new DeleteRequest;\n\t\t$errors = $requests->validate();\n\t\t\n\t\tif(count($errors) > 0){\n\n\t\t\t//Verifica se id não existe no banco ou deixar enviar, força o redirecionamento para pagina /users\n\t\t\tif( isset($errors['id']) ){\n\n\t\t\t\t$back = '/users?errors=' . json_encode(['id' => $errors['id']]);\n\n\t\t\t}else{\n\n\t\t\t\t$back = explode('?', $_SERVER['HTTP_REFERER'])[0] ?? '/users';\n\t\t\t\t$back .= '?id='.$_POST['id'].'&errors=' . json_encode($errors);\n\n\t\t\t}\n\n\t\t\theader('Location: ' . $back);\n\n\t\t}else{\n\n\t\t\t//Caso não houver nenhum impedimento, faz o delete do usuario\n\t\t\t$conn = Container::getDB();\n\t\t\t$user = new User;\n\t\t\t$crud = new CrudUser($conn, $user);\n\n\t\t\t$crud->delete($_POST['id']);\n\n\t\t\t//Redireciona para pagina de /users\n\t\t\theader('Location: /users?success=Usuário deletado com sucesso');\n\t\t\t\n\t\t}\n\n\t}", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function deleteAction() {\n\t\t $userId = $this->_request->getParam('userId');\n\t\t if($userId){\n\t\t $model_lucky = new Model_Lucky();\n\t\t $model_lucky->delete_where(array('user_id' => $userId));\n\t\t \n\t\t$this->_helper->json(1);\n\t\t}\n\t \n }", "public function delete($id = null) {\n // $this->request->onlyAllow('post');\n\n $this->request->allowMethod('post');\n\n $this->User->id = $id;\n if (!$this->User->exists()) {\n throw new NotFoundException(__('Usuario invalido'));\n }\n if ($this->User->delete()) {\n $this->Session->setFlash(__('Usuario eliminado'));\n return $this->redirect(array('action' => 'index'));\n }\n $this->Session->setFlash(__('Error al eliminar el usuario'));\n return $this->redirect(array('action' => 'index'));\n }", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "function eliminarDiaryUser($id) {\n $sql = \"DELETE FROM diario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "function index_delete()\n {\n $no_resi = $this->delete('no_resi');\n $this->db->where('no_resi', $no_resi);\n $delete = $this->db->delete('tabel_user');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function delete(User $user, Meeting $meeting)\n {\n //\n }", "public function deleteUser()\n {\n $this->delete();\n }", "public function destroy($todo)\n {\n try {\n $user = Auth::user();\n $todo = $user->todos()->findOrFail($todo);\n\n $todo->delete();\n\n $response = [\n 'ok' => true,\n ];\n return response()->json($response, 200);\n } catch (Exception $e) {\n Log::error($e->getMessage());\n $response = [\n 'ok' => false,\n ];\n return response()->json($response, 200);\n }\n }", "public function destroy($usuario_id)\n {\n }", "public function user_delete_post()\n { \n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n \n $id = $data['id'];\n $where = array(\n 'id' => $id\n );\n $this->model->delete('users', $where);\n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\n }", "public function delete($id) {\n // On supprime l'utilisateur\n $this->getDb()->delete('utilisateurs', array('user_id' => $id));\n }", "function deleteUser(){\n $bdd = bdd();\n $bdd->prepare(\"DELETE from postSujet where propri=?\")->execute(array($_GET['del']));\n $bdd->prepare(\"DELETE from membres where id=?\")->execute(array($_GET['del']));\n}", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "function delete(){\n $user_id = $this->uri->rsegment('3');\n $this->_del($user_id);\n redirect(admin_url('user'));\n\n }", "public function delete(User $user, Ico $ico)\n {\n //\n }", "public function delete(User $user, Negocio $negocio)\n {\n //\n }", "function delete() {\n $this->check_action_permission('delete');\n $tours_to_delete = $this->input->post('checkedID');\n if ($this->tour->delete_list($tours_to_delete)) {\n echo json_encode(array('success' => true, 'message' => lang('tours_successful_deleted')));\n } else {\n echo json_encode(array('success' => false, 'message' => lang('tours_cannot_be_deleted')));\n }\n }", "public function destroy(Request $request, $todo_id)\n {\n try {\n $todo = Todo::findOrFail($todo_id);\n if ($todo->user->is($request->user())) {\n $todo->delete();\n return response()->json([\"message\" => \"Todo Deleted\"]);\n }\n return response()->json([\"message\" => \"Not authorized\"], 401);\n } catch (\\Exception $exception) {\n return response()->json([\"error\" => \"Not found!\"], 400);\n }\n }", "public function delete(User $user, Task $task): bool\n {\n return $user->id == $task->created_by;\n }", "public function forceDelete(User $user, Exercise $exercise)\n {\n //\n }", "public function delete() {\n\n try{\n\n $this->checkOptionsAndEnableCors();\n\n $id = $this->input->get('id');\n if(isset($id)){\n $this->repository->delete((int) $id);\n echo json_encode([ \"data\" => 'User id '.$id. ' deleted' ]);\n } else {\n $this->handleError('Missing id parameter');\n }\n } catch (ORMException $e) {\n $this->handleError($e->getMessage());\n } catch (Exception $e) {\n log_message('error', $e->getMessage());\n $this->handleError($e->getMessage());\n }\n }", "public function delete_user($id)\n\t{\n\t\t$termination_date = date(\"Y-m-d H:i\");\n\t\t$dbres = $this->db->query(\"update user SET delete_status='1',termination_date='$termination_date' where id = $id \");\n\t\tredirect(site_url() . 'sys/get_employees?msg_del=success');\n\t}", "public function remove(){\n $stmt = $this->conn->prepare(\"DELETE FROM tbltodo WHERE id=:id\");\n $stmt->bindparam(\":id\",$this->id);\n $stmt->execute();\n return true;\n }", "public function delete($id)\n {\n\n if(count(DB::table('users')->where('fk_departamento',$id)->get())>0){\n return Redirect::to('/departamentos')->with( 'delete','Atenção: O departamento contém colaboradores, deve mover remover os colaboradores primeiro!')->withInput();\n }\n $departamento=departamento::where('pk_departamento',$id)->value('descricao');\n DB::table('departamentos')->where('pk_departamento',$id)->delete();\n \\Session::flash('success', 'O departamento '.$departamento.' foi removido.');\n\n // escrever log \n \n \n return Redirect::to('/departamentos');\n }", "public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }", "public function deleteToDoList() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $objToDoList->toDoList = $this->toDoList;\n return $objToDoList->deleteToDoList();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function delete($id_user){\n\t\t\t \n\t\t\t$this -> query = \"DELETE FROM usuari WHERE id='$id_user'\";\n\t\t\t$this -> executa_query();\n\t\t}", "public function del_check($del){\n\t\t$del_query=$this->db->where('id',$del)->delete('user');\n\t\t\n\t}", "abstract public function deleteByUser($userDao);", "public function delete($id = null) {\n // $this->request->onlyAllow('post');\n\n $this->isAdmin();\n if ($this->Auth->user()['id'] == $id) {\n $this->redirect(array('controller' => 'documents', 'action' => 'manage'));\n }\n \n $this->request->allowMethod('post');\n\n $this->User->id = $id;\n if (!$this->User->exists()) {\n throw new NotFoundException(__('Invalid user'));\n }\n if ($this->User->delete()) {\n $this->Session->setFlash(\n 'User deleted.',\n 'default',\n array('class' => 'succes')\n );\n return $this->redirect(array('action' => 'index'));\n }\n $this->Session->setFlash(\n 'User was not deleted.',\n 'default',\n array('class' => 'error')\n );\n return $this->redirect(array('action' => 'index'));\n }", "public function delete(User $user, Cargo $cargo)\n {\n //\n }", "public function delete($userid) {\n $sql = \"DELETE FROM usertable WHERE userid = :userid\";\n $stmt = $this->db_connect->prepare($sql);\n $stmt->bindParam(':userid', $userid, PDO::PARAM_INT);\n $stmt->execute();\n }", "function delete ($post) {\n \tif ( !isset($post['id']) || !User::exists($post['id']) ) {\n \t\t$_SESSION['fail'] = \"You must select a user\";\n \t\theader( 'Location: index.php?action=index');\n \t\texit;\n \t}\n \t\n \t// delete the record\n \t$user = User::find( $post['id']);\n \t$user->delete();\n \t\n \t// set our success redirect\n \t$_SESSION['success'] = 'The user was deleted successfully.';\n \theader( 'Location: index.php?action=index');\n \texit;\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function eliminar($id){\r\n //se eliminan todos los datos de este usuario de la tabla asignación\r\n return $this->db->delete('user', array('id' => $id));\r\n }", "function delete($id, $user = null)\n {\n return $this->_delete($id, $user);\n }", "public function userDeleted();", "public function delete(User $user, Fila $fila)\n {\n //\n }", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "public function delete(User $user, Post $post);", "public function delete($idPersonas);", "public function destroy($id)\n {\n \t$user = $this->user->find($id);\n $userId = $user->id;\n \n $atcls = $this->article->where('owner_id', $user->id)->get()->map(function($atcl){\n \t$atcl->owner_id = 1;\n $atcl->save();\n });\n \n \n $userDel = $this->user->destroy($id); //article del\n \n $status = $userDel ? '記事「'. $user->name.'」が削除されました' : '記事「'.$user->name.'」が削除出来ませんでした';\n \n return redirect('dashboard/users')->with('status', $status);\n }" ]
[ "0.74091667", "0.7018073", "0.6822474", "0.67303", "0.6677384", "0.6667483", "0.66359454", "0.6615946", "0.66150457", "0.66150457", "0.65988904", "0.65949965", "0.65663534", "0.6493768", "0.6488946", "0.64236283", "0.6370582", "0.6366892", "0.6365944", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.636438", "0.63609296", "0.6358275", "0.6356318", "0.63437665", "0.6334666", "0.6334666", "0.6334666", "0.6325896", "0.6315759", "0.6295033", "0.6285993", "0.6285543", "0.62842035", "0.6274051", "0.6266828", "0.6265037", "0.6264544", "0.6262982", "0.62619543", "0.6256752", "0.6247297", "0.62455255", "0.62323034", "0.622608", "0.6221851", "0.62202996", "0.6212055", "0.62109554", "0.62092465", "0.6207021", "0.62057495", "0.6193474", "0.6189779", "0.6186313", "0.6181895", "0.6178225", "0.61739695", "0.6170756", "0.6170702", "0.616371", "0.61622924", "0.6159988", "0.6149529", "0.6144782", "0.61439073", "0.61400354", "0.6137921", "0.6133815", "0.61292", "0.61272633", "0.6122895", "0.61221164", "0.6121578", "0.612027", "0.61062616", "0.6103002", "0.61021066", "0.60888076", "0.60886073", "0.60873425", "0.60811156", "0.6069311", "0.606582", "0.60642266", "0.6060067", "0.60550374", "0.6047995", "0.6042167" ]
0.8019444
0
this action creates user todos todo_type is mandatory field text is optional field
public function createUserTodoAction() { $data = $this->getRequestData(); if (isset($data['todo_type'])) { $user = Object_User::getById($this->getDeviceSession()->getUserId()); $folder = Object_Folder::getByPath('/todo/' . $user->getKey() . "-todo"); if (!$folder) { $folder = new Object_Folder(); $folder->setKey($user->getKey() . "-todo"); $folder->setParentId(30); $folder->save(); } $todo = new Object_Todo(); $todo->setCreator($user); $todo->setTodo_type($data['todo_type']); $todo->setText(isset($data['text']) ? $data['text'] : ""); $todo->setKey(Pimcore_File::getValidFilename($user->getKey() . "-" . time())); $todo->setPublished(true); $todo->setParentId($folder->getId()); if (!$todo->save()) { $this->setErrorResponse('cannot save Todo object!'); } } else { $this->setErrorResponse('todo_type is mandatory field for this request!'); } $this->_helper->json($todo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createTodo(Request $request) {\n // if (!is_null($exception)) {\n // return response()->json(\n // [\n // \"status\" => \"500\",\n // \"error\" => $exception\n // ], 500);\n // }\n $user = Auth::user();\n $validTodo = Validator::make($request->all(), [\n 'title' => 'required|string|unique:todo|max:255',\n 'description' => 'required|string|max:1024',\n 'category' => 'required|string|max:255',\n 'due' => 'required|date',\n ]);\n if ($validTodo->fails()) {\n return response()->json(\n [\n \"status\" => \"500\",\n \"error\" => $validTodo->errors()->all()\n ], 500);\n } else {\n try{\n $todo = new Todo;\n $todo->title = $request->title;\n $todo->description = $request->description;\n $todo->due = $request->due;\n $todo->category = $request->category;\n $todo->user_id = $user->id;\n $todo->save();\n } catch(\\Exception $e){\n return response()->json(\n [\n \"status\" => \"500\",\n \"error\" => $e\n ], 500);\n }\n return response()->json(\n [\n \"status\" => \"200\",\n \"success\" => \"Todo Created\",\n // \"data\" => Todo::where('user_id', $user->id)->get()\n ], 201);\n }\n }", "public function post_create() {\n\t\t$ext = 'json';\n\t\t$header = 'application/json';\n\n\t\tif (Request::accepts('text/xml')) {\n\t\t\t$ext = 'xml';\n\t\t\t$header = 'text/xml';\n\t\t}\n\n\t\t$todo = new Todo;\n\t\t$todo->title = Input::get('title');\n\t\t$todo->task = Input::get('task');\n\t\t$todo->due_date = Input::get('due_date');\n\t\t$todo->done = Input::get('done');\n\t\t$todo->save();\n\n\t\treturn Response::make('', '201',\n\t\t\t\tarray('Content-Type' => $header, 'Location' => 'todos/'\n\t\t\t\t\t\t. $todo->id));\n\t}", "public function todo($request, $user) {\n $todo = Todo::create([\n 'title' => $request->title,\n 'description' => $request->description,\n 'user_id' => $user->id\n ]);\n \\App\\Events\\LogProcessed::dispatch($todo, 'POST');\n return $todo;\n }", "public function store (TodoCreateRequest $request)\n {\n $todo = new Todo;\n $todo->todo = $request->todo;\n $todo->priority = $request->priority;\n $todo->done = false;\n $todo->save();\n }", "public function create($request)\n {\n //la reponse va contenir les infos du formulaire\n // je verifie si j'ai bien title et description dans ma requet\n if(isset($request['title'], $request['description'])) {\n $todo = [\n 'title' => $request['title'],\n 'description' => $request['description']\n ];\n\n if($this->model->createTodos($todo)) {\n $response = [\n \"status\" => \"succes\",\n \"message\" => \"Lea nouvelle tache a bien été enregistrée\",\n ];\n\n } else {\n $response = [\n 'status' => 'error',\n 'message' => 'Echec de création de la nouvelle tâche',\n ];\n }\n echo json_encode($response);\n }\n \n // si la methode createTodo de la classe model renvois true\n \n //reponse de type succes\n\n //sinon reponse de type erreur\n\n }", "public function store(CreateTodoRequest $request)\n\t{\n\t\tAuth::user()->todos()->create($request->all());\n\n\t\tflash()->success('Uw todo \"' . $request['item'] . '\" is toegevoegd');\n\n\t\treturn redirect('todos');\n\t}", "public function create(Request $request) {\n $todolist = User::create($request->all());\n\n return response()->json($todolist, 201);\n }", "public function create()\n {\n //\n return view('todo.create');\n }", "public function create()\n {\n //\n return view('todos.create');\n }", "public function create() // create task page\n {\n\n // tasks form\n\n return view('todo.create');\n }", "function CreateTask() {\n\tif (!empty($_GET['email']) && !empty($_GET['password'])) {\n\t\t// check if valid email and pw\n\t\tif (Authenticate($_GET['email'], $_GET['password'])) {\n\t\t\t// check if valid fields are present for task creation\n\t\t\tif (!empty($_GET['name']) && !empty($_GET['type']) && !empty($_GET['priority'])) {\n\t\t\t\t// store keys \n\t\t\t\t$_POST['name'] = $name= $_GET['name'];\n\t\t\t\t$_POST['type'] = $type = $_GET['type'];\n\t\t\t\t$_POST['priority'] = $priority = $_GET['priority'];\n\n\t\t\t\t// priority will be between 1 and 10\n\t\t\t\tif ($priority > 10) $_POST['priority'] = 10;\n\t\t\t\tif ($priority < 1) $_POST['priority'] = 1;\n\n\t\t\t\t//validate name\n\t\t\t\tif (strlen($name) > 100 || strlen($name) < 5) {\n\t\t\t\t\techo json_encode(\"Task name to short/long, n > 5 < 100\");\n\t\t\t\t\treturn;\n\t\t\t\t} \n\n\t\t\t\t// validate type\n\t\t\t\t$type= strtolower($type);\n\t\t\t\tif ($type != 'home' && $type != 'work') {\n\t\t\t\t\techo json_encode(\"Task type should be home or work\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// get the id of the user creating the task\n\t\t\t\t$conn = GetConnection();\n\t\t\t\t$stmt = \"SELECT ID FROM users WHERE email='$_GET[email]'\";\n\t\t\t\t$data = $conn->query($stmt) or die('Query failed: ' . mysqli_error($conn));\n\t\t\t\t$row = mysqli_fetch_row($data);\n\t\t\t\t//set id to the id of the owner\n\t\t\t\t$_POST['id'] = $row[0];\n\t\t\t\t// tasks always start as todo\n\t\t\t\t$_POST['status']= 'todo';\n\n\t\t\t\t// Creat the insert statement to add task entry\n\t\t\t\t$stmt=\"INSERT INTO task (ownerID,priority,type,status,name) VALUES \".\n\t\t\t\t\t\"('$_POST[id]','$_POST[priority]','$_POST[type]', '$_POST[status]', '$_POST[name]')\";\n\n\t\t\t\t$conn->query($stmt) or die('Query failed: ' . mysqli_error($conn));\n\t\t\t\techo json_encode('Task created');\n\t\t\t\t//close the connection to the database\n\t\t\t\tmysqli_close($conn);\n\t\t\t}else echo json_encode('No name/type/priority param(s) provided, use ?name=x&type=x&priority=x in url');\n\t\t}\n\t} else echo json_encode('No email/password param(s) provided, use ?email=x&password=x in url');\t\n\n}", "private function _addOrEdit($user,$type= 'add') {\n \n $user_id = $user['id'];\n\n //Get the creator's id\n if(isset($this->request->data['user_id'])){\n if($this->request->data['user_id'] == '0'){ //This is the holder of the token - override '0'\n $this->request->data['user_id'] = $user_id;\n }\n }\n\n $check_items = array(\n\t\t\t'available_to_siblings',\n\t\t\t'suffix_permanent_users',\n\t\t\t'suffix_vouchers',\n 'suffix_devices'\n\t\t);\n\t\t\n foreach($check_items as $i){\n if(isset($this->request->data[$i])){\n $this->request->data[$i] = 1;\n }else{\n $this->request->data[$i] = 0;\n }\n }\n \n if($type == 'add'){ \n $entity = $this->{$this->main_model}->newEntity($this->request->data());\n }\n \n if($type == 'edit'){\n $entity = $this->{$this->main_model}->get($this->request->data['id']);\n $this->{$this->main_model}->patchEntity($entity, $this->request->data());\n }\n \n if ($this->{$this->main_model}->save($entity)) {\n $this->set(array(\n 'success' => true,\n '_serialize' => array('success')\n ));\n } else {\n $message = 'Error';\n \n $errors = $entity->errors();\n $a = [];\n foreach(array_keys($errors) as $field){\n $detail_string = '';\n $error_detail = $errors[$field];\n foreach(array_keys($error_detail) as $error){\n $detail_string = $detail_string.\" \".$error_detail[$error]; \n }\n $a[$field] = $detail_string;\n }\n \n $this->set(array(\n 'errors' => $a,\n 'success' => false,\n 'message' => array('message' => __('Could not create item')),\n '_serialize' => array('errors','success','message')\n ));\n }\n\t}", "public function addNewToDoAction() {\n\t\t$todo = new todo();\n\t\t\n\t\t$todo->SaveNew($_POST['name']);\n\t\treturn $this->indexAction();\n\t}", "public function actionMenutousercreate()\r\n {\r\n $model = new MenuToUser();\r\n\t\t\r\n if ($model->load(Yii::$app->request->post())) {\r\n \tif(is_array($model->menulist))\r\n \t\t$model->menulist = implode(',', $model->menulist);\r\n \tif(is_array($model->plate))\r\n \t\t$model->plate = implode(',',$model->plate);\r\n \tif(is_array($model->businessmenu))\r\n \t\t$model->businessmenu = implode(',',$model->businessmenu);\r\n \tif(is_array($model->searchmenu))\r\n \t\t$model->searchmenu = implode(',', $model->searchmenu);\r\n if(is_array($model->auditinguser))\r\n $model->auditinguser = implode(',', $model->auditinguser);\r\n \t$model->save();\r\n return $this->redirect(['menutouserview', 'id' => $model->id]);\r\n } else {\r\n return $this->render('menutousercreate', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function CreateTask()\n {\n\n $data = $this->GetParamsFromRequestBody('create');\n\n if (!isset($data['status'])) {\n $data['status'] = \"open\";\n }\n\n $data['createdby'] = $this->loggedUser->getId();\n\n $this->insertArrayIntoDatabase('todo_task', $data);\n $id = mysql_insert_id();\n\n $this->response = array(\n \"status\" => 0,\n \"id\" => $id\n );\n $this->responseStatus = 201;\n }", "public function createManagerSignOffToDo($user_list)\n {\n $site = Site::findOrFail($this->site_id);\n $todo_request = [\n 'type' => 'maintenance',\n 'type_id' => $this->id,\n 'name' => 'Maintenance Request Sign Off - ' . $this->name . ' (' . $site->name . ')',\n 'info' => 'Please sign off on completed items',\n 'priority' => '1',\n 'due_at' => nextWorkDate(Carbon::today(), '+', 2)->toDateTimeString(),\n 'company_id' => '3',\n ];\n\n // Create ToDoo and assign to Site Supervisors\n $todo = Todo::create($todo_request);\n $todo->assignUsers($user_list);\n //$todo->emailToDo();\n }", "public function creating(Todo $todo)\n {\n $this->slugOperation($todo);\n }", "public function create()\n {\n return view('todo.create');\n }", "public function create()\n {\n return view('todo.create');\n }", "public function create()\n {\n return view('todo.create');\n }", "public function create()\n {\n return view('todos.create');\n }", "public function deleteUserTodoAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $todo->getCreator()->getId()) {\n $todo->setPublished(false);\n if (!$todo->save()) {\n $this->setErrorResponse('cannot delete Todo object!');\n }\n } else {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function actionAddTodoList()\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$items = array();\n\t\t$userObj = new Users();\n\t\t$items = $userObj->getAllUsers();\n\t\t\n\t\t$result = array();\n\t\t$this->renderPartial('addTodoList', array('data'=>$items));\n\t}", "function newTodo() {\n\n $results = array();\n $results['pageTitle'] = \"New To-Do\";\n $results['formAction'] = \"newTodo\";\n\n if ( isset( $_POST['saveChanges'] ) ) {\n\n // User has posted the to-do edit form: save the new to-do\n if ( !checkAuthToken() ) return;\n $todo = new Todo ( $_POST );\n $todo->userId = User::getLoggedInUser()->id;\n $todo->createdTime = time();\n $todo->completed = false;\n $todo->insert();\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n\n } elseif ( isset( $_POST['cancel'] ) ) {\n\n // User has canceled their edits: return to the to-do list\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n } else {\n\n // User has not posted the to-do edit form yet: display the form\n $results['todo'] = new Todo;\n require( TEMPLATE_PATH . \"/editTodo.php\" );\n }\n}", "public function create()\n {\n\n return view('todo.create');\n }", "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 show_create_form_task()\n {\n $user = factory(User::class)->create();\n $user->assignRole('task-manager');\n $this->actingAs($user);\n View::share('user', $user);\n\n factory(User::class, 5)->create();\n\n $response = $this->get('/tasks_php/create');\n $response->assertSuccessful();\n $response->assertViewIs('tasks.create_task');\n\n $users = User::all();\n $response->assertViewHas('users', $users);\n\n $response->assertSeeText('Create Task:');\n }", "public function getCreateTask(Request $req)\n {\n $users = User::get();\n //initialize input ni go to method getUserList\n $input = $this->getUserList($users, 'name');\n\n\n return view('tasks.create',compact('users','input'));\n\n }", "public function updateUserTodoAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Todo!');\n } else {\n if (isset($data['todo_type'])) {\n $todo->setTodo_type($data['todo_type']);\n }\n if (isset($data['text'])) {\n $todo->setText($data['text']);\n }\n if (!$todo->save()) {\n $this->setErrorResponse('cannot update Todo object');\n }\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n\n $this->_helper->json($todo);\n }", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "public function actionCreate()\n {\n $model = new AuthItem(null);\n $model->type = $this->type;\n if ($model->load(Yii::$app->getRequest()->post(),'') && $model->save()) {\n return $this->success();\n } else {\n return $this->fail($model->getErrors(),Yii::t('rbac-admin', 'Name'));\n }\n }", "public function create()\n\t{\n\t\tif(!in_array(9, $this->privsArray))\n\t\t\treturn redirect()->back();\n\t\t$types = [ 0 => \\Lang::get('messages.select')];\n\n\t\tswitch (Auth::user()->user_type_id) {\n\t\t\tcase 1:\n\t\t\t\t\t$types += User_Type::orderBy('type', 'DESC')->where('id', '!=', 5)->lists('type','id');\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t\t$types += User_Type::whereIn('id', [3, 6, 8])->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t\t$types += User_Type::where('id', 6)->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\t\t$types += User_Type::whereIn('id', [3, 6])->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\t\t// $categories = Category::lists('name','id');\n\t\t// return view('user.new_user', compact('types', 'categories'));\n\n\t\t$categories = Category::lists('name','id');\n\t\t$uUnCat = [];\n\t\t$uUnCat = DB::table('category_user')\n\t\t\t\t\t->distinct()\n ->lists('category_id');\n\t\tforeach ($uUnCat as $value) {\n\t\t\tunset($categories[$value]);\n\t\t}\n\n\t\treturn view('user.new_user', compact('types', 'categories', 'uUnCat'));\n\n\n\t}", "public function add(Request $request , $id)\n {\n $this->validate($request, [\n 'task' => 'required',\n 'description' => 'required'\n ]);\n return ToDo::create([\n 'user_id' =>$id,\n 'task'=>$request->input('task'),\n 'description'=>$request->input('description'),\n //'api_token' => app('hash')->make('ge2guihcksnlkcsjopjj'),\n ]);\n }", "function listUserTodos() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\t\t// only show todos if user has access\n\t\tif($page->validatePath(\"/janitor/admin/todo\")) {\n\t\t\t\n\t\t\t$IC = new Items();\n\t\t\t$model = $IC->typeObject(\"todo\");\n\t\t\t$todos = $IC->getItems(array(\"itemtype\" => \"todo\", \"where\" => \"todo.priority = 20\", \"user_id\" => session()->value(\"user_id\"), \"extend\" => array(\"tags\" => true)));\n\n\t\t\t$_ .= '<div class=\"todos\">';\n\t\t\t$_ .= '<h2>TODOs</h2>';\n\n\t\t\tif($todos) {\n\t\t\t\t$_ .= '<ul class=\"todos\">';\n\t\t\t\tforeach($todos as $todo) {\n\t\t\t\t\t$_ .= '<li class=\"todo todo_id:'.$todo[\"id\"].'\">';\n\t\t\t\t\t\t$_ .= '<h3>'.stringOr($HTML->link($todo[\"name\"], \"/janitor/admin/todo/edit/\".$todo[\"id\"], array(\"target\" => \"_blank\")), $todo[\"name\"]).'</h3>';\n\t\t\t\t\t\t$_ .= $this->tagList($todo[\"tags\"]);\n\t\t\t\t\t$_ .= '</li>';\n\t\t\t\t}\n\t\t\t\t$_ .= '</ul>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ .= '<p>No TODOs</p>';\n\t\t\t}\n\n\t\t\t$_ .= '</div>';\n\t\t}\n\n\t\treturn $_;\n\t}", "public function store(Request $request)\n {\n $this->validate($request, Todo::rules());\n $user = User::first();\n\n return $user->todos()->create($request->all());\n }", "public function createItemType($user_id)\n {\n $data = array(\n 'name' => $this->input->post('name'),\n 'description' => $this->input->post('description'),\n );\n\n return $this->db->insert('item_type', $data);\n }", "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function store(Request $request)\n {\n //\n\n $request->validate([\n 'name' => 'required',\n 'description' => 'required'\n ]);\n\n if($request->has('completed')) {\n $completed = true;\n } else {\n $completed = false;\n }\n\n Todo::create([\n 'name' => $request->name,\n 'description' => $request->description,\n 'completed' => $completed\n ]);\n\n \n // Todo::create($request->all());\n return redirect('/todos')->with('status', 'Data Berhasil Disimpan!');\n }", "public function todo(Request $request)\n {\n\n $form = $this->createForm(TodoType::class);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n\n try {\n\n $todTmp = $form->getData();\n\n $em = $this->getDoctrine()->getManager();\n\n $this->addFlash(\n 'notice',\n 'Your todo is record'\n );\n\n $em->persist($todTmp);\n $em->flush();\n\n } catch (\\Exception $Exception) {\n\n }\n }\n return $this->render('udemy/todo.html.twig', array(\n\n 'form' => $form->createView()\n ));\n }", "function Todo() {\n\t\t$query_string = Request::$GET;\n\t\t$global_string = $this->buildQuery($query_string);\n\n\t\t// we only want to do this is we have a valid, single user. \n\t\t$show_ical = FALSE;\n\n\t\t//Display User select tool if user has admin permissions\n\t\t$globalUser = '';\n\t\tif ($this->User->HasModuleItemAccess('administration', CU_ACCESS_ALL, CU_ACCESS_READ)) {\n\n\t\t\t// $actualUserID = $this->User->ID;\n\t\t\t// try to get a imitation user form the request string.\n\t\t\t$userID = Request::get('userID', Request::R_INT);\n\n\t\t\t// userID can be 'all'\n\t\t\tif (($userID == null) && (Request::get('userID') == 'all'))\n\t\t\t{\n\t\t\t\t$userID = 'all';\n\t\t\t}\n\n\t\t\t// else, check if we have a imitation user in the session object.\n\t\t\tif (!$userID) {\n\t\t\t $userID = $this->Session->Get('springboardID');\n\t\t\t}\n\t\t\t\n\t\t\t// Create Temp user for creating correct permissions\n\t\t\tif ($userID) {\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\n\t\t\t\tif ($userID == 'all')\n\t\t\t\t{\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->ID = null;\n\t\t\t\t} else {\n\t\t\t\t\t$show_ical = TRUE;\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->Initialise($userID, $this->DB);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->TempUser->ID = $this->User->ID;\n\t\t\t\t$userID = $this->User->ID;\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t}\n\t\t\t\n\t\t\t$globalUser = '<label>' . MSG_USER_TO_SHOW . '</label>'\n\t\t\t\t\t\t.'<select name=\"UserID\" class=\"TaskUpdate_dd\" id=\"userToShowFilter\">';\n\n\t\t\t$SQL = sprintf(SQL_GET_USER_LIST);\n\t\t\t$userList = $this->DB->Query($SQL);\n\t\t\tif ($userList) {\n\t\t\t\t// first add in a \"All users option\"\n\t\t\t\t$globalUser .= '<option value=\"all\"'\n\t\t\t\t. (($this->TempUser->ID == null) ? ' selected' : '') . '>'\n\t\t\t\t. MSG_SHOW_ALL . '</option>';\n\t\t\t \n\t\t\t\tfor ($i = 0; $i < count($userList); $i++) {\n\t\t\t\t\t$globalUser .= '<option value=\"' . $userList[$i]['ID'] . '\"'\n\t\t\t\t\t. ($this->TempUser->ID == $userList[$i]['ID'] ? ' selected' : '') . '>'\n\t\t\t\t\t. $userList[$i]['FirstName'].' '.$userList[$i]['LastName'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$globalUser .= '</select>';\n\t\t\t$tmplDash['globalUser'] = $globalUser;\n\n\t\t} else {\n\t\t\t// don't allow non-admins to edit the user they view for.\n\t\t\t$tmplDash['globalUser'] = '';\n\t\t\t$userID = $this->User->ID;\n\t\t\t$show_ical = TRUE;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t}\n\n\t\t$filter_array = array('mytasks','owed','all');\n\t\t$filter_display = array(MSG_MINE,MSG_OWED,MSG_ALL);\n\t\tfor ($i = 0, $filteroptions = null, $filtercount = count($filter_array); $i < $filtercount; $i++) \n\t\t{\n\t\t\t$filteroptions .= sprintf('<option value=\"%s\" %s>%s</option>', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_array[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($_GET['action'] == $filter_array[$i]) ? ' SELECTED' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_display[$i]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['showfilter'] = '<label>'.MSG_SHOW_THESE_TASKS.'</label>'\n\t\t\t.'<select id=\"showTheseTasksFilter\">'.$filteroptions.'</select>';\n\n\t\t$range_array = array('all' => '{MSG_ALL}', \n\t\t\t\t\t\t\t\t\t\t\t\t'lastweek' => '{MSG_LAST_WEEK}', \n\t\t\t\t\t\t\t\t\t\t\t\t'thisweek' => '{MSG_THIS_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'nextweek' => '{MSG_NEXT_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'today' => '{MSG_TODAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'yesterday' => '{MSG_YESTERDAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'lastmonth' => '{MSG_LAST_MONTH}',\n\t\t\t\t\t\t\t\t\t\t\t\t'thismonth' => '{MSG_THIS_MONTH}', \n\t\t\t\t\t\t\t\t\t\t\t\t'nextmonth' => '{MSG_NEXT_MONTH}'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\tforeach($range_array as $key => $value) \n\t\t{\n\t\t\t$rangeoptions .= sprintf('<option value=\"%s\" %s>%s</option>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$key, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($key == $query_string['show']) ? 'selected' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['period'] = '<label>'.MSG_PERIOD_TO_SHOW.'</label>\n\t\t\t\t\t\t\t <select id=\"periodToShowFilter\">'.$rangeoptions.'</select>';\n\n\t\t$URI = split (\"index\\.php\",Request::server(SCRIPT_NAME_VAR));\n\t\t// Create validity key\n\t\t\n\t\tif ($show_ical == TRUE)\n\t\t{\n\t\t $this->KeyUser =& new User();\n\t\t $this->KeyUser->Initialise($userID, $this->DB);\n\t\t $key = substr(md5($this->KeyUser->Fullname . $this->KeyUser->PasswordHash), 2, 8);\n\t\t $modAction[] = '<a href=\"webcal://' . Request::server(SERVER_NAME_VAR) . $URI[0] . 'system/ical_springboard.php?show=' . $query_string['show'] \n\t\t\t. '&completed=' . $query_string['completed'] \n\t\t\t. '&action=' . $query_string['action'] \n\t\t\t. '&key=' . $key \n\t\t\t. '&userid=' . $userID . '\">'.MSG_SYNC_TO_ICAL.'</a>';\n\t\t}\n\n\t\t$modAction[] = '<a id=\"dash-toggler\" href=\"#\" onclick=\"toggleDash(); return false;\">'.MSG_SHOW_DASH.'</a>';\n\t\t$this->setDash($this->getTemplate(\"dashBlock\", $tmplDash));\n\n\t\t// pick whether to show completed or active\n\t\t$completed = (isset($query_string['completed']) && ($query_string['completed'] == 1));\n\t\tif ($completed)\n\t\t{\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard\">'.MSG_VIEW_ACTIVE.'</a>';\n\t\t} else {\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard&completed=1\">'.MSG_VIEW_COMPLETED.'</a>';\n\t\t}\n\n\t\t$this->CreateTabs('todo');\n\t\t$tmpl['tasklist'] = $this->TaskList($query_string['action'], $userID);\n\n\t\t// Emulate the task view screen.\n\t\tif (Request::get('taskid', Request::R_INT)) {\n\t\t\tResponse::addToJavascript('auto_open_task', TRUE);\n\t\t\tResponse::addToJavascript('item_ids', array(\n\t\t\t\t'project_id' => Request::get('projectid', Request::R_INT),\n\t\t\t\t'task_id' => Request::get('taskid', Request::R_INT),\n\t\t\t\t'comment_id' => Request::get('commentid', Request::R_INT),\n\t\t\t));\n\t\t}\n\n\t\t// this is here to keep template happy.\n\t\t// remove when we are sure that nobody else calls the todo template.\n\t\t$tmpl['script'] = ''; \n\n\t\t$this->setTemplate('todo', $tmpl);\n\n\t\t$this->SetModule(MSG_TODO, $modAction);\n\t\t$this->Render();\n\t}", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function createNewListItem(Request $request)\n\t{\n\t\t$user = Auth::user()->id;\n\t\t//DB::table('lists')->where('user_id', Auth::user()->id)\n\n\t\t$list = DB::table('lists')->find($request->List_id);\n\t\t//dd($user,$list);\n\n\t\tif ($list == null || $user == null) {\n\t\t\treturn redirect(url('/yourLists'));\n\n\t\t} elseif ($user == $list->user_id) {\n\t\t\tDB::table('list_items')->insertOrIgnore([\n\t\t\t\t\"name\" => $request->listItemName,\n\t\t\t\t\"description\" => $request->description,\n\t\t\t\t\"List_id\" => $request->List_id,\n\t\t\t\t\"user_id\" => Auth::user()->id\n\t\t\t]);\n\t\t\treturn redirect(url('/yourLists'));\n\n\t\t} else {\n\t\t\treturn redirect(url('/yourLists'));\n\t\t}\n\t}", "public function create(Request $request)\n {\n $user_id = $request->user()->id;\n $categories = User::find($user_id)\n ->categories()\n ->get();\n\n return view('todos/create', [\n 'categories' => $categories,\n ]);\n }", "public function addtodo(Request $request){\n $todo = $request->new_todo;\n $id = Auth::user()->id;\n\n $todosave = new TodoList;\n $todosave->cid = $id;\n $todosave->todo = $todo;\n $todosave->updated_at = Carbon::now();\n $todosave->save();\n\n $data = $this->getTodoData();\n\n return $data;\n }", "public function create() : bool\n {\n if( ! User::isLoggedIn()) {\n header(\"Location: /user/login\");\n }\n\n $model = new Task();\n $attributes = $this->request->body();\n $user_id = User::getLoggedInUserId();\n $attributes['user_id'] = $user_id;\n\n if($this->request->isPost() && $model->setAttributes($attributes)->validate() && $model->create() ) {\n\n header(\"Location: /task/index\");\n exit;\n }\n\n return $this->render('create', $model);\n }", "public function create()\n {\n $checkAdmin = auth()->user()->role;\n $checkActive = User::where('active','=','0')->get();\n $activeCount = $checkActive->count();\n $task = Task::where('status','!=','X')->take(5)->get();\n $call = Call::where('status','!=','X')->take(5)->get();\n $countpriority = Task::where('status','I')->where('priority','4')->count();\n $priority = Task::where('status','I')->where('priority','4')->get();\n\n return view('pages.user.addUser')->with(compact('checkAdmin','activeCount','task','countpriority','priority','call'));\n }", "public function store(Request $request)\n {\n $user_id = 1;\n //prendo req.input e leggo solo param name\n $name = $request->input('name');\n //creo nuova risorsa\n $todoList = new TodoList();\n $todoList->name = $name;\n $todoList->user_id = $user_id;\n $todoList->deleted_at = now();\n //altro modo senza aggiungere fillable in Models/TodoList, perchè con save posso salvare il model e commento altro return \n $success = $todoList->save();\n //return $todoList;\n return $this->getResult($todoList->toArray(), $success);\n\n // con compact passo un array\n // return TodoList::create(compact('name', 'user_id'));\n }", "public function store()\n {\n $todo = new Todo(Request::all());\n $todo->user_id = Auth::user()->id;\n $todo->save();\n return $todo;\n }", "public function create()\n {\n //Declaration of vars in order to use the same form template\n $task = new Task;\n $title = \"Nueva Tarea\";\n $txtButton = \"Agregar\";\n $route = route('tasks.store');\n $users = User::all();\n return view('tasks.create', compact('task','title','txtButton','route','users'));\n }", "public function create()\n {\n \n //get type users\n \n\n return view('users.create', [\n 'types' => $types,\n 'departments' => $departments,\n ]);\n }", "public function create(){\n\t\t$this->autenticate();\n\t\t$user_id = $_POST['id'];\n\t\t$nombre = \"'\".$_POST['nombre'].\"'\";\n\t\t$cedula = \"'\".$_POST['cedula'].\"'\";\n\t\t$nacimiento = \"'2000/1/1'\"; //fecha de nacimiento default, despues el mismo usuario la puede editar\n\t\trequire_once(\"../app/models/administrativo.php\");//conexion entre los controladores\n\t\t$administrativo=new Administrativo();// crea el perfil administrativo vacio\n\t\t$administrativo->new($nombre,$cedula,$nacimiento); // inserta la informacion antes ingresada en la base de datos\n\t\t$administrativo_id = $administrativo->where(\"cedula\",$cedula); // se trae el perfil administrativo recien creado con la cedula\n\t\t$administrativo_id = $administrativo_id[0][\"id\"];\n\t\t$administrativo->attach_user($user_id,$administrativo_id); // amarra el usuario a su nuevo perfil docente\n\t\t$administrativo_id = strval($user_id);//convierte el user_id de entero a string\n\t\theader(\"Location: http://localhost:8000/usuarios/show/$user_id\");\n\t\texit;\n\t\t$this->view('administrativos/index', []);\n\t}", "public function create()\n {\n return view('users.create1');\n //\n $types =Type::lists('name', 'id');\n// dd($types); die;\n //为了在界面中显示标签name,id为了在保存文章的时候使用。\n return view('users.create',compact('types'));\n }", "public function create(){\n \t//solo los administradores pueden listar preguntas\n // if(!Login::isAdmin())\n // throw new Exception(\"Debes ser administrador\");\n \t//recupera la lista de modulos\n $modulos=Modulo::get();\n\n //cagar los usuarios\n $usuario=Login::getUsuario();\n\n require_once 'view/pregunta/form_new.php';\n }", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function creating(User $user)\n {\n\n }", "public function create()\n {\n //Valida se usuário possui permissão para acessar esta opção\n if(App\\Models\\User::getPermission('liberation_items_add',Auth::user()->user_type_code)){\n\n return view('liberation_items.create');\n\n }else{\n //Sem permissão\n Flash::error(Lang::get('validation.permission'));\n return redirect(route('liberation_items.index'));\n }\n }", "public function actionCreate() {}", "public function actionCreate() {}", "public function create()\n {\n $types = [];\n $data = $this->type->orderBy('name', 'asc')->get();\n foreach ($data as $item) {\n $types[$item->id] = $item->name; \n }\n\n return view('users.create', compact('types'));\n }", "public function store(CreateTodoRequest $request)\n {\n $todo = $this->todoRepository->createTodo($request->validated());\n return $this->sendSuccessResponseWithDataAndCode($todo,201,\"Todo Created\");\n }", "public function getUserTodoByIdAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json($todo);\n }", "function create() \n {\n $api = new Module_UserManagement_API();\n\n $user_types = $api->getExerciseTypes();\n\n $form = new AddUserForm();\n if ($form->validate()) {\n $userid = $form->getSubmitValue('login');\n $password = $form->getSubmitValue('password');\n $coach = $form->getSubmitValue('coach');\n $athlete = $form->getSubmitValue('athlete');\n $usertype = $form->getSubmitValue('usertype');\n\n $success = $api->createUser($userid, $password, \n $coach, $athlete, $usertype);\n if ($success) {\n /* We have sucessfully logged in, now lets \n * display the next page */\n /*\n if (!isset($redirect_module) || !isset($redirect_action)) {\n $redirect_module = 'Sessions';\n }\n\n Core_Url::redirectToUrl($urlToRedirect);\n */\n }\n }\n\n $view = Core_View::factory('adduser');\n //$view->users = $users;\n $view->addForm($form);\n $view->subTemplate = 'genericForm.tpl';\n\n /* Coach radio buttons */\n $view->assign('coach_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('coach_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('athlete_types', array('y' => 'Yes',\n 'n' => 'No'));\n $view->assign('athlete_selected', 'n');\n\n /* Athlete radio buttons */\n $view->assign('usertype_types', array('user' => 'User',\n 'superuser' => 'SuperUser'));\n $view->assign('usertype_selected', 'user');\n\n echo $view->render();\n }", "public function actionAddTodo($from=NULL)\n\t{\t\t\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$items = array();\n\t\t$userObj = new Users();\n\t\t$loginObj = new Login();\n\t\t$logindata=$loginObj->getUserId(Yii::app()->session['loginId']);\n\t\t$items = $userObj->getAllUsers();\n\t\t\n\t\t$todoListsObj\t=\tnew TodoLists();\n\t\t$res\t=\t$todoListsObj->getAllMyList(Yii::app()->session['loginId']);\n\t\tunset($res['pendingItems']);\n\t\t$items['myLists'] = $res;\n\t\t$items['from']\t=\t$from;\n\t\t\n\t\t$result = array();\n\t\t$this->renderPartial('addTodoItem', array('data'=>$items,'lastFavrite'=>$logindata));\n\t}", "public function postCreate()\n {\n\n // Declare the rules for the form validation\n $rules = array(\n 'name' => 'required'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Get the inputs, with some exceptions\n $inputs = Input::except('csrf_token');\n\n $this->type->name = $inputs['name'];\n $this->type->save();\n\n // Was the type created?\n if ($this->type->id)\n {\n // Redirect to the new type page\n return Redirect::to('admin/types/' . $this->type->id . '/edit')->with('success', Lang::get('admin/types/messages.create.success'));\n }\n\n // Redirect to the new type page\n return Redirect::to('admin/types/create')->with('error', Lang::get('admin/types/messages.create.error'));\n\n // Redirect to the type create page\n return Redirect::to('admin/types/create')->withInput()->with('error', Lang::get('admin/types/messages.' . $error));\n }\n\n // Form validation failed\n return Redirect::to('admin/types/create')->withInput()->withErrors($validator);\n }", "public function create()\n {\n $data['id'] = $this->db->order_by('id', 'desc')->get($this->User->table)->row()->id + 1;\n \n $this->Helper->view('user/create', $data);\n }", "public function create()\n {\n if(Auth::user()->user_type==1)\n {\n return view('backend.sections.create');\n }\n else{\n return redirect('welcome');\n }\n }", "public function store(Request $request)\n {\n $insert = new ToDo();\n $insert->project_no = $request->project_no;\n $insert->project_id = $request->project_id;\n $insert->task_name = $request->task_name;\n $insert->task_short_name = $request->task_short_name;\n $insert->begin = $request->start_date;\n $insert->over = $request->dead_line;\n $insert->save();\n Session::flash('message', 'Data insert successfully');\n return redirect('admin/insert_todo_list');\n }", "public function create()\n {\n //Valida se usuário possui permissão para acessar esta opção\n if(App\\Models\\User::getPermission('document_types_add',Auth::user()->user_type_code)){\n //Pega todos os movimentos\n $moviments = App\\Models\\Moviment::getMoviments(); \n return view('document_types.create')->with('moviments',$moviments);\n\n }else{\n //Sem permissão\n Flash::error(Lang::get('validation.permission'));\n return redirect(route('document_types.index'));\n }\n }", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function create()\n {\n // dd( $user->roles );\n $form[ 'formUrl' ] = url('users');\n $form[ 'formMethod' ] = 'post';\n $form[ 'blank' ] = 'blank';\n $formFields = User::getFormData( );\n unset( $formFields['_password'] );\n unset( $formFields['_password_confirmation'] );\n $form[ 'content' ] = view('layouts.templates.forms.form_fields', [ 'formFields' => $formFields ] );\n $form = view('layouts.templates.forms.form', $form );\n \n $this->data[ 'contents' ] = $form ;\n\n $this->data[ 'message_alert' ] = Session::get('message');\n $this->data[ 'page_title' ] = 'User management';\n $this->data[ 'header' ] = 'Tambah User';\n $this->data[ 'sub_header' ] = '';\n return $this->render( );\n }", "public function store(SaveTodoRequest $request)\n {\n $todo = new Todo();\n\n $todo->title = $request->title;\n $todo->priority = $request->priority;\n $todo->completed = $request->completed;\n\n $request->user()->todos()->save($todo);\n\n session()->flash('succes', 'The TODO item was succesfully saved');\n\n return redirect(route('index'));\n\n\n }", "public function create()\n\t{\t\n\t\t$modulos_list = Modulo::all()->lists('id', 'id');\n$professores_list = Professor::all()->lists('id', 'id');\n\n\t\t// load the create form (app/views/Turma/create.blade.php)\n\t\t$this->layout->content = View::make('Turma.create')\n->with('modulos_list', $modulos_list)\n->with('professores_list', $professores_list);\n\t}", "public function createPost(){\n \t//di chuyen den url: /admin/users/read\n if($this->model->modelCreate())\n //di chuyen den url\n return redirect(\"admin/users\");\n else{\n Session::flash(\"error\",\"email da ton tai\");\n return redirect(\"admin/users/addUser\")->withInput();\n }\n }", "public function create($type, $data, $userId);", "public function actionCreate()\n {\n $model = new NotetakingNotes();\n \n if (Yii::$app->user->can('createNote')){\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n return $this->redirect(['view', 'user_id' => $model->user_id, 'id' => $model->id]);\n }\n \n return $this->render('create', [\n 'model' => $model,\n ]);\n }else $this->goBack();\n\n}", "public function create(Request $request)\n {\n $task = new Task;\n $task->title = $request->title;\n $task->description = $request->description;\n $task->fkTodo = $request->fkTodo;\n $task->save();\n\n return redirect()->route('todo', ['id' => $request->fkTodo]);\n \n }", "public function store()\n {\n $this->validate([\n 'name' => 'required',\n 'content' => 'required',\n ]);\n \n Todo::updateOrCreate(['id' => $this->todo_id], [\n 'name' => $this->name,\n 'content' => $this->content\n ]);\n \n session()->flash('message', \n $this->todo_id ? 'Todo successfully updated.' : 'Todo successfully created.');\n \n $this->closeModal();\n $this->resetInputFields();\n }", "public function create(User $user)\n {\n return User::isAdmin($user);\n return $user->tipouser->permission()->get()->contains(\"nomePermissao\",\"Adicionar Eventos\");\n }", "public function create(Request $request, Response $response) {\n $data = $request->getParsedBody();\n $user = $request->getAttribute('user');\n $errors = [];\n // The validate method returns the validator instance\n $validator = $this->validator->validate($request, ValidationRules::todoPost());\n if (!$validator->isValid()) {\n $errors = $validator->getErrors();\n }\n // Check category exists\n if (!$errors) {\n $category = $user->categories()->find($data['category']);\n if (!$category) {\n $errors = ['Category ID invalid'];\n }\n }\n // record creation\n if (!$errors) {\n // Input is valid, so let's do something...\n $todo = $user->todos()->firstOrCreate([\n 'name' => $data['name'],\n 'category_id' => $category->id\n ]);\n return $response->withJson([\n 'success' => true,\n 'id' => $todo->id\n ], 200);\n }\n // error\n return $response->withJson([\n 'success' => false,\n 'errors' => $errors\n ], 400);\n }", "public function creat_new_user()\n {\n \n factory(User::class)->create();\n $respone=$this->post('/admin/category/create',[\n 'name' => 'Tuan',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'active'=>1,\n 'password' => '2', // password\n 'remember_token' => Str::random(10),\n ]);\n // $this->assertCount(8,User::all());\n }", "public function actionCreate($tipo_item, $id_projeto)\n {\n $model = new Item();\n $model->tipo_item = $tipo_item;\n $model->id_projeto = $id_projeto;\n\n $professores = User::find()->where(['professor' => 1, 'administrador' => 0])->orderBy('nome ASC')->all();\n $professores_nomes = ArrayHelper::map($professores, 'nome', 'nome');\n\n if ($model->tipo_item == 2){\n $model->natureza = 'Capital';\n }\n else{\n $model->natureza = 'Custeio';\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->mensagens('success', 'Item criado', 'Item criado com sucesso.');\n return $this->redirect(['index', 'id_projeto' => $model->id_projeto]);\n }\n\n return $this->render('create', [\n 'tipo_item' => $tipo_item,\n 'id_projeto' => $id_projeto,\n 'model' => $model,\n 'professores_nomes' => $professores_nomes,\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 testSuccessfullCreateTodo()\n {\n $response = $this->json('POST', '/todos', [\n 'content' => $this->todo['content'],\n 'is_active' => $this->todo['is_active'],\n 'is_completed' => $this->todo['is_completed'],\n ], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(201);\n $response->seeJsonStructure([\n 'data' => [\n 'content',\n 'is_active',\n 'is_completed',\n 'created_at',\n 'updated_at',\n ],\n ]);\n $response->seeJson([\n 'content' => $this->todo['content'],\n 'is_active' => $this->todo['is_active'],\n 'is_completed' => $this->todo['is_completed'],\n ]);\n }", "public function actionMyTodo($sortType='desc', $sortBy='itemId', $flag=0)\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$keyword = NULL;\n\t\tif(isset($_POST['keyword']))\n\t\t{\n\t\t\t$keyword = $_POST['keyword'];\n\t\t}\n\t\t$sessionArray['mylist']=0;\n\t\t$sessionArray['mytodoStatus']=0;\n\t\tif(isset($_POST['mylist']) && $_POST['mylist']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mylist']=$_POST['mylist'];\n\t\t}\n\t\tif(isset($_POST['mytodoStatus']) && $_POST['mytodoStatus']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mytodoStatus']=$_POST['mytodoStatus'];\n\t\t}\n\t\t$sessionArray['loginId']=Yii::app()->session['loginId'];\n\t\n\t\t$todoItemsObj\t=\tnew TodoItems();\n\t\t$todoListsObj\t=\tnew TodoLists();\n\t\t$usersObj\t=\tnew Users();\n\t\t\n\t\t$data\t=\t$todoItemsObj->getMyToDoItems($sessionArray,LIMIT_10, $sortType, $sortBy,$keyword);\n\t\t$data['myTodoCount']\t\t=\t$todoItemsObj->getMyTodoCount(Yii::app()->session['loginId']);\n\t\t$data['user']\t=\t$usersObj->getUserById(Yii::app()->session['userId'], 'myOpenStatus , myDoneStatus, myCloseStatus');\n\t\t\n\t\tif($sortType == 'desc'){\n\t\t\t$data['sortType']\t=\t'asc';\n\t\t\t$data['img_name']\t=\t'arrow_up.png';\n\t\t} else {\n\t\t\t$data['sortType']\t=\t'desc';\n\t\t\t$data['img_name']\t=\t'arrow_down.png';\n\t\t}\n\t\tif($flag == 0){\n\t\t\t$data['img_name']\t=\t'';\n\t\t}\n\t\t$data['sortBy']\t=\t$sortBy;\n\t\t$data['myLists']\t=\t$todoListsObj->getAllMyList(Yii::app()->session['loginId']);\n\t\tunset($data['myLists']['pendingItems']);\n\t\t$this->renderPartial('myTodoItems', array('data'=>$data));\n\t}", "public function create()\n {\n \treturn View::make(\"admin.UserAdd\");\n }", "public function store()\n\t{\n\t\t$newTodo = new Todo;\n\t\t$todoTitle = Input::get('title');\n\t\tif($todoTitle){\n\t\t\t$newTodo ->title = $todoTitle;\n\t\t\t$newTodo ->completed = 0;\n\t\t\t$newTodo ->save();\n\t\t}\n\t\treturn Response::json(['status' => 'ok'],200);\n\t}", "protected function setupCreateOperation()\n {\n CRUD::setValidation(UserRequest::class);\n\n $this->crud->setOperationSetting('contentClass', 'col-md-12 bold-labels');\n $this->crud->addFields([\n [ \n 'name' => 'name',\n 'label' => 'Name',\n 'type' => 'text',\n ],\n [ \n 'name' => 'password',\n 'label' => 'Password',\n 'type' => 'password',\n ],\n [ \n 'name' => 'email',\n 'label' => 'Email',\n 'type' => 'email',\n ],\n [ // radio\n 'name' => 'type_id', // the name of the db column\n 'label' => 'Type', // the input label\n 'type' => 'radio',\n 'options' => [\n // the key will be stored in the db, the value will be shown as label; \n 0 => \"Collector\",\n 1 => \"Administrator\"\n ],\n 'inline' => true, // show the radios all on the same line?\n ],\n ]);\n }", "public function create_task()\n {\n $title = $this->input->post('title');\n $start_date = $this->input->post('start_date');\n $due_date = $this->input->post('due_date');\n $description = $this->input->post('description');\n $user_id = $this->session->userdata('USER_ID');\n \n // get inputs - task category\n // $task_cat_name = $this->input->post('name');\n $task_cat_name = \"Medical Aid\";\n $task_cat_description =$this->input->post('description');\n \n \n // get inputs - task status\n //$task_status_name = $this->input->post('name');\n $task_status_name = \"Open\";\n $task_status_description =$this->input->post('description');\n \n \n \n $this->db->trans_start();\n \n // new task\n $this->new_task_data($title,$start_date,$due_date,$description, $user_id);\n // new task category\n $this->create_task_category($task_cat_name, $task_cat_description);\n // new task status\n $this->create_task_status($task_status_name, $task_status_description);\n \n // get all tasks\n $this->fetch_all_tasks();\n \n // update task details\n //$this->update_task($id);\n \n // delete task\n // $this->delete_task();\n \n // Complete transaction\n $this->db->trans_complete();\n \n return $this->db->trans_status();\n }", "public function create()\n {\n $objs = DB::table('users')\n ->select(\n 'users.*'\n )\n ->where('users.id', Auth::user()->id)\n ->first();\n // dd($objs);\n $data['objs'] = $objs;\n\n $department = department::all();\n\n $data['department'] = $department;\n $data['method'] = \"post\";\n $data['url'] = url('product_user');\n\n return view('my_pro.create', $data);\n }", "public function create()\n\t{\t\n\t\t$users = User::select('id','fullname')->where('status','=','0')->orderBy('id','DESC')->get();\n\t\treturn View::make('backend.notes.create',compact('users'))->with('title','Yeni Yazılı Notu Ekle');\n\t}", "public function create()\n\t{\n\t\tif(Auth::user()->tipo == 1) {\n\t\t\treturn view('cuentas.create');\n\t\t} \n\t\t\n\t\tif(Auth::user()->tipo == 3) {\n\t\t\t\treturn view('cuentas_asistente.create');\n\t\t} \n\t}", "public function store(Request $request)\n {\n $rules = [\n 'todo_name' => ['required', 'filled']\n ];\n $validate = (new ValidatorHelper)->validate($request->all(), $rules);\n if ($validate !== true) {\n return $validate;\n }\n\n try {\n $user = Auth::user();\n\n $data = [\n 'todo_name' => $request->todo_name\n ];\n $user->todos()->create($data);\n $response = [\n 'ok' => true,\n ];\n return response()->json($response, 200);\n } catch (Exception $e) {\n Log::error($e->getMessage());\n $response = [\n 'ok' => true,\n ];\n return response()->json($response, 200);\n }\n }", "public function create()\n\t{\n\t\t$todos = User::where(\"id\", \"!=\", Auth::user()->id)->get();\n\t\t$grupos = Grupo::all();\n\n\t\treturn View::make(\"mensajes.create\", [\n\t\t\t\"todos\" \t=> $todos,\n\t\t\t\"grupos\"\t=> $grupos\n\t\t\t]);\n\t}", "public function create()\n {\n $types = Type::all();\n return view('users.create',['types' => $types]);\n }", "public function getTodoTypeListAction(){\n /** @var Object_Todo $todo */\n $this->getDeviceSession()->getUserId();\n $todo = new Object_Todo();\n $this->_helper->json($todo->getClass()->getFieldDefinition('Todo_type'));\n }", "public function create()\n {\n $user = Auth::user();\n $id = Auth::id();\n\n $users = User::all();\n\n return view('web.agregar_categorias', ['list' => $users])->with('user_id', $id)->with('type_user', $user->type);\n }", "public function actionCreate() {\n $id_user = Yii::app()->user->getId();\n $model = User::model()->findByPk($id_user);\n $tipo = $model->id_tipoUser;\n if ($tipo == \"1\") {\n $model = new Consultor;\n $modelUser = new User;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Consultor'])) {\n $model->attributes = $_POST['Consultor'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n \n \n \n $senha = uniqid(\"\", true);\n $modelUser->password = $senha;\n $modelUser->username = $_POST['username'];\n $modelUser->email = trim($model->email);\n $modelUser->attributes = $modelUser;\n $modelUser->id_tipoUser = 4;\n $modelUser->senha = '0';\n\n if ($modelUser->save()) {\n\n $model->id_user = $modelUser->id;\n if ($model->save()) {\n $this->redirect(array('EnviaEmail', 'nomedestinatario' => $model->nome, \"emaildestinatario\" => $model->email, \"nomedeusuario\" => $modelUser->username, \"senha\" => $modelUser->password));\n }\n }\n \n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n \n }else {\n $this->redirect(array('User/ChecaTipo'));\n }\n }", "public function store(TodoFormRequest $request)\n {\n $todo = Todo::create($request->all());\n return $todo;\n }", "public function create()\n {\n $task_types = TaskType::all();\n return view('partner/task/task-create', compact('task_types'));\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('users',$input);\n \n $this->response(['User created successfully.'], REST_Controller::HTTP_OK);\n }" ]
[ "0.67349774", "0.6566828", "0.65167344", "0.6447439", "0.64180964", "0.63816625", "0.6286726", "0.6282339", "0.6275527", "0.626662", "0.6209051", "0.6199566", "0.61943555", "0.6192338", "0.6139905", "0.60863745", "0.60259867", "0.6021764", "0.6021764", "0.6021764", "0.59862447", "0.59746766", "0.59462494", "0.594488", "0.5925798", "0.59121144", "0.59109265", "0.590753", "0.59036595", "0.58931196", "0.5864475", "0.586225", "0.5851775", "0.5848918", "0.58464676", "0.58435667", "0.5815951", "0.58095324", "0.5806647", "0.58026195", "0.57950854", "0.57840633", "0.57811505", "0.57809585", "0.57734984", "0.5773027", "0.57705754", "0.57668287", "0.57569754", "0.5753234", "0.57425076", "0.5741418", "0.57329506", "0.5729592", "0.5720428", "0.57193977", "0.57170546", "0.57170546", "0.5713497", "0.5713302", "0.571238", "0.5710775", "0.57053834", "0.56961167", "0.5691195", "0.56896937", "0.5688424", "0.56855303", "0.5679302", "0.5671273", "0.56710136", "0.56699395", "0.56639", "0.5661073", "0.5658855", "0.56550235", "0.5652962", "0.56519073", "0.56510216", "0.5650921", "0.5644331", "0.5632122", "0.5629183", "0.56232435", "0.5618095", "0.5616312", "0.5616257", "0.5614492", "0.56130004", "0.5612577", "0.56104964", "0.5610115", "0.5609295", "0.56041", "0.5603724", "0.5602964", "0.5602261", "0.5600869", "0.5596839", "0.559406" ]
0.8327598
0
this action updates user todos by todo_id todo_type is mandatory field text is optional field
public function updateUserTodoAction() { /** @var Object_Todo $todo */ $data = $this->getRequestData(); if (isset($data['todo_id'])) { $todo = Object_Todo::getById($data['todo_id']); if (!$todo) { $this->setErrorResponse('no Todo with this todo_id!'); } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) { $this->setErrorResponse('you have no rights to change this Todo!'); } else { if (isset($data['todo_type'])) { $todo->setTodo_type($data['todo_type']); } if (isset($data['text'])) { $todo->setText($data['text']); } if (!$todo->save()) { $this->setErrorResponse('cannot update Todo object'); } } } else { $this->setErrorResponse('todo_id is mandatory field for this request!'); } $this->_helper->json($todo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateTodo(Request $request) {\n $user = Auth::user();\n $checkTodoExists = Todo::where('id', $request->id)->exists();\n if ($checkTodoExists) {\n $validTodo = Validator::make($request->all(), [\n 'title' => 'required|string|unique:todo|max:255',\n 'description' => 'required|string|max:1024',\n 'category' => 'required|string|max:255',\n 'due' => 'required|date',\n ]);\n if ($validTodo->fails()) {\n return response()->json([\n \"status\" => \"404\",\n \"error\" => $validTodo->errors()->all()\n ], 404);\n }\n try {\n $data = $request->only('title', 'description', 'category', 'due');\n $todo = Todo::where('user_id', $user->id)->where('id', $request->id)->update($data);\n if ($todo) {\n return response()->json([\n \"status\" => \"200\",\n \"success\" => \"Todo Updated Successfully\",\n // \"data\" => Todo::where('user_id', $user->id)->get()\n ], 201);\n } else {\n return response()->json([\n \"status\" => \"404\",\n \"error\" => 'Could not update, Please try again'\n ], 404);\n }\n } catch (\\Throwable $er) {\n return response()->json([\n \"status\" => \"404\",\n \"error\" => $er\n ], 404);\n }\n } else {\n return response()->json([\n \"status\" => \"404\",\n \"error\" => \"Incorrect Data Provided\",\n ], 404);\n }\n }", "function changeTodoStatus() {\n\n if ( !checkAuthToken() ) return;\n $todoId = isset( $_POST['todoId'] ) ? (int)$_POST['todoId'] : \"\"; \n $newStatus = isset( $_POST['newStatus'] ) ? $_POST['newStatus'] : \"\"; \n\n if ( !$todoId || !$newStatus ) {\n echo \"error\";\n return;\n }\n\n if ( $todo = Todo::getById( (int)$_POST['todoId'] ) ) {\n if ( $todo->userId == User::getLoggedInUser()->id ) {\n $todo->completed = ( $newStatus == \"true\" ) ? 1 : 0;\n $todo->update();\n echo \"success\";\n } else {\n echo \"error\";\n }\n \n } else {\n echo \"error\";\n }\n}", "public function updatetask(Request $request ,$id)\n {\n $user_id = DB::table('todo')->where('id', $id)->pluck('user_id');\n $tasks = DB::table('todo') ->where('id',$id)->update(['user_id' =>$user_id , 'task' => $request->input ('task') ,\n 'description' => $request->input('description')]);\n\n return response()->json('Updated successfully');\n return response()->json($tasks);\n }", "public function update(Request $request, ToDo $toDo)\n {\n }", "public function update(Request $request, ToDo $toDo)\n {\n //\n }", "public function updateToDoList(){\n\t\t$db = $this->db;\n\t\tif(count($this->errors)<1 && is_array($this->toDoList)){ //no error, to do list is an array\n\t\t\t\n\t\t\tforeach($this->toDoList as $item){\n\t\t\t\t$itemUUID = $item[\"itemUUID\"];\n\t\t\t\t$where = array();\n\t\t\t\t$where[] = \"itemUUID = '$itemUUID' \";\n\t\t\t\t$data = array('solr_indexed' => 1);\n\t\t\t\t$db->update('noid_bindings', $data, $where);\n\t\t\t}\n\t\t\t\n\t\t\t$this->totalIndexed = count($this->toDoList);\n\t\t}\n }", "public function update(Request $request, $todo)\n {\n\n $rules = [\n 'todo_name' => ['required', 'filled']\n ];\n $validate = (new ValidatorHelper)->validate($request->all(), $rules);\n if ($validate !== true) {\n return $validate;\n }\n\n try {\n $user = Auth::user();\n $todo = $user->todos()->findOrFail($todo);\n\n $data = [\n 'todo_name' => $request->todo_name\n ];\n\n foreach ($data as $key => $value) {\n $todo->$key = $value;\n }\n $todo->save();\n\n $response = [\n 'ok' => true,\n ];\n return response()->json($response, 200);\n } catch (Exception $e) {\n Log::error($e->getMessage());\n $response = [\n 'ok' => false,\n ];\n return response()->json($response, 200);\n }\n }", "public function update(Request $request, $todo_id)\n {\n try {\n $todo = Todo::findOrFail($todo_id);\n if ($todo->user->is($request->user())) {\n $todo->data = $request->data;\n $saved = $todo->save();\n return response()->json([$saved ? \"Data Updated\" : \"Update Failed\"]);\n }\n return response()->json([\"message\" => \"Not authorized\"], 401);\n } catch (\\Exception $exception) {\n return response()->json([\"error\" => \"Not found!\"], 400);\n }\n }", "public function edit(ToDo $toDo)\n {\n //\n }", "public function updateItemType($user_id)\n {\n $id = $this->input->post('id');\n $data = array(\n 'name' => $this->input->post('name'),\n 'description' => $this->input->post('description'),\n );\n\n $this->db->where('id', $id);\n return $this->db->update('item_type', $data);\n }", "public function update(Request $request, Todo $todo)\n {\n $name = $request->input('name');\n $surname = $request->input('surname');\n $res = Todo::find($request->id);\n $res->name = $name;\n $res->surname = $surname;\n $res->save();\n $request->session()->flash('msg', \"Your data is updated is successfully...\");\n return redirect('todo_show');\n }", "public function update(Request $request, Todo $todo)\n {\n //\n $request->validate([\n 'name' => 'required',\n 'description' => 'required'\n ]);\n\n if($request->has('completed')) {\n $completed = true;\n } else {\n $completed = false;\n }\n\n Todo::where('id', $todo->id)\n ->update([\n 'name' => $request->name,\n 'description' => $request->description,\n 'completed' => $completed\n ]);\n return redirect('/todos')->with('status', 'Data Berhasil Diubah!');\n }", "public function update(Request $request, $type=null,$item_id,$id)\n {\n //\n }", "public function update($id, $type, $data, $userId);", "public function update(Request $request, type_of_user $type_of_user)\n {\n //\n }", "public function getUserTodoByIdAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json($todo);\n }", "public function edit(type_of_user $type_of_user)\n {\n //\n }", "function update_tipo_usuario($id,$params)\n {\n $this->db->where('id',$id);\n return $this->db->update('tipo_usuario',$params);\n }", "public function edit(ListTodo $listTodo)\n {\n //\n }", "public function update(User $user, ToDoList $todolist)\n {\n return $todolist->owner_id == $user->id;\n\n }", "public function update($id)\n\t{\n\t\t$post = array(\n\t\t\t'user_id'=>Input::get('user_id'),\n\t\t\t'type'=>Input::get('type'),\n\t\t\t'note'=>Input::get('note'),\n\t\t\t'info'=>Input::get('info')\n\t\t);\n\t\t\n\t\tNotes::find($id)->update($post);\n\t\treturn Redirect::route('admin.notes.index');\n\t}", "public function update(Request $request, TodoList $todoList)\n {\n //\n }", "public function update(Request $request, $id)\n {\n\n $listid = $request->input('listid');\n\n $newtaskcontent = $request->input('newtaskcontent');\n\n $creatorname = DB::select('select creator_name from lists where id = :list_id',['list_id' => $listid])[0]->creator_name;\n\n if($creatorname==$request->user()->username || $request->user()->usertype == 'admin') {\n\n $updatedtask = DB::update('update list_tasks set task = :newtaskcontent where id = :taskid',['newtaskcontent' => $newtaskcontent, 'taskid' => $id]);\n\n return response($updatedtask, Response::HTTP_OK);\n\n } else {\n\n return response('action not allowed', Response::HTTP_OK);\n\n }\n\n }", "public function put_edit($id) {\n\t\t$ext = 'json';\n\t\t$header = 'application/json';\n\n\t\tif (Request::accepts('text/xml')) {\n\t\t\t$ext = 'xml';\n\t\t\t$header = 'text/xml';\n\t\t}\n\n\t\t$todo = Todo::find($id);\n\t\tif ($todo == NULL) {\n\t\t\tResponse::status('404');\n\t\t\tResponse::send_headers();\n\t\t\treturn;\n\t\t}\n\n\t\tif (Input::get('title'))\n\t\t\t$todo->title = Input::get('title');\n\t\tif (Input::get('task'))\n\t\t\t$todo->task = Input::get('task');\n\t\tif (Input::get('due_date'))\n\t\t\t$todo->due_date = Input::get('due_date');\n\t\tif (Input::get('done'))\n\t\t\t$todo->done = Input::get('done');\n\t\t$todo->save();\n\t\tResponse::status('201');\n\t\tResponse::header('Location', 'todos/' . $todo->id);\n\t\tResponse::send_headers();\n\n\t}", "public function update(User $user, Todo $todo)\n {\n return !$todo->isPrivate()\n || ($todo->created_by === $user->id);\n }", "public function editAction() {\n\t\t// Get all todos\n\t\t$todo = new todo;\n\t\t$todo = $todo->Get($this->get['id']);\n\t\t// Filter by passing an argument as array(array('done', '=', '0')) to\n\t\t// GetList. This would for example only select todos that are done.\n\n\t\t// Get template\n\t\t$template = $this->getTemplate('todo_edit');\n\n\t\t// Render template\n\t\treturn $template->render(array('todo' => $todo));\n\t}", "public function createUserTodoAction()\n {\n $data = $this->getRequestData();\n if (isset($data['todo_type'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/todo/' . $user->getKey() . \"-todo\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-todo\");\n $folder->setParentId(30);\n $folder->save();\n }\n $todo = new Object_Todo();\n $todo->setCreator($user);\n $todo->setTodo_type($data['todo_type']);\n $todo->setText(isset($data['text']) ? $data['text'] : \"\");\n $todo->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . time()));\n $todo->setPublished(true);\n $todo->setParentId($folder->getId());\n if (!$todo->save()) {\n $this->setErrorResponse('cannot save Todo object!');\n }\n } else {\n $this->setErrorResponse('todo_type is mandatory field for this request!');\n }\n\n $this->_helper->json($todo);\n }", "public function update(Request $request, $id)\n {\n $user = \\Auth::user();\n $todo = Todo::where('user_id', $user->id)->where('id', $id)->firstOrFail();\n \n $validator = \\Validator::make($request->all(), [\n 'title' => 'required',\n 'description' => 'required'\n ]);\n\n $status = \"error\";\n $message = \"\";\n $data = null;\n $code = 400;\n\n if($validator->fails()) {\n $errors = $validator->errors();\n $message = $errors;\n } else {\n $todo->title = $request->title;\n $todo->description = $request->description;\n $todo->save();\n \\App\\Events\\LogProcessed::dispatch($todo, 'UPDATE');\n $status = 'success';\n $message = 'update successfull';\n $data = $todo;\n $code = 201;\n }\n\n return response()->json([\n 'status' => $status,\n 'message' => $message,\n 'data' => $data\n ], $code);\n }", "public function deleteUserTodoAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $todo->getCreator()->getId()) {\n $todo->setPublished(false);\n if (!$todo->save()) {\n $this->setErrorResponse('cannot delete Todo object!');\n }\n } else {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function updateToDoList() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $objToDoList->toDoList = $this->toDoList;\n return $objToDoList->updateToDoList();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function update($id, Request $req){\n \n $user = User::find($id);\n\n $user->username = $req->username;\n $user->password = $req->password;\n $user->email = $req->email;\n $user->userType = $req->usertype;\n $user->save();\n\n return redirect('/home/userlist');\n \n }", "public function update($type, $id = null);", "public function update(CreateTodoRequest $request, $id)\n {\n $todo = $this->todoRepository->updateTOdo($request->validated(),$id);\n return $this->sendSuccessResponseWithData($todo,\"Todo updated successfully\");\n }", "public function update(Request $request, TodoList $todolist)\n\t{\n\n\t\t$this->validate($request, [\n 'name' => 'required',\n ]);\n\n\t\t$todolist->update($request->all()); //call update function, and update all that user have request (all input)\n \treturn $this->index()->with('status', 'To Do List updated!');\n\n\n\t}", "public function setToUpdate()\n\t{\n\t\t$this->todo = 2 ;\n\t}", "function editTodo() {\n\n $results = array();\n $results['pageTitle'] = \"Edit To-Do\";\n $results['formAction'] = \"editTodo\";\n $results['errorReturnAction'] = \"listTodos\";\n $results['errorMessage'] = \"To-do not found. Please try again.\";\n\n if ( isset( $_POST['saveChanges'] ) ) {\n\n // User has posted the to-do edit form: save the changes\n if ( !checkAuthToken() ) return;\n\n if ( $todo = Todo::getById( (int)$_POST['todoId'] ) ) {\n if ( $todo->userId == User::getLoggedInUser()->id ) {\n $todo->__construct( $_POST );\n $todo->update();\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n \n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } elseif ( isset( $_POST['cancel'] ) ) {\n\n // User has canceled their edits: return to the to-do list\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n\n } else {\n\n // User has not posted the to-do edit form yet: display the form\n if ( $results['todo'] = Todo::getById( (int)$_GET['todoId'] ) ) {\n if ( $results['todo']->userId == User::getLoggedInUser()->id ) {\n require( TEMPLATE_PATH . \"/editTodo.php\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n }\n}", "public function actionUpdate($id) {\n $id_user = Yii::app()->user->getId();\n $model = User::model()->findByPk($id_user);\n $tipo = $model->id_tipoUser;\n if($tipo == \"1\"){\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['Consultor'])) {\n $model->attributes = $_POST['Consultor'];\n if ($model->save())\n $this->redirect(array('index'));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n } else {\n $this->redirect(array('User/ChecaTipo'));\n }\n \n \n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n \n }", "public function update(Request $request, Todoitem $todoitem)\n {\n $todo = Todoitem::where('id', $request->id)->first();\n if ($todo) {\n $status = $todo->status;\n if ($status == 0) {\n $todo->status = 1;\n } else {\n $todo->status = 0;\n }\n $todo->save();\n return response($todo, 200);\n } else {\n return response(errors);\n }\n }", "public function update($id)\n {\n $todo = Todo::findOrFail($id);\n\n if (Input::has('title'))\n {\n $todo->title = Input::get('title');\n }\n\n if (Input::has('completed'))\n {\n $todo->completed = Input::get('completed');\n }\n\n $todo->completed = Input::get('completed');\n $todo->save();\n }", "public function edit($type=null,$item_id, $id)\n {\n //\n }", "public function update(AerolineasAeropuertosRequest $request, $type, $id)\n {\n try {\n $data = AerolineasAeropuertos::findOrFail($id);\n $data->update($request->all());\n $answer=array(\n \"datos\" => $request->all(),\n \"code\" => 200,\n \"status\" => 500,\n );\n return $answer;\n \n } catch (\\Exception $e) {\n $error = '';\n foreach ($e->errorInfo as $key => $value) {\n $error .= $key . ' - ' . $value . ' <br> ';\n }\n $answer=array(\n \"error\" => $error,\n \"code\" => 600,\n \"status\" => 500,\n );\n return $answer;\n }\n }", "public function update(Request $request, Todo $todo)\r\n {\r\n $todo->update($request->all());\r\n return redirect('/');\r\n }", "public function update(Request $request, UserType $userType)\n {\n //\n }", "public function editTask()\n\t{\n\t\t$jwt = Auth::isValidToken($_COOKIE['SSID']);\n \n if (!$jwt) {\n View::jsonResponse(['status' => 401, 'message' => 'Access denied for you!']);\n }\n\n $update = [ 'task' => $_POST['etask'], 'id' => $_POST['taskid']];\n $update = Validator::cleanData($update);\n\n if (Validator::isEmpty($update)) {\n View::jsonResponse(['status' => 401, 'message' => 'There are empty fields!']);\n }\n\n (new Task())->update($update)->execute();\n\n View::jsonResponse(['status' => 200, 'message' => 'Task edited successful!']); \n \n\t}", "function updateUserController(){\n\t\t\t$this->load->model('User_model');\n\t\t\t$id = $_POST[\"id\"];\n\t\t\t$title = $_POST[\"title\"]; \n\t\t\t$city = $_POST[\"city\"]; \n\t\t\t$country = $_POST[\"country\"];\n\t\t\t$phone = $_POST[\"phone\"];\n\t\t\t$bio = $_POST[\"bio\"];\n\t\t\t$interest = $_POST[\"interest\"];\n\t\t\tif($this->User_model->updateUserModel($id,$title,$city,$country,$phone,$bio,$interest)){\n\t\t\t \t$this->userTimeline($id, 'Bio', 'You updated your Bio and Interests', '');\n\t\t\t\techo 'added';\n\t\t\t}else{\n\t\t\t\techo 'Failed';\n\t\t\t}\n\t\t\t \n\t\t}", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function update(Request $request, $id)\n {\n $todo=Todo::find($id);\n $todo->todo=$request->todo;\n $todo->save();\n Session::flash('success','Your todo updated successfully');\n return redirect('/todo');\n }", "public function update($id)\n\t{\n\n\t\t$todo = Todo::find($id);\n\t\t$todoTitle = Input::get('title');\n\t\tif($todoTitle){\n\t\t\t$todo ->title = $todoTitle;\n\t\t\t$todo ->save();\n\t\t}\n\t\treturn Response::json(['status' => 'ok'],200);\n\t}", "public function update($id, Request $request)\n {\n \n // define rules\n $rules = array (\n 'name' => array('required','unique:todo_lists')\n );\n\n // pass input validator\n $validator = Validator::make($request->all(), $rules);\n\n // test if input is fails\n if ($validator->fails() ) {\n return redirect()->route('todos.edit', $id)->withErrors($validator)->withInput();\n }\n\n $name = $request->input('name');\n $list = TodoList::findOrFail($id);\n $list->name = $name;\n $list->update();\n return redirect()->route('todos.index')->withMessage('Successfully list was updated');\n }", "private function _addOrEdit($user,$type= 'add') {\n \n $user_id = $user['id'];\n\n //Get the creator's id\n if(isset($this->request->data['user_id'])){\n if($this->request->data['user_id'] == '0'){ //This is the holder of the token - override '0'\n $this->request->data['user_id'] = $user_id;\n }\n }\n\n $check_items = array(\n\t\t\t'available_to_siblings',\n\t\t\t'suffix_permanent_users',\n\t\t\t'suffix_vouchers',\n 'suffix_devices'\n\t\t);\n\t\t\n foreach($check_items as $i){\n if(isset($this->request->data[$i])){\n $this->request->data[$i] = 1;\n }else{\n $this->request->data[$i] = 0;\n }\n }\n \n if($type == 'add'){ \n $entity = $this->{$this->main_model}->newEntity($this->request->data());\n }\n \n if($type == 'edit'){\n $entity = $this->{$this->main_model}->get($this->request->data['id']);\n $this->{$this->main_model}->patchEntity($entity, $this->request->data());\n }\n \n if ($this->{$this->main_model}->save($entity)) {\n $this->set(array(\n 'success' => true,\n '_serialize' => array('success')\n ));\n } else {\n $message = 'Error';\n \n $errors = $entity->errors();\n $a = [];\n foreach(array_keys($errors) as $field){\n $detail_string = '';\n $error_detail = $errors[$field];\n foreach(array_keys($error_detail) as $error){\n $detail_string = $detail_string.\" \".$error_detail[$error]; \n }\n $a[$field] = $detail_string;\n }\n \n $this->set(array(\n 'errors' => $a,\n 'success' => false,\n 'message' => array('message' => __('Could not create item')),\n '_serialize' => array('errors','success','message')\n ));\n }\n\t}", "public function update (TodoUpdateRequest $request, $id)\n {\n ToDo::where('id', $id)\n ->update([\n 'todo' => $request->todo,\n 'priority' => $request->priority,\n 'done' => $request->done\n ]);\n }", "public function actionMenutouserupdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post())) {\r\n \tif(is_array($model->menulist))\r\n \t\t$model->menulist = implode(',', $model->menulist);\r\n \tif(is_array($model->plate))\r\n \t\t$model->plate = implode(',',$model->plate);\r\n \tif(is_array($model->businessmenu))\r\n \t\t$model->businessmenu = implode(',',$model->businessmenu);\r\n \tif(is_array($model->searchmenu))\r\n \t\t$model->searchmenu = implode(',', $model->searchmenu);\r\n if(is_array($model->auditinguser))\r\n $model->auditinguser = implode(',', $model->auditinguser);\r\n \t$model->save();\r\n return $this->redirect(['menutouserview', 'id' => $model->id]);\r\n } else {\r\n return $this->render('menutouserupdate', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required',\n 'sdate' => 'required',\n 'edate' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect(route('todo.edit'))\n ->withInput()\n ->withErrors($validator);\n }\n\n $todo = Todo::find($id);\n $todo->name = $request->name;\n $todo->user_id = $request->user()->id;\n $todo->content = $request->content;\n $todo->level = $request->level;\n $todo->category_id = $request->category_id;\n $todo->sdate = $request->sdate;\n $todo->stime = $request->stime;\n $todo->edate = $request->edate;\n $todo->etime = $request->etime;\n $todo->repeat = $request->repeat;\n $todo->save();\n\n return redirect(route('todo.index'));\n }", "public function update(Request $request, Todo $todo)\n {\n if ($request->ajax()) {\n if ($todo->done) {\n $todo->done = false;\n $todo->update();\n return response()->json(['response' => 'undone']);\n } else {\n $todo->done = true;\n $todo->update();\n return response()->json(['response' => 'done']);\n }\n }\n return response()->json(['response' => 'failure']);\n }", "public function update(User $user, Tareas $tareas)\n {\n\n }", "public function update_user($data) {\n\t\t$user_data=array('user_type' =>$data['user_type'] ,\n\t\t\t'first_name' =>$data['first_name'] ,\n\t\t\t'last_name' =>$data['last_name'] ,\n\t\t\t'status' =>$data['status'] \n\t\t);\n\t\t$this->db->where('id',$data['id']);\n\t\treturn $this->db->update('users',$user_data);\n\t}", "public function update(Request $request)\n {\n foreach ($request->id as $value) {\n $todo = Todo::find($value);\n $todo->completed = 1;\n $todo->save();\n }\n return redirect('todo/index');\n }", "public function updateTask(){\n $input_data = $this->_cleanInputs($_POST);\n if(sizeof($input_data)){\n $this->response = verifyCSRFToken();\n if($this->response->status === false){\n return $this->sendResponse($this->response);\n }\n //{\"tasks_name\":\"\",\"tasks_description\":\"\",\"roles\":[\"1\",\"12\",\"2\",\"18\",\"3\"]}\n $this->response = $this->validateTask($input_data,\"update\");\n if($this->response->status === false){\n return $this->sendResponse($this->response);\n }\n \n $task = new Tasks();\n $task = $task->find($input_data['tasks_id']);\n $task->tasks_name = $input_data['tasks_name'];\n $task->tasks_description = $input_data['tasks_description'];\n $user_info = $_SESSION['user_info'];\n $task->user_id = $user_info['user_id'];\n $task::$conn->beginTransaction();\n $this->response = $task->save();\n if($this->response->status === true){\n //Map roles with the tasks\n $roles = isset($input_data['roles']) && is_array($input_data['roles'])?$input_data['roles']:array();\n $this->response = $task->mapTaskWithRoles($task::$conn,$task->tasks_id, $roles);\n if($this->response->status === false){\n $task::$conn->rollback();\n $this->response->msg = \"Failed to update.\";\n }\n else{\n $task::$conn->commit();\n $this->response->msg = \"Successfully updated.\";\n }\n }\n \n }\n else{\n $this->response->set([\n \"status\"=>false,\n \"msg\"=>\"No input parameter.\",\n \"status_code\"=>403\n ]);\n }\n return $this->sendResponse($this->response);\n }", "public function edit_post($user_id)\n {\n $auth_token = $this->post('auth_token');\n //$user_id = $this->post('user_id');\n $userData['fname'] = $this->post('fname');\n $userData['lname'] = $this->post('lname');\n $userData['dob'] = $this->post('dob');\n $userData['gender'] = $this->post('gender'); /* Male/Female */\n $userData['address'] = $this->post('address');\n $userData['contact_no'] = $this->post('contact_no');\n $userData['about'] = $this->post('about');\n $userData['updated_date']= time();\n \n //checking auth token\n $record = $this->artists_model->is_valid_token($user_id,$auth_token);\n if($record == 0){\n //redirect to login\n $this->response([\n 'status' => FALSE,\n 'message' => 'Unauthorize user,please login again',\n 'status_code' => 401\n ], REST_Controller::HTTP_UNAUTHORIZED); // UNAUTHORIZED (401) being the HTTP response code\n }\n \n \n \n if( $user_id != '' && $userData['fname'] != '' && $userData['lname'] != '' && $userData['dob'] != '' && $userData['gender'] != '' \n && $userData['address'] != '' && $userData['contact_no'] != '' && $userData['about'] != '')\n {\n $record = $this->artists_model->update_user($user_id,$userData);\n $user_data = $this->artists_model->get_user_details($user_id);\n $message = [\n 'status' => TRUE,\n 'message' => 'User information updated successfully',\n 'user_data' => $user_data,\n 'status_code'=> 200 \n ];\n $this->set_response($message, REST_Controller::HTTP_OK);\n }\n else\n {\n $message = [\n 'status' => FALSE,\n 'message' => 'User information not updated,please enter required fields properly',\n 'status_code'=> 400\n ];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); \n }\n }", "public function update(Request $request, $id)\n {\n $user = \\Auth::user()->user_red;\n\n $Tipo = Tipo::find($request->id);\n $Tipo ->nombre = $request ->nombre;\n $Tipo ->estado = $request ->estado;\n $Tipo ->justificacion = $request ->justificacion;\n $Tipo ->registro = $user;\n $Tipo -> save();\n\n if($request ->estado==\"Inactivo\"){\n $Proceso=Proceso::orderBy('id','ASC')\n ->select('procesos.*')\n ->where('procesos.FK_Tipo', '=', $request->id)\n ->get();\n\n $Usuario=Usuario::orderBy('id','ASC')\n ->select('users.*')\n ->where('users.FK_Tipo', '=', $request->id)\n ->get();\n\n foreach ($Proceso as $proceso){\n $Proceso = Proceso::find($proceso->id);\n $Proceso ->estado = $request ->estado;\n $Proceso ->justificacion = \"El tipo asociado ha sido inactivado por \".$request ->justificacion;\n $Proceso->save();\n }\n\n foreach ($Usuario as $usuario){\n\n $Responsable = Usuario::find($usuario->id);\n $Responsable ->state = $request ->estado;\n $Responsable ->justificacion = \"El tipo asociado ha sido inactivado por \".$request ->justificacion;\n $Responsable ->registro = $user;\n $Responsable->save();\n }\n\n }else {\n\n $Proceso = Proceso::orderBy('id', 'ASC')\n ->select('procesos.*')\n ->where('procesos.FK_Tipo', '=', $request->id)\n ->get();\n\n $Usuario = Usuario::orderBy('id', 'ASC')\n ->select('users.*')\n ->where('users.FK_Tipo', '=', $request->id)\n ->get();\n\n foreach ($Proceso as $proceso) {\n $Proceso = Proceso::find($proceso->id);\n $Proceso->estado = $request->estado;\n $Proceso->justificacion = \"\";\n $Proceso->save();\n }\n\n foreach ($Usuario as $usuario) {\n\n $Responsable = Usuario::find($usuario->id);\n $Responsable->state = $request->estado;\n $Responsable->justificacion = \"\";\n $Responsable ->registro = $user;\n $Responsable->save();\n }\n }\n\n return redirect()->back();\n\n }", "protected function update(){\n // als er geen gebruiker is ingelogd, check session.. daarna maak session message\n if(!isset($_SESSION['isLoggedIn'])){\n $_SESSION['message'] = \"<div class=\\\"alert alert-dismissible alert-danger\\\">\n <button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\"></button>\n <strong>U moet ingelogd zijn om deze pagina te bezoeken! </strong>\";\n header('Location: '. ROOT_PATH . 'todos/all');\n }\n $viewmodel = new TodoModel();\n $this->returnView($viewmodel->update(),true);\n }", "public function update_user(Request $id)\n {\n \tif(Auth::check()==null){\n \t\treturn redirect('/');\n\t }\n\t elseif(Auth::check()){\n\t \tif(Auth::user()->usertype!=='admin'){\n\t \t\treturn redirect('/');\n\t \t}\n\t }\n\n\n \t$get_user_id = $id->id;\n\n \t// Validation rules\n \t$rules = [\n \t\t\t'name' => 'required|unique:users,name,'.$get_user_id, // Where name is unique to the user's id\n 'email' => 'required|email|unique:users,email,'.$get_user_id, // Where email is unique to the user's id\n 'usertype' => 'required',\n 'verified' => 'required',\n ];\n\n // Validate\n $this->validate($id, $rules);\n\n // Update users table with input from the edit-user form\n \tDB::table('users')->where('id', '=', $get_user_id)->update([\n \t\t'name' => Input::get('name'),\n \t\t'email' => Input::get('email'),\n \t\t'usertype' => Input::get('usertype'),\n \t\t'verified' => Input::get('verified'),\n \t]);\n\n \treturn redirect('admin-dashboard')->with('user_updated_msg', 'Record updated successfully');\n }", "public function update(Request $request, TodoTask $todotask): TaskResource\n {\n //validate the requests\n $request->validate([\n 'name' => 'required',\n 'todo_list_id' => 'required',\n ]);\n //update a user\n $todotask->update($request->all());\n return new TaskResource($todotask);\n }", "public function actionUpdate($user_id, $id)\n {\n\n if (!Yii::$app->user->can('seeAllNotes')) $user_id=Yii::$app->user->getId() ;\n $model = $this->findModel($user_id, $id);\n \n if (Yii::$app->user->can('updateNote')){\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'user_id' => $model->user_id, 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);}else return $this->goBack();\n }", "public function update(TodoRequest $request, $todo=null)\n {\n $validated = $request->validated();\n try {\n // if the returned instance wasn't found\n if(\\is_null($todo)) {\n return $this->resourceNotFound();\n }\n\n // update the Todo\n $todo->update($validated);\n \n return $this->sendResponse(new TodoResource($todo), 'Successfully updated Todo');\n \n } catch (\\Throwable $th) {\n \\Log::error($th);\n return $this->sendServerError('Unable to update Todo resource');\n }\n }", "public function UserListChangeStatus(): void{\n \n if(!ArtworkVerifier::setStatusList($_POST) || !Session::isLogin()){\n exit;\n }\n \n if(isset(UserList::where('user_list.user_id', Session::getUser()['id'])->where('user_list.artwork_id', $_POST['artwork_id'])->getOne()->id)){\n UserList::values([ 'user_list.status' => $_POST['status'] ])\n ->where('user_id' ,Session::getUser()['id'])\n ->where('artwork_id', $_POST['artwork_id'])\n ->update();\n exit;\n }\n }", "public function edit(TodoList $todoList)\n {\n //\n }", "public function edit(TodoList $todoList)\n {\n //\n }", "public function update(SaveTodoRequest $request, $id)\n {\n $todo = Todo::findOrFail($id);\n\n $todo->title = $request->title;\n $todo->priority = $request->priority;\n $todo->completed = $request->completed;\n\n $this->authorize('update', $todo);\n\n $todo->save();\n\n session()->flash('succes', 'The TODO item was succesfully added');\n\n return redirect(route('index'));\n }", "public function update($id, $data) {\r\n $model = TodoItemModel::findById($id);\r\n $model->setTitle($data[\"title\"]);\r\n $model->setText($data[\"text\"]);\r\n $model->save();\r\n return $this->redirect('/');\r\n }", "public function edit($id)\n\t{\n\t\tif(!in_array(11, $this->privsArray))\n\t\t\treturn redirect()->back();\n\t\t$user = User::find($id);\n\t\t$userCategories = $user->categories;\n\t\t$uCat = [];\n\t\tforeach ($userCategories as $userCategory) {\n\t\t\t$uCat[] = $userCategory->id;\n\t\t}\n#\t\t$types = User_Type::lists('type','id');\n\t\t$types = [ 0 => \\Lang::get('messages.select')];\n\t\tswitch (Auth::user()->user_type_id) {\n\t\t\tcase 1:\n\t\t\t\t\t $types += User_Type::orderBy('type', 'DESC')->where('id', '!=', 5)->lists('type','id');\n break;\n case 2:\n if($user->user_type_id == 6){\n $types += User_Type::where('id', 6)->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');}\n else{\n $types += User_Type::whereIn('id', [3,8])->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');\n }\n break;\n case 3: \n \n $types += User_Type::where('id', 6)->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');\n break;\n case 8:\n if($user->user_type_id == 6){\n $types += User_Type::where('id', 6)->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');}\n else{\n $types += User_Type::where('id', 3)->where('id', '!=', 5)->orderBy('type', 'DESC')->lists('type','id');\n }\n \n break;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\t\t// $categories = Category::lists('name','id');\n\t\t// return view('user.edit_user', compact('user','types', 'categories', 'uCat'));\n\n\t\t$categories = Category::lists('name','id');\n\t\t$uUnCat = [];\n\t\t$uUnCat = DB::table('category_user')\n\t\t\t\t\t->distinct()\n ->where('user_id', '<>', $id)\n ->lists('category_id');\n\t\tforeach ($uUnCat as $value) {\n\t\t\tunset($categories[$value]);\n\t\t}\n\t\treturn view('user.edit_user', compact('user','types', 'categories', 'uCat'));\n\n\n\n\t}", "public static function Update($context,$id,$nombre,$apellidos,$telefono){\n //si Retorna 0 error no controlado\n \n $statment = $context->prepare(\"UPDATE usuarios SET nombre= :nombre,apellidos=:apellidos,telefono=:tele WHERE id_usuario= :id\");\n $statment->bindParam(':id', $id);\n $statment->bindParam(':nombre', $nombre);\n $statment->bindParam(':apellidos', $apellidos);\n $statment->bindParam(':tele', $telefono);\n $statment->execute();\n $count=$statment->rowCount();\n if($count == 1){\n return true;\n }\n else{\n return false;\n }\n }", "function editUserAction()\n {\n $userRp = new UserRepository();\n $validateF = new ValidateFunctions();\n $user = $userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n if ($user != 0) {\n $obj_array = json_decode($user[3], true);\n $pass = $obj_array['user_password'];\n $addedBy = $obj_array['user_added'];\n\n if (!empty($_POST)) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email']];\n\n if ($_SESSION['id'] == $_GET['id']) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email'], $_POST['user_password'], $_POST['user_confirm']];\n }\n if ($this->checkUserInfo($_POST, $_FILES, $requiredFields)) {\n $file = $this->uploadUserImage($_FILES);\n $userInfo = $this->buildUserObject($_POST, $file, $pass, $addedBy);\n $email = $validateF->sanitize($_POST['user_email']);\n $this->updateUserToDatabase($userInfo, $validateF->sanitize($_GET['id']), $email);\n $_SESSION['success'] = ['User edited successfully.'];\n header('Location:index.php?action=index');\n } else{\n header('Location:index.php?action=index');\n }\n } else{\n $modelF = new ModelFunctions();\n $modelF->getAddUserForm();\n }\n } else {\n $_SESSION['error'] = ['User not found.'];\n header('Location:index.php?action=adminUsers');\n }\n\n }", "public function actionMyTodo($sortType='desc', $sortBy='itemId', $flag=0)\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$keyword = NULL;\n\t\tif(isset($_POST['keyword']))\n\t\t{\n\t\t\t$keyword = $_POST['keyword'];\n\t\t}\n\t\t$sessionArray['mylist']=0;\n\t\t$sessionArray['mytodoStatus']=0;\n\t\tif(isset($_POST['mylist']) && $_POST['mylist']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mylist']=$_POST['mylist'];\n\t\t}\n\t\tif(isset($_POST['mytodoStatus']) && $_POST['mytodoStatus']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mytodoStatus']=$_POST['mytodoStatus'];\n\t\t}\n\t\t$sessionArray['loginId']=Yii::app()->session['loginId'];\n\t\n\t\t$todoItemsObj\t=\tnew TodoItems();\n\t\t$todoListsObj\t=\tnew TodoLists();\n\t\t$usersObj\t=\tnew Users();\n\t\t\n\t\t$data\t=\t$todoItemsObj->getMyToDoItems($sessionArray,LIMIT_10, $sortType, $sortBy,$keyword);\n\t\t$data['myTodoCount']\t\t=\t$todoItemsObj->getMyTodoCount(Yii::app()->session['loginId']);\n\t\t$data['user']\t=\t$usersObj->getUserById(Yii::app()->session['userId'], 'myOpenStatus , myDoneStatus, myCloseStatus');\n\t\t\n\t\tif($sortType == 'desc'){\n\t\t\t$data['sortType']\t=\t'asc';\n\t\t\t$data['img_name']\t=\t'arrow_up.png';\n\t\t} else {\n\t\t\t$data['sortType']\t=\t'desc';\n\t\t\t$data['img_name']\t=\t'arrow_down.png';\n\t\t}\n\t\tif($flag == 0){\n\t\t\t$data['img_name']\t=\t'';\n\t\t}\n\t\t$data['sortBy']\t=\t$sortBy;\n\t\t$data['myLists']\t=\t$todoListsObj->getAllMyList(Yii::app()->session['loginId']);\n\t\tunset($data['myLists']['pendingItems']);\n\t\t$this->renderPartial('myTodoItems', array('data'=>$data));\n\t}", "private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}", "function Todo() {\n\t\t$query_string = Request::$GET;\n\t\t$global_string = $this->buildQuery($query_string);\n\n\t\t// we only want to do this is we have a valid, single user. \n\t\t$show_ical = FALSE;\n\n\t\t//Display User select tool if user has admin permissions\n\t\t$globalUser = '';\n\t\tif ($this->User->HasModuleItemAccess('administration', CU_ACCESS_ALL, CU_ACCESS_READ)) {\n\n\t\t\t// $actualUserID = $this->User->ID;\n\t\t\t// try to get a imitation user form the request string.\n\t\t\t$userID = Request::get('userID', Request::R_INT);\n\n\t\t\t// userID can be 'all'\n\t\t\tif (($userID == null) && (Request::get('userID') == 'all'))\n\t\t\t{\n\t\t\t\t$userID = 'all';\n\t\t\t}\n\n\t\t\t// else, check if we have a imitation user in the session object.\n\t\t\tif (!$userID) {\n\t\t\t $userID = $this->Session->Get('springboardID');\n\t\t\t}\n\t\t\t\n\t\t\t// Create Temp user for creating correct permissions\n\t\t\tif ($userID) {\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\n\t\t\t\tif ($userID == 'all')\n\t\t\t\t{\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->ID = null;\n\t\t\t\t} else {\n\t\t\t\t\t$show_ical = TRUE;\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->Initialise($userID, $this->DB);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->TempUser->ID = $this->User->ID;\n\t\t\t\t$userID = $this->User->ID;\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t}\n\t\t\t\n\t\t\t$globalUser = '<label>' . MSG_USER_TO_SHOW . '</label>'\n\t\t\t\t\t\t.'<select name=\"UserID\" class=\"TaskUpdate_dd\" id=\"userToShowFilter\">';\n\n\t\t\t$SQL = sprintf(SQL_GET_USER_LIST);\n\t\t\t$userList = $this->DB->Query($SQL);\n\t\t\tif ($userList) {\n\t\t\t\t// first add in a \"All users option\"\n\t\t\t\t$globalUser .= '<option value=\"all\"'\n\t\t\t\t. (($this->TempUser->ID == null) ? ' selected' : '') . '>'\n\t\t\t\t. MSG_SHOW_ALL . '</option>';\n\t\t\t \n\t\t\t\tfor ($i = 0; $i < count($userList); $i++) {\n\t\t\t\t\t$globalUser .= '<option value=\"' . $userList[$i]['ID'] . '\"'\n\t\t\t\t\t. ($this->TempUser->ID == $userList[$i]['ID'] ? ' selected' : '') . '>'\n\t\t\t\t\t. $userList[$i]['FirstName'].' '.$userList[$i]['LastName'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$globalUser .= '</select>';\n\t\t\t$tmplDash['globalUser'] = $globalUser;\n\n\t\t} else {\n\t\t\t// don't allow non-admins to edit the user they view for.\n\t\t\t$tmplDash['globalUser'] = '';\n\t\t\t$userID = $this->User->ID;\n\t\t\t$show_ical = TRUE;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t}\n\n\t\t$filter_array = array('mytasks','owed','all');\n\t\t$filter_display = array(MSG_MINE,MSG_OWED,MSG_ALL);\n\t\tfor ($i = 0, $filteroptions = null, $filtercount = count($filter_array); $i < $filtercount; $i++) \n\t\t{\n\t\t\t$filteroptions .= sprintf('<option value=\"%s\" %s>%s</option>', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_array[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($_GET['action'] == $filter_array[$i]) ? ' SELECTED' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_display[$i]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['showfilter'] = '<label>'.MSG_SHOW_THESE_TASKS.'</label>'\n\t\t\t.'<select id=\"showTheseTasksFilter\">'.$filteroptions.'</select>';\n\n\t\t$range_array = array('all' => '{MSG_ALL}', \n\t\t\t\t\t\t\t\t\t\t\t\t'lastweek' => '{MSG_LAST_WEEK}', \n\t\t\t\t\t\t\t\t\t\t\t\t'thisweek' => '{MSG_THIS_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'nextweek' => '{MSG_NEXT_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'today' => '{MSG_TODAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'yesterday' => '{MSG_YESTERDAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'lastmonth' => '{MSG_LAST_MONTH}',\n\t\t\t\t\t\t\t\t\t\t\t\t'thismonth' => '{MSG_THIS_MONTH}', \n\t\t\t\t\t\t\t\t\t\t\t\t'nextmonth' => '{MSG_NEXT_MONTH}'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\tforeach($range_array as $key => $value) \n\t\t{\n\t\t\t$rangeoptions .= sprintf('<option value=\"%s\" %s>%s</option>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$key, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($key == $query_string['show']) ? 'selected' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['period'] = '<label>'.MSG_PERIOD_TO_SHOW.'</label>\n\t\t\t\t\t\t\t <select id=\"periodToShowFilter\">'.$rangeoptions.'</select>';\n\n\t\t$URI = split (\"index\\.php\",Request::server(SCRIPT_NAME_VAR));\n\t\t// Create validity key\n\t\t\n\t\tif ($show_ical == TRUE)\n\t\t{\n\t\t $this->KeyUser =& new User();\n\t\t $this->KeyUser->Initialise($userID, $this->DB);\n\t\t $key = substr(md5($this->KeyUser->Fullname . $this->KeyUser->PasswordHash), 2, 8);\n\t\t $modAction[] = '<a href=\"webcal://' . Request::server(SERVER_NAME_VAR) . $URI[0] . 'system/ical_springboard.php?show=' . $query_string['show'] \n\t\t\t. '&completed=' . $query_string['completed'] \n\t\t\t. '&action=' . $query_string['action'] \n\t\t\t. '&key=' . $key \n\t\t\t. '&userid=' . $userID . '\">'.MSG_SYNC_TO_ICAL.'</a>';\n\t\t}\n\n\t\t$modAction[] = '<a id=\"dash-toggler\" href=\"#\" onclick=\"toggleDash(); return false;\">'.MSG_SHOW_DASH.'</a>';\n\t\t$this->setDash($this->getTemplate(\"dashBlock\", $tmplDash));\n\n\t\t// pick whether to show completed or active\n\t\t$completed = (isset($query_string['completed']) && ($query_string['completed'] == 1));\n\t\tif ($completed)\n\t\t{\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard\">'.MSG_VIEW_ACTIVE.'</a>';\n\t\t} else {\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard&completed=1\">'.MSG_VIEW_COMPLETED.'</a>';\n\t\t}\n\n\t\t$this->CreateTabs('todo');\n\t\t$tmpl['tasklist'] = $this->TaskList($query_string['action'], $userID);\n\n\t\t// Emulate the task view screen.\n\t\tif (Request::get('taskid', Request::R_INT)) {\n\t\t\tResponse::addToJavascript('auto_open_task', TRUE);\n\t\t\tResponse::addToJavascript('item_ids', array(\n\t\t\t\t'project_id' => Request::get('projectid', Request::R_INT),\n\t\t\t\t'task_id' => Request::get('taskid', Request::R_INT),\n\t\t\t\t'comment_id' => Request::get('commentid', Request::R_INT),\n\t\t\t));\n\t\t}\n\n\t\t// this is here to keep template happy.\n\t\t// remove when we are sure that nobody else calls the todo template.\n\t\t$tmpl['script'] = ''; \n\n\t\t$this->setTemplate('todo', $tmpl);\n\n\t\t$this->SetModule(MSG_TODO, $modAction);\n\t\t$this->Render();\n\t}", "public function update($user)\n {\n }", "public function change_todo_status($id, $status)\r\n {\r\n $this->db->where('todoid', $id);\r\n $this->db->where('staffid', get_staff_user_id());\r\n $date = date('Y-m-d H:i:s');\r\n $this->db->update('tbltodoitems', array(\r\n 'finished' => $status,\r\n 'datefinished' => $date\r\n ));\r\n if ($this->db->affected_rows() > 0) {\r\n return array(\r\n 'success' => true\r\n );\r\n }\r\n return array(\r\n 'success' => false\r\n );\r\n }", "public function update(Request $request, $id)\n {\n $v = Validator::make($request->all(), [\n // user\n 'type' => 'required|integer|not_in:--- Escolha um Type ---',\n 'name' => 'required|string|min:4|max:50|unique:users,name,'.$id,\n 'email' => 'required|string|email|min:7|max:50|unique:users,email,'.$id,\n ]);\n \n if($v->fails()) {\n return back()->with('message', 'Confira os dados informados!')->withErrors($v);\n }\n \n $user = User::find($id);\n $user->name = $request->name;\n $user->email = $request->email;\n $user->type_id = $request->type;\n if($user->update()){\n return redirect('/users')->with('success','Alteração realizada com sucesso!');\n } else {\n return back()->with('message', 'Falha no cadastro!');\n }\n }", "public function update(Request $request, $id)\n {\n try {\n $novoDados = $this->tipoUser->find($id);\n $novoDados->nome = $request->nome;\n if($novoDados->save()){\n $this->tipoPermissao->where('user_id',$id)->delete();\n foreach ($request->permissao as $permissao) {\n $tipoPermissao = new Permissao;\n $tipoPermissao->permissao = $permissao['permissao'];\n $tipoPermissao->navegacao = $permissao['navegacao'];\n $tipoPermissao->user_id = $id;\n $tipoPermissao->save();\n }\n }\n return response()->json('Editado com Sucesso');\n } catch (Exception $e) {\n return response()->json($e,500);\n }\n }", "public function update(Request $request, $id)\n {\n //\n $user = User::findOrFail($request->user_id);\n $user->cedula = $request->cedula_usuario;\n $user->nombres = $request->nombres_usuario;\n $user->apellidos = $request->apellidos_usuario;\n $user->iniciales = $request->iniciales_usuario;\n $user->telefono = $request->telefono_usuario;\n $user->email = $request->email_usuario;\n $user->permisos = array([\n 'crear_clientes' => isset($request->crear_clientes) ? 'true' : 'false',\n 'ver_clientes' => isset($request->ver_clientes) ? 'true' : 'false',\n 'crear_docs' => isset($request->crear_docs) ? 'true' : 'false',\n 'asignar_metas' => isset($request->asignar_metas) ? 'true' : 'false',\n 'ver_progresos' => isset($request->ver_progresos) ? 'true' : 'false',\n 'ver_comisiones' => isset($request->ver_comisiones) ? 'true' : 'false',\n 'resumen_comisiones' => isset($request->resumen_comisiones) ? 'true' : 'false',\n 'clientes_cerrados' => isset($request->clientes_cerrados) ? 'true' : 'false',\n 'asignar_facturas' => isset($request->asignar_facturas) ? 'true' : 'false',\n 'control_pagos' => isset($request->control_pagos) ? 'true' : 'false',\n 'agendar_servicios' => isset($request->agendar_servicios) ? 'true' : 'false',\n 'horarios_tecnicos' => isset($request->horarios_tecnicos) ? 'true' : 'false',\n 'listado_servicios' => isset($request->listado_servicios) ? 'true' : 'false',\n 'recepcion_docs' => isset($request->recepcion_docs) ? 'true' : 'false',\n 'inventario_docs' => isset($request->inventario_docs) ? 'true' : 'false',\n 'reporte_docs' => isset($request->reporte_docs) ? 'true' : 'false',\n 'crear_novedades' => isset($request->crear_novedades) ? 'true' : 'false',\n 'crear_tecnicos' => isset($request->crear_tecnicos) ? 'true' : 'false',\n 'crear_usuarios' => isset($request->crear_usuarios) ? 'true' : 'false',\n 'reporte_ganancias' => isset($request->reporte_ganancias) ? 'true' : 'false',\n 'gestion_productos' => isset($request->gestion_productos) ? 'true' : 'false',\n 'gastos' => isset($request->gastos) ? 'true' : 'false'\n ]);\n\n if($request->hasFile('foto_usuario')){\n $user->foto = $request->file('foto_usuario')->store('public');\n }\n\n if(isset($request->contrasena_user) && $request->contrasena_user){\n $user->password = bcrypt($request->contrasena_user);\n }\n $user->cargo_id = $request->cargo_usuario;\n switch ($request->cargo_usuario) {\n case '1':\n $user->area_id = '1';\n break;\n case '2':\n $user->area_id = '2';\n break;\n case '3':\n $user->area_id = '3';\n break;\n case '4':\n $user->area_id = '1';\n break;\n case '5':\n $user->area_id = '4';\n break;\n case '6':\n $user->area_id = '5';\n break;\n default:\n $user->area_id = '6';\n break;\n }\n $user->save();\n\n \\Flash::success('Usuario actualizado correctamente.')->important();\n return Redirect::to('/users');\n }", "public function update_user(Request $request){\n Session::put('menu_item_parent', 'users');\n Session::put('menu_item_child', '');\n Session::put('menu_item_child_child', '');\n $user = User::where('userIdx', $request->userIdx)->get()->first();\n\n if($user){\n $data = array();\n $data['firstname'] = $request->firstname;\n $data['lastname'] = $request->lastname;\n $data['email'] = $request->email;\n $data['jobTitle'] = $request->jobTitle;\n if($request->businessName2 == \"Other industry\") {\n $data['businessName'] = $request->businessName;\n } else {\n $data['businessName'] = $request->businessName2;\n }\n if($request->role2 == \"Other\") {\n $data['role'] = $request->role;\n } else {\n $data['role'] = $request->role2;\n }\n User::where('userIdx', $request->userIdx)->update($data);\n\n $logDetail = 'Updated: UserID- '.$request->userIdx.', Email- '.$data['email'].', Firstname- '.$data['firstname'].', Lastname- '.$data['lastname'];\n SiteHelper::logActivity('USER', $logDetail, 'admin');\n\n Session::flash('flash_success', 'User detail has been updated successfully');\n echo \"success\";\n }else \n echo \"fail\";\n }", "public function update(Request $request, $id)\n {\n \n return \"metodo update\";\n\n }", "public function updateUser($id,$userData){\n $this->db->where('id', $id);\n\t\treturn $this->db->update('master_judge', $userData);\n }", "public function edit($id)\n {\n $item = users::where('id', $id)->where('status', '!=', '2')->first();\n if (!$item)\n return redirect()->route('user.index')->with(['msg' => 'ko tim thay san pham', 'status' => 'danger']);\n $data = [\n 'pagename' => $this->pagename,\n 'route' => $this->route,\n 'action' => route('user.update', $id),\n 'method' => 'PUT',\n 'item' => $item\n\n\n ];\n return view('backend.user.form', $data);\n }", "public function update(TodoFormRequest $request, Todo $todo)\n {\n $todo->update($request->all());\n return $todo;\n }", "public function update($id, Request $request)\n\t{\n\n\t\t$privileges = Privileges::all();\n\t\t$privilegesArray = [];\n\t\t$this->validate($request, [\n\t\t 'name' => 'required|max:255',\n\t\t 'surname' => 'required|max:255',\n\t\t 'email' => 'required|email|max:255',\n\t\t 'user_type_id' => 'required|exists:user_types,id',\t\t\t\n\t\t 'phone' => 'numeric|digits_between:10,11'\n\t\t]);\n\n\t\t$input = $request->all();\n\t\t$input['login'] = strtolower($input['login']);\n\t\t$user = User::find($id);\n\t\tif(strcmp($user->login, $input['login']) !== 0) {\n\t\t\t$this->validate($request, [\n\t\t 'login' => 'required|unique:users',\n\t\t\t]);\n\n\t\t}\n\t\t$user->user_type_id = $input['user_type_id'];\n\t\t$user->name = $input['name'];\n\t\t$user->surname = $input['surname'];\n\t\t$user->login = $input['login'];\n\n\t\t#$pass = $input['password'];\n\t\t#$passConf = $input['password_confirmation'];\n\t\t\n\t\t$user->email = $input['email'];\n\t\t$user->phone = $input['phone'];\n\t\t$user->heramus_link = $input['heramus_link'];\n\t\t$user->save();\n\t\t$user->privileges()->detach();\n\t\tswitch ($input['user_type_id']) {\n\t\tcase 1: /* Admin */\n\t\t\t\tforeach ($privileges as $privilege) {\n\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2: /* HR */\n\t\t\t\tforeach ($privileges as $privilege) {\n\t\t\t\t\tif(in_array($privilege->privilege, ['Users', 'Assignments' ])) {\n\t\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3: /* HR Officer */\n foreach ($privileges as $privilege){\n \tif(in_array($privilege->privilege,['Users']) && $privilege->type !='u' && $privilege->type !='d'){\n $privilegesArray[] = $privilege->id;\n \t} elseif (in_array($privilege->privilege,['Assignments']) && $privilege->type !='u'){\n $privilegesArray[] = $privilege->id;\n \t }\n }\n\t\t\t\tbreak;\n\t\t\tcase 4: /* Tehnic */\n\t\t\t\tforeach ($privileges as $privilege) {\n\t\t\t\t\tif(in_array($privilege->privilege, ['Questions', 'Quizzes'])) {\n\t\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t\t} elseif(in_array($privilege->privilege,['Assignments']) && $privilege->type =='r') {\n\t\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4: /* Intern */\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t\tcase 5: /* Candidate */\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t\tcase 7: /* Candidate */\n\t\t\t\tforeach ($privileges as $privilege) {\n\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 8: /* HR TEAM LEADER */\n foreach ($privileges as $privilege){\n \tif(in_array($privilege->privilege,['Users']) && $privilege->type !='u' && $privilege->type !='d'){\n $privilegesArray[] = $privilege->id;\n \t} elseif (in_array($privilege->privilege,['Assignments']) && $privilege->type !='u'){\n $privilegesArray[] = $privilege->id;\n \t } \t \n }\n\t\t\tbreak;\n\t\t}\n\t\t$user->privileges()->attach($privilegesArray);\n\t\t$user->categories()->detach();\n\t\tif(isset($input['categories'])) {\n\t\t\t$user->categories()->attach($input['categories']);\n\t\t}\n\n\t\treturn redirect('users');\t\t\n\t}", "public function updateAction($userId) {\r\n\t\t// When submit information of user\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$updateUser = Users::findFirst ( $this->request->get ( \"id\" ) );\r\n\t\t\t$updateUser->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$updateUser->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$updateUser->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$updateUser->save ();\r\n\t\t\treturn $this->dispatcher->forward ( array (\r\n\t\t\t\t\t'action' => 'index' \r\n\t\t\t) );\r\n\t\t} else {\r\n\t\t\t// When click to select user to update\r\n\t\t\t$this->view->user = Users::findFirst ( $userId );\r\n\t\t}\r\n\t}", "public function update(User $user, Tasks $task)\n {\n if($user->id == $task->user_id){\n return true;\n }\n else{\n return false;\n }\n }", "public function update(Request $request, TipoProductos $tipoProductos)\n {\n //\n }", "public function update(Request $request)\n {\n try {\n $todo = ToDo::find($request->get('id'));\n $todo->name = $request->get('name');\n $todo->done = $request->get('done') == 1 ? 1 : 0;\n $todo->save();\n\n if (!$todo->save()) {\n return Response::HTTP_BAD_REQUEST;\n }\n\n return Response::HTTP_OK;\n } catch (\\Exception $exception) {\n\n return Response::HTTP_BAD_REQUEST;\n }\n }", "function update($id, $user){\n\t\t$this->db->where('id', $id);\n\t\t$this->db->update('tbl_patient_treatments', $user);\n\t}", "public function update(Request $request, $id)\n {\n DB::table('todos')\n ->where('id', '=', $id)\n ->update([\n 'task' => $request->task,\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n\n return redirect(url('/todolist'));\n }", "public function update()\n {\n if(!isset($_SESSION['login']) || $_SESSION['login'] != 'admin123') {\n return redirect('page-not-found');\n }\n $status = (isset($_POST['status'])) ? 1 : 0;\n $this->task->updateTask($_POST['id'], $_POST['text'], $status);\n\n return redirect('');\n }", "public function actionSetTypeUsers()\n {\n if (count($_GET) > 0) {\n foreach ($_GET as $userID => $typeValue) {\n $userID = intval($userID);\n\n //check input data\n if ($userID == 0 || !isset($this->userTypes[$typeValue])) {\n $this->redirect('/admin?tab=user_type_mgmt');\n die;\n }\n\n $typeValue = $this->userTypes[$typeValue];\n\n // get user\n $user = Users::model()->findByPk($userID);\n\n\n if ($typeValue == 'DB Admin') {\n //we need to check it\n\n //if current user is\n if (Yii::app()->user->id == 'admin') {\n Yii::app()->user->setFlash('error', \"Admin can't change his user type to 'DBAdmin'\");\n } else {\n $user->User_Type = $typeValue;\n $user->save();\n Yii::app()->user->setFlash('success', \"Users' types have been successfully updated!\");\n }\n } else {\n $user->User_Type = $typeValue;\n $user->save();\n Yii::app()->user->setFlash('success', \"Users' types have been successfully updated!\");\n }\n\n\n\n\n }\n\n\n } else {\n Yii::app()->user->setFlash('success', \"You don't choose the users!\");\n }\n $this->redirect('/admin?tab=user_type_mgmt');\n }", "public function edit(UserType $userType)\n {\n //\n }", "public function updateTelefono($numero, $tipo, $id)\n {\n $tipo = strtoupper($tipo);\n try{\n if ($this->checkNumero($numero) && $this->checkString($tipo)) {\n $this->connect();\n // prepare and bind\n $stmt = $this->conn->prepare(\"UPDATE telefoni SET numero=? , tipo=? WHERE id=?\");\n $stmt->bind_param(\"ssi\", $numero, $tipo, $id);\n // set parameters and execute\n $stmt->execute();\n //echo \"New records created successfully\";\n $stmt->close();\n $this->disconnect();\n }\n } catch (InvalidArgumentException $e) {\n echo \"<script>alert('Uno o più campi non sono abilitati ad essere gestiti. Riprovare.')</script>\";\n //echo (\"<script LANGUAGE='JavaScript'>\n // window.alert('Uno o più campi non sono abilitati ad essere gestiti.');\n // window.location.href='../index.php';\n // </script>\");\n }\n }", "public function update(Request $request, TodoList $todoList)\n {\n //\n $item = TodoList::find($request->id);\n $item->item = $request->value;\n $item->save();\n return $request->all();\n }", "public function update(StoreTodo $request, Todo $todo)\n {\n $todo->update($request->validated());\n\n return response()->json([\n \"data\" => $todo\n ], 200);\n }", "public function update(Request $request, $id)\n { \n // echo \"<pre>\";\n // print_r($id);\n // die;\n $id = Auth::user()->id;\n $data = User::find($id);\n if($data->type == \"admin\"){\n $data->name = $request->name;\n $data->email = $request->email;\n }\n $data->save();\n return redirect('/admin/create');\n }" ]
[ "0.68656677", "0.6525809", "0.64533186", "0.63667476", "0.63080096", "0.61703837", "0.61580944", "0.61555594", "0.6144964", "0.61303717", "0.6080912", "0.60475385", "0.60449976", "0.6022284", "0.60189694", "0.60168105", "0.5974697", "0.5970464", "0.59687585", "0.59511757", "0.5947507", "0.59419024", "0.59247726", "0.5920512", "0.5903465", "0.5902678", "0.58853257", "0.58848226", "0.5859407", "0.5857344", "0.58571136", "0.5850459", "0.5849996", "0.5842337", "0.5830039", "0.58294624", "0.5820299", "0.5810924", "0.5802143", "0.579336", "0.57930166", "0.5771516", "0.5752675", "0.5749201", "0.5745239", "0.57362443", "0.57100886", "0.57003194", "0.5696172", "0.56956035", "0.5694253", "0.5682741", "0.56624746", "0.56488407", "0.563659", "0.56362605", "0.56355137", "0.5630474", "0.5613202", "0.5602009", "0.5599717", "0.5598753", "0.5597484", "0.5588681", "0.55779225", "0.5575411", "0.5572505", "0.5572505", "0.55717826", "0.5555368", "0.55528325", "0.5547671", "0.55447495", "0.5534936", "0.5529094", "0.5524022", "0.5520688", "0.5510858", "0.55090564", "0.5508832", "0.55018", "0.5494847", "0.5479996", "0.5474846", "0.5466551", "0.5460436", "0.54551554", "0.544227", "0.54347974", "0.543247", "0.5429558", "0.5427199", "0.54212433", "0.54195976", "0.5419215", "0.54153585", "0.5413674", "0.54127026", "0.5410336", "0.5409153" ]
0.7856997
0
this method gets todos type list
public function getTodoTypeListAction(){ /** @var Object_Todo $todo */ $this->getDeviceSession()->getUserId(); $todo = new Object_Todo(); $this->_helper->json($todo->getClass()->getFieldDefinition('Todo_type')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listarTodos_get(){\n $data = $this->Aluno->getAlunos();\n $this->response($data, REST_Controller::HTTP_OK);\n \n }", "function Todos(){\n\t\t\t\treturn $this->todos;\n\t\t\t}", "public function getTodos(){\n\t\t\t$this->db->query(\"SELECT * FROM generos\");\n\t\t\treturn $this->db->fetchAll();\n\t\t}", "public static function TraerTodos():array;", "function listUserTodos() {\n\t\tglobal $HTML;\n\t\tglobal $page;\n\n\t\t$_ = '';\n\n\t\t// only show todos if user has access\n\t\tif($page->validatePath(\"/janitor/admin/todo\")) {\n\t\t\t\n\t\t\t$IC = new Items();\n\t\t\t$model = $IC->typeObject(\"todo\");\n\t\t\t$todos = $IC->getItems(array(\"itemtype\" => \"todo\", \"where\" => \"todo.priority = 20\", \"user_id\" => session()->value(\"user_id\"), \"extend\" => array(\"tags\" => true)));\n\n\t\t\t$_ .= '<div class=\"todos\">';\n\t\t\t$_ .= '<h2>TODOs</h2>';\n\n\t\t\tif($todos) {\n\t\t\t\t$_ .= '<ul class=\"todos\">';\n\t\t\t\tforeach($todos as $todo) {\n\t\t\t\t\t$_ .= '<li class=\"todo todo_id:'.$todo[\"id\"].'\">';\n\t\t\t\t\t\t$_ .= '<h3>'.stringOr($HTML->link($todo[\"name\"], \"/janitor/admin/todo/edit/\".$todo[\"id\"], array(\"target\" => \"_blank\")), $todo[\"name\"]).'</h3>';\n\t\t\t\t\t\t$_ .= $this->tagList($todo[\"tags\"]);\n\t\t\t\t\t$_ .= '</li>';\n\t\t\t\t}\n\t\t\t\t$_ .= '</ul>';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ .= '<p>No TODOs</p>';\n\t\t\t}\n\n\t\t\t$_ .= '</div>';\n\t\t}\n\n\t\treturn $_;\n\t}", "function get_all_todos($type,$conn){\n\t$arr_out = array();\n\tif ($type==2) {\n\t\t$stmt_get = \"SELECT `id`,`todo_text`,`completed_flag` FROM `tbl_todo_content` WHERE `completed_flag` IS NULL\";\n\t}elseif($type==3){\n\t\t$stmt_get = \"SELECT `id`,`todo_text`,`completed_flag` FROM `tbl_todo_content` WHERE `completed_flag`IS NOT NULL\";\n\t}elseif($type==1){\n\t\t$stmt_get = \"SELECT id, todo_text, completed_flag FROM tbl_todo_content \";\n\t}else{\n\n\t}\n\n\t$result = $conn->query($stmt_get);\n\n\tforeach ($result as $row) {\n\t\t$arr_out[] = $row;\n\t}\n\treturn $arr_out;\n}", "public function listarTodos(){\n\t\t\n\t\t$sql = 'SELECT * FROM itempedido';\n\t\t$consulta = $this->conn->prepare($sql);\n\t\t$consulta->execute();\n\t\treturn ($consulta->fetchAll(PDO::FETCH_ASSOC));\n\t}", "public function list_of($type)\n {\n }", "function listar_todos(){\n $result = $this->ComplementosModel->listar_todos();\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "public function listarTodos(){\r\n\t\t$sql = 'SELECT * FROM oficina';\r\n\t\t$consulta = $conexao->prepare($sql);\r\n\t\t$resultado = $consulta->execute();\r\n\t\treturn ($resultado->fetchAll(PDO::FETCH_ASSOC));\r\n\t}", "function listTodos() {\n $results = array();\n $results['todos'] = Todo::getListForUser( User::getLoggedInUser() );\n require( TEMPLATE_PATH . \"/listTodos.php\" );\n}", "public function index()\n {\n return auth()->user()->todos()->orderBy('priority', 'DESC')->get();\n }", "public function listadoTipoDocumento(){\n \n\t\t$data= $this->Model_maestras->BuscarTiposDocumentos();\n\t\n\t\techo($data); \n\t \n\n\t}", "public function getUserTodos()\n {\n return $this->userTodos;\n }", "public function ajaxGetTodoList($account = '', $id = '', $type = 'select')\n {\n $this->app->loadClass('date', $static = true);\n $customerIdList = $this->loadModel('customer')->getCustomersSawByMe();\n $products = $this->loadModel('product')->getPairs();\n $thisWeek = date::getThisWeek();\n $orders = array();\n if($account == '') $account = $this->app->user->account;\n\n $sql = $this->dao->select('o.id, o.product, o.createdDate, c.name as customerName, t.id as todo')->from(TABLE_ORDER)->alias('o')\n ->leftJoin(TABLE_CUSTOMER)->alias('c')->on(\"o.customer=c.id\")\n ->leftJoin(TABLE_TODO)->alias('t')->on(\"t.type='order' and o.id=t.idvalue\")\n ->where('o.deleted')->eq(0)\n ->andWhere('o.assignedTo')->eq($account)\n ->andWhere('o.nextDate')->between($thisWeek['begin'], $thisWeek['end'])\n ->andWhere('o.customer')->in($customerIdList)\n ->orderBy('o.id_desc');\n $stmt = $sql->query();\n while($order = $stmt->fetch())\n { \n if($order->todo) continue;\n $order->products = array();\n $productList = explode(',', $order->product);\n foreach($productList as $product) if(isset($products[$product])) $order->products[] = $products[$product];\n $productName = count($order->products) > 1 ? current($order->products) . $this->lang->etc : current($order->products);\n $order->title = sprintf($this->lang->order->titleLBL, $order->customerName, $productName, date('Y-m-d', strtotime($order->createdDate))); \n $orders[$order->id] = $order->title;\n } \n\n if($type == 'select')\n {\n if($id) die(html::select(\"idvalues[$id]\", $orders, '', 'class=\"form-control\"'));\n die(html::select('idvalue', $orders, '', 'class=form-control'));\n }\n if($type == 'board')\n {\n die($this->loadModel('todo', 'sys')->buildBoardList($orders, 'order'));\n }\n die(json_encode($orders));\n }", "public function seleccionarTodos();", "public function lerTodos() {\n\n $xml = self::$soapClient->lerTodos();\n $xml = $this->xmlToArray($xml);\n \n if (isset($xml)) {\n foreach ($xml[\"NODELIST\"] as $key => $value) {\n $result[$key] = $value;\n }\n }\n return $result;\n }", "public function index()\n\t{\n\t\treturn Todo::all();\n\t}", "public function listarTodos(){\r\n\t\tinclude(\"../config/conexao.php\");\r\n\t\t$sql = 'SELECT * FROM cliente';\r\n\t\t$consulta = $pdo->prepare($sql);\r\n\t\t$consulta->execute();\r\n\t\treturn ($consulta->fetchAll(PDO::FETCH_ASSOC));\r\n\t}", "public function index()\n {\n $todos = Todo::orderBy('created_at')->get();\n\n return $todos;\n }", "function getTypeslist ()\r\n\t{\r\n\t\t$query = 'SELECT id, name'\r\n\t\t\t\t. ' FROM #__flexicontent_types'\r\n\t\t\t\t. ' WHERE published = 1'\r\n\t\t\t\t. ' ORDER BY name ASC'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$types = $this->_db->loadObjectList();\r\n\t\treturn $types;\r\n\t}", "protected function list($type = null)\n {\n $faqs = $this->repository\n ->pushCriteria(app('Litepie\\Repository\\Criteria\\RequestCriteria'))\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n\n return $this->response->title(trans('faq::faq.names'))\n ->view('faq::public.faq.index')\n ->data(compact('faqs'))\n ->output();\n }", "public function getUserTodosAction()\n {\n $todo = new Workapp_Todo();\n $this->_helper->json($todo->getTodoList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "public function listar(){\n\t\t$sql = \"SELECT * FROM equipo_tipo\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function getTodoData(){\n $id = Auth::user()->id;\n\n return TodoList::latest('updated_at')->where('cid', $id)->get();\n }", "public function getItems($type);", "public function index() {\n \t$types = TipoTransparencia::all();\n \treturn $types;\n }", "public function get_todo_list()\n\t{\n\tif (empty($this->cal['VTODO'])) {\n\t\treturn [];\n\t}\n\treturn $this->cal['VTODO'];\n\t}", "public function index()\n {\n return TodoResource::collection(\n Todo::with('category', 'priority')->get()\n );\n }", "public function index ()\n {\n return ToDo::all();\n }", "public function listar(){\n require_once 'models/Nota.php';\n \n //Lógica acción controlador\n $nota = new Nota();\n \n $notas = $nota->conseguirTodos('notas');\n \n //Vista\n require_once 'views/nota/listar.php';\n \n }", "function listar_todos_repuestos(){\n\t\t $this->db->SELECT('*');\n\t\t$this->db->From('repuestos');\n\t\t$this->db->order_by(\"id\",\"desc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function encontrarTodos() {\n return $this->getEntityManager()->getRepository($this->getEntity())->findAll();\n }", "public function listarTodos()\n\t{\n\t\t$inst_table = BDD::getInstance()->query(\"select * from system.\". self::claseMinus());\n\t\t$i = 0;\n\t\twhile ($fila = $inst_table->_fetchRow())\n\t\t{\n\t\t\tforeach ($fila as $campo => $valor)\n\t\t\t{\n\t\t\t\t$data[$i][$campo] = $valor;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\techo (json_encode($data));\n\t}", "public function todos(){\n $salon = salon::select(\"id\",\"nombre\",\"precio\")->where(\"estado\",\"=\",\"activo\")->get();\n return ['data' => $salon];\n }", "public static function todos()\n\t{\n\t\t// Arreglo que va a contener todos los roles\n\t\t$lista_medios = [];\n\n\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\n\t\t// Consulta para la base de datos y despues lo guarda en la variable\n\t\t$resultado = $conexion->conn->query(\"SELECT * FROM \". static::$tablaConsulta );\n\n\n\t\t// Recorrer todos los roles que llegaron de la bd\n\t\twhile ( $medio = $resultado->fetch_assoc() ) {\n\n\t\t\t// Crear un reporte temporal en cada vuelta\n\t\t\t$medioTemporal = new MedioPago;\n\n\t\t\t// Añadir los campos al rol\n\t\t\t$medioTemporal->id \t = $medio['id'];\n\t\t\t$medioTemporal->medio \t = $medio['medio'];\n\n\t\t\t// Guarda el objeto rol en el arreglo\n\t\t\t$lista_medios[] = $medioTemporal;\n\t\t}\n\n\t\t// Devolver todos los roles\n\t\treturn $lista_medios;\n\n\t}", "public function type_movie_list() {\n\n // Capa de Modelo, carga la data \n $data[\"types_movie\"] = $this->Type_movie->findAll();\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/types_movie/list\", $data, TRUE);\n $view['title'] = \"Listado de tipos de películas\";\n $this->parser->parse('core/templates/body', $view);\n }", "protected function getTypes() {}", "public function getTypeslist ( $type_ids=false, $check_perms = false, $published=false )\n\t{\n\t\treturn flexicontent_html::getTypesList( $type_ids, $check_perms, $published);\n\t}", "public function index()\n {\n $result = $this->todoService->all();\n $activeTodo = [];\n\n if (isset($result['status']) && $result['stutus'] == 404) {\n return response()->json($result, 404);\n }\n\n foreach ($result as $value) {\n if (!isset($value['archived_at']) || $value['archived_at'] === null) {\n array_push($activeTodo, $value);\n }\n }\n\n return response()->json(['status' => 'success', 'type' => 'Todo Collection', 'data' => $activeTodo], 200);\n }", "public function getTypesList() {\n \t//maybe someday sorts them by course, student progress?\n \t$course_id = Auth::user()->course_id;\n Debugbar::info($course_id);\n $course = Course::find($course_id);\n Debugbar::info($course);\n $typesList = $course->questions;\n Debugbar::info($typesList);\n \treturn $typesList;\n }", "public function getAgendaTopicTypeListAction(){\n /** @var Object_Agenda $agenda */\n $this->getDeviceSession()->getUserId();\n $agenda = new Object_Agenda();\n $this->_helper->json($agenda->getClass()->getFieldDefinition('Topic'));\n }", "public function index()\n {\n $archived = !! Input::get('archived');\n $lists = Todo::allLists($archived);\n\n $return = array(\n 'lists' => array(),\n );\n\n foreach ($lists as $listId)\n {\n $list = Todo::get($listId, $archived);\n $return['lists'][] = array(\n 'name' => $listId,\n 'title' => $list->title(),\n 'subtitle' => $list->get('subtitle'),\n 'isArchived' => $list->isArchived(),\n 'numNextActions' => $list->taskCount('next'),\n 'numNormal' => $list->taskCount('todo'),\n 'numCompleted' => $list->taskCount('done'),\n );\n }\n return Response::json($return);\n }", "function generate_todo_list(){\n\t\t$todo = array();\n\t\t$used = array();\n\n\t\t\n\t\tforeach ($this->todo_groups as $group_name => $group) {\n\t\t\tforeach ($group as $process_name => $process) {\n\t\t\t\t$process_name = 'pa_' . $group_name .'_' . str_replace( array( $group_name .'_', 'pa_'), array('', ''), $process_name);\t\n\n\t\t\t\t$pa_class_name = '\\gcalc\\pa\\\\' . $process['class_name'];\n//var_dump($process_name.'::'.$pa_class_name, class_exists( $pa_class_name ));\n\t\t\t\tif ( !in_array( $process_name, $used ) && class_exists( $pa_class_name ) && !preg_match('/format/', $pa_class_name)) {\t\n\t\t\t\t\t$new_todo = new $pa_class_name( $this->bvars, $this->product_id, $this, array( $group_name, $process_name ) );\n\n\n\t\t\t\t\t$todo[ $process_name ] = $new_todo;\t\t\t\t\n\t\t\t\t\tarray_push( $used, $process_name );\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\n\n\t\t$this->todo->set_plist( $todo );\t\t\t\t\n\t\treturn $todo;\n\t}", "public function listaTipoMovimiento(){\n $marcas = $this->repoTipoMovimiento->all();\n return view('mantenimiento.compraventa.tipomovimiento.tipomovimiento', compact('marcas'));\n }", "public function obtenerArticulosPorTipo(){\n log_message('DEBUG', \"#TRAZA | #TRAZ-PROD-TRAZASOFT | Camion | obtenerArticulosPorTipo()\");\n $rsp = $this->Materias->listar('TODOS');\n if($rsp['status']){\n $materiasPrimas = json_decode($rsp['data']);\n $data['status'] = $rsp['status'];\n $data['data'] = selectBusquedaAvanzada(false, false, $materiasPrimas->articulos->articulo, 'arti_id', 'barcode',array('descripcion','um'));\n echo json_encode($data);\n }else{\n $rsp['msj'] = \"Fallo el servicio que obtiene los articulos tipo materia prima.\";\n json_encode($rsp);\n }\n }", "public function todos(Request $request) {\n\t\t// Get user session\n\t\t$user = Session::get('user');\n\n\t\t// Get the active to-do lists of the user\n\t\t$todos = Todo::where('creator_id', $user->id)->orderBy('updated_at', 'desc')->get();\n\n\t\t// Get the archived to-do lists of the user\n\t\t$archives = Todo::withTrashed()->whereNotNull('deleted_at')->where('creator_id', $user->id)->orderBy('updated_at', 'desc')->get();\n\n\t\treturn View::make('todos')->with(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'page' => 'Todos',\n\t\t\t\t\t\t\t\t\t\t\t\t'todos' => $todos,\n\t\t\t\t\t\t\t\t\t\t\t\t'archives' => $archives\n\t\t\t\t\t\t\t\t\t\t\t));\n\t}", "public function index()\n {\n //qui ritorno l'elenco delle liste\n //return TodoList::paginate(20);\n $lists = TodoList::paginate(20);\n return $this->getResult($lists->toArray());\n }", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "public function index()\n {\n return ToDoListResource::collection(ToDoList::with('toDoItems')->get());\n }", "public function getTipoProducto(){\n $items = TcTipoProducto::where('id_estado','=',1)->get();\n return $items;\n }", "public function listaTipoPago(){\n $marcas = $this->repoTipoPago->all();\n return view('mantenimiento.compraventa.tipopago.listatipopago', compact('marcas'));\n }", "public function listar(){\r\n }", "private function listarTodosParticipante(){\n print_r($this->participantePDO->findAll());\n }", "public function getAllTypes(){\n return $this->find()->asArray()->orderBy('typeDesc ASC')->all();\n }", "public function getUserList($type = 'all'): void{\n\n if(Session::isLogin()){\n\n if($type === 'anime'){\n $userList = UserList::where('user_list.user_id', Session::getUser()['id'])->where('type', 'Anime')->getAll();\n }else if($type === 'manga'){\n $userList = UserList::where('user_list.user_id', Session::getUser()['id'])->where('type', 'Manga')->getAll();\n }else{\n $userList = UserList::where('user_list.user_id', Session::getUser()['id'])->getAll();\n }\n \n if(isset($_GET['id'])){\n foreach($userList as $artwork){\n if($artwork->id === $_GET['id']){\n echo json_encode($userList);\n exit;\n }\n }\n }\n }\n \n if(!empty($userList))\n echo json_encode($userList);\n else\n echo json_encode([]);\n }", "public function getList();", "public function getList();", "public function getTodoList($options)\r\n {\r\n $todos = new Object_Todo_List();\r\n $tods = array();\r\n if (isset($options['user_id'])) {\r\n $todos->setCondition('Creator__id = ?', array($options['user_id']));\r\n }\r\n\r\n foreach ($todos as $todo) {\r\n $tods[] = $todo;\r\n }\r\n\r\n return $tods;\r\n }", "public function get_types()\n {\n }", "function backup_migrate_crud_get_items($type) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->all_items();\n }\n}", "public function CategoryListWithType(Request $request,$type)\n {\n $society_id = OauthToken::find($request->get('access_token'))->society()->first()->id;\n $results = Category::where('type', $type)\n ->where('society_id', $society_id)->get();\n return $this->presentor->make200Response('Successfully loaded.', $results);\n }", "public function todos()\n\t{\n\t\t$todosTodo = Auth::user()->todos()->where('done', 0)->latest()->get();\n\n\t\t$todosDone = Auth::user()->todos()->where('done', 1)->latest()->get();\n\n\t\treturn view('pages.todos', compact('todosTodo', 'todosDone'));\n\t}", "public function index() {\n\t\t\t$this->data[\"content\"] = $this->mongo_db->order_by(array(\"_id\"))->get(\"content_types\");\n\t\t\t$this->returndata();\n\t\t}", "public static function getList()\n {\n $cont = new RestController();\n $orderTypesRaw = $cont->getRequest('OrderTypes?$filter=Type_Id+ne+null');\n if($orderTypesRaw instanceof View)\n {\n $response_array['status'] = 'error';\n return json_encode($response_array);\n }\n $orderTypes = array();\n foreach($orderTypesRaw->value as $ot)\n {\n //filter forms without name\n if($ot->FormName==null){\n continue;\n }\n $orderTypes[$ot->Id] = $ot->FormName;\n }\n return $orderTypes;\n }", "public function getBuscarRegistros()\n {\n return $this->repository->menu->getTodosMenus();\n }", "public function index()\n {\n $todoList = Todo::all();\n return compact('todoList');\n }", "public static function getTypesList()\n {\n return ArrayHelper::map(Yii::$app->get('cms')->getPageTypes(), 'type', 'name');\n }", "public function get_todos_autores()\n {\n return $this->userRepo->get_todos_autores();\n }", "private static function getList\r\n\t(\r\n\t\t$listType\t\t// <str> Set the type of list to retrieve from the database.\r\n\t)\t\t\t\t\t// RETURNS <array> Returns the designated list.\r\n\t\r\n\t// $listData = self::getList('tables');\r\n\t{\r\n\t\t$list = array();\r\n\t\t$path = self::$path . \"/\" . $listType;\r\n\t\t$files = File_Scan::scanRecursive($path, \"*.json\");\r\n\t\t\r\n\t\tforeach($files as $file) {\r\n\t\t\t$file = str_replace($path . \"/\", \"\", $file);\r\n\t\t\t$file = str_replace(\".json\", \"\", $file);\r\n\t\t\t$list[] = $file;\r\n\t\t}\r\n\t\t\r\n\t\treturn $list;\r\n\t}", "function loadTodos($intProject = null){\n\t\t\t\tglobal $AppUI;\n\n\t\t\t\t$arTmp = array();\n\n\t\t\t\t// Traigo los todos que tiene permitidas //\n\n\t\t\t\t if ($AppUI->user_type == 1){\n\t\t\t\t\t $strSql = \"SELECT id_todo,description, project_id\"\n\t\t\t\t\t\t\t\t. \"\\nFROM project_todo \"\n\t\t\t\t\t\t\t\t.\"\\n WHERE user_assigned = $AppUI->user_id\"\n\t\t\t\t\t\t\t\t. \"\\n order by description\";\t\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 $strSql = \"SELECT DISTINCT project_id \n\t\t\t\t\t\t\t FROM project_todo \n\t\t\t\t\t\t\t\t\tWHERE user_assigned= $AppUI->user_id \n\t\t\t\t\t\t\t\t\t\";\n \n $allowed = db_loadColumn($strSql);\n\n\t\t\t\t\t\t if (count($allowed)==\"0\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$allowed[0] =\"-1\" ;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t $strSql = \"SELECT id_todo,description, project_id\n\t\t\t\t\t\t\t\t\tFROM project_todo\n\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\tproject_id IN (\" . implode( ',', $allowed ) . \")\n\t\t\t\t\t\t\t\t and user_assigned= $AppUI->user_id \n\t\t\t\t\t\t\t\t\torder by description asc\";\n \n\t\t\t\t }\n\t\t\t\t\n\t\t\t\t$arTodos = db_loadList($strSql);\n\t\t\t\t\n\t\t\t\t$i = 0;\n\t\t\t\tforeach ($arTodos as $ToDo)\n\t\t\t\t{\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&aacute;\",\"á\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&eacute;\",\"é\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&iacute;\",\"í\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&oacute;\",\"ó\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&uacute;\",\"ú\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&apos;\",\"'\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&#039;\",\"'\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&quot;\",\"'\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t$arTodos[$i][\"description\"] = ereg_replace(\"&apos;\",\"'\",$arTodos[$i][\"description\"]);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t\t$this->todos = $arTodos;\n\n\t\t\t\tif($this->_addItems_forEachProject_inTodos && count($this->items) > 0){\n\t\t\t\t\t$intProjectId = \"\";\n\t\t\t\t\tforeach($arTodos as $rRow){\n\t\t\t\t\t\tif($rRow[\"project_id\"] != $intProjectId){\n\t\t\t\t\t\t\t$intProjectId = $rRow[\"project_id\"];\n\t\t\t\t\t\t\tforeach($this->items as $kItem => $rItem){\n\t\t\t\t\t\t\t\t$this->addItemAtBeginOfTodos($this->addItemTodo($intProjectId, key($rItem), $rItem[key($rItem)]));\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\tif($this->_breset_Items) $this->items = array();\n\t\t\t\t}\n\t\t\t}", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public function getTamanios(){\n $items = TcTamanio::where('id_estado','=',1)->get();\n return $items;\n }", "public function index()\n {\n // $types = Type::get();\n $types = Type::select('id', 'name', 'sort')->get();\n\n // return response([\n // 'data' => $types,\n // ], Response::HTTP_OK);\n return new TypeCollection($types);\n }", "public function getListeTypeContent () \n {\n $db = $this->getModel('db');\n $sql = \"SHOW TABLES LIKE '\" . $this->table_cms_contenu . \"_%'\";\n $stmt = $db->query($sql);\n for (true; $res = $db->fetch_assoc($stmt); true) {\n $liste_type_content[] = $res['Tables_in_' . Clementine::$config['clementine_db']['name'] . ' (' . $this->table_cms_contenu . '_%)']; \n }\n return $liste_type_content;\n }", "function ctools_term_list_ctools_content_types() {\n return array(\n 'single' => TRUE,\n 'title' => t('List of related terms'),\n 'icon' => 'icon_term.png',\n 'description' => t('Terms related to an existing term; may be child, siblings or top level.'),\n 'required context' => new ctools_context_required(t('Term'), 'term'),\n 'category' => t('Taxonomy term'),\n 'defaults' => array('title' => '', 'type' => 'child', 'list_type' => 'ul'),\n );\n}", "function grabTypes(){\n\t\t$d=$this->find('all',array('order'=>array('id ASC')));\n\t\treturn $d;\n\t}", "public function index()\n {\n $types = Type::all();\n return $this->showAll($types);\n }", "public function readAllTD(){\n $objT=new tipodocDAO();//leer todos los tipos de documentos para los registros \n $resul=$objT->readall();\n return $resul;\n \n }", "public function getItems(...$types);", "public function getList()\n\t{\n\t\tif(!isset($this->_list))\n\t\t{\n\t\t\tparent::getList();\n\t\t\t\n\t\t\t$table = $this->getTable();\n\t\t\t$types = array(\n\t\t\t\t'forum' => $table->getTypeIdFromName('forum'),\n\t\t\t\t'topic' => $table->getTypeIdFromName('topic'),\n\t\t\t\t'person' => $table->getTypeIdFromName('person')\n\t\t\t);\n\n\t\t\t//@TODO optimize this to 3 queries in total, instead of multiple\n\t\t\tforeach($this->_list as $item)\n\t\t\t{\n\t\t\t\t//@TODO speed this up by adding it as a db column\n\t\t\t\t$item->modified_by = false;\n\t\t\t\t$item->modified_name = JText::_('COM_NINJABOARD_NA');\n\t\t\t\t\n\t\t\t\tif($item->subscription_type == $types['forum'])\n\t\t\t\t{\n\t\t\t\t\t$item->type = 'forum';\n\t\t\t\t\t$item->title = $this->getService('com://admin/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($item->subscription_type_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->title;\n\t\t\t\t\t\n\t\t\t\t\t$icon = '/forums/default.png';\n\t\t\t\t\t$link = '&view=forum&id='.$item->subscription_type_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($item->subscription_type == $types['topic'])\n\t\t\t\t{\n\t\t\t\t\t$item->type = 'topic';\n\t\t\t\t\t$topic = $this->getService('com://admin/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($item->subscription_type_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t\t\t$item->title = $topic->subject;\n\t\t\t\t\t\n\t\t\t\t\t$icon = '/topic/32__default.png';\n\t\t\t\t\t$link = '&view=topic&id='.$item->subscription_type_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($item->subscription_type == $types['person'])\n\t\t\t\t{\n\t\t\t\t\t$item->type = 'person';\n\t\t\t\t\t$item->title = $this->getService('com://admin/ninjaboard.model.people')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($item->subscription_type_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->display_name;\n\t\t\t\t\t$icon = '/16/users.png';\n\t\t\t\t\t$link = '&view=person&id='.$item->subscription_type_id;\n\t\t\t\t}\n\n\t\t\t\t$item->link = JRoute::_('index.php?option=com_ninjaboard'.$link);\n\t\t\t\t$item->icon = $this->getService('ninja:template.helper.document')->img($icon);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_list;\n\t}", "public function listsGenericget()\r\n {\r\n $response = Generic::all();\r\n return response()->json($response,200);\r\n }", "public function apiListAll()\n {\n $feedTypes = DB::table('feeds_feed_types')\n ->select('feeds_feed_types.*','feeds_feed_type_budgeted_amount_per_day.*')\n ->where('name','!=','None')\n ->leftJoin('feeds_feed_type_budgeted_amount_per_day','feeds_feed_type_budgeted_amount_per_day.feed_type_id','=','feeds_feed_types.type_id')\n ->latest()\n ->get();\n\n $feedTypes = $this->toArray($feedTypes);\n\n return $feedTypes;\n }", "function content_list_of($type_id, $category_id) {\n\n global $data_base, $env;\n\n if ($env == \"prod\") {\n\n $request = $data_base->prepare(\"\n SELECT content_id\n FROM imago_info_content \n WHERE type = ? \n AND category = ?\n AND env = ?\n AND ppv = 'no'\n ORDER BY content_id ASC\n \");\n\n $request->execute(array($type_id, $category_id, $env));\n }\n\n else {\n\n $request = $data_base->prepare(\"\n SELECT content_id\n FROM imago_info_content \n WHERE type = ? \n AND category = ?\n AND ppv = 'no'\n ORDER BY content_id ASC\n \");\n\n $request->execute(array($type_id, $category_id));\n\n }\n\n return $request->fetchAll(PDO::FETCH_COLUMN, 0);\n }", "public function getListNoId($type = null)\n {\n $sql = \"SELECT * FROM comments \";\n\n switch ($type) {\n case 'checked':\n $and = \" WHERE checked = 1 \";\n break;\n case 'flag':\n $and = \" WHERE checked = 2 \";\n break;\n case 'unchecked':\n $and = \" WHERE checked = 0 \";\n break;\n default:\n $and = \" \";\n break;\n }\n\n\n $sql .= $and;\n $sql .= \"ORDER BY publishDate DESC\";\n $query = $this->db->query($sql);\n $query->setFetchMode(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, Comment::class);\n $commentList = $query->fetchAll();\n\n $query->closeCursor();\n return $commentList;\n }", "public function getAll($type)\n {\n $sql = DB::table('aerolineas_aeropuertos')\n ->join('localizacion', 'aerolineas_aeropuertos.localizacion_id', '=', 'localizacion.id')\n ->join('deptos', 'localizacion.deptos_id', '=', 'deptos.id')\n ->join('pais', 'deptos.pais_id', '=', 'pais.id')\n ->select('aerolineas_aeropuertos.*', DB::raw('CONCAT(aerolineas_aeropuertos.codigo,\" - \", aerolineas_aeropuertos.nombre) AS name'), 'localizacion.nombre as ciudad', 'localizacion.id as ciudad_id', 'deptos.descripcion as estado', 'deptos.id as estado_id', 'pais.descripcion as pais', 'pais.id as pais_id')\n ->where([\n ['aerolineas_aeropuertos.deleted_at', '=', NULL],\n ['aerolineas_aeropuertos.tipo', '=', $type]\n ])\n ->orderBy('aerolineas_aeropuertos.nombre');\n return \\DataTables::of($sql)->make(true);\n }", "public function getlists($type) {\n // get holidays\n $ch = curl_init();\n $timeout = 5;\n curl_setopt ($ch, CURLOPT_URL, 'https://holidays-jp.github.io/api/v1/date.json');\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $init['holidays'] = json_decode(curl_exec($ch), true);\n curl_close($ch);\n if($type == 1) {\n $init['offers'] = Offer::with(['user', 'event'])->orderBy('updated_at', 'DESC')->paginate(20);\n } else if($type == 2) {\n $init['offers'] = Offer::with(['user', 'event'])->where('user_id', null)->orderBy('updated_at', 'DESC')->paginate(20);\n } else {\n $init['offers'] = Offer::with(['user', 'event'])->where('user_id', auth()->user()->id)->orderBy('updated_at', 'DESC')->paginate(20);\n }\n foreach($init['offers'] as $key=>$offer) {\n $offer['from'] = json_decode($offer->from_info, true);\n $offer['to'] = json_decode($offer->to_info, true);\n $offer['items'] = json_decode($offer->items, true);\n $offer['otherservice'] = json_decode($offer->other_service, true);\n $offer['images'] = json_decode($offer->images, true);\n }\n return $init;\n }", "public function pegaTodos(){\n\t\treturn $this->resultado->fetchAll();\n\t}", "public function actionMyTodo($sortType='desc', $sortBy='itemId', $flag=0)\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$keyword = NULL;\n\t\tif(isset($_POST['keyword']))\n\t\t{\n\t\t\t$keyword = $_POST['keyword'];\n\t\t}\n\t\t$sessionArray['mylist']=0;\n\t\t$sessionArray['mytodoStatus']=0;\n\t\tif(isset($_POST['mylist']) && $_POST['mylist']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mylist']=$_POST['mylist'];\n\t\t}\n\t\tif(isset($_POST['mytodoStatus']) && $_POST['mytodoStatus']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mytodoStatus']=$_POST['mytodoStatus'];\n\t\t}\n\t\t$sessionArray['loginId']=Yii::app()->session['loginId'];\n\t\n\t\t$todoItemsObj\t=\tnew TodoItems();\n\t\t$todoListsObj\t=\tnew TodoLists();\n\t\t$usersObj\t=\tnew Users();\n\t\t\n\t\t$data\t=\t$todoItemsObj->getMyToDoItems($sessionArray,LIMIT_10, $sortType, $sortBy,$keyword);\n\t\t$data['myTodoCount']\t\t=\t$todoItemsObj->getMyTodoCount(Yii::app()->session['loginId']);\n\t\t$data['user']\t=\t$usersObj->getUserById(Yii::app()->session['userId'], 'myOpenStatus , myDoneStatus, myCloseStatus');\n\t\t\n\t\tif($sortType == 'desc'){\n\t\t\t$data['sortType']\t=\t'asc';\n\t\t\t$data['img_name']\t=\t'arrow_up.png';\n\t\t} else {\n\t\t\t$data['sortType']\t=\t'desc';\n\t\t\t$data['img_name']\t=\t'arrow_down.png';\n\t\t}\n\t\tif($flag == 0){\n\t\t\t$data['img_name']\t=\t'';\n\t\t}\n\t\t$data['sortBy']\t=\t$sortBy;\n\t\t$data['myLists']\t=\t$todoListsObj->getAllMyList(Yii::app()->session['loginId']);\n\t\tunset($data['myLists']['pendingItems']);\n\t\t$this->renderPartial('myTodoItems', array('data'=>$data));\n\t}", "public function getTodosDoBanco() {\n $query = $this->newQuery();\n $query->select('*')\n ->from($this->table);\n return $this->execute($query);\n }", "function read_type()\n {\n $this->acl->validate_read(null, $this->vclass_user_type);\n $data = array();\n $menu_name = lang('master').' '.lang('user_type');\n\n if($this->input->post('submit'))\n {\n unset($_POST['submit']);\n $data['records'] = $this->m_user->get_type($this->input->post());\n echo $this->load->view('dashboard/user/list_type', $data, TRUE);\n die();\n }\n\n LOAD_NAVBAR($menu_name);\n $this->template->write_view('content', 'dashboard/user/read_type', $data, TRUE);\n $this->template->render();\n }", "public function listarStatusCelularTodos()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"SELECT Discipulo.nome AS discipulo , TipoStatusCelular.nome AS status FROM Discipulo,StatusCelular, TipoStatusCelular\n WHERE Discipulo.id = StatusCelular.discipuloId And StatusCelular.tipoOferta = TipoStatusCelular.id ORDER BY discipulo\";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n\n $resposta = $stm->execute();\n\n //fechar conexão\n $pdo = null ;\n\n return $stm->fetchAll();\n }", "public function listarStatusCelularTodos()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"SELECT Discipulo.nome AS discipulo , TipoStatusCelular.nome AS status FROM Discipulo,StatusCelular, TipoStatusCelular\n WHERE Discipulo.id = StatusCelular.discipuloId And StatusCelular.tipoOferta = TipoStatusCelular.id ORDER BY discipulo\";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n\n $resposta = $stm->execute();\n\n //fechar conexão\n $pdo = null ;\n\n return $stm->fetchAll();\n }", "public function todos()\n {\n //$pres=Prescription::all();\n $pres= Prescription::where('medico_id', Auth::user()->id)->get();\n return view('Prescriptions.todos',[\"prescripciones\"=>$pres]);\n }", "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 getTaskListList(){\n return $this->_get(2);\n }", "public function __invoke(Request $request) {\n\n if (Auth::check()){\n\n if ($request->has(['from', 'to', 'category'])){\n\n $todosFrom = $request->input('from').' 00:00:00';\n $todosTo = $request->input('to').' 23:59:59';\n $todosCategory = $request->input('category');\n\n } else {\n $todosFrom = date('Y-m-d 00:00:00');\n $todosTo = date(\"Y-m-d 23:59:59\");\n $todosCategory = 'all';\n }\n\n if (!$this->validateDate($todosFrom) || !$this->validateDate($todosTo) || date_create($todosFrom) > date_create($todosTo) ){\n $todosFrom = '2020-10-10 00:00:00';\n $todosTo = date(\"Y-m-d 23:59:59\");\n }\n\n if (!ctype_alpha($todosCategory)){\n $todosCategory = 'all';\n }\n\n $getTodos = DB::table('user_todos')->select('todo')\n ->where('id', Auth::id())\n ->get();\n\n if (count($getTodos) > 0){\n $todos = json_decode($getTodos[0]->todo, true);\n\n $todoList = [];\n $categories = [];\n\n $firstCount = count($todos);\n\n if ($todosCategory !== 'all'){\n foreach ($todos as $time => $todo){\n $dateFrom = date_create($todosFrom);\n $dateTo = date_create($todosTo);\n $addedTime = date_create($time);\n if ($todosCategory === $todo['category'] && $addedTime >= $dateFrom && $addedTime <= $dateTo){\n $todoList[$time] = $todo;\n }\n if (!in_array($todo['category'], $categories)){\n array_push($categories, $todo['category']);\n }\n if ($addedTime > date_create(date('Y-m-d'))){\n unset($time);\n }\n }\n } else {\n foreach ($todos as $time => $todo){\n $dateFrom = date_create($todosFrom);\n $dateTo = date_create($todosTo);\n $addedTime = date_create($time);\n if ($addedTime >= $dateFrom && $addedTime <= $dateTo){\n $todoList[$time] = $todo;\n }\n if (!in_array($todo['category'], $categories)){\n array_push($categories, $todo['category']);\n }\n if ($addedTime > date_create(date('Y-m-d'))){\n unset($time);\n }\n }\n }\n\n $secondCount = count($todos);\n\n if ($firstCount > $secondCount){\n DB::table('user_todos')\n ->where('id', Auth::id())\n ->update(['todo' => json_encode($todos)]);\n }\n\n krsort($todoList);\n\n $data = [$todoList, $categories];\n\n } else {\n $data = [];\n }\n\n if ($request->hasHeader('Request-Medium')){\n return response()->json($data);\n } else {\n return view('/todo', ['todoData' => $data]);\n }\n } else {\n return redirect('/signin');\n }\n }", "function fetchTipo() {\n\n $tipos = array();\n\n $con = new DB();\n $sql = $con->prepare(\"SELECT * FROM tipo\");\n $result = $con->executeQuery($sql);\n\n foreach ($result as $row) {\n $id = $row['id'];\n $nombre = $row['nombre'];\n $tipo = new Tipo($id, $nombre);\n array_push($tipos, $tipo);\n }\n\n return $tipos;\n }", "public function listar()\n {\n return $this->request('GET', 'unidadesmedida');\n }", "protected function list($type = null)\n {\n $documents = $this->repository\n ->pushCriteria(app('Litepie\\Repository\\Criteria\\RequestCriteria'))\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n\n return $this->response->title(trans('$document::$document.names'))\n ->view('$document::public.document.index')\n ->data(compact('$documents'))\n ->output();\n }" ]
[ "0.6810606", "0.6740433", "0.6655522", "0.6643761", "0.65414137", "0.6497332", "0.64786375", "0.6441917", "0.6401906", "0.6374171", "0.63325936", "0.63288575", "0.62990177", "0.62312394", "0.6214008", "0.6201043", "0.6172661", "0.60776323", "0.6033479", "0.6017789", "0.6014871", "0.6010341", "0.60042346", "0.59936583", "0.59736234", "0.59596616", "0.5958153", "0.5950092", "0.5946687", "0.59306127", "0.5922847", "0.5915879", "0.5899299", "0.58703256", "0.5863998", "0.5861933", "0.585194", "0.58245933", "0.5810649", "0.57904726", "0.5787694", "0.5782066", "0.5781465", "0.5776686", "0.57685715", "0.57658124", "0.5763335", "0.5757417", "0.5753987", "0.57241184", "0.57232004", "0.5718805", "0.5706741", "0.57005316", "0.56982505", "0.56894565", "0.56892633", "0.56892633", "0.5683731", "0.56815934", "0.5680522", "0.567851", "0.5672484", "0.5665845", "0.56658244", "0.5657093", "0.56526196", "0.56521136", "0.5651264", "0.56474334", "0.56466764", "0.56356335", "0.56289726", "0.5628801", "0.56256855", "0.5622049", "0.5611424", "0.5608001", "0.560311", "0.5596862", "0.5593844", "0.5586689", "0.5586286", "0.55857295", "0.55841976", "0.55740225", "0.5571382", "0.55713403", "0.55641925", "0.55530906", "0.55526507", "0.55489707", "0.55489707", "0.55475324", "0.55470014", "0.5542316", "0.55403626", "0.5539716", "0.5534891", "0.55317694" ]
0.8069818
0
get list of user operations
public function getUserOperationsAction() { $operation = new Workapp_Operation(); $this->_helper->json($operation->getOperationList(array('user_id' => $this->getDeviceSession()->getUserId()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function retrieveUserActions()\n {\n return $this->start()->uri(\"/api/user-action\")\n ->get()\n ->go();\n }", "public function getOperations()\r\n {\r\n return $this->operations;\r\n }", "public function getOperations()\n {\n return $this->operations;\n }", "public function operations()\n {\n return $this->morphMany(History::class, 'user');\n }", "public function getList($user);", "public function getOperations() {\n return $this->__getFunctions();\n }", "public function actionOperations()\n\t{\n\t\tYii::app()->user->rightsReturnUrl = array('authItem/operations');\n\t\t\n\t\t$dataProvider = new RAuthItemDataProvider('operations', array(\n\t\t\t'type'=>CAuthItem::TYPE_OPERATION,\n\t\t\t'sortable'=>array(\n\t\t\t\t'id'=>'RightsOperationTableSort',\n\t\t\t\t'element'=>'.operation-table',\n\t\t\t\t'url'=>$this->createUrl('authItem/sortable'),\n\t\t\t\t'pagination'=>array(\n\t\t\t\t\t\t'pageSize'=>5,\n\t\t\t\t),\n\t\t\t),\n\t\t));\n\t\t\n\t\t// Render the view\n\t\t$this->render('operations', array(\n\t\t\t'dataProvider'=>$dataProvider,\n\t\t\t'isBizRuleEnabled'=>$this->module->enableBizRule,\n\t\t\t'isBizRuleDataEnabled'=>$this->module->enableBizRuleData,\n\t\t));\n\t}", "function get_users()\n {\n //Unimplemented\n }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "public function getUsersList()\n {\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function getUserList(){\n\t\t$this->load->database();\n\t\t$eventlist = $this->db->query(\"SELECT * FROM user \");\n\t\treturn $eventlist;\n\t}", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "public function allOperations(){\n $fonction = Auth::user()->fonction;\n if($fonction == 'admin') return redirect('/admin/dashboard');\n if($fonction == 'gest') return redirect('/gest/dashboard');\n //get all operations\n $operations['operations'] = DB::table('operations')->get();\n return view('tech.alloperations',$operations);\n }", "public function getCompareUserList() {}", "public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}", "public function index()\n {\n return Operation::all();\n }", "public function listAction()\n {\n $user = $this->get('security.context')->getToken()->getUser();\n $repositories = $user->getRepositorys();\n\n return array(\n 'name' => $user->getUsernameCanonical(),\n 'repositories' => $repositories\n );\n }", "public function actionListUser($id)\n {\n $operationId = new \\MongoId($id);\n $sensitiveOperation = SensitiveOperation::findByPk($operationId);\n\n if (empty($sensitiveOperation)) {\n throw new BadRequestHttpException('Incorrect operation id');\n }\n\n $accountId = $this->getAccountId();\n // the common condition\n $condition = ['isActivated' => true, 'role' => User::ROLE_OPERATOR, 'accountId' => $accountId];\n // query the selected user\n $selectedUsers = User::findAll(array_merge($condition, ['_id' => ['$in' => $sensitiveOperation->users]]));\n // query the unselected user\n $unselectedUsers = User::findAll(array_merge($condition, ['_id' => ['$nin' => $sensitiveOperation->users]]));\n return ['selectedUsers' => $selectedUsers, 'unselectedUsers' => $unselectedUsers];\n }", "public static function getActions()\n\t{\n\t\t$user\t= JFactory::getUser();\n\t\t$result\t= new JObject;\n\n\t\t$assetName = 'com_wbty_users';\n\n\t\t$actions = array(\n\t\t\t'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.edit.state', 'core.delete'\n\t\t);\n\n\t\tforeach ($actions as $action) {\n\t\t\t$result->set($action,\t$user->authorise($action, $assetName));\n\t\t}\n\n\t\treturn $result;\n\t}", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "public function getList()\r\n {\r\n $result = $this->query(\r\n \"SHOW USERS\",\r\n $this->getValueBuilder('Aviogram\\InfluxDB\\Entity\\Admin\\User')\r\n ->addField('user', 'getName', 'setName')\r\n ->addField('admin', 'isAdmin', 'setAdmin')\r\n );\r\n\r\n $return = new Collection\\Admin\\User();\r\n\r\n foreach ($result->getSeries() as $serie) {\r\n foreach($serie->getValues() as $value) {\r\n $return->append($value);\r\n }\r\n }\r\n\r\n return $return;\r\n }", "function getOperationInfo() {\n return userpoints_get_info($this->getOperation());\n }", "public function getVPOperationUsers($filter = array())\n {\n //$vp_ops_dept = 54;\n $vp_ops_dept = $this->em->getRepository(\"HrisAdminBundle:JobTitle\")->findBy(array('name'=> 'VP Operations'));\n \n $query = 'select d from HrisWorkforceBundle:Employee d where d.job_title = :code';\n $opts = $this->em ->createQuery($query)\n ->setParameter('code', $vp_ops_dept) \n ->getResult();\n\n $list_opts = array();\n foreach ($opts as $item)\n $list_opts[$item->getID()] = $item->getFirstName().' '.$item->getLastName();\n\n return $list_opts;\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function getOps(): array\n {\n return $this->ops;\n }", "public function index()\n {\n $users = $this->user->findByCancelFlag('N');\n return compact('users');\n }", "private function _getAllSectionOperations($userOperations)\n {\n $operations = [];\n\n $operationList = App::getInstance()\n ->getOperation()\n ->getSectionOperations(true);\n asort($operationList);\n\n $type = Operation::TYPE_SECTIONS;\n\n foreach ($operationList as $key => $label) {\n $value = false;\n $hasSections = array_key_exists(\n $type,\n $userOperations\n );\n if ($hasSections === true) {\n $hasAll = array_key_exists(\n Operation::ALL,\n $userOperations[$type]\n );\n if ($hasAll === true) {\n $value = in_array(\n $key,\n $userOperations[$type][Operation::ALL]\n );\n }\n }\n\n $operations[] = [\n 'label' => $label,\n 'name' => sprintf(\n 'operations.%s.%s.%s',\n $type,\n Operation::ALL,\n $key\n ),\n 'value' => $value\n ];\n }\n\n return $operations;\n }", "public function operationlist(Request $req)\n {\n $user = Report::all();\n \treturn view('nurse.OperationList', ['user'=>$user]);\n \n }", "public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}", "public function getOperators() {\n\t\t$query = $this->db->select('\n\t\t\tUser.UserID,\n\t\t\tUserFname,\n\t\t\tUserLname,\n\t\t\tNetID\n\t\t')->\n\t\tfrom('User')->\n\t\tjoin('UserRole', 'User.UserID = UserRole.UserID')->\n\t\tjoin('UserType', 'UserType.UserTypeID = UserRole.UserTypeID')->\n\t\twhere(\"UserTypeName = 'VenueOperator'\")\n\t\t->get();\n\n\t\treturn $query->result_array();\n\t}", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function getListUser()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"select * from m_user where username<>'admin' order by username desc\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "public function getUserTokens();", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function getOperations()\n {\n $operations = [];\n foreach (static::attributes() as $attribute => $type) {\n if ($type === Operation::class && isset($this->$attribute)) {\n $operations[$attribute] = $this->$attribute;\n }\n }\n return $operations;\n }", "public function listAction(){\n $r=$this->getRequest();\n $query=Doctrine_Query::create()\n ->select(\"uo.orgid, u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,r.role\")\n ->from(\"Users u\")\n ->leftJoin(\"u.Role r\")\n ->leftJoin(\"u.UsersOrganizations uo\")\n ->where(\"uo.orgid=\".$r->getParam('orgid'))\n ->addWhere(\"uo.active=\".Constants::UTENTE_ATTIVO);\n list($users,$total)=DBUtils::pageQuery($query,array(),$this->getLimit(),$this->getOffset());\n $this->emitTableResult($users,$total);\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public function getUserActivitiesAction()\n {\n $getOperations = false;\n $activity = new Workapp_Activity();\n $data = $this->getRequestData();\n if (isset($data['getoperations'])) {\n $getOperations = $data['getoperations'];\n }\n $this->_helper->json($activity->getActivityList(array('user_id' => $this->getDeviceSession()->getUserId(), 'getoperations' => $getOperations)));\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function getLTIUsers();", "function listUsers() {\n return $this->users;\n }", "public function getUserList() {\n return $this->users;\n }", "public function getOperation()\n {\n $objDataBase = $this->_connectSuperDataBase();\n\n $objDataBase->executeQueryStoreProcedure('get_Operations');\n\n\t $row = $objDataBase->exploreAllArraySelect();\n\n if (!isset($row)) {\n $row[0]['Pk_operation'] = 1;\n $row[0]['name'] = Class_Config::get('operation');\n $row[0]['domain'] = Class_Config::get('domain');\n }\n\t\n\n return $row;\n }", "public function operations();", "public function index()\n {\n return $this->user->all();\n }", "public function getUserOperationByIdAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) {\n $this->setErrorResponse('no Operation for this user with current operation_id!');\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n $this->_helper->json($operation);\n }", "public function get_actions() {\n $actions = parent::get_actions();\n $assignaction = new deepsight_action_usersetuser_assign($this->DB, 'usersetuserassign');\n $assignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n array_unshift($actions, $assignaction);\n return $actions;\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "public function getList(){\r\n \r\n $sql = \"SELECT * FROM ESTADO_USUARIO\";\r\n $ests = array();\r\n if(!$resultado = pg_Exec($this->conexion, $sql));\r\n\r\n while($row = pg_fetch_array($resultado))\r\n { \r\n $est = New Status_User();\r\n $est->setCod_estado($row[0]);\r\n $est->setNom_estado($row[1]);\r\n $ests[] = $est;\r\n }\r\n return $ests;\r\n }", "public function getOpinions()\n {\n return $this->hasMany(Opinions::class, ['task_id' => 'id']);\n }", "public function getUsers(){\n return self::getModel(\"users\", \"*\");\n }", "public function retrieveInactiveUserActions()\n {\n return $this->start()->uri(\"/api/user-action\")\n ->urlParameter(\"inactive\", true)\n ->get()\n ->go();\n }", "public function all_user()\n {\n $this->res->SetObject(RCD::SC, RCD::SC, FALSE, $this->db->get('user')->result());\n }", "public function getAllUser(){\n return $this->users;\n }", "public function index()\n\t{\n\t\t$operation = \"get\";\n\t\t$success = true;\n\t\t$errors = [];\n\n\t\t$user = Auth::user();\n\n\t\t$data = Status::findByUserId($user->id);\n\n\t\treturn compact('operation', 'success', 'data', 'errors');\n\t}", "function exchange_get_user_caps() {\n\treturn array(\n\t\t'list_users',\n\t\t'edit_users',\n\t\t'create_users',\n\t\t'add_users',\n\t\t'remove_users',\n\t\t'promote_users',\n\t);\n}", "function get_user_list()\n {\n $query = $this->db->get('user_login');\n return $query->result();\n }", "public function getAutoposList(){\n return $this->_get(2);\n }", "public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}", "public function get_list_admin()\n {\n $this->db->where('type', 1);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function getOperation();", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "function get_userlist() {\r\n \r\n $this->db->order_by('id', 'desc');\r\n $query = $this->db->get('users');\r\n return $query->result_array();\r\n }", "public function getUserListResult()\n {\n return $this->readOneof(16);\n }", "function user_list()\n\t{\n\t\t$this->db->where('is_active','1');\n\t\t\n\t\t$result = $this->db->get('user');\n\t\treturn $result->result_array();\n\t}", "private function _getAllBlockOperations($userOperations, $blockKey)\n {\n $operations = [];\n\n switch ($blockKey) {\n case BlockModel::TYPE_TEXT:\n $operationList = App::getInstance()->getOperation()\n ->getBlockTextOperations(true);\n break;\n case BlockModel::TYPE_IMAGE:\n $operationList = App::getInstance()->getOperation()\n ->getBlockImageOperations(true);\n break;\n default:\n $operationList = [];\n break;\n }\n\n asort($operationList);\n\n $type = Operation::TYPE_BLOCKS;\n\n foreach ($operationList as $key => $label) {\n $value = false;\n $hasBlocks = array_key_exists(\n $type,\n $userOperations\n );\n if ($hasBlocks === true) {\n $hasType = array_key_exists(\n $blockKey,\n $userOperations[$type]\n );\n if ($hasType === true) {\n $hasAll = array_key_exists(\n Operation::ALL,\n $userOperations[$type][$blockKey]\n );\n if ($hasAll === true) {\n $value = in_array(\n $key,\n $userOperations[$type][$blockKey][Operation::ALL]\n );\n }\n }\n }\n\n $operations[] = [\n 'label' => $label,\n 'name' => sprintf(\n 'operations.%s.%s.%s.%s',\n $type,\n $blockKey,\n Operation::ALL,\n $key\n ),\n 'value' => $value\n ];\n }\n\n return $operations;\n }", "public function getAllUsers()\n {\n return \"users from mongo\";\n }", "abstract protected function getCommandList();", "public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }", "public function getAllowedOperations()\n {\n return [\n self::OPERATION_REQUEST,\n self::OPERATION_CANCEL,\n self::OPERATION_APPROVE,\n self::OPERATION_REJECT,\n self::OPERATION_QUERY,\n ];\n }", "public function getAllUser()\n\t{\n\t\t$data = $this->db->get('admin');\n\t\treturn $data->result_array();\n\t}", "public function index()\n {\n $this->user_list();\n }", "function getUsersWithUserRights() {\n\n $userRightsUsers = array();\n $allUsers = REDCap::getUsers();\n foreach($allUsers as $cnt => $user) {\n $rights = REDCap::getUserRights($user);\n if ($rights[$user][\"user_rights\"] == 1) {\n $userRightsUsers[] = $user;\n }\n }\n\n return $userRightsUsers;\n\n}", "public function indexAdmin ()\n {\n $listOfUsers = $this->userRequest->usersIndexForAdmin();\n return $listOfUsers;\n }", "public function users(){\n\t\t$user = $this->ion_auth->user()->row();\n\n\t\t$query = $this->db->select()\n\t\t\t\t\t\t\t\t\t\t\t ->from('users')\n\t\t\t\t\t\t\t\t\t\t\t ->where('admin_id',$user->id)\n\t\t\t\t\t\t\t\t\t\t\t ->order_by('id', 'asc')\n\t\t\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $query;\n\t}", "public static function getActions()\n\t{\n\t\t$user\t= JFactory::getUser();\n\t\t$result\t= new JObject;\n\n\t\t$actions = array(\n\t\t\t'core.admin', 'core.manage'\n\t\t);\n\n\t\tforeach ($actions as $action) {\n\t\t\t$result->set($action, $user->authorise($action, 'com_repair'));\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getUserTodosAction()\n {\n $todo = new Workapp_Todo();\n $this->_helper->json($todo->getTodoList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "function statusModificationList( $user = false )\n {\n if ( $user === false )\n $user = eZUser::currentUser();\n else if ( is_numeric( $user ) )\n $user = eZUser::fetch( $user );\n\n if ( !is_object( $user ) )\n {\n eZDebug::writeError( \"Cannot calculate status access list without a user\", __METHOD__ );\n return false;\n }\n\n $accessResult = $user->hasAccessTo( 'owshop' , 'setstatus' );\n $accessWord = $accessResult['accessWord'];\n $access = false;\n\n $currentStatusID = $this->attribute( \"status_id\" );\n\n $statusList = array();\n if ( $accessWord == 'yes' )\n {\n // We have full access so we return all of them\n $statusList = eZOrderStatus::fetchOrderedList( true, false );\n return $statusList;\n }\n\n if ( $accessWord == 'limited' )\n {\n $limitationList = $accessResult['policies'];\n $access = true;\n // All 'to' statues will be appended to this array\n $accessList = array();\n foreach ( $limitationList as $pid => $limit )\n {\n $access = true;\n foreach ( $limit as $name => $value )\n {\n if ( $name == 'FromStatus' )\n {\n if ( !in_array( $currentStatusID, $value ) )\n $access = false;\n }\n if ( !$access )\n break;\n }\n if ( $access )\n {\n if ( isset( $limit['ToStatus'] ) )\n {\n $accessList = array_merge( $accessList, $limit['ToStatus'] );\n }\n else\n {\n // We have full access for the current status so we return all of them\n $statusList = eZOrderStatus::fetchOrderedList( true, false );\n return $statusList;\n }\n }\n }\n if ( count( $accessList ) > 0 )\n {\n $accessList = array_unique( array_merge( $accessList, array( $currentStatusID ) ) );\n $statuses = eZOrderStatus::fetchOrderedList( true, false );\n foreach ( $statuses as $status )\n {\n if ( in_array( $status->attribute( 'status_id' ), $accessList ) )\n $statusList[] = $status;\n }\n }\n }\n return $statusList;\n }", "public function index()\n {\n $query = [];\n if(!$this->user->is_admin){\n array_push($query,['user_id','=',$this->user->id]);\n }\n return $this->helper->get(null,$query);\n }", "function getUsers(){\n\t\t$this->users = $this->fileHandler->parseRows($this->userFile, '^', '|');\n\t\t$this->logMsg(SUCCESS, 'users generated');\n\t}", "public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }", "public function getUserTodos()\n {\n return $this->userTodos;\n }", "function ulist_op()\n\t{\n\t\t$club_id = 0;\n\t\tif (isset($_REQUEST['club_id']))\n\t\t{\n\t\t\t$club_id = (int)$_REQUEST['club_id'];\n\t\t}\n\t\t\n\t\t$num = 0;\n\t\tif (isset($_REQUEST['num']))\n\t\t{\n\t\t\t$num = (int)$_REQUEST['num'];\n\t\t}\n\t\t\n\t\t$name = '';\n\t\tif (isset($_REQUEST['name']))\n\t\t{\n\t\t\t$name = $_REQUEST['name'];\n\t\t}\n\t\t\n\t\tarray();\n\t\tif (!empty($name))\n\t\t{\n\t\t\t$name_wildcard = '%' . $name . '%';\n\t\t\t$query = new DbQuery(\n\t\t\t\t'SELECT u.id, u.name as _name, NULL, u.flags, c.name FROM users u' .\n\t\t\t\t\t' LEFT OUTER JOIN clubs c ON c.id = u.club_id' .\n\t\t\t\t\t' WHERE (u.name LIKE ? OR u.email LIKE ?) AND (u.flags & ' . USER_FLAG_BANNED . ') = 0' .\n\t\t\t\t\t' UNION' .\n\t\t\t\t\t' SELECT DISTINCT u.id, u.name as _name, r.nick_name, u.flags, c.name FROM users u' .\n\t\t\t\t\t' LEFT OUTER JOIN clubs c ON c.id = u.club_id' .\n\t\t\t\t\t' JOIN registrations r ON r.user_id = u.id' .\n\t\t\t\t\t' WHERE r.nick_name <> u.name AND (u.flags & ' . USER_FLAG_BANNED . ') = 0 AND r.nick_name LIKE ? ORDER BY _name',\n\t\t\t\t$name_wildcard,\n\t\t\t\t$name_wildcard,\n\t\t\t\t$name_wildcard);\n\t\t}\n\t\telse if ($club_id > 0)\n\t\t{\n\t\t\t$query = new DbQuery('SELECT u.id, u.name, NULL, u.flags, c.name FROM users u JOIN user_clubs uc ON u.id = uc.user_id LEFT OUTER JOIN clubs c ON c.id = u.club_id WHERE uc.club_id = ? AND (uc.flags & ' . USER_CLUB_FLAG_BANNED . ') = 0 AND (u.flags & ' . USER_FLAG_BANNED . ') = 0 ORDER BY rating DESC', $club_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query = new DbQuery('SELECT u.id, u.name, NULL, u.flags, c.name FROM users u LEFT OUTER JOIN clubs c ON c.id = u.club_id WHERE (u.flags & ' . USER_FLAG_BANNED . ') = 0 ORDER BY rating DESC');\n\t\t}\n\t\t\n\t\tif ($num > 0)\n\t\t{\n\t\t\t$query->add(' LIMIT ' . $num);\n\t\t}\n\t\t\n\t\t$list = array();\n\t\twhile ($row = $query->next())\n\t\t{\n\t\t\tlist ($u_id, $u_name, $nick, $u_flags, $club_name) = $row;\n\t\t\t$p = new GPlayer($u_id, $u_name, $club_name, $u_flags, USER_CLUB_PERM_PLAYER);\n\t\t\tif ($nick != NULL && $nick != $u_name)\n\t\t\t{\n\t\t\t\t$p->nicks[$nick] = 1; \n\t\t\t}\n\t\t\t$list[] = $p;\n\t\t}\n\t\t$this->response['list'] = $list;\n\t}", "public function getAllUsers(){\n\t\treturn $this->user;\n\t}", "public static function all() {\n try {\n $db = Database::getInstance();\n $sql = \"SELECT username, is_admin, token, token_expiration FROM `User`\";\n $stmt = $db->prepare($sql);\n $stmt->execute();\n \n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function getAction(){\n \t$user=Doctrine_Query::create()\n\t\t ->select(\"u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,u.ID_role\")\n\t\t ->from(\"Users u\")\n\t\t ->addWhere(\"u.ID=?\",$this->getRequest()->getParam('id'))\n\t\t ->fetchOne(null,Doctrine::HYDRATE_ARRAY);\n $this->emitLoadData($user);\n }", "public function list(): array\n {\n return User::all()->toArray();\n }", "public function getUserList() {\n $users = DB::select(\"select * from users\");\n $count = DB::table(\"users\") -> count();\n $data = [];\n foreach ($users as $user) {\n array_push($data, array(\n \"id\" => $user -> id,\n \"role\" => ($user -> role == 0)?\"Inactive\":($user -> role == 1?\"Active\":'[ Admin ]'),\n \"fname\" => $user -> fname,\n \"lname\" => $user -> lname,\n \"affiliation\" => $user -> affiliation,\n \"email\" => $user -> email,\n \"created_at\" => $user -> created_at,));\n };\n return array(\"code\" => 0, \"msg\" => \"\", \"count\" => $count, \"data\" => $data);\n }", "function _getCommands()\n\t{\n\t\t$commands = array();\n\t\t$commands[] = array( 'permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true );\n//\t\t$commands[] = array('permission' => 'read', 'cmd' => 'render', 'lang_var' => 'show', 'default' => true);\n//\t\t$commands[] = array('permission' => 'write', 'cmd' => 'enableAdministrationPanel', 'lang_var' => 'edit_content');\n//\t\t$commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings' );\n\n\t\treturn $commands;\n\t}", "public static function getlist(){\n $sql = new Sql();\n \n return $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }", "public function get_actions() {\n $actions = parent::get_actions();\n $unassignaction = new deepsight_action_usersetuser_unassign($this->DB, 'usersetuserunassign');\n $unassignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n $unassignaction->condition = 'function(rowdata) { return (rowdata.canunassign == \\'0\\') ? false : true; }';\n array_unshift($actions, $unassignaction);\n return $actions;\n }", "public function getUsers()\n {\n return User::where('user_status', 1)->get();\n }", "protected function getUserAndAdminCommands(): array\n {\n /** @var Command[] $all_commands */\n $all_commands = $this->telegram->getCommandsList();\n\n // Only get enabled Admin and User commands that are allowed to be shown.\n $commands = array_filter($all_commands, function ($command): bool {\n return !$command->isSystemCommand() && $command->showInHelp() && $command->isEnabled();\n });\n\n // Filter out all User commands\n $user_commands = array_filter($commands, function ($command): bool {\n return $command->isUserCommand();\n });\n\n // Filter out all Admin commands\n $admin_commands = array_filter($commands, function ($command): bool {\n return $command->isAdminCommand();\n });\n\n ksort($commands);\n ksort($user_commands);\n ksort($admin_commands);\n\n return [$commands, $user_commands, $admin_commands];\n }" ]
[ "0.680076", "0.6613225", "0.65985155", "0.63677585", "0.6356829", "0.6329935", "0.6310219", "0.6276504", "0.6249319", "0.6248521", "0.6200661", "0.6200661", "0.6114851", "0.61132526", "0.6097535", "0.60906106", "0.60802996", "0.6047144", "0.60229105", "0.59813344", "0.59746826", "0.5967244", "0.5958507", "0.5942534", "0.5937592", "0.5936893", "0.59336406", "0.5919153", "0.5917773", "0.5917773", "0.5917773", "0.5905905", "0.5896168", "0.586291", "0.5859423", "0.58587927", "0.5854997", "0.584638", "0.58374596", "0.58323354", "0.58203226", "0.581579", "0.5807217", "0.58069193", "0.580352", "0.5796693", "0.57963157", "0.5788759", "0.57818455", "0.5776864", "0.5775983", "0.5751387", "0.5749578", "0.5747225", "0.5737984", "0.5731238", "0.57257265", "0.57070917", "0.57051826", "0.5697132", "0.5689757", "0.56885195", "0.5680764", "0.5677293", "0.5666485", "0.56642956", "0.566281", "0.5661963", "0.5657401", "0.5649877", "0.5643369", "0.5641875", "0.56409484", "0.56401944", "0.56394356", "0.5632665", "0.56276524", "0.56215566", "0.56204814", "0.56204736", "0.56191254", "0.5617719", "0.5616523", "0.5606733", "0.56001467", "0.55998665", "0.55990195", "0.5597191", "0.55944026", "0.559137", "0.5588777", "0.5587497", "0.5585453", "0.5585179", "0.5581626", "0.55813795", "0.5571823", "0.55715615", "0.55690193", "0.5566566" ]
0.8104111
0
returns user operation by operation_id operation_id mandatory field
public function getUserOperationByIdAction() { /** @var Object_Operation $operation */ $data = $this->getRequestData(); if (isset($data['operation_id'])) { $operation = Object_Operation::getById($data['operation_id']); if (!$operation) { $this->setErrorResponse('no Operation with this operation_id!'); } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) { $this->setErrorResponse('no Operation for this user with current operation_id!'); } } else { $this->setErrorResponse('operation_id is mandatory field for this request!'); } $this->_helper->json($operation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOperation();", "public function getOperationId()\n {\n return $this->operation_id;\n }", "public function getEventOperation($id)\n {\n\n $FillableDropdown = new FillableDropdown();\n $operations = $FillableDropdown->eventOperations($default = 2);\n\n $event = Events::findOrFail($id);\n if(count($event) > 0){\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $user_id = $user->id;\n }else{\n\n $user_id = false;\n }\n\n if (isset($user_id)) {\n\n $subscribed_event = $event->user()\n ->wherePivot('user_id', '=', $user_id)\n ->select('operation')\n ->get();\n\n if(isset($subscribed_event) && $subscribed_event->count() > 0){\n\n\n if(isset($subscribed_event[0])){\n\n $op_key = $subscribed_event->first()->operation;\n }\n\n $operation_arr = array();\n if(count($operations) > 0 && isset($op_key)){\n\n foreach (array_values($operations) as $index => $value){\n\n if($index%2 == 0){\n\n $operation_arr = array_add($operation_arr, $index, $value);\n }\n if($op_key == $index && $op_key%2 == 0){\n\n $operation_arr = array_add($operation_arr, $index+1, $operations[$index+1]);\n }\n if($op_key == $index && $op_key%2 != 0){\n\n $operation_arr = array_add($operation_arr, $index-1, $operations[$index-1]);\n }\n\n }\n\n\n if(count($operation_arr) > 0){\n\n if (array_key_exists($op_key, $operation_arr)) {\n\n $operations = array_except($operation_arr, [$op_key]);\n\n return $operations;\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n }else{\n\n return false;\n }\n }\n else{\n return false;\n }\n\n }\n }", "function getOperation() {\n\t\treturn $this->get('_operation', $this->get('operation'));\n\t}", "public function getOperationId(): ?string;", "function getOperation() {\n return $this->operation;\n }", "public function operation($operation);", "public function getOperation($name);", "public function getOperation()\n {\n return $this->operation;\n }", "public function getOperation()\n {\n return $this->operation;\n }", "public function getOperation()\n {\n return $this->operation;\n }", "public function getOperation()\n {\n return $this->operation;\n }", "public function getOperation()\n {\n return $this->operation;\n }", "public function getOperation() {\n\t\treturn $this->operation;\n\t}", "public function createUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['title']) && isset($data['activity_id'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/operations/' . $user->getKey() . \"-operations\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-operations\");\n $folder->setParentId(4);\n $folder->save();\n }\n\n $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']);\n\n $operation = new Object_Operation();\n $operation->setCreator($user);\n $operation->setTitle($data['title']);\n $operation->setExplanation(isset($data['explanation']) ? $data['explanation'] : \"\");\n $operation->setLocation($geo);\n $operation->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : \"\");\n $operation->setVideo(isset($data['video']) ? Asset_Video::getById($data['video']) : \"\");\n $operation->setActivity(Object_Activity::getById($data['activity_id']));\n $operation->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $operation->setPublished(true);\n $operation->setParentId($folder->getId());\n if (!$operation->save()) {\n $this->setErrorResponse('cannot save Operation object');\n }\n } else {\n $this->setErrorResponse('title and activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($operation);\n }", "public function deleteUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $operation->getCreator()->getId()) {\n $operation->setPublished(false);\n if (!$operation->save()) {\n $this->setErrorResponse('cannot delete Operation object!');\n }\n } else {\n $this->setErrorResponse('no Operation for this user with current operation_id!');\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function getOperation()\n {\n $objDataBase = $this->_connectSuperDataBase();\n\n $objDataBase->executeQueryStoreProcedure('get_Operations');\n\n\t $row = $objDataBase->exploreAllArraySelect();\n\n if (!isset($row)) {\n $row[0]['Pk_operation'] = 1;\n $row[0]['name'] = Class_Config::get('operation');\n $row[0]['domain'] = Class_Config::get('domain');\n }\n\t\n\n return $row;\n }", "public function addOperation(string $operation): OperationInterface;", "public function getOpId()\n {\n\n return $this->op_id;\n }", "public function delete(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function updateUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Operation!');\n } else {\n if (isset($data['title'])) {\n $operation->setTitle($data['title']);\n }\n if (isset($data['explanation'])) {\n $operation->setExplanation($data['explanation']);\n }\n if (isset($data['photo'])) {\n $operation->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (isset($data['video'])) {\n $operation->setVideo(Asset_Video::getById($data['video']));\n }\n if (isset($data['latitude']) && isset($data['longtitude'])) {\n $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']);\n $operation->setLocation($geo);\n }\n if (isset($data['activity_id'])) {\n $operation->setActivity(Object_Activity::getById($data['activity_id']));\n }\n if (!$operation->save()) {\n $this->setErrorResponse('cannot update Operation object');\n }\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n\n $this->_helper->json($operation);\n }", "public function getOperation(): string\n {\n return $this->operation;\n }", "public function getOperation(): string\n {\n return $this->operation;\n }", "public function operationName(): ?string;", "public static function getOperation(\\GraphQL\\Language\\AST\\DocumentNode $document, $operationName = null)\n {\n }", "function getOperation() {\n\t\tif (isset($_POST['operation'])){\n\t\t\treturn $_POST['operation'];\n\t\t}\n\t\treturn \"index\";\n\t}", "public function update(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "function getOperationInfo() {\n return userpoints_get_info($this->getOperation());\n }", "public function getToken($operation)\n {\n return $this->_token($operation);\n }", "public function access($op, $id = NULL) {\n return entity_access($op, $this->entityType, isset($id) ? $this->wrapper($id)->value() : NULL);\n }", "protected function findMyOperationByPurse($operationId, $purseId)\n {\n return $this\n ->getManager()\n ->getRepository('AccountingApiBundle:Operation')\n ->findOneByIdAndPurseIdAndUserId($operationId, $purseId, $this->getCurrentUser()->getId());\n }", "public function getUserOperationsAction()\n {\n $operation = new Workapp_Operation();\n $this->_helper->json($operation->getOperationList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "protected function _getOperationName()\n {\n $operation = lcfirst($this->_getContainer()->getConfig()->getRequestParameter('operation'));\n\n if (method_exists($this->_getContainer()->getClient(), $operation)) {\n return $operation;\n }\n\n $this->setViewData(array('sError' => \"Operation '{$operation}' does not exist\"));\n return false;\n }", "public abstract function isAllowed($operation);", "public function getOperation()\n {\n return $this->getRequest()->operation;\n }", "private function _getSectionIdOperations($userOperations, $sectionId)\n {\n $operations = [];\n\n $operationList = App::getInstance()\n ->getOperation()\n ->getSectionOperations(false);\n asort($operationList);\n\n foreach ($operationList as $key => $label) {\n $value = false;\n $hasSections = array_key_exists(\n Operation::TYPE_SECTIONS,\n $userOperations\n );\n if ($hasSections === true) {\n $hasSectionId = array_key_exists(\n $sectionId,\n $userOperations[Operation::TYPE_SECTIONS]\n );\n if ($hasSectionId === true) {\n $value = in_array(\n $key,\n $userOperations[Operation::TYPE_SECTIONS][$sectionId]\n );\n }\n }\n\n $operations[] = [\n 'label' => $label,\n 'name' => sprintf(\n 'operations.%s.%s.%s',\n Operation::TYPE_SECTIONS,\n $sectionId,\n $key\n ),\n 'value' => $value\n ];\n }\n\n return $operations;\n }", "public function show(Operation $operation)\n {\n $array = [\n 'operation' => $operation,\n 'client' => $operation->Client,\n 'compte' => $operation->Compte,\n 'type' => $operation->Type\n ];\n return $operation;\n }", "public function getService($operation)\n {\n return $this->services[$operation];\n }", "public function restore(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "protected function getCrudOperation() {\n\t\treturn $this->crudOperation;\n\t}", "public function apiCall($operation)\n {\n return $this->client->call($operation);\n }", "protected function compute_operation(&$data) {\n\n $operations = $this->get_operations_array();\n\n foreach($operations as $xml_node_name => $label) {\n if(array_key_exists($xml_node_name, $data)) {\n $data['OPERATION'] = $data[$xml_node_name];\n unset($data[$xml_node_name]);\n return $xml_node_name;\n }\n }\n }", "protected function userHasAccess(string $operation): bool {\n return $this->ogAccess->userAccessGroupContentEntityOperation($operation, $this->group, $this->groupContent, $this->user)->isAllowed();\n }", "function getCommandById($op,$id){\n\t$sql = \"select * from common_cmd where cmd_type=\".$id;\n\t$res = $op->getResult($sql);\n\t$c = new Command();\n\twhile($row = mysql_fetch_row($res)){\n\t\t$c->cmd_type = $row[0];\n $c->content = $row[1];\n $c->need_sudo = $row[2];\n $c->cmd_desc= $row[3];\n\t}\n\treturn $c;\n}", "public function view(User $user, Operation $operation)\n {\n //\n }", "function get_operation_type_name_by_id($operation_type_id)\n {\n return $this->operation_type_array[$operation_type_id]['name'];\n }", "public function forceDelete(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function getOperationType()\n {\n return $this->operation_type;\n }", "public function getOperationType(): ?string;", "public function setOperationId($var)\n {\n GPBUtil::checkString($var, True);\n $this->operation_id = $var;\n\n return $this;\n }", "private function _getBlockIdOperations(\n $operationList,\n $userOperations,\n $blockKey,\n $blockId\n ) {\n $operations = [];\n\n $type = Operation::TYPE_BLOCKS;\n\n foreach ($operationList as $key => $label) {\n $value = false;\n $hasBlocks = array_key_exists(\n $type,\n $userOperations\n );\n if ($hasBlocks === true) {\n $hasType = array_key_exists(\n $blockKey,\n $userOperations[$type]\n );\n if ($hasType === true) {\n $hasId = array_key_exists(\n $blockId,\n $userOperations[$type][$blockKey]\n );\n if ($hasId === true) {\n $value = in_array(\n $key,\n $userOperations[$type][$blockKey][$blockId]\n );\n }\n }\n }\n\n $operations[] = [\n 'label' => $label,\n 'name' => sprintf(\n 'operations.%s.%s.%s.%s',\n $type,\n $blockKey,\n $blockId,\n $key\n ),\n 'value' => $value\n ];\n }\n\n return $operations;\n }", "public function execute($operation = NULL)\n\t{\n\t\tif (is_null($operation))\n\t\t{\n\t\t\t$modalWindowId = preg_replace('/[^A-Za-z0-9_-]/', '', Core_Array::getGet('modalWindowId', '', 'str'));\n\t\t\t$windowId = $modalWindowId ? $modalWindowId : $this->_Admin_Form_Controller->getWindowId();\n\n\t\t\t$amount = $this->_object->getShopDocumentRelatedAmount();\n\n\t\t\tob_start();\n\n\t\t\tCore_Html_Entity::factory('Script')\n\t\t\t\t->value('$(function() {\n\t\t\t\t\t$(\"#' . $windowId . ' input[name = amount]\").val(\"' . $amount . '\");\n\t\t\t\t\t$(\"#' . $windowId . ' .amount-alert\").addClass(\"hidden\");\n\t\t\t\t})')\n\t\t\t\t->execute();\n\n\t\t\t$this->addMessage(ob_get_clean());\n\n\t\t\treturn TRUE;\n\t\t}\n\t}", "private function normalizeOperation($operation)\n {\n switch ($operation) {\n case '<>':\n return '$ne';\n break;\n case '=':\n return '$eq';\n break;\n case '>':\n return '$gt';\n break;\n case '<':\n return '$lt';\n break;\n case '>=':\n return '$gte';\n break;\n case '<=':\n return '$lte';\n break;\n default:\n throw new \\Exception('Invalid operator ' . $operation);\n }\n\n }", "public function execute($operation = NULL)\r\n\t{\r\n\t\t$oShopItemParent = Core_Entity::factory('Shop_Item', intval(Core_Array::getPost('shop_item_id', 0)));\r\n\t\t$oShop = $oShopItemParent->Shop;\r\n\t\t$oShopGroup = $oShopItemParent->Shop_Group;\r\n\t\t$oShopDir = $oShop->Shop_Dir;\r\n\r\n\t\t$iIndex = 0;\r\n\t\t$aPropertiesId = array();\r\n\t\t$aData = array();\r\n\t\tforeach($_POST as $key => $sPostData)\r\n\t\t{\r\n\t\t\tif(strpos($key, 'property_') === 0)\r\n\t\t\t{\r\n\t\t\t\t$iPropertyID = explode('_', $key);\r\n\r\n\t\t\t\t$oProperty = Core_Entity::factory('Property')->find($iPropertyID[1]);\r\n\r\n\t\t\t\t$aPropertiesId[] = $iPropertyID[1];\r\n\r\n\t\t\t\t$aList_Items = $oProperty->List->List_Items->getAllByActive(1);\r\n\r\n\t\t\t\tif(isset($_POST[\"property{$oProperty->id}list\"]))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($_POST[\"property{$oProperty->id}list\"] as $value)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$aData[$iIndex][] = array(\r\n\t\t\t\t\t\t\t'property' => $oProperty,\r\n\t\t\t\t\t\t\t'list_item' => Core_Entity::factory('List_Item', $value)\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$iIndex++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sName = Core_Array::getPost('name');\r\n\r\n\t\t$aResult = Core_Array::combine($aData);\r\n\r\n\t\t$iCount = 1;\r\n\r\n\t\tforeach ($aResult as $aTmpResult)\r\n\t\t{\r\n\t\t\t$sTmpName = $sName;\r\n\t\t\tforeach ($aTmpResult as $aTmpList)\r\n\t\t\t{\r\n\t\t\t\t$sTmpName = str_replace(\"{P{$aTmpList['property']->id}}\", $aTmpList['list_item']->value, $sTmpName);\r\n\t\t\t}\r\n\r\n\t\t\t// Вставка модификации\r\n\t\t\t$oShopItem = Core_Entity::factory('Shop_Item');\r\n\r\n\t\t\t$oShopItem->name = $sTmpName;\r\n\t\t\t$oShopItem->modification_id = $oShopItemParent->id;\r\n\t\t\t$oShopItem->shop_group_id = 0;\r\n\t\t\t$oShopItem->price = Core_Array::getPost('price');\r\n\t\t\t$oShopItem->shop_currency_id = Core_Array::getPost('currency');\r\n\t\t\t$oShopItem->shop_measure_id = Core_Array::getPost('measure');\r\n\t\t\t$oShopItem->marking = str_replace(\"{N}\", $iCount++, Core_Array::getPost('marking'));\r\n\t\t\t$oShopItem->shop_id = $oShopItemParent->shop_id;\r\n\t\t\t$oShopItem->save();\r\n\r\n\t\t\t// Копировать основные свойства\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_main_properties')))\r\n\t\t\t{\r\n\t\t\t\t$oShopItem->datetime = $oShopItemParent->datetime;\r\n\t\t\t\t$oShopItem->start_datetime = $oShopItemParent->start_datetime;\r\n\t\t\t\t$oShopItem->end_datetime = $oShopItemParent->end_datetime;\r\n\t\t\t\t$oShopItem->shop_seller_id = $oShopItemParent->shop_seller_id;\r\n\t\t\t\t$oShopItem->shop_producer_id = $oShopItemParent->shop_producer_id;\r\n\t\t\t\t$oShopItem->shop_tax_id = $oShopItemParent->shop_tax_id;\r\n\t\t\t\t$oShopItem->description = $oShopItemParent->description;\r\n\t\t\t\t$oShopItem->text = $oShopItemParent->text;\r\n\t\t\t\t$oShopItem->image_large = $oShopItemParent->image_large;\r\n\t\t\t\t$oShopItem->image_small = $oShopItemParent->image_small;\r\n\t\t\t\t$oShopItem->length = $oShopItemParent->length;\r\n\t\t\t\t$oShopItem->width = $oShopItemParent->width;\r\n\t\t\t\t$oShopItem->height = $oShopItemParent->height;\r\n\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tCore_File::copy($oShopItemParent->getLargeFilePath(), $oShopItem->getLargeFilePath());\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception $e) {}\r\n\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tCore_File::copy($oShopItemParent->getSmallFilePath(), $oShopItem->getSmallFilePath());\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception $e) {}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать SEO-поля\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_seo')))\r\n\t\t\t{\r\n\t\t\t\t$oShopItem->seo_title = $oShopItemParent->seo_title;\r\n\t\t\t\t$oShopItem->seo_description = $oShopItemParent->seo_description;\r\n\t\t\t\t$oShopItem->seo_keywords = $oShopItemParent->seo_keywords;\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать поля вкладки \"Экспорт/Импорт\"\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_export_import')))\r\n\t\t\t{\r\n\t\t\t\t$oShopItem->yandex_market = $oShopItemParent->yandex_market;\r\n\t\t\t\t$oShopItem->vendorcode = $oShopItemParent->vendorcode;\r\n\t\t\t\t$oShopItem->yandex_market_bid = $oShopItemParent->yandex_market_bid;\r\n\t\t\t\t$oShopItem->yandex_market_cid = $oShopItemParent->yandex_market_cid;\r\n\t\t\t\t$oShopItem->yandex_market_sales_notes = $oShopItemParent->yandex_market_sales_notes;\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать дополнительные цены для товара\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_prices_to_item')))\r\n\t\t\t{\r\n\t\t\t\t$aShop_Item_Prices = $oShopItemParent->Shop_Item_Prices->findAll();\r\n\r\n\t\t\t\tforeach($aShop_Item_Prices as $oShop_Item_Price)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oShop_Item_Price_Copy = clone $oShop_Item_Price;\r\n\t\t\t\t\t$oShop_Item_Price_Copy->shop_item_id = $oShopItem->id;\r\n\t\t\t\t\t$oShop_Item_Price_Copy->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать специальные цены\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_specials_prices_to_item')))\r\n\t\t\t{\r\n\t\t\t\t$aShop_Specialprices = $oShopItemParent->Shop_Specialprices->findAll();\r\n\r\n\t\t\t\tforeach($aShop_Specialprices as $oShop_Specialprice)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oShop_Specialprice_Copy = clone $oShop_Specialprice;\r\n\t\t\t\t\t$oShop_Specialprice_Copy->shop_item_id = $oShopItem->id;\r\n\t\t\t\t\t$oShop_Specialprice_Copy->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать сопутствующие товары\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_tying_products')))\r\n\t\t\t{\r\n\t\t\t\t\t$aShop_Item_Associated = $oShopItemParent->Shop_Item_Associateds->findAll();\r\n\r\n\t\t\t\t\tforeach($aShop_Item_Associated as $oShop_Item_Associated)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$oShop_Item_Associated_Copy = clone $oShop_Item_Associated;\r\n\t\t\t\t\t\t$oShop_Item_Associated_Copy->shop_item_id = $oShopItem->id;\r\n\t\t\t\t\t\t$oShop_Item_Associated_Copy->save();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать дополнительные свойства\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_external_property')))\r\n\t\t\t{\r\n\t\t\t\t$aPropertyValues = $oShopItemParent->getPropertyValues();\r\n\t\t\t\tforeach($aPropertyValues as $oPropertyValue)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Не копируем св-во, по которому создается модификация\r\n\t\t\t\t\tif (!in_array($oPropertyValue->property_id, $aPropertiesId))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$oNewPropertyValue = clone $oPropertyValue;\r\n\t\t\t\t\t\t$oNewPropertyValue->entity_id = $oShopItem->id;\r\n\t\t\t\t\t\t$oNewPropertyValue->save();\r\n\r\n\t\t\t\t\t\tif ($oNewPropertyValue->Property->type == 2)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCore_File::copy($oShopItemParent->getItemPath() . $oPropertyValue->file, $oShopItem->getItemPath() . $oPropertyValue->file);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (Exception $e) {}\r\n\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCore_File::copy($oShopItemParent->getItemPath() . $oPropertyValue->file_small, $oShopItem->getItemPath() . $oPropertyValue->file_small);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (Exception $e) {}\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}\r\n\r\n\t\t\t// Копировать метки\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_tags')))\r\n\t\t\t{\r\n\t\t\t\t$aTags = $oShopItemParent->Tags->findAll();\r\n\t\t\t\tforeach($aTags as $oTag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oShopItem->add($oTag);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Значения св-в для создаваемых модификаций\r\n\t\t\tforeach ($aTmpResult as $aTmpList)\r\n\t\t\t{\r\n\t\t\t\t$oPropertyValue = $aTmpList['property']->createNewValue($oShopItem->id);\r\n\t\t\t\t$oPropertyValue->value($aTmpList['list_item']->id);\r\n\t\t\t\t$oPropertyValue->save();\r\n\t\t\t}\r\n\r\n\t\t\t$oShopItem->save();\r\n\t\t}\r\n\r\n\t\treturn $this;\r\n\t}", "public function setOperation($operation) {\n\t\t$this->operation = $operation;\n\t\treturn $this;\n\t}", "public function setOperation($operation)\n {\n $this->operation = $operation;\n return $this;\n }", "public function eventOperation($e_id, $op_key)\n {\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $user_id = $user->id;\n } else{\n\n return redirect()->route('user.login')->with('error', 'Please login ');\n }\n\n if (isset($user_id)){\n\n $user = User::findOrFail($user_id);\n if (count($user) > 0){\n\n if($user->events){\n\n $event = $user->events()->wherePivot('events_id', '=', $e_id)->get();\n\n if(count($event) > 0) {\n if (isset($event[0])) {\n\n\n if (isset($event[0]->pivot->operation)) {\n\n $event[0]->pivot->operation = $op_key;\n $event[0]->pivot->save();\n\n return redirect()->route('event.index')->with('success', 'Operation is performed successfully.');\n }\n }\n }\n else{\n\n $user->events()->attach($e_id, ['operation' => $op_key]);\n return redirect()->route('event.index')->with('success', 'Operation is performed successfully.');\n }\n }\n }\n }\n }", "public function hasOperation($name);", "public function getOperatorById($id)\n {\n\t\treturn $this -> db -> fetchRow('SELECT * FROM '.self::TABLE_NAME.' WHERE id = ?', $id); \t\n }", "protected function _getOPSPaymentOperation()\n {\n $value = $this->getPaymentAction();\n if ($value==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE) {\n $value = self::OPS_AUTHORIZE_ACTION;\n } elseif ($value==Mage_Payment_Model_Method_Abstract::ACTION_AUTHORIZE_CAPTURE) {\n $value = self::OPS_AUTHORIZE_CAPTURE_ACTION;\n }\n return $value;\n }", "public function getOperationsFile($path) {\n\n $operations = array();\n if (isset($this->filesOperations[$path])) {\n foreach ($this->filesOperations[$path] as $operationPath) {\n $operations = array_merge($operations, $this->getOperation($operationPath));\n }\n }\n\n return $operations;\n }", "public function getOperations()\r\n {\r\n return $this->operations;\r\n }", "public function rules()\n {\n \n return [\n 'operation_reference' => 'required|exists:operations,id',\n ];\n }", "public function getExecutor()\n {\n return $this->hasOne(User::className(), ['id' => 'executor_id']);\n }", "#[CustomOpenApi\\Operation(id: 'userMe', tags: [Tags::User, Tags::V1])]\n #[OpenApi\\Parameters(factory: DefaultHeaderParameters::class)]\n #[CustomOpenApi\\Response(resource: UserResource::class)]\n public function me(): UserResource\n {\n return new UserResource(auth()->user()->loadMissing('company'));\n }", "function setOperation($operation) {\n $this->checkChange();\n\n $this->operation = $operation;\n return $this;\n }", "public function getOperationContext();", "function getLibelOperation($type_op) { //Renvoie le libellé dun operation\n\tglobal $dbHandler,$global_id_agence;\n\t$db = $dbHandler->openConnection();\n\t\n\t$sql=\"SELECT traduction from ad_cpt_ope a, ad_traductions b where a.libel_ope = b.id_str and categorie_ope in (2,3) and type_operation = $type_op ;\";\n\t\n\t$result = $db->query($sql);\n\tif (DB :: isError($result)) {\n\t\t$dbHandler->closeConnection(false);\n\t\tsignalErreur(__FILE__, __LINE__, __FUNCTION__, $result->getMessage());\n\t}\n\t$dbHandler->closeConnection(true);\n\t$retour = $result->fetchrow();\n\treturn $retour[0];\n}", "public function model()\n {\n return Operation::class;\n }", "public function setOperation($operation)\n {\n $this->operation = $operation;\n\n return $this;\n }", "public function getOp()\n {\n return $this->Op;\n }", "public function getOp()\n {\n return $this->Op;\n }", "public function getOperation($operator) {\n switch($operator) {\n case '+' :\n $operation = 'add';\n break;\n case '-' :\n $operation = 'subtract';\n break;\n case '*' :\n $operation = 'multiply';\n break;\n case '/' :\n $operation = 'divide';\n break;\n case '%' :\n $operation = 'modulus';\n break;\n case '^' :\n $operation = 'exponentiation';\n break;\n default :\n throw new Exception(\"Calculator does not support this operator\");\n }\n\n return $operation;\n }", "public function hasConvert($operation)\n {\n $row = $this->where('operation', $operation)->where('original_id', $this->getKey())->first();\n if($row && $row->getFile())\n return $row;\n return false;\n }", "public function removeOperation($operation)\n {\n if (in_array($operation, $this->operations, true)) {\n $key = array_search($operation, $this->operations, true);\n unset($this->operations[$key]);\n }\n }", "private function findOperation(RequestInterface $request): OperationAddress\n {\n $pathFinder = new PathFinder(\n $this->adapted->getSchema(),\n $request->getUri(),\n $request->getMethod()\n );\n\n $operations = $pathFinder->search();\n if (\\count($operations) === 0) {\n throw new OperationNotFoundException($request);\n }\n\n foreach ($operations as $operation) {\n //If we got an exact path match, we use the current Operation\n if ($operation->path() === $request->getUri()->getPath()) {\n return $operation;\n }\n }\n\n //If we haven't an exact match, use the first in the list\n return $operations[0];\n }", "function process($op) {\n\tswitch ($op) {\n\t\tcase \"login\" :\n\t\t\tloginFunc($_REQUEST['user'], $_REQUEST['pass']);\n\t\t\tbreak;\n\t\tcase \"sarrera\" :\n\t\t\t$gehi = (isset($_REQUEST['gehi'])) ? $_REQUEST['gehi'] : 'TRUE';\n\t\t\tgehituFunc(\"sarrerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['num'], $gehi);\n\t\t\tbreak;\n\t\tcase \"irteera\" :\n\t\t\t$gehi = (isset($_REQUEST['gehi'])) ? $_REQUEST['gehi'] : 'TRUE';\n\t\t\tgehituFunc(\"irteerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['num'], $gehi);\n\t\t\tbreak;\n\t\tcase \"sarrera_urratu\" :\n\t\t\turratuFunc(\"sarrerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['id']);\n\t\t\tbreak;\n\t\tcase \"irteera_urratu\" :\n\t\t\turratuFunc(\"irteerak\", $_REQUEST['user'], $_REQUEST['pass'], $_REQUEST['id']);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\tresponseError(ERROR_INVALID_OP, \" \\\"\" . $op . \"\\\"\");\n\t\t\tbreak;\n\t}\n}", "private function _token($operation)\n {\n $len = strlen($operation);\n $tokens = array();\n \n for ($i = 0, $offset = 0; $i < $len;) {\n switch ($operation[$i]) {\n case '(':\n $tokens[] = '(';\n $offset++;\n $i++;\n break;\n \n case ')':\n $tokens[] = ')';\n $offset++;\n $i++;\n break;\n \n case '.':\n $tokens[] = '&&';\n $offset++;\n $i++;\n break;\n \n case '+':\n $tokens[] = '||';\n $offset++;\n $i++;\n break;\n \n default:\n preg_match(\n \t'/^AND|^and|^OR|^or|^\\d+/', \n substr($operation, $offset), $match, PREG_OFFSET_CAPTURE\n );\n if ($match) {\n switch ($match[0][0]) {\n case 'AND':\n case 'and':\n $tokens[] = '&&';\n $i += strlen($match[0][0]);\n $offset = $i;\n break 2;\n \n case 'OR':\n case 'or':\n $tokens[] = '||';\n $i += strlen($match[0][0]);\n $offset = $i;\n break 2;\n \n default:\n $tokens[] = $match[0][0];\n $i += strlen($match[0][0]);\n $offset = $i;\n break 2;\n }\n }\n else {\n// $tokens[] = 'error';\n $offset++;\n $i++;\n }\n break;\n }\n }\n return $tokens;\n }", "private function get_data($operation)\r\n\t{\t\t\r\n\t\t$data = array(); \r\n\t\t$result = mysqli_query($this->cn, $operation) or die(mysqli_error($this->cn));\r\n\t\twhile ($row = mysqli_fetch_object($result))\r\n\t\t{\r\n\t\t\tarray_push($data, $row);\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "public function getOperations()\n {\n return $this->operations;\n }", "public function getRequestName()\n\t{\n\t\treturn $this->operation;\n\t}", "public function getCalculateOperation($operator) {\n switch ($operator) {\n case \"*\":\n $operation = new Multiplication();\n break;\n case \"/\":\n $operation = new Division();\n break;\n case \"+\":\n $operation = new Addition();\n break;\n case \"-\":\n $operation = new Subtraction();\n break;\n }\n return $operation;\n }", "public static function userOperationsDataProvider($id = null)\n {\n if (!$id) {\n $id = Yii::$app->getUser()->getId();\n }\n\n return new ActiveDataProvider(['query' => BalanceOperations::find()->allByUser($id), 'sort' => ['defaultOrder' => ['id' => SORT_DESC]]]);\n }", "public function getExecutor()\n {\n return $this->hasOne(User::class, ['id' => 'executor_id']);\n }", "public function documentOperationEdit($id, $operation)\n {\n $admin = false;\n $create = true;\n $document = $this->document->find($id);\n $account = $this->account->all();\n $documentType = $this->documentType->all();\n $operations = $this->operations;\n $operation = Operation::find($operation);\n\n return view('pages.operation.documents.edit',compact('document','operation','account','documentType','operations','admin','create'));\n }", "public function getHandler($operation)\n {\n return $this->handlers[$operation];\n }", "private function normalizeLogicOperation ($operation)\n {\n $operation = strtolower ($operation);\n switch ($operation) {\n case 'or':\n return '$or';\n break;\n case 'and':\n return '$and';\n break;\n\n default:\n throw new \\Exception('Invalid logic operator ' . $operation);\n }\n\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }", "public function getOperationsClient()\n {\n return $this->operationsClient;\n }" ]
[ "0.6466772", "0.645045", "0.635007", "0.6150604", "0.6120574", "0.6117501", "0.60444075", "0.5980355", "0.5909346", "0.5909346", "0.5909346", "0.5909346", "0.5909346", "0.58539873", "0.5792927", "0.57478184", "0.5733128", "0.5679877", "0.5626372", "0.56249577", "0.5606406", "0.55890304", "0.55890304", "0.5575953", "0.55340964", "0.55049986", "0.54740936", "0.54711676", "0.5458813", "0.5449506", "0.5410715", "0.53966886", "0.53828853", "0.53825176", "0.5354359", "0.53522974", "0.5348249", "0.53223544", "0.52745485", "0.5272234", "0.5266597", "0.52342707", "0.5198729", "0.5195753", "0.51861846", "0.5132269", "0.5097967", "0.50791377", "0.5074473", "0.5072938", "0.50052375", "0.49973568", "0.49799958", "0.49498078", "0.4940974", "0.49380475", "0.4931833", "0.4928205", "0.49175698", "0.488971", "0.48787546", "0.48697275", "0.48305306", "0.48264918", "0.48256952", "0.4816089", "0.48139808", "0.48135108", "0.4808727", "0.4799228", "0.4798126", "0.4798126", "0.47968042", "0.47900945", "0.47689068", "0.47682366", "0.47627404", "0.47624454", "0.47465375", "0.47462195", "0.47330403", "0.47149113", "0.4713459", "0.470147", "0.4698276", "0.46932596", "0.46916148", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366", "0.46881366" ]
0.7410504
0
delete user operation by operation_id operation_id mandatory field
public function deleteUserOperationAction() { /** @var Object_Operation $operation */ $data = $this->getRequestData(); if (isset($data['operation_id'])) { $operation = Object_Operation::getById($data['operation_id']); if (!$operation) { $this->setErrorResponse('no Operation with this operation_id!'); } elseif ($this->getDeviceSession()->getUserId() == $operation->getCreator()->getId()) { $operation->setPublished(false); if (!$operation->save()) { $this->setErrorResponse('cannot delete Operation object!'); } } else { $this->setErrorResponse('no Operation for this user with current operation_id!'); } } else { $this->setErrorResponse('operation_id is mandatory field for this request!'); } $this->_helper->json(array('deleted' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function forceDelete(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function destroy(Operation $operation)\n { \n $operation->delete();\n }", "public function getUserOperationByIdAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) {\n $this->setErrorResponse('no Operation for this user with current operation_id!');\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n $this->_helper->json($operation);\n }", "public function removeOperation($operation)\n {\n if (in_array($operation, $this->operations, true)) {\n $key = array_search($operation, $this->operations, true);\n unset($this->operations[$key]);\n }\n }", "public function delete_user($user);", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function delete($user){\n }", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "public function delete(User $user, InterventionRequest $interventionRequest)\n {\n //\n }", "public function delOperator(){\n\t\tif($this->input->post('opId') and !empty($this->input->post('opId'))){\n\t\t\t// delete row where opId match\n\t\t\t$tbl=$this->session->userdata('prefix').'fsft_touroperator';\n\t\t\t$result=$this->Common_model->delete($tbl, array('id'=> $this->input->post('opId')));\n\t\t\tif($result>0){ // in case when record successfully deleted\n\t\t\t\techo 'OK::Tour Operator has been deleted Successfully::success';\n\t\t\t} else {\n\t\t\t\techo 'OK::Tour Operator Not Deleted. Try again::error';\n\t\t\t}\n\t\t} // end of if\n\t}", "public function delete($user)\n {\n\n }", "function validate_user_deletion()\n{ }", "public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }", "public function test_a_user_cannot_destroy_an_operation_shift()\n {\n $this->actingAs($this->user);\n\n $shift = $this->createShift()->create();\n\n $response = $this->delete(route('operations.shifts.destroy', [$shift->operation->id, $shift->id]));\n $response->assertForbidden();\n $this->assertDatabaseHas('operation_shifts', ['id' => $shift->id]);\n }", "public function updateUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Operation!');\n } else {\n if (isset($data['title'])) {\n $operation->setTitle($data['title']);\n }\n if (isset($data['explanation'])) {\n $operation->setExplanation($data['explanation']);\n }\n if (isset($data['photo'])) {\n $operation->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (isset($data['video'])) {\n $operation->setVideo(Asset_Video::getById($data['video']));\n }\n if (isset($data['latitude']) && isset($data['longtitude'])) {\n $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']);\n $operation->setLocation($geo);\n }\n if (isset($data['activity_id'])) {\n $operation->setActivity(Object_Activity::getById($data['activity_id']));\n }\n if (!$operation->save()) {\n $this->setErrorResponse('cannot update Operation object');\n }\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n\n $this->_helper->json($operation);\n }", "public function delete(User $user, Ico $ico)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function delete(User $user, Negocio $negocio)\n {\n //\n }", "public function delete(User $user, ContractCost $contractCost)\n {\n //\n }", "public function delete(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}", "public function delete_user($user_id) {\r\n $this->conn->connect();\r\n if ($user_id != null) {\r\n $res = $this->conn->execute_query(\"\r\n UPDATE Shifts\r\n SET UserID=NULL\r\n WHERE UserID=?;\",\"d\",$user_id);\r\n $res = $this->conn->execute_query(\"\r\n DELETE FROM Requests\r\n WHERE UserID=?;\",\"d\",$user_id);\r\n $res = $this->conn->execute_query(\"\r\n DELETE FROM Users\r\n WHERE UserId=?;\",\"d\",$user_id);\r\n }\r\n }", "public function createUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['title']) && isset($data['activity_id'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/operations/' . $user->getKey() . \"-operations\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-operations\");\n $folder->setParentId(4);\n $folder->save();\n }\n\n $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']);\n\n $operation = new Object_Operation();\n $operation->setCreator($user);\n $operation->setTitle($data['title']);\n $operation->setExplanation(isset($data['explanation']) ? $data['explanation'] : \"\");\n $operation->setLocation($geo);\n $operation->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : \"\");\n $operation->setVideo(isset($data['video']) ? Asset_Video::getById($data['video']) : \"\");\n $operation->setActivity(Object_Activity::getById($data['activity_id']));\n $operation->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $operation->setPublished(true);\n $operation->setParentId($folder->getId());\n if (!$operation->save()) {\n $this->setErrorResponse('cannot save Operation object');\n }\n } else {\n $this->setErrorResponse('title and activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($operation);\n }", "abstract public function deleteByUser($userDao);", "public function cancelUserDeletion(): void\n {\n $this->dispatch('close-modal', id: 'confirmingUserDeletion');\n }", "public function restore(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function delete(User $user, Dictation $dictation)\n {\n //\n }", "function index_delete($user_id) {\n $user_id = $this->uri->segment(3, NULL); // BASE_URL/api/user/id\n $resource = $this->uri->segment(4, NULL); // BASE_URL/api/user/id/clubs or /friends\n $elem_id = $this->uri->segment(5, NULL); // BASE_URL/api/user/id/clubs or /friends /id \n $command = $this->uri->segment(6, NULL); // BASE_URL/api/user/id/clubs or /friends /delete (just to confirm)\n \n //if id is null, its a new user\n if ($user_id == NULL || !is_numeric($user_id)) {\n $this->response(NULL, REST_Controller::HTTP_BAD_REQUEST);\n } else {\n //otherwise include resource accordingly\n if ($resource == 'clubs' && $command = 'delete') {\n $club_id = $elem_id;\n $result = $this->user_model->removeClub($user_id,$club_id); \n } elseif ($resource == 'friends' && $command = 'delete') {\n $friend_user_id = $elem_id;\n $result = $this->user_model->removeFriend($user_id,$friend_user_id); \n } else {\n $this->response(NULL, REST_Controller::HTTP_BAD_REQUEST);\n }\n }\n //$this->response($result, REST_Controller::HTTP_OK);\n if($result === FALSE) {\n $this->response(array('status' => 'failed'), REST_Controller::HTTP_OK);\n } else {\n $this->response(array('status' => 'success'), REST_Controller::HTTP_OK);\n }\n }", "public function destroy(){\n $query = 'delete from Usuario where\n user_id = \"'.$this->getUser_id().'\"';\n $this->driver->exec($query);\n }", "public function delete($usuario_has_hojaruta);", "public function delete(User $user, SystemUnit $systemUnit)\n {\n //\n }", "public function operation($operation);", "public function delete(User $user, Grupo $grupo)\n {\n //\n }", "public function delete($id,$logical)\n {\n \n if(isset($logical) and $logical == 'true'){\n $data = AerolineasAeropuertos::findOrFail($id);\n $now = new \\DateTime();\n $data->deleted_at =$now->format('Y-m-d H:i:s');\n if($data->save()){\n $answer=array(\n \"datos\" => 'Eliminación exitosa.',\n \"code\" => 200\n ); \n } else{\n $answer=array(\n \"error\" => 'Error al intentar Eliminar el registro.',\n \"code\" => 600\n );\n } \n \n return $answer;\n }else{\n $this->destroy($id);\n }\n }", "public function delete( UserEntityInterface $user ): bool;", "public function delete(User $user, Checkout $checkout)\n {\n //\n }", "public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function delete(User $user, Evento $evento)\n {\n //\n }", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function actionUserdelete()\n {\n $timeLimit = time() - 0;\n $deactivateRequests = DeactivateAccount::find()->where(['processingDate' => null])->andWhere('creationDate < '.$timeLimit)->all();\n\n foreach ($deactivateRequests as $request)\n {\n $user = $request->user;\n\n if ($user->last_login <= $request->creationDate+3)\n {\n $user->setScenario('status');\n $user->status = User::STATUS_DELETED;\n $user->save();\n\n Campaign::updateAll(['status' => Campaign::STATUS_DELETED], 'userId = :userId', [':userId' => $user->id]);\n }\n\n $request->setScenario('processing');\n $request->processingDate = time();\n $request->save();\n }\n }", "public function delete(User $user, Information $information)\n {\n //\n }", "public function update(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function deleteProductorById($request, $response, $args){\n\t\t$id = $args['id'];\n $validations = [\n v::intVal()->validate($id)\n ];\n\n if ($this->validate($validations) === false) {\n return $response->withStatus(400);\n }\n\t\t$delete = Models\\User::find($id)->delete();\n\t\treturn $response->withJson(json_encode(array(\"status\" => TRUE)));\n\t}", "public\n function delete(User $user, EvaluationForm $evaluationForm)\n {\n //\n }", "public function deleted_user_action($id) {\r\n $this->db->delete_by_user_id($id);\r\n }", "function delete_user_option($user_id, $option_name, $is_global = \\false)\n {\n }", "public function testDeleteUser()\n {\n }", "public function delete(User $user, Servicos $servicos)\n {\n //\n }", "public function forceDelete(User $user, Attraction $attraction)\n {\n //\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "#[\n OpenApi\\Operation(\n tags: ['Cookbooks/Users'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: ShowCookbookUsersParameters::class)]\n #[OpenApi\\Response(factory: NoContentResponse::class, statusCode: 204)]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[OpenApi\\Response(factory: NotFoundResponse::class, statusCode: 404)]\n #[OpenApi\\Response(factory: ConflictResponse::class, statusCode: 409)]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function destroy(Cookbook $cookbook, int $user) {\n $this->verifyNoDemo();\n\n $this->authorizeAnonymously('update', $cookbook);\n\n if (\n $cookbook\n ->users()\n ->whereNot('users.id', $user)\n ->where('cookbook_user.is_admin', true)\n ->count() === 0\n ) {\n throw new ConflictHttpException(\n __('messages.cookbooks.cant_delete_last_admin_user')\n );\n }\n\n $cookbook->users()->detach($user);\n\n Recipe::query()\n ->where('user_id', $user)\n ->where('cookbook_id', $cookbook->id)\n ->update(['cookbook_id' => null]);\n\n return response()->noContent();\n }", "public function delete(User $user, Upload $upload)\n {\n //\n }", "function eliminarDiaryUser($id) {\n $sql = \"DELETE FROM diario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function deleteDetailsAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$deletion_id\t= isset($params['deletion_id'])?$params['deletion_id']:\"\";\n\t\t\t\t$type\t= isset($params['type'])?$params['type']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase 'sowing':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\t\t\t\t\t\t$db->update('logi_land_showing',$deleteDetail,array('land_sowing_id=?'=>$deletion_id));\n\t\t\t\t\t\tbreak; \n\n\t\t\t\t\t\tcase 'prepration':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\t\t\t\t\t\t$db->update('logi_land_prepration',$deleteDetail,array('land_prepration_id=?'=>$deletion_id));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'fertilizer':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\t\t\t\t\t\t$db->update('logi_land_fertilizer',$deleteDetail,array('land_farmer_id=?'=>$deletion_id));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'cropprotection':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\t\t\t\t\t\t$db->update('logi_land_cropprotection',$deleteDetail,array('land_protection_id=?'=>$deletion_id));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'irrigation':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\t\t\t\t\t\t$db->update('logi_land_irrigation',$deleteDetail,array('land_irri_id=?'=>$deletion_id));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'yield':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\t\t\t\t\t\t$db->update('logi_land_yield_component',$deleteDetail,array('yield_id=?'=>$deletion_id));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'visit':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\t\t\t\t\t\t$db->update('logi_land_visit',$deleteDetail,array('visit_id=?'=>$deletion_id));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'land':\n\t\t\t\t\t\t$deleteDetail['status'] = '1';\n\n\t\t\t\t\t\t$db->update('logi_land_showing',$deleteDetail,array('land_id=?'=>$deletion_id)); \n\t\t\t\t\t\t$db->update('logi_land_prepration',$deleteDetail,array('land_id=?'=>$deletion_id));\n\t\t\t\t\t\t$db->update('logi_land_fertilizer',$deleteDetail,array('land_id=?'=>$deletion_id)); \n\t\t\t\t\t\t$db->update('logi_land_cropprotection',$deleteDetail,array('land_id=?'=>$deletion_id)); \n\t\t\t\t\t\t$db->update('logi_land_irrigation',$deleteDetail,array('land_id=?'=>$deletion_id)); \n\t\t\t\t\t\t$db->update('logi_land_yield_component',$deleteDetail,array('land_id=?'=>$deletion_id)); \n\t\t\t\t\t\t$db->update('logi_land_visit',$deleteDetail,array('land_id=?'=>$deletion_id));\n\t\t\t\t\t\t$db->update('logi_land_information',$deleteDetail,array('land_id=?'=>$deletion_id));\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase '':\n\t\t\t\t\t\tdefault:\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Data Deleted successfully.'));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}", "public function deleteCompanyUser(CompanyUserTransfer $companyUserTransfer): CompanyUserResponseTransfer;", "private function removeOperationsFromSelector(RequestDescriptor $operation)\n {\n if ($this->selector) {\n $this->selector->removeAllSocketOperations($operation);\n }\n }", "public function userDeleted();", "public function delete( $value = NULL, $field = 'id' );", "public function delete(){\n\t\t$this->_getDAO(false);\n\t\treturn $this->dao->delete($this->user->getID(), $this->ident);\n\t}", "public function deleteUser()\n {\n $this->delete();\n }", "public function testDeleteUser()\n {\n $id = 6;\n $this->json('DELETE', \"api/user/delete/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\"\n ]);\n }", "public function delete(User $user, Language $language)\n {\n //\n }", "public function delete($id_option, $id_user = null, $id_group = null){\n if ( !bbn\\str::is_integer($id_option) ){\n $id_option = $this->from_path($id_option);\n }\n\t\tif ( $id_group ){\n\t\t\treturn $this->db->delete($this->class_cfg['table'], [\n\t\t\t\t$this->class_cfg['cols']['id_option'] => $id_option,\n\t\t\t\t$this->class_cfg['cols']['id_group'] => $id_group\n\t\t\t]);\n\t\t}\n\t\tif ( $id_user || $this->id_user ){\n\t\t\treturn $this->db->delete($this->class_cfg['table'], [\n\t\t\t\t$this->class_cfg['cols']['id_option'] => $id_option,\n\t\t\t\t$this->class_cfg['cols']['id_user'] => $id_user ? $id_user : $this->id_user\n\t\t\t]);\n\t\t}\n\t}", "function eliminarUoFuncionario(){\r\n\t\t$this->objFunSeguridad=$this->create('MODUoFuncionario');\t\r\n\t\t$this->res=$this->objFunSeguridad->eliminarUoFuncionario($this->objParam);\r\n\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\r\n\t}", "function delete($user, $notrigger = 0) {\n global $conf, $langs;\n $error = 0;\n\n $this->db->begin();\n\n if (!$error) {\n if (!$notrigger) {\n // Uncomment this and change MYOBJECT to your own tag if you\n // want this action call a trigger.\n //// Call triggers\n //include_once(DOL_DOCUMENT_ROOT . \"/core/class/interfaces.class.php\");\n //$interface=new Interfaces($this->db);\n //$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);\n //if ($result < 0) { $error++; $this->errors=$interface->errors; }\n //// End call triggers\n }\n }\n\n if (!$error) {\n $sql = \"DELETE FROM \" . MAIN_DB_PREFIX . \"iconta_accountingdebcred\";\n $sql.= \" WHERE fk_transaction=\" . $this->id . \"; \";\n $resql1 = $this->db->query($sql);\n dol_syslog(get_class($this) . \"::delete sql=\" . $sql);\n\n $sql = \"DELETE FROM \" . MAIN_DB_PREFIX . \"iconta_accountingtransaction\";\n $sql.= \" WHERE rowid=\" . $this->id;\n dol_syslog(get_class($this) . \"::delete sql=\" . $sql);\n $resql = $this->db->query($sql);\n\n if (!$resql || !$resql1) {\n $error++;\n $this->errors[] = \"Error \" . $this->db->lasterror();\n }\n }\n\n // Commit or rollback\n if ($error) {\n foreach ($this->errors as $errmsg) {\n dol_syslog(get_class($this) . \"::delete \" . $errmsg, LOG_ERR);\n $this->error.=($this->error ? ', ' . $errmsg : $errmsg);\n }\n $this->db->rollback();\n return -1 * $error;\n } else {\n $this->db->commit();\n return 1;\n }\n }", "public function delete(User $user, Attraction $attraction)\n {\n dd('i m here!!!,delete');\n return $user->id === $attraction->user_id;\n }", "function deleteuser_vizitki($user_id) {\n\tglobal $database;\n\n\t// DELETE vizitki ENTRIES AND COMMENTS\n\t$database->database_query(\"DELETE FROM se_vizitkientries, se_vizitkicomments USING se_vizitkientries LEFT JOIN se_vizitkicomments ON se_vizitkientries.vizitkientry_id=se_vizitkicomments.vizitkicomment_vizitkientry_id WHERE se_vizitkientries.vizitkientry_user_id='$user_id'\");\n\n\t// DELETE COMMENTS POSTED BY USER\n\t$database->database_query(\"DELETE FROM se_vizitkicomments WHERE vizitkicomment_authoruser_id='$user_id'\");\n\n\t// DELETE STYLE\n\t$database->database_query(\"DELETE FROM se_vizitkistyles WHERE vizitkistyle_user_id='$user_id'\");\n\n}", "public function delete($user, $ident);", "public function delete() {\n// 'missionServiceUsers' => array(self::HAS_MANY, 'MissionServiceUser', 'id_service_user'),\n// //'serviceUserConditions' => array(self::MANY_MANY, 'Condition', 'tbl_service_user_condition(id_service_user, id_condition)'),\n// 'serviceUserConditions' => array(self::HAS_MANY, 'ServiceUserCondition', 'id_service_user'),\n\n\n parent::delete();\n }", "public function testDeleteNetworkMerakiAuthUser()\n {\n }", "public function deleteAction(){\n\n\t\t$auth = Zend_Auth::getInstance();\n\t\tif($auth->hasIdentity())\n\t\t{\n\t\t\t\n\t\t\t$loginUserId = $auth->getStorage()->read()->id;\n\t\t}\n\t\t$id = $this->_request->getParam('id');\n\t\t$emp_id = $this->_request->getParam('emp_id');\n\t\t$messages['message'] = ''; $messages['msgtype'] = '';\n\t\t$messages['flagtype'] = '';\n\t\t$actionflag = 3;\n\t\tif($id)\n\t\t{\n\t\t\t\n\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\n\t\t\t//check employee has amount of select amount\n\t\t\t$getEmployeeBalance = $employeeadvancesModel->getEmpAdvanceSummary($emp_id);\n\t\t\t$total = !empty($getEmployeeBalance[0]['balance'])?$getEmployeeBalance[0]['balance']:0;\n\t\t\t\n\t\t\t$employeeAdvanceData = $employeeadvancesModel->getsingleEmployeeadvancesData($id,$type='advance');\n\t\t\t\n\t\t\t$employeebalance = !empty($employeeAdvanceData[0]['application_amount'])?$employeeAdvanceData[0]['application_amount']:0;\n\t\t\t\n\t\t\tif($total >= $employeebalance) //if employee has suffiecient amount to delete advance\n\t\t\t{\n\t\t\t\t$data = array('isactive'=>0,'modifieddate'=>gmdate(\"Y-m-d H:i:s\"));\n\t\t\t\t$data['modifiedby'] = $loginUserId;\n\t\t\t\t$where = array('id=?'=>$id);\n\t\t\t\t$id = $employeeadvancesModel->saveOrUpdateAdvanceData($data, $where);\n\t\t\t\tif($id == 'update')\n\t\t\t\t{\n\t\t\t\t\t//remove deleted advance amount from employee total advance amount\n\t\t\t\t\t$advancesummary = new Expenses_Model_Advancesummary();\n\t\t\t\t\t$emp_advance_summery = $advancesummary->getAdvanceDetailsById($emp_id);\n\t\t\t\t\t$totalsum = $emp_advance_summery[0]['total']-$employeebalance;\n\t\t\t\t\t$balence = $emp_advance_summery[0]['balance']-$employeebalance;\n\t\t\t\t\t$summerydata = array('total'=>$totalsum,\n\t\t\t\t\t\t\t\t\t'balance'=>$balence,\n\t\t\t\t\t\t\t\t\t 'modifiedby'=> $loginUserId,\n\t\t\t\t\t\t\t\t\t 'modifieddate' =>gmdate(\"Y-m-d H:i:s\")\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t$summeryWhere = array('employee_id=?'=>$emp_id); \n\t\t\t\t\t$insertSummey = $advancesummary->SaveAdvanceData($summerydata, $summeryWhere);\n\t\t\t\t\t\n\t\t\t\t\t$messages['message'] = 'advance deleted successfully.';\n\t\t\t\t\t$messages['msgtype'] = 'success';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$messages['message'] = 'advance cannot be deleted already used.';\n\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t$messages['msgtype'] = 'error';\n\t\t}\n\t\t$this->_helper->json($messages);\n\n\t}", "public function testDeleteUser()\n {\n\n }", "public function delete(User $user, Barang $barang)\n {\n //\n }", "public function delete(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::delete(): Attempt to delete a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\t//Delete the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t\t$st = $conn->prepare ( \"DELETE FROM \".TABLENAME_GROUPS.\" WHERE id = :id LIMIT 1\" );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\t$st->execute();\r\n\t\t\t$conn = null;\t\t\r\n\t\t}", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "function del($ar){\n $p = new XParam($ar, array());\n $oid = $p->get('oid');\n $lnkuser = selectQuery('select lnkuser from '.$this->xset->getTable().' where KOID=\\''.$oid.'\\'')->fetch(PDO::FETCH_COLUMN);\n // satus du compte \n updateQuery('update '.$this->xset->getTable().' set STATUS=\\'INACTIVE\\' where KOID=\\''.$oid.'\\'');\n // date du users\n updateQuery('update USERS set DATET=\\''.date('Y-m-d').'\\' where KOID=\\''.$lnkuser.'\\'');\n }", "public function testProjectProjectIDUsersUserIDDelete()\n {\n }", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function delete() {\n\n try{\n\n $this->checkOptionsAndEnableCors();\n\n $id = $this->input->get('id');\n if(isset($id)){\n $this->repository->delete((int) $id);\n echo json_encode([ \"data\" => 'User id '.$id. ' deleted' ]);\n } else {\n $this->handleError('Missing id parameter');\n }\n } catch (ORMException $e) {\n $this->handleError($e->getMessage());\n } catch (Exception $e) {\n log_message('error', $e->getMessage());\n $this->handleError($e->getMessage());\n }\n }", "public function delete_user($user){\n if(empty($user->email))\n {\n $this->res->SetObject(RCD::EC_EMPTY, RCD::ED_EMPTY, FALSE, NULL);\n }\n $where = array('id'=>$id);\n $this->db->where(array('id' => $user['id']));\n if($this->db->delete(self::user))\n {\n $this->res->SetObject(RCD::SC, RCD::SD, FALSE, NULL);\n }\n else\n {\n $this->res->SetObject(RCD::EC_DELETE, RCD::ED_DELETE, TRUE, NULL);\n }\n }", "public function deleteUser()\n {\n \n $headers = getallheaders();\n $token = $headers['Authorization'];\n $key = $this->key;\n $userData = JWT::decode($token, $key, array('HS256'));\n $id_user = Users::where('email', $userData->email)->first()->id;\n $id_users = $_POST['idUser'];\n $id = $id_users;\n\n $user = Users::find($id);\n\n $rolUser = Users::where('email', $userData->email)->first();\n \n\n if ($rolUser->rol_id == 1){\n\n $user_name = Users::where('id', $id_users)->first()->name;\n Users::destroy($id);\n\n return $this->success('Acabas de borrar a', $user_name);\n\n }else{\n return $this->error(403, 'No tienes permisos');\n }\n \n\n if (is_null($user)) \n {\n return $this->error(400, 'El lugar no existe');\n }\n // }else{\n\n // $user_name = Users::where('id', $id_users)->first()->name;\n // Users::destroy($id);\n\n // return $this->success('Carlos he borrado el usuario', $user_name);\n // }\n }", "public function undeleteAction(){\n\t}", "public function forceDelete(User $user, InterventionRequest $interventionRequest)\n {\n //\n }" ]
[ "0.6942536", "0.63960385", "0.6170827", "0.6157917", "0.60886914", "0.595917", "0.5957814", "0.58890164", "0.58630633", "0.58294594", "0.5799882", "0.5795458", "0.578762", "0.5725511", "0.5724582", "0.5705047", "0.5699891", "0.56541896", "0.56541896", "0.56541896", "0.56231934", "0.561293", "0.5595027", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5585561", "0.5582518", "0.5579139", "0.5569643", "0.5569322", "0.5562224", "0.5560867", "0.5555959", "0.5553651", "0.5547854", "0.5533364", "0.55211043", "0.55174184", "0.5512086", "0.5494112", "0.5482202", "0.54798234", "0.54752135", "0.5466696", "0.5462102", "0.54552966", "0.5449157", "0.5438664", "0.5426342", "0.5418677", "0.5417068", "0.5409044", "0.54054886", "0.54047704", "0.5403143", "0.54017633", "0.5399632", "0.5396979", "0.5396745", "0.53876907", "0.53825325", "0.53811145", "0.53781736", "0.53752434", "0.5368621", "0.5366983", "0.53589225", "0.5354353", "0.53490496", "0.5341515", "0.53361225", "0.5334127", "0.5327665", "0.53266263", "0.5320549", "0.5305495", "0.5303998", "0.5293905", "0.5288053", "0.5274814", "0.527289", "0.52720773", "0.52684194", "0.5267282", "0.526698", "0.52669024", "0.52601033", "0.52576584", "0.5256939", "0.5256282" ]
0.79668754
0
this action creates user operation title and activity_id is mandatory field explanation, photo, video, latitude, longtitude is optional field
public function createUserOperationAction() { /** @var Object_Operation $operation */ $data = $this->getRequestData(); if (isset($data['title']) && isset($data['activity_id'])) { $user = Object_User::getById($this->getDeviceSession()->getUserId()); $folder = Object_Folder::getByPath('/operations/' . $user->getKey() . "-operations"); if (!$folder) { $folder = new Object_Folder(); $folder->setKey($user->getKey() . "-operations"); $folder->setParentId(4); $folder->save(); } $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']); $operation = new Object_Operation(); $operation->setCreator($user); $operation->setTitle($data['title']); $operation->setExplanation(isset($data['explanation']) ? $data['explanation'] : ""); $operation->setLocation($geo); $operation->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : ""); $operation->setVideo(isset($data['video']) ? Asset_Video::getById($data['video']) : ""); $operation->setActivity(Object_Activity::getById($data['activity_id'])); $operation->setKey(Pimcore_File::getValidFilename($user->getKey() . "-" . $data['title'] . "-" . time())); $operation->setPublished(true); $operation->setParentId($folder->getId()); if (!$operation->save()) { $this->setErrorResponse('cannot save Operation object'); } } else { $this->setErrorResponse('title and activity_id is mandatory field for this request!'); } $this->_helper->json($operation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createUserActivityAction()\n {\n $data = $this->getRequestData();\n if (isset($data['title'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/activities/' . $user->getKey() . \"-activities\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-activities\");\n $folder->setParentId(3);\n $folder->save();\n }\n\n $activity = new Object_Activity();\n $activity->setCreator($user);\n $activity->setTitle($data['title']);\n $activity->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : \"\");\n $activity->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $activity->setPublished(true);\n $activity->setParentId($folder->getId());\n if (!$activity->save()) {\n $this->setErrorResponse('cannot save Activity object');\n }\n } else {\n $this->setErrorResponse('title is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "function createactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $name = $this->input->post('name');\n $multiplicity = $this->input->post('multiplicity');\n $severity = $this->input->post('severity');\n $unit = $this->input->post('unit');\n $desc = $this->input->post('desc');\n $this->m_activities->create($wl_id, $name, $multiplicity, $severity, $unit, $desc);\n $this->activities();\n }", "public function createUserDetail($userName,$password,$email,$about,$onlineStatus,$maxContacts,$maxFavorites,$birthday,$gender,$avatarFile,$thumbFile,$go_id,$reg_status,$invite_user_id,$create_id,$desired_team_title='',$signup_team_id=null)\r\n {\r\n \r\n $now = time();\r\n \r\n $valueArray = array();\r\n $valueArray['name'] = $userName;\r\n $valueArray['email'] = $email;\r\n $valueArray['password'] = $password;\r\n $valueArray['about'] = $about;\r\n $valueArray['online_status'] =$onlineStatus;\r\n $valueArray['max_contact_count'] = $maxContacts;\r\n $valueArray['max_favorite_count'] = $maxFavorites;\r\n $valueArray['birthday'] = $birthday;\r\n $valueArray['gender'] = $gender;\r\n $valueArray['avatar_file_id'] = $avatarFile;\r\n $valueArray['avatar_thumb_file_id'] = $thumbFile;\r\n $valueArray['created'] = $now;\r\n $valueArray['modified'] = $now;\r\n $valueArray['go_id'] = $go_id; \r\n $valueArray['reg_status'] = $reg_status; \r\n $valueArray['invite_user_id'] = $invite_user_id; \r\n $valueArray['create_id'] = $create_id; \r\n $valueArray['desired_team_title'] = $desired_team_title; \r\n $valueArray['signup_team_id'] = $signup_team_id;\r\n if($this->DB->insert('user',$valueArray)){\r\n return $this->DB->lastInsertId(\"_id\");\r\n }else{\r\n return null;\r\n }\r\n \r\n }", "public function actionCreate()\n {\n //创建活动时,点击后会先创建个活动,然后跳到修改页面,因为添加活动图需要有活动ID,\n $model = new ActivityInfo();\n //加载默认值\n $model->loadDefaultValues();\n $model->Tiltle = '1';\n $model->Url = '1';\n $model->JumpTo = '1';\n if ($model->save()) {\n $model->Tiltle = '';\n $model->Url = '';\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['index']);\n // }\n // $model->StartTime = date(\"Y-m-d\");\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n }", "public function createAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_createExtraParameters;\n\n parent::createAction();\n }", "public function actionCreate(){ \n // function to create User.\n //redirect a user if not super admin\n\n $site_url = Yii::$app->params['yii_url'];\n $upload_url = \"\";\n if($site_url == \"http://dev.digitalvidya.com/assist\") {\n $upload_url - $site_url.\"/uploads/user_image/\";\n } else {\n $upload_url = $site_url . \"/uploads/\";\n }\n if (!Yii::$app->CustomComponents->check_permission('create_user')) {\n return $this->redirect(['site/index']);\n }\n\n $model = new DvUsers();\n if (!empty($model->course)) {\n $model->course = explode(',', $model->course);\n }\n\n\n if ($model->load(Yii::$app->request->post())) {\n if (!empty($model->course)) {\n $model->course = implode(\",\", $_POST['DvUsers']['course']);\n }\n\n if (isset($_POST['usermeta']['day_avail'])) {\n $day_avail = $_POST['usermeta']['day_avail'];\n }\n\n if (!empty($day_avail)) {\n $day_avail = implode(\",\", $_POST['usermeta']['day_avail']);\n }\n\n $userdata = Yii::$app->request->post();\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($userdata); die;\n\t\t\tif($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n\t\t\t\t$email = $userdata['DvUsers']['email'];\n\t\t\t\t$phone = $userdata['usermeta']['phone'];\n\t\t\t\t$fname = $userdata['DvUsers']['first_name'];\n\t\t\t\t$lname = $userdata['DvUsers']['last_name'];\n\t\t\t\t$fb_link = $userdata['usermeta']['fb_link'];\n\t\t\t\t$linkedin_link = $userdata['usermeta']['linkedin_link'];\n\t\t\t\t$twitter_link = $userdata['usermeta']['twitter_link'];\n\t\t\t\t\n\t\t\t\tif(isset($userdata['usermeta']['description'])){\n\t\t\t\t\t$desc = $userdata['usermeta']['description'];\n\t\t\t\t}else{\n\t\t\t\t\t$desc = \"\";\n\t\t\t\t}\n\n\t\t\t\n\t\t\t \n\t\t\t}\n\t\t\t\n $model->save();\n\n $uid = Yii::$app->db->getLastInsertID();\n\t\t\tif($userdata['usermeta']['role'] == 4){\n\t\t\t\t$usre_role = 1;\n\t\t\t\t$profile_visibility = $userdata['usermeta']['profile_visibility'];\n\t\t\t}else{\n\t\t\t\t$usre_role = 2;\n\t\t\t\t$profile_visibility = 1;\n\t\t\t}\n\n if($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n // ***************** Start of curl ************************\n \n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n CURLOPT_USERAGENT => 'Get course data',\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => [\n \n 'ta_email' => $email,\n 'tm_fname' => $fname,\n 'tm_lname' => $lname,\n 'tm_phone' => $phone,\n 'tm_facebook' => $fb_link,\n 'tm_linkedin' => $linkedin_link,\n 'tm_twitter' => $twitter_link,\n 'tm_description' => $desc,\n 'tm_image_url' => $upload_url.'img_'.$uid.'.jpg',\n 'tm_image_name' => 'img_'.$uid.'.jpg',\n 'profile_visibility' => $profile_visibility,\n\t\t\t\t\t\t'user_role' => $usre_role\n\n ]\n ]);\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n $resulst = json_decode($resp,true);\n curl_close($curl);\n\t\t\t\t//echo \"<pre>\";print_r($resulst);die;\n // ************* End of the curl ************************\n }\n\n $model->picture = UploadedFile::getInstance($model, 'picture');\n if (!empty($model->picture->baseName)) {\n $model->picture->saveAs('uploads/user_image/img_' . $uid . '.' . $model->picture->extension);\n $user_image = 'img_' . $uid . '.' . $model->picture->extension;\n Yii::$app->db->createCommand(\"UPDATE assist_users SET picture = '$user_image' WHERE id = '$uid' AND status = 1 \")->execute();\n }\n\n $usermeta = $_POST['usermeta'];\n unset($usermeta['day_avail']);\n\t\t\tif(isset($resulst['user_id'])){\n\t\t\t\t$usermeta['wp_user_id'] = $resulst['user_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\tif(isset($resulst['post_id'])){\n\t\t\t\t\n\t\t\t\t$usermeta['wp_post_id'] = $resulst['post_id'];\n\t\t\t\t$usermeta['trainer_profile_url'] = $_SERVER['SERVER_NAME'].\"/?p=\".$resulst['post_id'];\n\t\t\t}\n\n\n foreach ($usermeta as $key => $val) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => $key, 'meta_value' => $val])->execute();\n }\n\n if (!empty($day_avail)) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => 'day_avail', 'meta_value' => $day_avail])->execute();\n }\n\n $user_password = $_POST['DvUsers']['password']; \n\n // send email\n if ($usermeta['notify'] == 1) {\n $subject = Yii::$app->params['site_name'].\" New Account Invitation\";\n $body = \" <h3>Welcome to \". Yii::$app->params['site_name'].\"</h3>\n <p>Hi $model->first_name,</p>\n <p>Your login details are:</p>\n <p>Site URL: \". Yii::$app->params['yii_url'].\"</p>\n <p>Username: $model->username</p>\n <p>Password: $user_password</p>\n <br>\n <br>\n <p>Thanks and Regards</p>\n <p>Digital Vidya Team</p>\n \";\n\n $is_sent = Yii::$app->mailer->compose()\n ->setFrom('[email protected]')\n //->setTo('[email protected]')\n ->setTo($model->email)\n ->setBcc ('[email protected]')\n ->setSubject($subject)\n ->setHtmlBody($body)\n ->send();\n \n }\n\n return $this->redirect(['view', 'id' => $uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function creating(User $user)\n {\n\n $user->user_creator_id = \\Auth::id();\n //$user->user_updater_id = \\Auth::id();\n }", "private function createActivityTable()\n {\n $createTable = \"CREATE TABLE IF NOT EXISTS `mapping`.`userActivity` (\n\n `oldAttemptID` int(11) NOT NULL, \n `userId` varchar(50) NOT NULL DEFAULT '00',\n `sessionId` varchar(50) NOT NULL DEFAULT '00',\n\n `oldActivityId` varchar(45) DEFAULT NULL, \n `contentId` varchar(50) NOT NULL DEFAULT '00',\n `revisionNumber` int(11) NOT NULL DEFAULT 1,\n `contentLanguageCode` varchar(50) NOT NULL DEFAULT 'en',\n `extraParams` varchar(100) DEFAULT NULL,\n\n `timeTaken` int(11) NOT NULL DEFAULT 0,\n `score` int(11) NOT NULL DEFAULT 0,\n `result` varchar(50) DEFAULT NULL,\n `activityType` varchar(20) DEFAULT NULL,\n `status` varchar(20) DEFAULT NULL,\n `activityTime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n `contentAttemptNumber` int(11) NOT NULL DEFAULT 1,\n `srNo` int(11) NOT NULL AUTO_INCREMENT,\n `mode` varchar(20) NOT NULL DEFAULT 'Activity',\n `subject` varchar(20) NOT NULL DEFAULT 'math',\n `isSchoolLogin` int(10) NOT NULL DEFAULT 1,\n `contentType` varchar(20) DEFAULT 'activity',\n `attemptCount` int(10) NOT NULL DEFAULT 1\n \n PRIMARY KEY (`srNo`),\n CONSTRAINT UC_User_Attempt UNIQUE (userId,oldActivityId,oldAttemptID)\n )\";\n $result = $this->mySQL->rawQuery($createTable);\n }", "function addUserRecognizedActivity(){\n\n\t\tglobal $dclserver;\n\t\t$url=\"$dclserver/MMDataCurationRestfulService/webresources/InformationCuration/AddUserRecognizedActivity\";\n\t\t\n\t\t$data = array(\"userRecognizedActivityId\"=>NULL,\n\t\t\"userId\"=>39,\n\t\t\"activityId\"=>2,\n\t\t\"startTime\"=>\"2015 05 05 16:58:56\",\n\t\t\"endTime\"=>\"2015 05 05 16:58:59\",\n\t\t\"duration\"=>3\n\t\t\n\t\t);\n\t\t\n\t\n\t$json = json_encode($data,true);\n\t\n\t$result =postJsonRest($url,$json);\n\t\n\treturn $result;\n\n\t\t\n}", "function Create()\n\t{\n\t\tif (!ss9024kwehbehb($this)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t$this->FilterData();\n\n\t\tif (!$this->Validate('create')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$processed_unique_token = API_USERS::generateUniqueToken(SENDSTUDIO_LICENSEKEY . $this->username);\n\t\t$processed_password = API_USERS::generatePasswordHash($this->password, $processed_unique_token);\n\n\t\tif (!is_array($this->eventactivitytype)) {\n\t\t\t$this->eventactivitytype = array();\n\t\t}\n\n\t\tif ($this->trialuser == '1') {\n\t\t\t$agency_variables = get_agency_license_variables();\n\n\t\t\t$this->admintype = 'c';\n\t\t}\n\n\t\t$query = \"\n\t\t\tINSERT INTO [|PREFIX|]users (\n\t\t\t\tgroupid, username, password, unique_token, status, emailaddress, fullname,\n\t\t\t\ttrialuser, admintype, listadmintype, templateadmintype, segmentadmintype,\n\t\t\t\teditownsettings, usertimezone,\n\t\t\t\ttextfooter, htmlfooter,\n\t\t\t\tinfotips,\n\t\t\t\tsmtpserver, smtpusername, smtppassword, smtpport,\n\t\t\t\tcreatedate, lastloggedin,\n\t\t\t\tenableactivitylog, usewysiwyg, xmlapi, xmltoken,\n\t\t\t\tgettingstarted, googlecalendarusername, googlecalendarpassword,\n\t\t\t\teventactivitytype,\n\t\t\t\tadminnotify_email, adminnotify_send_flag, adminnotify_send_threshold,\n\t\t\t\tadminnotify_send_emailtext, adminnotify_import_flag, adminnotify_import_threshold, adminnotify_import_emailtext\n\t\t\t) VALUES (\n\t\t\t\t\" . intval($this->groupid) . \", '\" . $this->Db->Quote($this->username) . \"', '\" . $this->Db->Quote($processed_password) . \"', '\" . $this->Db->Quote($processed_unique_token) . \"', '\" . intval($this->status) . \"', '\" . $this->Db->Quote($this->emailaddress) . \"', '\" . $this->Db->Quote($this->fullname) . \"',\n\t\t\t\t'\" . ($this->trialuser == '1' ? '1' : '0') . \"', '\" . $this->Db->Quote($this->admintype) . \"', '\" . $this->Db->Quote($this->listadmintype) . \"', '\" . $this->Db->Quote($this->templateadmintype) . \"', '\" . $this->Db->Quote($this->segmentadmintype) . \"',\n\t\t\t\t'\" . intval($this->editownsettings) . \"', '\" . $this->Db->Quote($this->usertimezone) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->textfooter) . \"', '\" . $this->Db->Quote($this->htmlfooter) . \"',\n\t\t\t\t'\" . intval($this->infotips) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->smtpserver) . \"', '\" . $this->Db->Quote($this->smtpusername) . \"', '\" . $this->Db->Quote(base64_encode($this->smtppassword)) . \"', \" . intval($this->smtpport) . \",\n\t\t\t\t\" . time() . \", 0,\n\t\t\t\t'\" . intval($this->enableactivitylog) . \"', '\" . intval($this->usewysiwyg) . \"', '\" . intval($this->xmlapi) . \"', '\" . $this->Db->Quote($this->xmltoken) . \"'\n\t\t\t\t,\" . intval($this->gettingstarted) . \", '\" . $this->Db->Quote($this->googlecalendarusername) . \"', '\" . $this->Db->Quote($this->googlecalendarpassword) . \"', '\" . serialize($this->eventactivitytype) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->adminnotify_email) . \"', '\" . intval($this->adminnotify_send_flag) . \"', '\" . intval($this->adminnotify_send_threshold) . \"', '\" . $this->Db->Quote($this->adminnotify_send_emailtext) . \"',\n\t\t\t\t'\" . intval($this->adminnotify_import_flag) . \"', '\" . intval($this->adminnotify_import_threshold) . \"', '\" . $this->Db->Quote($this->adminnotify_import_emailtext) . \"'\n\t\t\t)\n\t\t\";\n\n\t\t// We want to get the userid once it is created.\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$query .= ' RETURNING userid';\n\t\t}\n\n\t\t$this->Db->StartTransaction();\n\t\t$result = $this->Db->Query($query);\n\n\t\tif (!$result) {\n\t\t\t$this->Db->CommitTransaction();\n\t\t\treturn false;\n\t\t}\n\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$userid = $this->Db->FetchOne($result, 'userid');\n\t\t} else {\n\t\t\t$userid = $this->Db->LastId(SENDSTUDIO_TABLEPREFIX . 'users_sequence');\n\t\t}\n\n\t\t$this->userid = $userid;\n\t\t\n\t\t$status = (create_user_dir($userid) === true);\n\n\t\tif (!$status) {\n\t\t\t$this->Db->RollbackTransaction();\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->Db->CommitTransaction();\n\t\t$this->_cacheUserTypeCount = false;\n\t\treturn $userid;\n\t}", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function create()\n {\n $this->resetFields();\n //DAN MEMBUKA AREA\n $this->openUser();\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function createUserTodoAction()\n {\n $data = $this->getRequestData();\n if (isset($data['todo_type'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/todo/' . $user->getKey() . \"-todo\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-todo\");\n $folder->setParentId(30);\n $folder->save();\n }\n $todo = new Object_Todo();\n $todo->setCreator($user);\n $todo->setTodo_type($data['todo_type']);\n $todo->setText(isset($data['text']) ? $data['text'] : \"\");\n $todo->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . time()));\n $todo->setPublished(true);\n $todo->setParentId($folder->getId());\n if (!$todo->save()) {\n $this->setErrorResponse('cannot save Todo object!');\n }\n } else {\n $this->setErrorResponse('todo_type is mandatory field for this request!');\n }\n\n $this->_helper->json($todo);\n }", "public function actionCreate()\n {\n $model = new UserScreening();\n if(Yii::$app->request->isPost)\n { $model->load(Yii::$app->request->post());\n $model->file = UploadedFile::getInstance($model, 'file');\n $filename = Yii::$app->security->generateRandomString(32) . '_' . $model->file->baseName . '.' . $model->file->extension;\n $bool_saved = $model->file->saveAs(Yii::getAlias('@webroot').'/../uploads/' . $filename);\n if($bool_saved)\n {\n $model->status = 0;\n $model->cv = $filename;\n $model->file = null; // So that on saving it should not look for it again\n if($model->save()) {\n return $this->redirect(Url::to(['user-screening/index']));\n }\n else {\n throw new ErrorException(Json::encode($model->getErrors()));\n }\n }\n else {\n echo \"Error in uploading file\" ; exit;\n }\n }\n else\n {\n $model = new UserScreening();\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public function handleactivitycreate()\n {\n $game = new activity_master;\n $game->activitytitle = Input::get('activitytitle');\n $game->description = Input::get('description');\n $game->domain = Input::get('domain');\n \n $game->save();\n\n \n return Redirect::to('/admin');\n }", "public function actionCreate()\n {\n $model = new UserProfile();\n\n $model->user_id = Yii::$app->user->identity->id;\n\n\n $POST_VARIABLE = Yii::$app->request->post('Place');\n echo $POST_VARIABLE['first_name'];\n\n if ($already_exists = RecordHelpers::userHas('user_profile')) {\n return $this->render('view', [\n\n 'model' => $this->findModel($already_exists),\n ]);\n\n } elseif ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash(\"success\", Yii::t('app', 'Profile successfully created!'));\n return $this->redirect(['view']);\n\n } else {\n// echo $model->user_id;\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n }\n\n// if ($model->load(Yii::$app->request->post()) && $model->save()) {\n//\n// return $this->redirect(['view', 'id' => $model->id]);\n// } else {\n// return $this->render('create', [\n// 'model' => $model,\n// ]);\n// }\n }", "public function createAction()\n {\n echo (new View('userCreate'))->render();\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $foto = UploadedFile::getInstance($model,'use_foto');\n\n if ($foto == ''){\n $model->use_foto = 'usuario_anonimo.jpg';\n }else{\n\n $modelFoto = User::find()->count();\n\n $foto->saveAs('img/user/'. $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension);\n $model->use_foto = $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension;\n }\n\n /*\n * 1. usuario Administrador\n * 2. usuario Investigador\n * 3. usuario Registrado\n */\n\n /* if($model->rol_id != 2){\n $model ->use_estado = 1;\n //Aqui va codigo borrar el perfil del investigador\n }*/\n\n $model -> use_estadoAudit = 'N';\n $model -> use_fechaCreacion = date('y-m-d H:i:s');\n $model -> use_fechaAudit = date('y-m-d H:i:s');\n $model -> use_accion = 'N';\n\n\n if($model->signup()){\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Registro agregado!</h4>\n El registro se agregó correctamente.\n </div>\n ');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function getUserActivityByIdAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if(isset($data['getoperations']) && $activity){\n $operation = new Workapp_Activity();\n $activity->operations = $operation->getActivityRequiredByOperations($activity);\n }\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('no Activity for this user with current activity_id!');\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function actionCreate()\n {\n $model = new User;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // получаем изображение для последующего сохранения\n $file = UploadedFile::getInstance($model, 'image');\n if ($file && $file->tempName) {\n $fileName = self::_saveFile($model, $file);\n if ($fileName) {\n $model->image = $fileName;\n } else {\n // уведомить пользователя, админа о невозможности сохранить файл\n }\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n MainFunctions::register('Добавлен пользователь ' . $model->name);\n return $this->redirect(['view', 'id' => $model->_id]);\n } else {\n return $this->render('create', ['model' => $model]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Person();\n /** @var EntityForm $EntityForm */\n $EntityForm = new EntityForm(new ActivityDirection());\n\n if ($model->load(Yii::$app->request->post())) {\n\n /** Save activities directions mapping **/\n if ($model->activities_ids) {\n $model->setRelated('activities', $model->activities_ids, true);\n }\n\n if(UploadedFile::getInstance($model, 'logo'))\n {\n $model->logo=UploadedFile::getInstance($model, 'logo');\n $model->logo->saveAs('../../frontend/web/mt/img/'.$model->logo->baseName.\".\".$model->logo->extension);\n $model->logo=$model->logo->baseName.\".\".$model->logo->extension; \n }\n if($model->tags)\n $model->tags = implode(\", \", $model->tags);\n $model->raiting = 0;\n $model->reviews = 0;\n \n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'entityForm' => $EntityForm\n ]);\n }\n }", "function postViewerActivity($title, $body) {\r\n $this->debug(\"Posting viewer activity with title: $title and body: $body\");\r\n\r\n $batch = $this->osapi->newBatch();\r\n\r\n $activity = new osapiActivity();\r\n $activity->setField('title', $title);\r\n $activity->setField('body', $body);\r\n\r\n $this->debug(\"Created OsapiActivity object: \" . print_r($activity, true));\r\n\r\n $create_params = array(\r\n 'userId' => '@me', //$this->userId,\r\n 'groupId' => '@self',\r\n 'activity' => $activity,\r\n 'appId' => '@app' //$this->appId\r\n );\r\n\r\n $batch->add($this->osapi->activities->create($create_params), 'createActivity');\r\n\r\n $response = $batch->execute();\r\n $this->debug(\"Response:<br /><pre>\" . print_r($response, true) . \"</pre>\");\r\n\r\n return $response;\r\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 actionCreate() {}", "public function actionCreate() {}", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function create() {\n $this->operationsModel->create($_POST);\n $this->response('',200,'Success');\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createNewEntry(ApiUser $apiUser);", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'image' => 'required',\n 'description' =>'required'\n ]);\n \n \n $file =$request->image;\n \n $activity = new Activity();\n $activity->name = $request->name;\n $activity->image =$file ;\n $activity->description = $request->description;\n \n $activity->users_id =$request->user_id ;\n \n $activity->save();\n\n return redirect('/activity')->with('success_message','Upload berhasil');\n }", "public function indexApCreate(){\n //This will be used to display in the Wizard of available Realms in the Create screens of Vouchers; Permanent Users; and Devices\n $user = $this->Aa->user_for_token($this);\n if(!$user){ //If not a valid user\n return;\n }\n $this->_doApListFor($user,'create'); \n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Upload.Developer.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_upload())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('upload_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'upload');\n\n\t\t\t\tTemplate::set_message(lang('upload_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/developer/upload');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('upload_create_failure') . $this->upload_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('upload', 'upload.js');\n\n\t\tTemplate::set('toolbar_title', lang('upload_create') . ' Upload');\n\t\tTemplate::render();\n\t}", "function getActivity()\n\t\t{\n\t\t\t$userID = $_POST[\"userID\"];\n\t\t\t$title = \"userPost\";\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t\n\t\t\techo $this->postActivity($userID, $title, $description, $link);\n\t\t}", "public function action_createblank(){\n\t\t\n\t\t\t$userinfo = array();\n\t\t\t\n\t\t\t$userinfo['mis'] = '';\n\t\t\t$userinfo['name'] = '';\n\t\t\t$userinfo['username'] = '';\n\t\t\t$userinfo['iohid'] = '';\n\t\t\t$userinfo['password'] = '';\n\t\t\t\n\t\t\t$userinfo['email'] = '';\n\t\t\t$userinfo['mobileno'] = '';\n\t\t\t$userinfo['dob'] = 'DD / MM / YYYY';\n\t\t\t$userinfo['gender'] = '';\n\t\t\t$userinfo['year'] = '';\n\t\t\t$userinfo['stream']= '';\n\t\t\t\n\t\t\t$userinfo['age'] = ''; \n\t\t\t$userinfo['orderid'] = '';\n\t\t\t$year = 'blank';\n\t\t\t$stream = 'blank';\n\t\t\t//$this->placepdfvalue(json_encode($userinfo),str_replace('coep2013_', '', $user->username).'_1', 'studentinfo.php');\n\t\t\t$this->placepdfvalue(json_encode($userinfo),'blank', 'stjohnhealthcard.php',$year,$stream );\n\t\t\tdie;\n\t}", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function create(): void\n {\n\n $description = null;\n $image = null;\n $velo_id = null;\n\n if (!empty($_POST['description']) && $_POST['description'] != \"\") {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!empty($_POST['image'])) {\n $image = htmlspecialchars($_POST['image']);\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n\n if (!$description || !$image || !$velo_id) {\n die(\"formulaire mal rempli\");\n }\n\n $this->model->insert($description, $image, $velo_id);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function create()\n {\n //\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.create', compact('usuario'));\n }", "public function create()\n {\n //\n return view('admin.activity.create');\n }", "public function create(Request $request)\n {\n // Get the user data from JWT\n $userData = TokenHandler::decode($request->header('token'));\n\n $activity = [\n 'user_id' => $userData['id'],\n 'title' => $request->get('title'),\n 'description' => $request->get('description'),\n 'task' => $request->get('task'),\n 'online_resource' => $request->get('onlineResource'),\n 'duration' => $request->get('duration'),\n 'created_at' => \\Carbon\\Carbon::now(),\n 'updated_at' => \\Carbon\\Carbon::now()\n ];\n\n $validator = Validator::make($activity, Activity::rules());\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n\n try {\n Activity::insert($activity);\n } catch (\\Exception $ex) {\n return APIHandler::response(0, \"Unable to create activity.\", 400);\n }\n\n\n return APIHandler::response(1, \"Activity has been successfully created.\", 201);\n }", "public function updateUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Operation!');\n } else {\n if (isset($data['title'])) {\n $operation->setTitle($data['title']);\n }\n if (isset($data['explanation'])) {\n $operation->setExplanation($data['explanation']);\n }\n if (isset($data['photo'])) {\n $operation->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (isset($data['video'])) {\n $operation->setVideo(Asset_Video::getById($data['video']));\n }\n if (isset($data['latitude']) && isset($data['longtitude'])) {\n $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']);\n $operation->setLocation($geo);\n }\n if (isset($data['activity_id'])) {\n $operation->setActivity(Object_Activity::getById($data['activity_id']));\n }\n if (!$operation->save()) {\n $this->setErrorResponse('cannot update Operation object');\n }\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n\n $this->_helper->json($operation);\n }", "function create( $obj )\n\t{\n\t\t$data = array(\n\t\t\t'user_id' => $obj->user_id,\n\t\t\t'action_text' => $obj->action_text,\n\t\t\t'action_created' => getNow()\n\t\t);\n\n\t\t// Insert the data\n\t\tif ( $this->db->insert( 'actions', $data ) )\n\t\t{\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function createOpportunity($target='') {\n\t\tif($this->session->userdata('uid')) {\n\t\t\tif (($target == '') || (strtolower($target) != 'lead' && strtolower($target) != 'customer')) {\n\t\t\t\t$this->new_stages();\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\t$user_id = $this->session->userdata('uid');\n\t\t\t\t\t$data = $this->opp_common->fetch_userPrivilages($user_id);\n\t\t\t\t\t$data['target'] = $target;\n\t\t\t\t\t$this->load->view('sales_opportunity_create', $data);\n\t\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function createNoUser(){\r\n $this -> setInscrit(0);\r\n $this -> insertDb();//Insertion en Bd d'un tuple user\r\n \r\n }", "public function CreateTask()\n {\n\n $data = $this->GetParamsFromRequestBody('create');\n\n if (!isset($data['status'])) {\n $data['status'] = \"open\";\n }\n\n $data['createdby'] = $this->loggedUser->getId();\n\n $this->insertArrayIntoDatabase('todo_task', $data);\n $id = mysql_insert_id();\n\n $this->response = array(\n \"status\" => 0,\n \"id\" => $id\n );\n $this->responseStatus = 201;\n }", "public function voxy_create_new_user()\n {\n $data = $this->input->post();\n\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n if(isset($data['expiration_date']) && $data['expiration_date'] != ''){\n $data['expiration_date'] = strtotime($data['expiration_date']);\n }\n if(isset($data['date_of_next_vpa']) && $data['date_of_next_vpa'] != ''){\n $data['date_of_next_vpa'] = strtotime($data['date_of_next_vpa']);\n }\n if(isset($data['can_reserve_group_sessions']) && $data['can_reserve_group_sessions'] != ''){\n $data['can_reserve_group_sessions'] = strtolower($data['can_reserve_group_sessions']);\n }\n\n $api_data = $this->m_voxy_connect->register_a_new_user($data['external_user_id'], $data);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Tạo tài khoản người dùng thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\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 create($uid, $activity)\n\t{\n\t\treturn $this->request->send('POST', \"/profiles/$uid/activities\", $activity);\n\t}", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function actionCreate()\n {\n $model = new User();\n $employee=new UserProfile();\n if ($model->load(Yii::$app->request->post()) && $employee->load(Yii::$app->request->post())) {\n $model->password=Yii::$app->getSecurity()->generatePasswordHash($model->password);\n if($model->save()){\n $employee->user_id=$model->id;\n $employee->photo = UploadedFile::getInstance($employee, 'photo');\n if ($employee->photo){ \n $photo_name='profile_'.date('Ymdhis').'.' . $employee->photo->extension; \n $employee->photo->saveAs(\\Yii::$app->basePath.'/web/images/' . $photo_name);\n $employee->photo=$photo_name;\n }\n if($employee->save())\n {\n return $this->redirect(['index']);\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'employee'=>$employee\n ]);\n }", "function _create_user($user_data){\n \n $person_id=$this->model->insert($user_data);\n return $person_id;\n \n }", "function admin_create_new_user(){ \r\n\t\t\t$id = $this->uri->segment(3);\r\n\t\t\tif($id){\r\n\t\t\t\t$result['update_user_value'] = $this->model->get_edit_record();\r\n\t\t\t}\t \r\n\t\t\t$result['new_user_data'] = $this->model->select_new_user();\r\n\t\t\t$this->load->view('admin-worldsclinicalguide/admin_create_new_user',$result); \r\n\t}", "public function creating(User $user)\n {\n\n }", "public function actionCreate()\n\t{\n\t\t$model=new User;\n\t\t$guide = new Guide;\n\t\t\n\t\t$model->setScenario('common');\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['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$model->created_on = date('Y-m-d H:i:s');\n\t\t\t\n\t\t\tif(isset($_POST['User']['social_identifier']) && trim($_POST['User']['social_identifier']) != '')\n\t\t\t$model->setScenario('social');\n\t\t\telse\n\t\t\t$model->setScenario('normal');\n\t\t\tif($model->validate()){\n\t\t\t \n\t\t\t if($model->save()){\n\t\t\t\t\t if($model->role == '3')\n\t\t\t\t\t $this->redirect(array('guidedetails','id'=>$model->user_id));\n\t\t\t\t\t else if($model->role == '4')\n\t\t\t\t\t $this->redirect(array('iyerdetails','id'=>$model->user_id));\n\t\t\t\t\t else if($model->role == '2'){\n\t\t\t\t\t\t\t $this->redirect(array('regsuccesss','id'=>$model->user_id));\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'guide'=>$guide,\n\t\t));\n\t}", "public function creating(User $user): void\n {\n \n }", "public function insertCapturedInformationAction(){\n\n\t // Get the Request parameters\n\n\t\t$params = $this->getRequest()->getParams();\n\n\t\t$secretkey = $this->secretkey;\n\n\t\t$db = $this->db;\n\n\t\t// Genaral Information of the user login details\n\n\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\"; \n\t\t$captured_info_type\t= isset($params['captured_info_type'])?$params['captured_info_type']:\"\";\n\n //For Contact Information Params//\n\n\n\t\t$name\t= isset($params['name'])?$params['name']:\"\";\n\t\t$mobile = isset($params['mobile'])?$params['mobile']:\"\";\n\t\t$whatsapp\t= isset($params['whatsapp'])?$params['whatsapp']:\"\";\n\t\t$profession\t= isset($params['profession'])?$params['profession']:\"\";\n\t\t$cast\t= isset($params['cast'])?$params['cast']:\"\";\n\t\t$address\t= isset($params['address'])?$params['address']:\"\";\n\t\t$polling_both\t= isset($params['polling_both'])?$params['polling_both']:\"\";\n\t\t$party_affilitation\t= isset($params['party_affilitation'])?$params['party_affilitation']:\"\";\n\t\t$party_name\t = isset($params['party_name'])?$params['party_name']:\"\";\n\t\t$offline_sink_datetime = isset($params['offline_sink_datetime'])?$params['offline_sink_datetime']:\"\";\n\t\t$availiability = isset($params['availiability'])?$params['availiability']:\"\";\n\t\t$lat\t= isset($params['lat'])?$params['lat']:\"\"; \n\t\t$long\t= isset($params['long'])?$params['long']:\"\"; \n\t\t$project\t= isset($params['project'])?$params['project']:\"\"; \n\n // End of Contact Information Params //\n\n\n //For Placed Information Params//\n\n\t\t$place_description\t= isset($params['place_description'])?$params['place_description']:\"\";\n\t\t$consenred_person= isset($params['consenred_person'])?$params['consenred_person']:\"\";\n\t\t$designation = isset($params['designation'])?$params['designation']:\"\";\n\n\t\t$contact\t= isset($params['contact'])?$params['contact']:\"\";\n\t\t$address\t= isset($params['address'])?$params['address']:\"\";\n\t\t$lat\t= isset($params['lat'])?$params['lat']:\"\";\n\t\t$long\t= isset($params['long'])?$params['long']:\"\";\n\t\t$offline_sink_datetime\t= isset($params['offline_sink_datetime'])?$params['offline_sink_datetime']:\"\";\n\n\t\t$under\t= isset($params['under'])?$params['under']:\"\"; \n\n // End of Placed Information Params //\n\n\t\t$error_code = 1;\n\n\t\t$succes = FALSE;\n\n\t\ttry\n\n\t\t{\n\n\t\t\t$db->beginTransaction();\n\n\t\t\tif($secretkey != $appkey){\n\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t}\t\n\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t}\t\t\t\n\t\t\t$user = new Application_Model_Users();\n\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t}\n\n\t\t\tif(!empty($alldata['DeviceID']))\n\t\t\t{\t\t\t\n\t\t\t\tif($alldata['DeviceID'] != $device_id)\n\t\t\t\t{\n\t\t\t\t\t$error_code = 3;\n\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac')\n\t\t\t{\n\t\t\t\t$error_code = 3;\n\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t}\t\n\n\t\t\tif($alldata['App_Access_Status'] == 2)\n\t\t\t{\n\t\t\t\t$error_code = 2;\n\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t}\n\n\n\t\t\t// Add Basic Information of farmer\n\t\t\tif($captured_info_type ==1){ \n\t\t\t\tif(isset($_FILES['photograph_pi']['tmp_name']) AND !empty($_FILES['photograph_pi']['tmp_name'])){\n\t\t\t\t\t$tempName = $_FILES['photograph_pi']['tmp_name'];\n\t\t\t\t\t$imageName = time().$_FILES['photograph_pi']['name']; \n\t\t\t\t\t$uploads = 'uploads/user_photograph/';\n\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t}\n\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\t\t\t\t} \n\t\t\t\t$insertcapturedData = array();\n\t\t\t\t$insertcapturedData['place_description'] = $place_description;\n\t\t\t\t$insertcapturedData['consenred_person'] = $consenred_person;\n\t\t\t\t$insertcapturedData['designation'] = $designation;\n\t\t\t\t$insertcapturedData['contact'] = $contact;\n\t\t\t\t$insertcapturedData['address'] = $address;\n\t\t\t\t$insertcapturedData['lat'] = $lat;\n\t\t\t\t$insertcapturedData['long'] = $long;\n\t\t\t\t$insertcapturedData['offline_sink_datetime'] = $offline_sink_datetime;\n\t\t\t\t$insertcapturedData['photo'] = $pathComplete;\n\t\t\t\t$insertcapturedData['user_id'] = $LoginID;\n\t\t\t\t$insertcapturedData['project'] = $project;\n\t\t\t\t$insertcapturedData['under'] = $under;\n\t\t\t\t$db->insert('place_info',$insertcapturedData);\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\tif(isset($_FILES['photograph_ci']['tmp_name']) AND !empty($_FILES['photograph_ci']['tmp_name'])){\n\t\t\t\t\t$tempName = $_FILES['photograph_ci']['tmp_name'];\n\t\t\t\t\t$imageName = time().$_FILES['photograph_ci']['name']; \n\t\t\t\t\t$uploads = 'uploads/user_photograph/';\n\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t}\n\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\t\t\t\t} \n\n\t\t\t\t$insertData = array();\n\t\t\t\t$insertData['name'] = $name;\n\t\t\t\t$insertData['mobile'] = $mobile;\n\t\t\t\t$insertData['whatsapp'] = $whatsapp;\n\t\t\t\t$insertData['profession'] = $profession;\n\t\t\t\t$insertData['cast'] = $cast;\n\t\t\t\t$insertData['address'] = $address;\n\t\t\t\t$insertData['polling_both'] = $polling_both;\n\t\t\t\t$insertData['party_affilitation'] = $party_affilitation;\n\t\t\t\t$insertData['offline_sink_datetime'] = $offline_sink_datetime;\n\t\t\t\t$insertData['party_name'] = $party_name;\n\t\t\t\t$insertData['availiability'] = $availiability;\n\t\t\t\t$insertData['lat'] = $lat;\n\t\t\t\t$insertData['long'] = $long;\n\t\t\t\t$insertData['photo'] = $pathComplete;\n\t\t\t\t$insertData['user_id'] = $LoginID;\n\t\t\t\t$insertData['project'] = $project;\n\t\t\t\t$insertData['under'] = $under;\n\t\t\t\t$db->insert('contact_info',$insertData);\n\t\t\t}\n\n\t\t\t$update['Last_location_service_hit_time'] = $offline_sink_datetime;\n\n\t\t\t$user->updateSingleTableData('logi_field_users',$update,'LoginID',$alldata['LoginID']);\n\n\n\n\t\t\t$db->commit();\n\n\t\t\t$succes = TRUE;\t\n\n\t\t}\n\n\t\tcatch(Exception $e)\n\n\t\t{\n\n\t\t\t//Rollback transaction\n\n\t\t\t$db->rollBack();\n\n\t\t\t$error= $e->getMessage();\n\n\t\t}\n\n\n\n\t\tif($succes == TRUE )\n\n\t\t{\n\n\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Captured Information added Successfully.'));\n\n\t\t\texit;\n\n\t\t}\n\n\t\telse\n\n\t\t{\n\n\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error ));\n\n\t\t\texit;\n\n\t\t}\n\n\t}", "public function create()\n {\n \n echo \"Syntax: POST: /api?telefon=*telefon*&id_agencija=*id*<br>/api?email=*email*&id_agencija=*id*\";\n \n }", "public function actionCreate()\n\t{\n $this->actionUpdate();\n\t}", "public function create(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUcrDataByToken(UserController::getUcrRequestTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function updateUserActivityAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Activity!');\n } else {\n if (isset($data['title'])) {\n $activity->setTitle($data['title']);\n }\n if (isset($data['photo'])) {\n $activity->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (!$activity->save()) {\n $this->setErrorResponse('cannot update Activity object');\n }\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public static function ADMIN_ARCHIVE_CREATE_USER_TAG(){\n\t $SQL_String = \"INSERT INTO user_tags VALUES (NULL,:owner,:tag_term,NULL);\";\n\t return $SQL_String;\n\t}", "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}", "public function actionCreate() {\n $model = new Task;\n\n $reqModel = Yii::app()->getRequest()->getPost('Task');\n\n $user = new UserTask();\n $user->user_id = Yii::app()->user->id;\n $reqUser = Yii::app()->getRequest()->getPost('UserTask', array('user_id' => Yii::app()->user->id));\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if ($reqModel !== null) {\n $model->attributes = $reqModel;\n $user->attributes = $reqUser;\n if ($model->validate()) {\n if (is_array($reqUser['user_id'])) {\n if ($reqUser !== null) {\n $userIds = $reqUser['user_id'];\n $assoc = Yii::app()->getRequest()->getPost('Assoc', array('multiple' => '0'));\n if ($assoc['multiple'] === '1') {\n foreach ($userIds as $userId) {\n $task = new Task;\n $task->attributes = $reqModel;\n if ($task->save()) {\n UserTask::associate($task->id, $userId);\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.associate.success'));\n $this->_sendAssociationNotification(array($userId), $task->id);\n $this->_sendEmailAssociationNotification(array($userId), $task->id);\n }\n }\n } else {\n if ($model->save()) {\n foreach ($userIds as $userId) {\n UserTask::associate($model->id, $userId);\n }\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.create.success'));\n $this->_sendAssociationNotification($userIds, $model->id);\n $this->_sendEmailAssociationNotification($userIds, $model->id);\n }\n }\n }\n $this->redirect(array('view', 'id' => $model->id));\n } else {\n //this is bad but we need to check this part\n $user->addError('user_id', Yii::t('app', 'Task.associate.failure.user'));\n }\n }\n } else {\n $model->start_date = date('Y-m-d');\n $model->status = TaskStatus::model()->default()->find()->id;\n $model->type = TaskType::model()->default()->find()->id;\n }\n\n $this->render('create', array(\n 'model' => $model,\n 'user' => $user,\n 'projectId' => Yii::app()->getRequest()->getQuery('project_id')\n ));\n }", "public static function userCreateSuccess(){\n self::$IntelligenceService->addToIntelligenceStack(self::USER_INTELLIGENCE_CREATE_KEY, self::USER_INTELLIGENCE_SUCCESS);\n }", "public function testTrackOrderRequestWithUserCreateMethod(): void\n {\n $tracker = new Tracker($this->DATASET_ID(), $this->API_KEY());\n\n $money = new Money();\n $money->amount = 100;\n $money->currency = new Currency();\n $money->currency->value = \"DKK\";\n\n $order = new Order();\n $order->user = User::create(null, \"t-Id\", null, null, null, null, null);\n $order->subtotal = $money;\n $order->orderNumber = \"1\";\n\n $trackOrderRequest = new TrackOrderRequest();\n $trackOrderRequest->order = $order;\n\n $response = $tracker->request('TrackOrderRequest', $trackOrderRequest);\n\n self::assertEquals(200, $response->code);\n self::assertEquals(null, $response->body);\n }", "public function create(){\n\t\t$p=$this->input->post();\n\t\t$id=$this->m_user->saveUserFromTim($p);\n\t\t$p['id']=$id;\n\t\t$idt = $this->m_timHps->saveTimHps($p);\n\t\t$exp = explode(',', $p['anggota']);\n\t\t$jml = count($exp);\n\t\tfor($i=0; $i < $jml; $i++) { \n\t\t\t$this->m_timHps->saveAnggotaTimHps($exp[$i],$idt);\n\t\t}\n\t\t\n\t}", "public function actionCreate()\n {\n $model = new Action();\n if (Yii::$app->request->isPost) {\n $postActionFields = Yii::$app->request->post('ActionFields', []);\n $actionFieldsModels = [];\n for ($i = 0; $i < count($postActionFields); $i++) {\n $actionFieldsModels[] = new ActionFields();\n }\n if ($model->load(Yii::$app->request->post()) && Model::loadMultiple($actionFieldsModels, ['ActionFields' => $postActionFields])) {\n if (($model->validate() && Model::validateMultiple($actionFieldsModels))) {\n if ($model->save(false)) {\n foreach ($actionFieldsModels as $actionField) {\n $actionField->action_id = $model->id;\n $actionField->save(false);\n }\n //share op socialMedia\n $this->socialMediaPost($model);\n //redirect to view\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n }\n } else {\n $actionFieldsModels = $model->actionFields;\n }\n return $this->render('create', ['model' => $model, 'actionFields' => $actionFieldsModels]);\n\n }", "public function createUserAgendaAction()\n {\n $data = $this->getRequestData();\n if (isset($data['topic']) && isset($data['title'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/agenda/' . $user->getKey() . \"-agenda\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-agenda\");\n $folder->setParentId(51);\n $folder->save();\n }\n $agenda = new Object_Agenda();\n $agenda->setCreator($user);\n $agenda->setTopic($data['topic']);\n $agenda->setTitle($data['title']);\n $agenda->setNotes(isset($data['notes']) ? $data['notes'] : \"\");\n $agenda->setStart_time(isset($data['start_time']) ? $data['start_time'] : \"\");\n $agenda->setEnd_time(isset($data['end_time']) ? $data['end_time'] : \"\");\n $agenda->setWith_whom(isset($data['with_whom']) ? $data['with_whom'] : \"\");\n $agenda->setWith_people(isset($data['people']) ? Object_People::getById($data['people']) : \"\");\n $agenda->setLocation(isset($data['location']) ? $data['location'] : \"\");\n $agenda->setAlarm(isset($data['alarm']) ? $data['alarm'] : \"\");\n $agenda->setRepeat_days(isset($data['repeat_days']) ? $data['repeat_days'] : array());\n $agenda->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $agenda->setPublished(true);\n $agenda->setParentId($folder->getId());\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot save Agenda object');\n }\n } else {\n $this->setErrorResponse('topic and title is mandatory field for this request!');\n }\n\n $this->_helper->json($agenda);\n }", "public function actionCreate()\n {\n $model = new ActivityDetail();\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 addPhotoAction(){\n $data = $this->getRequestData();\n $types = array('activity', 'operation', 'people');\n if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']);\n if (!$folder) {\n switch($data['type']){\n case 'activity':\n $fid = 3;\n break;\n case 'operation':\n $fid = 4;\n break;\n case 'people':\n $fid = 7;\n break;\n }\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-\" . $data['type']);\n $folder->setParentId($fid);\n $folder->save();\n }\n\n $asset = new Asset_Image();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save photo!');\n }\n } else {\n $this->setErrorResponse('photo and type is mandatory for this request!');\n }\n\n $this->_helper->json(array('photo' => $asset->getId()));\n }", "public function actionCreateUser()\n {\n $model = new MstAccount();\n\t\t$date = date('Y-m-d H:i:s'); // @TODO Use Yii dateformatter\n\n\t\t// set defaults\n\t\t// @TODO: transfer updating of status/created/updated details to model\n\t\t// set status, created and updated details\n\t\t$model->status\t\t\t= Yii::$app->params['STATUS_ACTIVE'];\n\t\t$model->creator_id\t\t= Yii::$app->user->id;\n\t\t$model->created_date \t= $date;\n\t\t$model->updater_id\t\t= Yii::$app->user->id;\n\t\t$model->updated_date\t= $date;\n\n\t\t// get plant list\n\t\t$plant_location_list = Yii::$app->modelFinder->getPlantList(null, ['status' => Yii::$app->params['STATUS_ACTIVE']], 'plant_location');\n\t\t$assignment_list = ArrayHelper::map($plant_location_list, 'plant_location', 'plant_location');\n\n if ($model->load(Yii::$app->request->post())) {\n \t$model->password = md5($model->password);\n\n\t\t\t// convert to correct date format\n\t\t\t$model->start_date = Yii::$app->dateFormatter->convert($model->start_date);\n\t\t\t$model->end_date = Yii::$app->dateFormatter->convert($model->end_date);\n\n\t\t\tif ($model->save()) {\n\t\t\t\treturn $this->redirect(['view-user', 'id' => $model->id]);\n\t\t\t} else {\n\t\t\t\treturn $this->render('create-user', [\n\t 'model' => $model,\n\t 'assignment_list' => $assignment_list,\n\t ]);\n\t\t\t}\n } else {\n return $this->render('create-user', [\n 'model' => $model,\n 'assignment_list' => $assignment_list,\n ]);\n }\n }", "public function actionCreate() {\n $this->actionUpdate();\n }", "public function __construct(CreateUserActivityUseCase $usecase)\n {\n $this->usecase = $usecase;\n }", "public function create()\n {\n $data['id'] = $this->db->order_by('id', 'desc')->get($this->User->table)->row()->id + 1;\n \n $this->Helper->view('user/create', $data);\n }", "function QM_after_Users_insertUser($params)\n{\n\t$user = $params['user'];\n\t$stream = Streams::create($user->id, $user->id, 'Streams/category', array(\n\t\t'name' => 'QM/bookmarklets'\n\t));\n\t$stream->join(array('userId' => $user->id));\n}", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()))\n {\n if(isset($_FILES['User']['name']['image']) && $_FILES['User']['name']['image'] != null)\n {\n if($model->image_path != '' && $model->image_path != null && file_exists(Yii::getAlias('@webroot').'/'.$model->image_path))\n {\n unlink(Yii::getAlias('@webroot').\"/\".$model->image_path);\n }\n $new_image['name'] = $_FILES['User']['name']['image'];\n $new_image['type'] = $_FILES['User']['type']['image'];\n $new_image['tmp_name'] = $_FILES['User']['tmp_name']['image'];\n $new_image['error'] = $_FILES['User']['error']['image'];\n $new_image['size'] = $_FILES['User']['size']['image'];\n\n $name = Yii::$app->common->normalUpload($new_image, Yii::$app->params['userimage']);\n $model->image_path = $name;\n }\n $model->password =md5($model->password);\n $model->i_by = Yii::$app->user->id;\n $model->i_date = time();\n $model->u_by = Yii::$app->user->id;\n $model->u_date = time();\n\n if($model->save(false))\n {\n $msg=\"User has been successfully added\";\n $flash_msg = \\Yii::$app->params['msg_success'].$msg.\\Yii::$app->params['msg_end'];\n \\Yii::$app->getSession()->setFlash('flash_msg', $flash_msg);\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createNewActivity(Request $request) {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string|max:120',\n 'description' => 'required|string|max:1000',\n 'start_date' => 'required',\n 'end_date' => 'required',\n 'skills' => 'required',\n 'participants' => 'required',\n ]);\n\n if($validator->fails()){\n return response()->json($validator->errors()->toJson(), 422);\n }\n\n try {\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n } else {\n // ONLY EXPERT USER CAN REGISTER NEW ACTIVITY\n if (!parent::checkAccess($user->profile_id, 'expert')) {\n return response()->json(['Only EXPERT user can create new activity'], 422);\n }\n\n $activity = Activity::create([\n 'title' => $request->get('title'),\n 'user_id' => $user->id,\n 'description' => $request->get('description'),\n 'start_date' => $request->get('start_date'),\n 'end_date' => $request->get('end_date'),\n 'skills' => json_encode($request->get('skills')),\n 'participants' => json_encode($request->get('participants')),\n ]);\n if($activity) {\n return response()->json([\n 'message' => 'Create success',\n 'status' => 'OK'\n ], 200);\n } else {\n return response()->json([\n 'message' => 'Create failed',\n 'status' => 'ERROR'\n ], 422);\n }\n }\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n }", "function CreateUser() {\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USER_TYPE] = $this->reseller->getUserType();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USERNAME] = $this->reseller->getUserLoginName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EMAIL_ID] = $this->reseller->getEmailId();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CONTACT_NO] = $this->reseller->getMobileNo();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_FULL_NAME] = $this->reseller->getFullName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ADDRESS] = $this->reseller->getAddress();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CITY] = $this->reseller->getCity();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_REGION] = $this->reseller->getRegion();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_COUNTRY] = $this->reseller->getCountry();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DOMAIN_NAME] = $this->reseller->getDomainName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EXPIRY_DATE] = $this->reseller->getExpiryDate();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ENABLE_CMS] = $this->reseller->getEnableCMS();\n $this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DLT_ENTITY_ID] = $this->reseller->getDltEntityId();\n\t\t\t$response = new sgc_callapi(sgc_constant::SGC_API, sgc_constant::SGC_ENDPOINT_RESELLER_CREATE_USER, $this->data, $this->header, sgc_common_api_params::API_COMMON_METHOD_POST, $this->useRestApi);\n\t\t\treturn $response->getResponse();\n\t\t}", "function CreateTask() {\n\tif (!empty($_GET['email']) && !empty($_GET['password'])) {\n\t\t// check if valid email and pw\n\t\tif (Authenticate($_GET['email'], $_GET['password'])) {\n\t\t\t// check if valid fields are present for task creation\n\t\t\tif (!empty($_GET['name']) && !empty($_GET['type']) && !empty($_GET['priority'])) {\n\t\t\t\t// store keys \n\t\t\t\t$_POST['name'] = $name= $_GET['name'];\n\t\t\t\t$_POST['type'] = $type = $_GET['type'];\n\t\t\t\t$_POST['priority'] = $priority = $_GET['priority'];\n\n\t\t\t\t// priority will be between 1 and 10\n\t\t\t\tif ($priority > 10) $_POST['priority'] = 10;\n\t\t\t\tif ($priority < 1) $_POST['priority'] = 1;\n\n\t\t\t\t//validate name\n\t\t\t\tif (strlen($name) > 100 || strlen($name) < 5) {\n\t\t\t\t\techo json_encode(\"Task name to short/long, n > 5 < 100\");\n\t\t\t\t\treturn;\n\t\t\t\t} \n\n\t\t\t\t// validate type\n\t\t\t\t$type= strtolower($type);\n\t\t\t\tif ($type != 'home' && $type != 'work') {\n\t\t\t\t\techo json_encode(\"Task type should be home or work\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// get the id of the user creating the task\n\t\t\t\t$conn = GetConnection();\n\t\t\t\t$stmt = \"SELECT ID FROM users WHERE email='$_GET[email]'\";\n\t\t\t\t$data = $conn->query($stmt) or die('Query failed: ' . mysqli_error($conn));\n\t\t\t\t$row = mysqli_fetch_row($data);\n\t\t\t\t//set id to the id of the owner\n\t\t\t\t$_POST['id'] = $row[0];\n\t\t\t\t// tasks always start as todo\n\t\t\t\t$_POST['status']= 'todo';\n\n\t\t\t\t// Creat the insert statement to add task entry\n\t\t\t\t$stmt=\"INSERT INTO task (ownerID,priority,type,status,name) VALUES \".\n\t\t\t\t\t\"('$_POST[id]','$_POST[priority]','$_POST[type]', '$_POST[status]', '$_POST[name]')\";\n\n\t\t\t\t$conn->query($stmt) or die('Query failed: ' . mysqli_error($conn));\n\t\t\t\techo json_encode('Task created');\n\t\t\t\t//close the connection to the database\n\t\t\t\tmysqli_close($conn);\n\t\t\t}else echo json_encode('No name/type/priority param(s) provided, use ?name=x&type=x&priority=x in url');\n\t\t}\n\t} else echo json_encode('No email/password param(s) provided, use ?email=x&password=x in url');\t\n\n}", "public function add_on_new_user( $operation ) {\n\t\tif ( 'add-new-user' !== $operation ) {\n\t\t\t// $operation may also be 'add-existing-user'\n\t\t\treturn;\n\t\t}\n\n\t\t$fields = self::get_fields();\n\t\tunset( $fields['first_name'], $fields['last_name'] );\n\t\t?>\n\t\t<table class=\"form-table\">\n\t\t<?php foreach ( $fields as $id => $field ) { ?>\n\t\t\t<tr>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" id=\"<?php echo $id; ?>\" name=\"<?php echo $id; ?>\" placeholder=\"<?php echo $field['title']; ?>\" value=\"<?php echo isset( $_POST[ $id ] ) ? esc_attr( $_POST[ $id ] ) : ''; ?>\" class=\"regular-text\">\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php } ?>\n\t\t</table>\n\t\t<?php\n\t}", "public function actionCreate()\n {\n if (!Yii::$app->user->isGuest) {\n\n if (Yii::$app->user->can('createUser')) {\n\n $model = new Employees();\n $user = new User();\n\n $model->created_by = Yii::$app->user->identity->getId();\n $model->created_at = date('Y-m-d H:i');\n $model->status = Employees::ACTIVE;\n\n\n if ($model->load(Yii::$app->request->post()) && $user->load(Yii::$app->request->post())) {\n\n if($model->save()){\n\n $model->employee_image = UploadedFile::getInstance($model, 'employee_image');\n\n if ($model->employee_image != null) {\n $model->employee_image->saveAs('uploads/employee/' . $model->employee_image . '.' . $model->employee_image->extension);\n $model->image = $model->employee_image . '.' . $model->employee_image->extension;\n }\n\n $user->employee_id = $model->id;\n $user->\tcreated_at = date('Y-m-d H:i');\n $user->\tupdated_at = date('Y-m-d H:i');\n try {\n\n if ($user->save()) {\n\n Yii::$app->authManager->assign(Yii::$app->authManager->getRole($user->role), $user->id);\n\n Yii::$app->session->setFlash('', [\n 'type' => 'success',\n 'duration' => 5000,\n 'icon' => 'fa fa-check',\n 'title' => 'Notification',\n 'message' => 'Registration successfully registered',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 10000,\n 'icon' => 'fa fa-warning',\n 'title' => 'Notification',\n 'message' => 'User registration not successfully,username have already used',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n\n // Audit::setActivity('Duplicates user ID in User table ' . '(' . $model->id . ')', 'Wafanyakazi', 'Create', '', '');\n Employees::deleteAll(['id' => $model->id]);\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n }\n } catch (\\Exception $e) {\n\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 5000,\n 'icon' => 'fa fa-warning',\n 'message' => 'User registration not successfully',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n // Audit::setActivity('Duplicates user ID in User table ' . '(' . $model->id . ')', 'Wafanyakazi', 'Create', '', '');\n Employees::deleteAll(['id' => $model->id]);\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n\n }\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n }\n\n\n } else {\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 8000,\n 'icon' => 'fa fa-warning',\n 'title' => 'Notification',\n 'message' => 'You dont have a permission',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n return $this->redirect(['index']);\n }\n\n } else {\n $model = new LoginForm();\n return $this->redirect(['site/login',\n 'model' => $model,\n ]);\n }\n\n\n }", "public function activityAction() {\n\tif($this->_getParam('id',false)){\n\t$activities = new PrimaryActivities();\n\t$this->view->activities = $activities->getActivityDetails($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function actionCreate()\n {\n $model = new DataUser();\n if(Yii::$app->request->isPost){\n $postdata=Yii::$app->request->post('postdata');\n $model->setAttributes($postdata,false);\n $model->created=date(\"Y-m-d H:i:s\");\n if($model->save()){\n return $this->redirect(['index']);\n }\n }\n \n return $this->render('create', []);\n }", "protected function setupCreateOperation()\n {\n CRUD::setValidation(UserRequest::class);\n\n $this->crud->setOperationSetting('contentClass', 'col-md-12 bold-labels');\n $this->crud->addFields([\n [ \n 'name' => 'name',\n 'label' => 'Name',\n 'type' => 'text',\n ],\n [ \n 'name' => 'password',\n 'label' => 'Password',\n 'type' => 'password',\n ],\n [ \n 'name' => 'email',\n 'label' => 'Email',\n 'type' => 'email',\n ],\n [ // radio\n 'name' => 'type_id', // the name of the db column\n 'label' => 'Type', // the input label\n 'type' => 'radio',\n 'options' => [\n // the key will be stored in the db, the value will be shown as label; \n 0 => \"Collector\",\n 1 => \"Administrator\"\n ],\n 'inline' => true, // show the radios all on the same line?\n ],\n ]);\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "public function store(Request $request)\n {\n $activityName = $request->input('name');\n\n if($activityName){\n //$activity = Activity::firstOrCreate(['activityName' => $activityName]);\n //$activity = Activity::where('activityName', '=', $activityName)->first();\n $activity =Activity::find($request->input('id'));\n\n if ($activity == null){\n $activity = new Activity; \n $activity->activityName = $activityName;\n }\n $activity->userId = $request->user()->id;\n $activity->activityName = $activityName;\n $activity->startTime = $request->input('startTime'); \n $activity->endTime = $request->input('endTime'); \n $activity->description = $request->input('description'); \n $activity->save();\n }\n\n //return (Activity::All());\n return response()->json([\n 'message' => 'Success'\n ]);\n\n }", "private function fillCreationDetails(User $user) {\n $user->CreatedBy = Auth::user()->UserName;\n $user->CreatedDate = date(\"y-m-d h:i:s\");\n }", "public function createUser()\n {\n $result = 1;\n \n $this->registrationDate = date('Y-m-d');\n $this->validation = uniqid();\n \n $transaction = $this->dbConnection->beginTransaction();\n \n try\n { \n if($this->save()){\n //Get the idUser of the new User and specify it in the table verifIdentity\n $idUser = Yii::app()->db->getLastInsertId();\n $verifIdentity = VerifIdentity::model()->findByPk($this->serialNumber);\n $verifIdentity->idUser = $idUser;\n if(!$verifIdentity->save())\n throw new CDbException(null); \n\n //Upload of Profile Picture\n if($this->profilePicture !== \"default\")\n {\n $result = $this->addPicture($this->profilePicture, $this->profilePictureExtension);\n if($result !== 1)\n {\n $this->addError('pictureUploader',$result);\n throw new CException(null); \n }\n }\n\n $transaction->commit();\n }\n else $result = 0;\n }\n catch(Exception $e)\n {\n if($e !== null)\n $this->addError('pictureUploader',\"Problem during create process\");\n $transaction->rollBack();\n $result = 0;\n } \n\n return $result;\n }", "public function create($type, $data, $userId);", "public function xadmin_createaction() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$action_title = $args [1];\n\t\t$action_type = $args [2];\n\t\t\n\t\t/* Load Model */\n\t\t$action = $this->getModel ( 'action' );\n\t\t$this->session->returnto ( 'actions' );\n\t\t\n\t\t/* create the form */\n\t\t$action->createNewAction ( $action_title, $action_type );\n\t\t\n\t\t$this->loadPluginModel ( 'actions' );\n\t\t$plug = Plugins_Actions::getInstance ();\n\t\t\n\t\t/* allow changes to be made by plugin */\n\t\t$plug->trigger ( 'onAfterCreateAction', $action );\n\t\t\n\t\t/* allow changes to be made by plugin - extend schema of data table */\n\t\t$plug->trigger ( 'onAfterCreateAction_ExtendDataTable', $action );\n\t\t\n\t\t/* set argument for the edit view */\n\t\t$this->setArguments ( array ($action->id ) );\n\t\t\n\t\t$this->_registry->setValue ( 'usedTabs', 1 );\n\t\t\n\t\t/* quiet redirect */\n\t\t$this->_redirect ( '_editAction' );\n\t}", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function create(string $activity, string $country, string $season, string $comments, string $done) :void\n {\n if (isset($_POST['addTravelGoal']) && !empty($_POST['activity']) && !empty($_POST['country']) && !empty($_POST['done'])) {\n $activity = $_POST['activity'];\n $country = $_POST['country'];\n $season = $_POST['season'];\n $comments = $_POST['comments'];\n $done = $_POST['done'];\n\n $sqlCreate = \"INSERT INTO travel_list (activity, country, season, comments, done) VALUES ('$activity','$country','$season','$comments','$done');\";\n $result = $this->databaseManager->connection->query($sqlCreate);\n\n //TODO remove test echo\n echo \"Your travel goal has been added!\";\n\n// return [\n// \"result\" => $result,\n// \"message\" => \"<div class='alert alert-success'>\" . $travels->confirmationMsg() . \"</div>\"\n// ];\n\n } else {\n $invalidFields = validateFields();\n if (!empty($invalidFields)) {\n if (in_array(\"activity\", $invalidFields)) {\n $errorMsg = \"Whoops! Please fill out the activity you want to do.\";\n $errorMsg .= \"<br>\";\n }\n if (in_array(\"country\", $invalidFields)) {\n $errorMsg .= \"Whoops! Please select a country.\";\n $errorMsg .= \"<br>\";\n }\n //TODO verify how to check for unchecked or double checked boxes\n if (in_array(\"done\", $invalidFields)) {\n $errorMsg .= \"Whoops! Please check one of the boxes.\";\n $errorMsg .= \"<br>\";\n }\n\n //TODO remove test echo\n echo \"Please fill out the required fields\";\n // Display any empty or invalid data with corresponding error message\n// return [\n// \"travel\" => null,\n// \"message\" => \"<div class='alert alert-danger'>\" . $errorMsg . \"</div>\"\n// ];\n }\n }\n }", "public function CreateUserCfop($userId, $cfop, $description)\n {\n $this->userId = $userId;\n $this->cfop = $cfop;\n $this->description = $description;\n\n $insertUserCfopl = \"INSERT INTO user_cfop (user_id,cfop,description,active,default_cfop,created)VALUES(:user_id,:cfop,:description,:active,:default_cfop,NOW())\";\n $userCfoplInfo = $this->sqlDataBase->prepare($insertUserCfopl);\n $userCfoplInfo->execute(array(':user_id'=>$this->userId,':cfop'=>$this->cfop,':description'=>$this->description,':active'=>$this->active,':default_cfop'=>UserCfop::DEFAULT_CFOP));\n $errorArr = $userCfoplInfo->errorInfo();\n echo $errorArr[2];\n $this->userCfopId =$this->sqlDataBase->lastInsertId();\n }", "public function createUser(){\n\n $t = new QuestionsModel();\n $questions = $t->where([\"test_id\" => $_POST[\"test_id\"]]);\n\n $amount = 0;\n\n if($questions) {\n $amount = count($questions);\n }\n\n $params = [\n \"user_name\" => $_POST[\"user_name\"],\n \"test_id\" => $_POST[\"test_id\"],\n \"test_key\" => $_POST[\"hash\"],\n \"test_length\" => $amount\n ];\n\n $u = new UserModel();\n $entry = $u->insert($params);\n\n $response = [\n \"success\" => 1,\n \"payload\" => $entry\n ];\n\n die(json_encode($response));\n }", "public function userSave() {\r\n $user_id = \\Yii::$app->user->getId();\r\n $baseimgurl = 'date/upload/wechat/user/';\r\n $createpath=\\Yii::$app->basePath.'/web/'.$baseimgurl;\r\n ToolService::createdir($createpath);\r\n //生成随机文件名\r\n $basefilename = $user_id . '_' . time() . '_' . rand(1000, 9999);\r\n $this->s_img_url = $sfilename = $baseimgurl . 's' . $basefilename . '.' . $this->file->extension;\r\n $this->o_img_url = $ofilename = $baseimgurl . 'o' . $basefilename . '.' . $this->file->extension;\r\n $this->m_img_url = $mfilename = $baseimgurl . 'm' . $basefilename . '.' . $this->file->extension;\r\n $this->b_img_url = $bfilename = $baseimgurl . 'b' . $basefilename . '.' . $this->file->extension;\r\n $this->file->saveAs($bfilename);\r\n $image = \\Yii::$app->image->load($bfilename);\r\n //生成中图片\r\n $image->resize(100, 100, Image::NONE);\r\n $image->save($mfilename);\r\n //生成小图片\r\n $image->resize(64, 64, Image::NONE);\r\n $image->save($sfilename);\r\n //生成微略图\r\n $image->resize(48, 48, Image::NONE);\r\n $image->save($ofilename);\r\n\r\n\r\n $newpic = new Pic();\r\n $newpic->setAttributes([\r\n 'user_id' => $user_id,\r\n 'pic_type' => 1,\r\n 'pic_s_img' => '/' . $sfilename,\r\n 'pic_m_img' => '/' . $mfilename,\r\n 'pic_b_img' => '/' . $bfilename\r\n ]);\r\n if ($newpic->save()) {\r\n $this->id = \\Yii::$app->db->getLastInsertID();\r\n return true;\r\n }\r\n return FALSE;\r\n }", "public function actionCreate()\n {\n $this->_model->status = User::ACTIVE;\n return $this->save($this->_model);\n }", "function do_addstream($user)\r\n\t{\r\n $created_by=$user['userid'];\r\n foreach(array(\"st_title\",\"st_description\") as $i)\r\n\t\t\t$$i=$this->input->post($i);\r\n if($st_title=='') die(\"Please enter title\");\r\n\t\t$created_time = time();\r\n $this->db->query(\"insert into m_streams(title,description,created_by,created_time,status) values(?,?,?,?,?)\",array($this->prep($st_title),$this->prep($st_description),$created_by,$created_time,1));\r\n $streamid=$this->db->insert_id();\r\n \r\n $read=1; $write=2; $status=1;\r\n if(isset($_POST['permissions_r'])) {\r\n foreach($_POST['permissions_r'] as $userid)\r\n $this->db->query(\"insert into m_stream_users(stream_id,user_id,access,is_active,created_by,created_on) values(?,?,?,?,?,?)\",array($streamid,$userid,$read,$status,$created_by,$created_time));\r\n }\r\n if(isset($_POST['permissions_w'])) {\r\n foreach($_POST['permissions_w'] as $userid) \r\n $this->db->query(\"insert into m_stream_users(stream_id,user_id,access,is_active,created_by,created_on) values(?,?,?,?,?,?)\",array($streamid,$userid,$write,$status,$created_by,$created_time));\r\n }\r\n\t\t$this->session->set_flashdata(\"erp_pop_info\",\"New stream created\");\r\n\t\tredirect(\"admin/streams\");\r\n\t}", "function createSystemUser() {\n if (Session::get('privilege') == 'Operator') {\n $val = $this->model->createSystemUser($_POST);\n if ($val == 1) {\n $mag = 'Success';\n header('location: ' . URL . 'systemUser/create/' . $mag . '');\n } else {\n $mag = 'Fail/\" (' . $val . ') \"';\n header('location: ' . URL . 'systemUser/create/' . $mag . '');\n }\n } else {\n $this->error();\n }\n }", "public static function addActivty($sfGuardUserId, $activityTypeId, $title = '')\n\t {\n\t\t$activity = new Activity();\n\t\t$activity->setSfuserId($sfGuardUserId);\n\t\t$activity->setActivitytypeId($activityTypeId);\n\t\t$activity->setTitle($title);\n\t\t$activity->save();\n\t\t \n\t\treturn $activity; \t\n\t }", "public function createUserAction($userActionId, $request)\n {\n return $this->start()->uri(\"/api/user-action\")\n ->urlSegment($userActionId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }" ]
[ "0.7053734", "0.5742937", "0.5668721", "0.5636948", "0.56229883", "0.55819947", "0.5574787", "0.55622447", "0.555195", "0.55331993", "0.5502536", "0.5407458", "0.5368779", "0.53570044", "0.5341209", "0.5339537", "0.53374046", "0.533324", "0.5319097", "0.53076345", "0.5275988", "0.52700126", "0.5258099", "0.52503", "0.52494836", "0.52494836", "0.5248176", "0.524542", "0.5239307", "0.5231302", "0.5221565", "0.5215963", "0.52084464", "0.52070624", "0.5205727", "0.5199948", "0.5185872", "0.5184558", "0.5180115", "0.5175554", "0.51668406", "0.5155071", "0.5143589", "0.5137028", "0.5134886", "0.51316875", "0.5129608", "0.5126374", "0.51205885", "0.5119249", "0.5116111", "0.51099795", "0.5109151", "0.5102294", "0.5100103", "0.5093862", "0.5086327", "0.5079721", "0.5077721", "0.50739735", "0.5067984", "0.50644916", "0.50641936", "0.5063708", "0.506359", "0.5056377", "0.5037487", "0.50292516", "0.50269055", "0.50227946", "0.50226784", "0.50162566", "0.50131714", "0.50115806", "0.5006934", "0.5004938", "0.5002452", "0.5000549", "0.50001884", "0.49917907", "0.49884987", "0.4986155", "0.498132", "0.49795958", "0.49790767", "0.49773157", "0.49761394", "0.4972761", "0.49709696", "0.4966846", "0.49600202", "0.49576193", "0.4954003", "0.4953505", "0.4947334", "0.49337354", "0.49304998", "0.49294734", "0.49284202", "0.49276152" ]
0.70964044
0
this action updates user operation by operation_id title and activity_id is mandatory field explanation, photo, video, latitude, longtitude is optional field
public function updateUserOperationAction() { /** @var Object_Operation $operation */ $data = $this->getRequestData(); if (isset($data['operation_id'])) { $operation = Object_Operation::getById($data['operation_id']); if (!$operation) { $this->setErrorResponse('no Operation with this operation_id!'); } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) { $this->setErrorResponse('you have no rights to change this Operation!'); } else { if (isset($data['title'])) { $operation->setTitle($data['title']); } if (isset($data['explanation'])) { $operation->setExplanation($data['explanation']); } if (isset($data['photo'])) { $operation->setPhoto(Asset_Image::getById($data['photo'])); } if (isset($data['video'])) { $operation->setVideo(Asset_Video::getById($data['video'])); } if (isset($data['latitude']) && isset($data['longtitude'])) { $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']); $operation->setLocation($geo); } if (isset($data['activity_id'])) { $operation->setActivity(Object_Activity::getById($data['activity_id'])); } if (!$operation->save()) { $this->setErrorResponse('cannot update Operation object'); } } } else { $this->setErrorResponse('operation_id is mandatory field for this request!'); } $this->_helper->json($operation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateUserActivityAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Activity!');\n } else {\n if (isset($data['title'])) {\n $activity->setTitle($data['title']);\n }\n if (isset($data['photo'])) {\n $activity->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (!$activity->save()) {\n $this->setErrorResponse('cannot update Activity object');\n }\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function update(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function createUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['title']) && isset($data['activity_id'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/operations/' . $user->getKey() . \"-operations\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-operations\");\n $folder->setParentId(4);\n $folder->save();\n }\n\n $geo = new Object_Data_Geopoint($data['longtitude'], $data['latitude']);\n\n $operation = new Object_Operation();\n $operation->setCreator($user);\n $operation->setTitle($data['title']);\n $operation->setExplanation(isset($data['explanation']) ? $data['explanation'] : \"\");\n $operation->setLocation($geo);\n $operation->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : \"\");\n $operation->setVideo(isset($data['video']) ? Asset_Video::getById($data['video']) : \"\");\n $operation->setActivity(Object_Activity::getById($data['activity_id']));\n $operation->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $operation->setPublished(true);\n $operation->setParentId($folder->getId());\n if (!$operation->save()) {\n $this->setErrorResponse('cannot save Operation object');\n }\n } else {\n $this->setErrorResponse('title and activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($operation);\n }", "public function getUserOperationByIdAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $operation->getCreator()->getId()) {\n $this->setErrorResponse('no Operation for this user with current operation_id!');\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n $this->_helper->json($operation);\n }", "public function update($id){\n $fonction = Auth::user()->fonction;\n if($fonction == 'admin') return redirect('/admin/dashboard');\n if($fonction == 'gest') return redirect('/gest/dashboard');\n\n //get the id of the operation to update it's note\n $operation_id['operation_id'] = $id;\n return view('/tech/update',$operation_id);\n }", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function eventOperation($e_id, $op_key)\n {\n\n $authentication = \\App::make('authenticator');\n $user = $authentication->getLoggedUser();\n\n if (isset($user)) {\n\n $user_id = $user->id;\n } else{\n\n return redirect()->route('user.login')->with('error', 'Please login ');\n }\n\n if (isset($user_id)){\n\n $user = User::findOrFail($user_id);\n if (count($user) > 0){\n\n if($user->events){\n\n $event = $user->events()->wherePivot('events_id', '=', $e_id)->get();\n\n if(count($event) > 0) {\n if (isset($event[0])) {\n\n\n if (isset($event[0]->pivot->operation)) {\n\n $event[0]->pivot->operation = $op_key;\n $event[0]->pivot->save();\n\n return redirect()->route('event.index')->with('success', 'Operation is performed successfully.');\n }\n }\n }\n else{\n\n $user->events()->attach($e_id, ['operation' => $op_key]);\n return redirect()->route('event.index')->with('success', 'Operation is performed successfully.');\n }\n }\n }\n }\n }", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function actionUpdate()\n {\n\t\t/**\n\t\t * @author \t: ptrnov <[email protected]>\n\t\t * @since \t\t: 1.2\n\t\t * Subject\t\t: PERMISSION PER MODUL.\n\t\t * Metode\t\t: PUT (Update)\n\t\t * URL\t\t\t: http://production.kontrolgampang.com/login/user-permissions\n\t\t * Body Param\t: ACCESS_ID (key),MODUL_ID (key), BTN_VIEW/BTN_CREATE/BTN_UPDATE/BTN_DELETE/STATUS.\n\t\t * Alert\t\t: {\"result\": \"ACCESS_ID-Empty\"}=> Field ACCESS_ID Param tidak ada.\n\t\t *\t\t\t\t {\"result\": \"User-Not-Exist\"}=> user tidak di temukan.\n\t\t */\n\t\t$paramsBody \t\t= Yii::$app->request->bodyParams;\n\t\t$accessId\t\t\t= isset($paramsBody['ACCESS_ID'])!=''?$paramsBody['ACCESS_ID']:'';\n\t\t$modulId\t\t\t= isset($paramsBody['MODUL_ID'])!=''?$paramsBody['MODUL_ID']:'';\n\t\t$btnView\t\t\t= isset($paramsBody['BTN_VIEW'])!=''?$paramsBody['BTN_VIEW']:'';\n\t\t$btnCreate\t\t\t= isset($paramsBody['BTN_CREATE'])!=''?$paramsBody['BTN_CREATE']:'';\n\t\t$btnUpdate\t\t\t= isset($paramsBody['BTN_UPDATE'])!=''?$paramsBody['BTN_UPDATE']:'';\n\t\t$btnDelete\t\t\t= isset($paramsBody['BTN_DELETE'])!=''?$paramsBody['BTN_DELETE']:'';\n\t\t$status\t\t\t\t= isset($paramsBody['STATUS'])!=''?$paramsBody['STATUS']:'';\n\t\t\n\t\tif($accessId){\n\t\t\t$cntUser= User::find()->where(['ACCESS_ID'=>$accessId])->count();\n\t\t\tif($cntUser){\n\t\t\t\t$modalPermission = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\tif ($btnView!=''){$modalPermission->BTN_VIEW=$btnView;};\n\t\t\t\tif ($btnCreate!=''){$modalPermission->BTN_CREATE=$btnCreate;};\n\t\t\t\tif ($btnUpdate!=''){$modalPermission->BTN_UPDATE=$btnUpdate;};\n\t\t\t\tif ($btnDelete!=''){$modalPermission->BTN_DELETE=$btnDelete;};\n\t\t\t\tif ($status!=''){$modalPermission->STATUS=$status;};\n\t\t\t\tif($modalPermission->save()){\n\t\t\t\t\t$modalView = AppModulPermission::find()->where(['ACCESS_ID'=>$accessId,'MODUL_ID'=>$modulId])->one();\n\t\t\t\t\treturn array('USER_PERMISSIONS'=>$modalView);\t\n\t\t\t\t}else{\n\t\t\t\t\treturn array('result'=>'permission-Not-Exist');\n\t\t\t\t}\t\t\t\t\n\t\t\t}else{\n\t\t\t\treturn array('result'=>'User-Not-Exist');\n\t\t\t}\n\t\t}else{\n\t\t\treturn array('result'=>'ACCESS_ID-Empty');\n\t\t}\n\t}", "public function editUniqueIdAction($header_data,$post_data){\n if(!isset($post_data['unique_id'])) {\n Library::logging('alert',\"API : editUniqueId : \".ERROR_INPUT.\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_INPUT, null);\n } else {\n try {\n $post_data['unique_id'] = strtolower($post_data['unique_id']);\n $db = Library::getMongo();\n \n $user_info = $db->execute('return db.users.find({\"_id\" :ObjectId(\"'.$header_data['id'].'\") }).toArray()');\n if($user_info['ok'] == 0) {\n Library::logging('error',\"API : editUniqueId (user info) , mongodb error: \".$user_info['errmsg'].\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n \n if($user_info['retval'][0]['is_edit'] == 0) {\n \n $user_unique_id = $post_data['unique_id'];\n $ids = $db->execute('return db.users.find({},{unique_id:1,_id:0}).toArray()');\n if($ids['ok'] == 0) {\n Library::logging('error',\"API : editUniqueId (get ids) , mongodb error: \".$ids['errmsg'].\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n\n foreach($ids['retval'] as $unique_id) {\n if($user_unique_id == $unique_id['unique_id']) {\n Library::output(false, '0', UNIQUE_USER_ID, null);\n }\n }\n\n $update_id = $db->execute('return db.users.update({\"_id\" :ObjectId(\"'.$header_data['id'].'\") },{$set:{unique_id : \"'.$user_unique_id.'\",is_edit:1}})');\n if($update_id['ok'] == 0) {\n Library::logging('error',\"API : editUniqueId (update id), mongodb error: \".$update_id['errmsg'].\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n\n Library::output(true, '1', UNIQUE_USER_UPDATED, null);\n } else {\n Library::output(false, '0', UNIQUE_USER_ALREADY_SET, null);\n }\n \n } catch(Exception $e) {\n Library::logging('error',\"API : editUniqueId : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }\n }", "public function updateUserPhoto($app) {\n $user = Users::findFirstById($this->request->get('user_id'));\n if ($user) {\n $extension;\n if ($this->request->hasFiles()) {\n //DEVUELVE SI O SI UN ARRAY\n $files = $this->request->getUploadedFiles();\n foreach ($files as $file) {\n $arrayextension = explode('.', $file->getName());\n $extension = $arrayextension[sizeof($arrayextension) - 1];\n if ($extension == 'jpg' || $extension == 'jpeg' || $extension == 'png') {\n $time = time();\n $file->moveTo('files/' . $user->id . $time . '.' . $extension);\n $user->photo = $user->id . $time . '.' . $extension;\n $user->update();\n return array('response' => true, 'user' => $user);\n } else {\n $resultado = array('response' => false, 'message' => 'Formato de la foto no valido');\n }\n }\n }\n } \n }", "public function testUpdateUser()\n {\n }", "public function update($user)\n {\n }", "public function update(Request $request, Operation $operation)\n {\n if($operation->update($request->all())) {\n $operation->save();\n return response()->json([\n 'success' => 'Operation modifier avec success'\n ], 200);\n }\n }", "public function testUpdateNetworkMerakiAuthUser()\n {\n }", "function updateUser($userId, $image, $password, $email, $phone, $about){\n //TODO Actually implement the function.\n // $dbQuery = \"UPDATE USERS SET \";\n }", "public function update(){\n $sql = \"update \".self::$tablename.\" set correlativo=\\\"$this->correlativo\\\",nombre_instalador=\\\"$this->nombre_instalador\\\",nombre_proyecto=\\\"$this->nombre_proyecto\\\",localizacion=\\\"$this->localizacion\\\",contrato_orden_trabajo=\\\"$this->contrato_orden_trabajo\\\",sector_trabajo=\\\"$this->sector_trabajo\\\",area_aceptada=\\\"$this->area_aceptada\\\",fecha_proyecto=\\\"$this->fecha_proyecto\\\" where id_usuario=$this->id_usuario\";\n Executor::doit($sql);\n }", "public function updateUserAction($userActionId, $request)\n {\n return $this->start()->uri(\"/api/user-action\")\n ->urlSegment($userActionId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function execute($operation = NULL)\n\t{\n\t\t$sCommentText = Core_Array::getRequest('text_note', '', 'trim');\n\n\t\t$oCrm_Note = Core_Entity::factory('Crm_Note');\n\t\t$oCrm_Note->text = $sCommentText;\n\t\t$oCrm_Note->datetime = Core_Date::timestamp2sql(time());\n\n\t\t$result = Core_Array::getPost('result', 0, 'int');\n\n\t\tif ($result)\n\t\t{\n\t\t\t$oCrm_Note->result = Core_Array::getPost('completed', 0, 'int');\n\t\t}\n\n\t\t$oCrm_Note->save();\n\n\t\t$this->_object = $oCrm_Note;\n\t}", "protected function _editSelf() {\n\t\t$actions = func_get_args();\n\n\t\tif (in_array($this->action, $actions)) {\n\t\t\tif (!isset($this->passedArgs['User'])) {\n\t\t\t\t$this->passedArgs['User'] = $this->activeUser['User']['id'];\n\t\t\t\t$this->params['named']['User'] = $this->activeUser['User']['id'];\n\t\t\t}\n\t\t}\n\t}", "#[\n OpenApi\\Operation(\n tags: ['Cookbooks/Users'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: ShowCookbookUsersParameters::class)]\n #[OpenApi\\RequestBody(factory: UpdateCookbookUserRequestBody::class)]\n #[\n OpenApi\\Response(\n factory: CookbookUserShowResponse::class,\n statusCode: 200\n )\n ]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[OpenApi\\Response(factory: ForbiddenResponse::class, statusCode: 403)]\n #[OpenApi\\Response(factory: NotFoundResponse::class, statusCode: 404)]\n #[\n OpenApi\\Response(\n factory: ValidationErrorResponse::class,\n statusCode: 422\n )\n ]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function update(Request $request, Cookbook $cookbook, User $user) {\n $this->verifyNoDemo();\n\n $this->authorizeAnonymously('update', $cookbook);\n\n if ($user->id === auth()->id()) {\n throw new AuthorizationException(__('messages.cant_update_self'));\n }\n\n $data = $request->validate([\n 'is_admin' => ['boolean'],\n ]);\n\n $cookbook->users()->updateExistingPivot($user->id, $data);\n\n $cookbookUser = $cookbook\n ->users()\n ->where('user_id', $user->id)\n ->first();\n\n return JsonResource::make($cookbookUser);\n }", "public static function activity( $operation, $data = null, $exception = null ){\n\t\tif (!$data) {$data=$_POST;}\n\t\t$msg = \"-----------------------------------------\\n\";\n\t\t$msg .= 'Date - time\t\t: '.self::today().' '.self::now().\"\\n\";\n\t\t$msg .= 'Loged Admin ID\t\t: '.$_SESSION['admin']['id'].\"\\n\";\n\t\t$msg .= 'Operation\t\t: '.$operation.\"\\n\";\n\t\t$msg .= 'Data\t\t\t: '.print_r($data, true).\"\\n\";\n\t\t$msg .= 'Ex\t\t\t\t: '.($exception?$exception:'none').\"\\n\";\n\t\t$msg .= \"-----------------------------------------\";\n\t\tself::write( '_AdminActivity.log', $msg, self::LOG_DIR );\n\t}", "public function update(UsersEditRequest $request, $id)\n {\n $request->validate([\n 'first_name' => 'required|regex:/^[\\pL\\s]+$/u|max:50',\n 'last_name' => 'required|regex:/^[\\pL\\s]+$/u|max:20',\n 'email' => \"required|email|unique:users,email,$id\",\n 'is_active' => 'required',\n 'password' => 'confirmed|nullable',\n 'photo_id' => 'mimes:jpeg,jpg,png | max:4096 | nullable',\n ]); \n\n $user = User::findOrFail($id);\n $input = $request->all();\n if(!empty($request->password)) {\n $request->validate([\n 'password' => 'confirmed|min:8'\n ]); \n $input['password'] = bcrypt($request->password);\n }\n else{\n $input['password'] = $user->password;\n }\n if($file = $request->file('photo_id')){\n $name = time() . $file->getClientOriginalName();\n $file->move('images', $name);\n $photo = Photo::create(['file'=>$name]);\n $input['photo_id'] = $photo->id;\n }\n \n if($user->is_active == 1){\n $activebefore = 'active';\n }\n else{\n $activebefore = 'not active';\n }\n if($request->is_active == 1){\n $active = 'active';\n }\n else{\n $active = 'not active';\n }\n $first_name = Auth::user()->first_name;\n $last_name = Auth::user()->last_name;\n $message = $first_name . ' ' . $last_name . ' <<UPDATED A USER FROM>> ' . '{' . 'name:' . $user->first_name .' '. \n $user->last_name. ' '.'email:'. $user->email.' ' .'role:'. $user->role->name . ' ' . 'is_active:'. \n $activebefore . '}' . ' <<TO>> ' . '{' . 'name:' . $request->first_name .' '. \n $request->last_name. ' '.'email:'. $request->email. ' ' . 'is_active:'. \n $active . '}';\n Log::info($message);\n $user->update($input);\n Session::flash('success', 'You successfully updated a user');\n return redirect('/admin/users');\n }", "public function update($userId, $goalId)\n {\n //\n }", "public function actionUpdate($id)\n {\n Url::remember('', 'actions-redirect');\n $user = $this->findModel($id);\n // var_dump($user);die;\n $user->scenario = 'update';\n \n $session = Yii::$app->session;\n $company=$session->get('user.company');\n\t\t\n \n $commonCode=new \\common\\models\\CommonCode();\n \n $userPermission= json_decode($session->get('userPermission'));\n\t\t$company_id = $userPermission->company_id;\n $roles=$userPermission->roles;\n $roleId=$this->getUserPermissionRoleId($roles);\n $ownupdate=0;\n if($userPermission->isSystemAdmin)\n {\n \n $roleObj = \\backend\\models\\Roles::find()->where([\"is_superadmin\"=>1])->asArray()->all(); \n $user->is_superadmin=1;\n \n \n }else if($userPermission->isSuperAdmin) \n {\n if($id==$userPermission->user_id)\n {\n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company_id,\"id\"=>$roleId])->asArray()->all(); \n \n $ownupdate=1;\n }\n else\n {\n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company_id,\"is_superadmin\"=>0])->asArray()->all(); \n }\n \n \n }else{\n \n if($commonCode->canAccess(\"user-create\") || $commonCode->canAccess(\"user-update\"))\n {\n if($id==$userPermission->user_id)\n {\n $ownupdate=1;\n }\n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company['id'],\"is_superadmin\"=>0])->asArray()->all();\n \n }else\n {\n \n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company['id'],\"id\"=>$roleId])->asArray()->all(); \n \n \n }\n }\n $roleArray = ArrayHelper::map($roleObj, 'id', 'role_name'); \n if($userPermission->isSystemAdmin)\n {\n if($id==$userPermission->user_id)\n {\n \n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"=\",\"id\",$company['id']])->asArray()->all();\n \n }\n else{\n \n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"!=\",\"id\",$company['id']])->asArray()->all();\n }\n \n }else{\n \n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"id\"=>$company['id']])->asArray()->all();\n }\n \n $companyArray = ArrayHelper::map($companyObj, 'id', 'company_code'); \n \n if(isset($param['User']['company_id']))\n {\n $user->company_id=$param['User']['company_id'];\n }else{\n \n $user->company_id=$user->getUserCompany($id);\n }\n\n $this->performAjaxValidation($user);\n \n $param=Yii::$app->request->post();\n $rarray=$selectedRoleArray= $user->getUserRole($id);\n if(isset($param['selectItemUser']['role_id']))\n {\n $selectedRoleArray=implode(\",\",$param['selectItemUser']['role_id']); \n \n }\n \n $userdbrole=$user->getDBRole($id);\n \n \n if($userdbrole)\n $dbRole=explode(\",\",$userdbrole);\n\n if ($user->load(Yii::$app->request->post()) && $user->save()) \n {\n $user->company_id=$param['User']['company_id'];\n if(isset($param['selectItemUser']['role_id']))\n {\n if($param['selectItemUser']['role_id']!=explode(\",\",$rarray))\n {\n $auth = Yii::$app->authManager;\n $userroledelete=$user->deleteuserrole($id);\n $userrole=$auth->getRolesByUser($id);\n\n if(isset($param['selectItemUser']['role_id']))\n {\n $roles=$param['selectItemUser']['role_id'];\n foreach($roles as $role)\n {\n $userrole=new \\backend\\models\\UserRoles(); \n $userrole->role_id=$role;\n $userrole->user_id=$user->id; \n $userrole->save();\n }\n\n //assign permission to user\n $rolepermission=$user->UpdateRolePermission($user->id,$param['selectItemUser']['role_id'],$userdbrole);\n\n\n\n }else{\n\n $user->addError(\"role_id\",\"please select role\");\n return $this->render('_account', [\n 'user' => $user,\n 'roleArray'=>$roleArray,\n 'companyArray'=>$companyArray,\n \"selectedRoleArray\"=>$selectedRoleArray,\n 'ownupdate'=>$ownupdate\n ]); \n }\n }\n \n }else{\n \n $user->addError(\"role_id\",\"please select role\");\n return $this->render('_account', [\n 'user' => $user,\n 'roleArray'=>$roleArray,\n 'companyArray'=>$companyArray,\n \"selectedRoleArray\"=>$selectedRoleArray,\n 'ownupdate'=>$ownupdate]);\n }\n $user->updateUserCompany($id,$user->company_id);\n \n Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Account details have been updated'));\n\n return $this->refresh();\n }\n\n return $this->render('_account', [\n 'user' => $user,\n 'roleArray'=>$roleArray,\n 'companyArray'=>$companyArray,\n \"selectedRoleArray\"=>$selectedRoleArray,\n 'ownupdate'=>$ownupdate\n ]);\n }", "public static function update_additional_user_object_data($user_id, $input, $mutation_name, \\WPGraphQL\\AppContext $context, \\GraphQL\\Type\\Definition\\ResolveInfo $info)\n {\n }", "public function update(OperatorRequest $request, $id)\n { \n $edit = $this->data->uuid($id)->firstOrFail();\n\n $input = $request->all();\n\n $input['password'] = !is_null($request->password) ? bcrypt($request->password) : $edit->password;\n $input['plain'] = !is_null($request->password) ? $request->password : $edit->plain;\n\n if($request->hasFile('avatar')): \n deleteImg($edit->avatar);\n $input['avatar'] = $this->upload($request->file('avatar'), $edit->uuid);\n else:\n $input['avatar'] = $edit->avatar;\n endif;\n\n $edit->update($input);\n\n notify()->flash($this->tUpdate, 'success');\n return redirect($this->toIndex);\n }", "public function updateScreenedPhotoCountMobileAppPic($user,$source,$appPhotos,$editPhotos)\r\n\t{\r\n\t\t$source = strtoupper($source);\r\n\r\n\t\t$sql = \"UPDATE MIS.PHOTO_SCREEN_STATS SET \".$source.\" = \".$source.\" + 1\";\r\n\t\tif($appPhotos)\r\n\t\t\t$sql = $sql.\", \".$source.\"_APPROVE = \".$source.\"_APPROVE + 1\";\r\n\t\telseif($editPhotos)\r\n\t\t\t$sql = $sql.\", \".$source.\"_EDITED = \".$source.\"_EDITED + 1\";\r\n\t\t$sql = $sql.\" WHERE SCREENED_BY = :USER AND DATE = CURDATE()\";\r\n\t\t$res = $this->db->prepare($sql);\r\n\t\t$res->bindValue(\":USER\", $user, PDO::PARAM_STR);\r\n\t\t$res->execute();\r\n\t\tif($res->rowCount()==0)\r\n {\r\n\t\t\t$sql2 = \"INSERT INTO MIS.PHOTO_SCREEN_STATS(\".$source.\",\".$source.\"_APPROVE,\".$source.\"_EDITED,SCREENED_BY,DATE) VALUES (:\".$source.\",:\".$source.\"_APPROVE,:\".$source.\"_EDITED,:USER,CURDATE())\";\r\n\t\t\t$res2 = $this->db->prepare($sql2);\r\n\t\t\t$res2->bindValue(\":USER\", $user, PDO::PARAM_STR);\r\n\t\t\t$res2->bindValue(\":\".$source, 1, PDO::PARAM_INT);\r\n\t\t\tif($appPhotos)\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_APPROVE\", 1, PDO::PARAM_INT);\r\n\t\t\telse\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_APPROVE\", 0, PDO::PARAM_INT);\r\n\t\t\tif($editPhotos)\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_EDITED\", 1, PDO::PARAM_INT);\r\n\t\t\telse\r\n\t\t\t\t$res2->bindValue(\":\".$source.\"_EDITED\", 0, PDO::PARAM_INT);\r\n\t\t\t$res2->execute();\r\n\t\t}\r\n\t}", "public function actionActualiza_perfilApoderado() {\n// $idp = Yii::app()->user->id;\n\n $dniA = $_POST['dni'];\n $nombreA = $_POST['nombre'];\n $ap = $_POST['ap'];\n $am = $_POST['am'];\n $c = $_POST['celular'];\n $o = $_POST['ocupacion'];\n\n $distrito = $_POST['distrito'];\n $sector = $_POST['sector'];\n $direccion = $_POST['direccion'];\n $puntoReferencia = $_POST['preferencia'];\n $correo = $_POST['correo'];\n $infoColegio = $_POST['infocolegio'];\n $especiOcupacion = $_POST['especiocupacion'];\n $genero = $_POST['genero'];\n\n try {\n $command = Yii::app()->db->createCommand();\n //Actualizando datos...\n $command->UPDATE('apoderado', array(\n 'nombre' => $nombreA,\n 'apellidoP' => $ap,\n 'apellidoM' => $am,\n 'celular' => $c,\n 'ocupacion' => $o,\n 'domicilio' => $direccion,\n 'distrito' => $distrito,\n 'sector' => $sector,\n 'puntoreferencia' => $puntoReferencia,\n 'infocolegio' => $infoColegio,\n 'especiocupacion' => $especiOcupacion,\n 'correo' => $correo,\n 'genero' => $genero\n ), 'DNIapoderado=:DNIapoderado', array(':DNIapoderado' => $dniA));\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n echo 'ok';\n }", "public function deleteUserOperationAction()\n {\n /** @var Object_Operation $operation */\n $data = $this->getRequestData();\n if (isset($data['operation_id'])) {\n $operation = Object_Operation::getById($data['operation_id']);\n if (!$operation) {\n $this->setErrorResponse('no Operation with this operation_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $operation->getCreator()->getId()) {\n $operation->setPublished(false);\n if (!$operation->save()) {\n $this->setErrorResponse('cannot delete Operation object!');\n }\n } else {\n $this->setErrorResponse('no Operation for this user with current operation_id!');\n }\n } else {\n $this->setErrorResponse('operation_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "function modify_task($user, $session_uid, $update_fields_array) {\r\n global $conn, $task_attributes;\r\n $out = array(false, false, array());\r\n $user = make_safe($user);\r\n $session_uid = make_safe($session_uid);\r\n $task_id = isset($update_fields_array['id']) ? $update_fields_array['id'] : false;\r\n //verify access && make sure we got and id and at least one other attr\r\n if (verify_access($user, $session_uid) && $task_id != false && count($update_fields_array) > 1) {\r\n //create the query\r\n $query = \"UPDATE tasks SET \";\r\n $where_string = \" WHERE id=$task_id\";\r\n //add a field for each one defined in $update_fields_array\r\n foreach($update_fields_array as $field => $update_value) {\r\n $safe_update_value = make_safe($update_value);\r\n switch ($field) {\r\n case \"id\":\r\n break;\r\n case \"parent_id\":\r\n case \"completed\":\r\n\t if (!($field=='parent_id' && !preg_match(\"/^\\d+$/\", $safe_update_value))) {}\r\n $query = $query.\"$field=$safe_update_value, \";\r\n break;\r\n default:\r\n\t $safe_update_value = str_replace(\"'\", \"''\", $safe_update_value);\r\n $query = $query.\"$field='$safe_update_value', \";\r\n break;\r\n }\r\n }\r\n //remove the extra comma and space\r\n $l = strlen($query) - 2;\r\n $query = substr($query, 0, $l);\r\n //append where clause to query\r\n $query = $query.$where_string;\r\n //send query\r\n $out[2]['query'] = $query;\r\n if ($conn->query($query)) {\r\n //verify results\r\n if ($db_record = $conn->query(\"SELECT * FROM tasks WHERE id=$task_id\")->fetch_assoc()) {\r\n //if modified successfully, set $out to true\r\n $change_out = true;\r\n foreach($db_record as $field => $value) {\r\n //if any of the returned reults don't match the inputted values, dont change $Out\r\n if (isset($update_fields_array[$field])) {\r\n if ($value !== $update_fields_array[$field]) {\r\n $change_out = false;\r\n }\r\n }\r\n }\r\n $out[0] = $change_out ? true : $out[0];\r\n\t $out[1] = $change_out ? $db_record : $out[1];\r\n //close the select query\r\n }\r\n }\r\n }\r\n //return array\r\n return $out;\r\n}", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "function updateactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $activity_id = $this->input->post('activityid');\n $name = $this->input->post('name');\n $multiplicity = $this->input->post('multiplicity');\n $severity = $this->input->post('severity');\n $unit = $this->input->post('unit');\n $desc = $this->input->post('desc');\n $status = $this->m_activities->update($activity_id, $wl_id, $name, $multiplicity, $severity, $unit, $desc);\n $this->activities();\n }", "public function updateElemAction(){\n\n if(Zend_Auth::getInstance()->hasIdentity()){\n $userInfo = Zend_Auth::getInstance()->getStorage()->read();\n\n $userName=$userInfo->username;\n\n $id = $userInfo->id;\n $elements = $this->getRequest()->getParams();\n\n foreach($elements as $key => $val){\n $newName = $val; \n $element = $key;\n } \n\n $this->user_model->updateElement($id,$newName,$element);\n\n\n //////////////Update Storage after update any element.///////////////////////////\n\n // Zend_Auth::getInstance()->getStorage()->write($element);\n\n\n // $db = Zend_Db_Table::getDefaultAdapter();\n \n\n // $adapter = new Zend_Auth_Adapter_DbTable(\n // $db,\n // 'users',\n // 'username',\n // 'password'\n // );\n\n // $adapter->setIdentity(Zend_Auth::getInstance()->getIdentity());\n \n // Zend_Auth::getInstance()->getStorage()->write($adapter->getResultRowObject(array('name' , 'password' , 'email', 'id','image')));\n\n $this->redirect('users/logout/username/'.$userName);\n\n }\n\n }", "public function actionUpdate($id) {\n //redirect a user if not super admin\n $site_url = Yii::$app->params['yii_url'];\n $upload_url = \"\";\n if($site_url == \"http://dev.digitalvidya.com/assist\") {\n $upload_url - $site_url.\"/uploads/user_image/\";\n } else {\n $upload_url = $site_url . \"/uploads/\";\n }\n if (!Yii::$app->CustomComponents->check_permission('edit_user')){ \n return $this->redirect(['index']);\n }\n $model = DvUsers::find()->where([\"id\"=>$id])->one();\n if (!empty($model->course)) {\n $model->course = explode(',', $model->course);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n if (!empty($model->course)) {\n unset($model->course);\n $model->course = implode(\",\", $_POST['DvUsers']['course']);\n }\n\n if (isset($_POST['usermeta']['day_avail'])) {\n $day_avail = $_POST['usermeta']['day_avail'];\n }\n\n if (!empty($day_avail)) {\n $day_avail = implode(\",\", $_POST['usermeta']['day_avail']);\n }\n\n $model->picture = UploadedFile::getInstance($model, 'picture');\n\n if (!empty($model->picture->baseName)) {\n $model->picture->saveAs('uploads/user_image/img_'.$id.'.'.$model->picture->extension);\n $model->picture = 'img_' . $id . '.' . $model->picture->extension;\n } else { \n unset($model->picture);\n }\n\n //encript pass before save\n $password = $_POST['DvUsers']['password']; \n if (!empty($password)) {\n $model->password = md5($model->password); \n } else {\n unset($model->password);\n }\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($model); die;\n\t\t\tif($_POST['usermeta']['role'] == 4 || $_POST['usermeta']['role'] == 5){\n\t\t\t\t$email = $model->email;\n\t\t\t\t$phone = $_POST['usermeta']['phone'];\n\t\t\t\t$fname = $_POST['DvUsers']['first_name'];\n\t\t\t\t$lname = $_POST['DvUsers']['last_name'];\n\t\t\t\t$fb_link = $_POST['usermeta']['fb_link'];\n\t\t\t\t$linkedin_link = $_POST['usermeta']['linkedin_link'];\n\t\t\t\t$twitter_link = $_POST['usermeta']['twitter_link'];\n\t\t\t\t//$profile_visibility = $_POST['usermeta']['profile_visibility'];\n\t\t\t\tif(isset($_POST['usermeta']['description'])){\n\t\t\t\t\t$desc = $_POST['usermeta']['description'];\n\t\t\t\t}else{\n\t\t\t\t\t$desc = \"\";\n\t\t\t\t}\n\t\t\t\tif($_POST['usermeta']['role'] == 4){\n\t\t\t\t\t$usre_role = 1;\n\t\t\t\t\t$profile_visibility = $_POST['usermeta']['profile_visibility'];\n\t\t\t\t}else{\n\t\t\t\t\t$usre_role = 2;\n\t\t\t\t\t$profile_visibility = 1;\n\t\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t\t // ***************** Start of curl ************************\n\t\t\t \n\t\t\t\t$curl = curl_init();\n\t\t\t\t// Set some options - we are passing in a useragent too here\n\t\t\t\tcurl_setopt_array($curl, [\n\t\t\t\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\t\t\t\tCURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n\t\t\t\t\tCURLOPT_USERAGENT => 'Get course data',\n\t\t\t\t\tCURLOPT_POST => 1,\n\t\t\t\t\tCURLOPT_POSTFIELDS => [\n\t\t\t\t\t\t\n\t\t\t\t\t\t'ta_email' => $email,\n\t\t\t\t\t\t'tm_fname' => $fname,\n\t\t\t\t\t\t'tm_lname' => $lname,\n\t\t\t\t\t\t'tm_phone' => $phone,\n\t\t\t\t\t\t'tm_facebook' => $fb_link,\n\t\t\t\t\t\t'tm_linkedin' => $linkedin_link,\n\t\t\t\t\t\t'tm_twitter' => $twitter_link,\n\t\t\t\t\t\t'tm_description' => $desc,\n\t\t\t\t\t\t'tm_image_url' => $upload_url.'img_'.$id.'.jpg',\n\t\t\t\t\t\t'tm_image_name' => 'img_'.$id.'.jpg',\n 'profile_visibility' => $profile_visibility,\n\t\t\t\t\t\t'user_role' => $usre_role\n\n\t\t\t\t\t]\n\t\t\t\t]);\n\t\t\t\t// Send the request & save response to $resp\n\t\t\t\t$resp = curl_exec($curl);\n\t\t\t\t// Close request to clear up some resources\n\t\t\t\t$resulst = json_decode($resp,true);\n\t\t\t\tcurl_close($curl);\n\t\t\t\t//echo \"<pre>\";\n\t\t\t\t//print_r($resulst); die;\n\t\t\t}\n\t\t\t\n $usermeta = $_POST['usermeta'];\n unset($usermeta['day_avail']);\n\n foreach ($usermeta as $key => $val) {\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$val' WHERE meta_key = '$key' AND uid = '$model->id' \")->execute();\n }\n\n if (isset($_POST['usermeta']['role'])) {\n \t$user_usermeta = $_POST['usermeta']['role'];\n\t if($user_usermeta == '6'){\n\t Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '' WHERE meta_key = 'team' AND uid = '$model->id' \")->execute();\n\t }\n } \n\n if (!empty($day_avail)) {\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$day_avail' WHERE meta_key = 'day_avail' AND uid = '$model->id' \")->execute();\n }\n unset($model->email);\n $model->save(false);\n Yii::$app->session->setFlash('success', 'Profile Updated successfully.');\n if (Yii::$app->CustomComponents->check_permission('all_users')) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $user_id = Yii::$app->getUser()->identity->id;\n return $this->redirect(['view', 'id' => $user_id]);\n }\n } else {\n return $this->render('update', [ 'model' => $model]);\n }\n }", "function editUserAction()\n {\n $userRp = new UserRepository();\n $validateF = new ValidateFunctions();\n $user = $userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n if ($user != 0) {\n $obj_array = json_decode($user[3], true);\n $pass = $obj_array['user_password'];\n $addedBy = $obj_array['user_added'];\n\n if (!empty($_POST)) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email']];\n\n if ($_SESSION['id'] == $_GET['id']) {\n $requiredFields = [$_POST['user_name'], $_POST['user_street1'], $_POST['user_city'], $_POST['user_country'], $_POST['user_phone'], $_POST['user_email'], $_POST['user_password'], $_POST['user_confirm']];\n }\n if ($this->checkUserInfo($_POST, $_FILES, $requiredFields)) {\n $file = $this->uploadUserImage($_FILES);\n $userInfo = $this->buildUserObject($_POST, $file, $pass, $addedBy);\n $email = $validateF->sanitize($_POST['user_email']);\n $this->updateUserToDatabase($userInfo, $validateF->sanitize($_GET['id']), $email);\n $_SESSION['success'] = ['User edited successfully.'];\n header('Location:index.php?action=index');\n } else{\n header('Location:index.php?action=index');\n }\n } else{\n $modelF = new ModelFunctions();\n $modelF->getAddUserForm();\n }\n } else {\n $_SESSION['error'] = ['User not found.'];\n header('Location:index.php?action=adminUsers');\n }\n\n }", "public function actionUpdate()\n {\n $bodyRaw = json_decode(Yii::$app->getRequest()->getRawBody(), true);\n //$body = json_decode(Yii::$app->getRequest()->getBodyParams(), true);\n\n if (is_array($bodyRaw)) {\n // check user is a guest\n if (array_key_exists('token', $bodyRaw)) {\n $userByToken = \\Yii::$app->user->loginByAccessToken($bodyRaw['token']);\n if (empty($userByToken)) {\n //return $this->goHome();\n return Json::encode(array('method' => 'PUT', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Аутентификация не выполнена'));\n }\n } else {\n return Json::encode(array('method' => 'PUT', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Аутентификация не выполнена'));\n }\n\n // Get array with user Roles\n $userRole =[];\n $userAssigned = Yii::$app->authManager->getAssignments($userByToken->id);\n foreach($userAssigned as $userAssign){\n array_push($userRole, $userAssign->roleName);\n }\n //return Json::encode(array('method' => 'GET', 'status' => 1, 'type' => 'error', 'message' => $userRole));\n\n // Check rights\n // If user have create right that his allowed to other actions to the Spacialization table\n if (static::CHECK_RIGHTS_RBAC && !\\Yii::$app->user->can('createCustomer') && !\\Yii::$app->user->can('createMediator')) {\n return Json::encode(array('method' => 'PUT', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Не хватает прав на операцию обновления'));\n }\n /*\n $flagRights = false;\n foreach(array('admin', 'customer', 'contractor') as $value) {\n if (in_array($value, $userRole)) {\n $flagRights = true;\n }\n }\n if (!$flagRights) return Json::encode(array('method' => 'POST', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Не хватает прав на операцию добавления'));\n */\n\n // Because the field names may match within a single query, the parameter names may not match the table field names. To solve this problem let's create an associative arrays\n $arrayFeedbackAssoc = array ('id' => 'id', 'profile_id' => 'profile_id', 'status_feedback_id' => 'status_feedback_id', 'content' => 'content');\n\n if (array_key_exists($arrayFeedbackAssoc['id'], $bodyRaw)) {\n // check id parametr\n if (!preg_match(\"/^[0-9]*$/\",$bodyRaw[$arrayFeedbackAssoc['id']])) {\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка валидации: id'));\n }\n\n // Search record by id in the database \n if (in_array('admin', $userRole)) {\n $queryFeedback = Feedback::find()->where(['id' => $bodyRaw[$arrayFeedbackAssoc['id']]]); // get all records\n } else {\n $queryFeedback = Feedback::find()->where(['AND', ['id' => $bodyRaw[$arrayFeedbackAssoc['id']]], ['created_by'=> $userByToken->id]]); // get records created by this user\n }\n $modelFeedback = $queryFeedback->one();\n\n if (empty($modelFeedback)) {\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: В БД не найден Отзыв по id'));\n }\n\n foreach ($arrayFeedbackAssoc as $nameFeedbackAssoc => $valueFeedbackAssoc) {\n if (array_key_exists($valueFeedbackAssoc, $bodyRaw)) {\n if ($modelFeedback->hasAttribute($nameFeedbackAssoc)) {\n $modelFeedback->$nameFeedbackAssoc = $bodyRaw[$arrayFeedbackAssoc[$nameFeedbackAssoc]];\n if (!$modelFeedback->validate($nameFeedbackAssoc)) return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка валидации: параметр '.$valueRequestAssoc));\n\n $modelFeedback->created_by = $userByToken->id;\n $modelFeedback->updated_at = time();\n }\n }\n }\n\n // Save Feedback object\n if ($modelFeedback->validate()) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n $flagFeedback = $modelFeedback->save(false); // update Feedback table\n\n if ($flagFeedback) {\n $transaction->commit();\n } else {\n $transaction->rollBack();\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Отзыв не может быть обновлен'));\n }\n } catch (Exception $ex) {\n $transaction->rollBack();\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Отзыв не может быть обновлен'));\n }\n } else {\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка валидации'));\n }\n\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 0, 'type' => 'success', 'message' => 'Отзыв успешно сохранен'));\n } else {\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Отсутствет id параметр в запросе'));\n }\n } else {\n return Json::encode(array('method' => 'PUT, PATCH', 'status' => 1, 'type' => 'error', 'message' => 'Ошибка: Тело запроса не обработано'));\n }\n }", "public function update(Request $request, $id)\n {\n\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n 'position' => 'required|max:255',\n 'functional_unit' => 'required',\n 'isActivated' => 'required',\n 'role' => 'required',\n 'profile_photo' => 'image|nullable|max:5000'\n ], $this->custom_messages);\n\n\n //Check if new username alredy exists\n $old_user = User::find($id);\n if($request->username === $old_user->username){\n $validator->validate();\n }else{\n $username = User::where('username', $request->username)->pluck('username');\n \n if(count($username) === 0){\n $validator->validate();\n }else{\n \n $validator->after(function ($validator) {\n $validator->errors()->add('username', 'The username has already been taken.');\n });\n $validator->validate();\n \n }\n }\n\n\n\n\n $user = User::find($id);\n $log = new Log;\n $log->name = Auth::user()->name;\n $log->action = 'EDIT';\n $log->module = 'USER';\n $log->description = 'Updated user Name: ' . $user->name . ' Position: ' . $user->position;\n $log->save();\n\n $fileNameToStore = '';\n $this->get_photo($request, $fileNameToStore, $user->profile_photo);\n\n \n //if the user account is uograded to admin account\n if($request->role === 'admin'){\n $this->update_user($request, $request->role, '1,1,1,1,1,1,1,1,1,1,1,1', $fileNameToStore, $id);\n return redirect('/sysmg/accounts');\n\n }\n\n //if admin account is downgraded to employee\n if($request->role === 'employee' && $user->role === 'admin'){\n $this->update_user($request, $request->role, '1,0,0,1,0,0,1,0,0,1,0,0', $fileNameToStore, $id);\n return redirect('/sysmg/accounts');\n\n }\n\n //if admin account is downgraded to manager\n if($request->role === 'manager' && $user->role === 'admin'){\n $this->update_user($request, $request->role, '1,1,1,1,1,1,1,1,1,1,1,1', $fileNameToStore, $id);\n return redirect('/sysmg/accounts');\n\n }\n\n //if manager account is downgraded to employee\n if($request->role === 'employee' && $user->role === 'manager'){\n $this->update_user($request, $request->role, '1,0,0,1,0,0,1,0,0,1,0,0', $fileNameToStore, $id);\n return redirect('/sysmg/accounts');\n\n }\n\n //if employee account is upgraded to manager\n if($request->role === 'manager' && $user->role === 'employee'){\n $this->update_user($request, $request->role, '1,0,0,1,0,0,1,0,0,1,0,0', $fileNameToStore, $id);\n return redirect('/sysmg/accounts');\n }\n\n\n\n $temp_permission = [\"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\", \"0\"];\n $this->process_permission_array($request, $temp_permission);\n \n $this->update_user($request, $request->role, $temp_permission, $fileNameToStore, $id);\n return redirect('/sysmg/accounts');\n\n \n }", "public function updating(User $user)\n{\n $userBeforeUpdated = $this->userRepository->find($user->id);\n\n $this->userService->trackUserActivity(Auth::id(),User::class, config('constants.TRACK_USER_FIELDS'),\n $userBeforeUpdated, $user);\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 update(User $user, Upload $upload)\n {\n //\n }", "public function update($request,$id) {\n \n\n }", "function update_activity($pid) {\n $a_name = $_POST['activity_name'];\n $a_destination = $_POST['activity_destination'];\n $a_caption = $_POST['caption'];\n $a_meta_title = $_POST['meta_title'];\n $a_meta_keywords = $_POST['meta_keywords'];\n $a_meta_description = $_POST['meta_description'];\n $a_description = $_POST['data'];\n $a_image = $this->upload_activity_image();\n $a_publish = $_POST['publish'];\n if (empty($a_image)) {\n $sql = \"UPDATE activity SET activity_name='$a_name',destination_id='$a_destination',caption='$a_caption',meta_title='$a_meta_title',meta_keywords='$a_meta_keywords',meta_description='$a_meta_description',description='$a_description',publish='$a_publish' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n } else {\n $sql = \"UPDATE activity SET activity_name='$a_name',destination_id='$a_destination',caption='$a_caption',meta_title='$a_meta_title',meta_keywords='$a_meta_keywords',meta_description='$a_meta_description',description='$a_description',image= '$a_image',publish='$a_publish' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n }\n\n\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo \"<script type='text/javascript'>alert('Activity updated successfully')</script>\";\n }\n }", "public function update(UserVO $userVO){\r\n }", "function saveUserPic($img,$action)\n\t\t{\n\t\t\t//checking that product with order id is present or not\n\t\t\tif($action == 'pro')\n\t\t\t{\n\t\t\t\t//update user profile pic\n\t\t\t\t$update = $this->manageContent->updateValueWhere('user_info', 'profile_image', 'files/pro-image/'.$img, 'user_id', $_SESSION['user_id']);\n\t\t\t}\n\t\t\telseif($action == 'cov')\n\t\t\t{\n\t\t\t\t//update user cover pic\n\t\t\t\t$update = $this->manageContent->updateValueWhere('user_info', 'cover_image', 'files/cov-image/'.$img, 'user_id', $_SESSION['user_id']);\n\t\t\t}\n\t\t}", "public function testUpdateMetadata1UsingPUT()\n {\n }", "public function update(Request $request, User $user)\n {\n //\n //только изменение информации, кроме head и blocked\n }", "public function putAction()\n {\n try\n {\n $trackingReq = $this->_helper->TrackingRequest($this->_request->getRawBody());\n }\n catch (\\InvalidArgumentException $e)\n {\n $this->sendAlteredResponse(400, 'Malformed APP Envelope');\n }\n\n try\n {\n $this->trackingService->changeFulfillmentStatus($trackingReq);\n }\n catch (\\InvalidArgumentException $e)\n {\n $this->sendAlteredResponse(400, 'No ID passed in content');\n }\n catch (SE\\Infrastructure\\Tracking\\Exception $e)\n {\n $this->sendAlteredResponse(403, 'No Tracking Request Resource With This ID');\n }\n }", "public function updateUser($data) {\n\t\t\n\t}", "public function userupdatesuccessAction()\n {\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $modelFoto = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n\n $foto = UploadedFile::getInstance($model,'use_foto');\n\n if ($foto == ''){\n $model->use_foto = $modelFoto->use_foto;\n }else{\n\n if($modelFoto->use_foto != 'usuario_anonimo.jpg'){\n unlink('img/user/'.$modelFoto->use_foto);\n }\n\n $modelFoto = User::find()->count();\n $foto->saveAs('img/user/'. $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension);\n $model->use_foto = $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension;\n\n }\n\n if($model->rol_id != 2){\n $model ->use_estado = 1;\n //Aqui va codigo borrar el perfil del investigador\n $investigador = new Investigador();\n if($investigador->find()->where(['usu_id'=>$model->id])->count() != 0 ){\n $investigador->find()->where(['usu_id'=>$model->id])->one()->delete();\n }\n\n }\n\n $model -> use_fechaAudit = date('y-m-d H:i:s');\n $model -> use_accion = 'M';\n\n if($model->signup()){\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Registro modificado!</h4>\n El registro se modificó correctamente.\n </div>\n ');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request, user $user)\n {\n //\n }", "public function actualizarInfoUsuario(){\n \n if(isset($_PUT[\"editFname\"])){\n \n $datos = array(\n \"id\" => $_PUT[\"\"],\n \"Fname\" => $_PUT[\"\"],\n \"Lname\" => $_PUT[\"\"],\n \"Pass\" => $_PUT[\"\"],\n \"Area\" => $_PUT[\"\"],\n );\n\n $actualizar = UsersModel::actualizarInfoUsuario($datos, \"usuario\");\n\n if($actualizar){\n header(\"location: \".URL_PAGE.\"viewUser/\".$_PUT[\"\"]);\n }; \n \n\n }\n\n }", "function updateUser() {\n\t\t$rating = $this -> getTaskRating();\n\t\t$sql = \"Update Users set finishedBasic=1, userRating=userRating+\" . $rating . \" where UID= (Select t.UID from Task t WHERE t.TaskId=\" . $this -> data[0]['TaskId'] . \")\";\n\t\t$stmt = $this -> DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$this -> checkforLast();\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'to update user with TaskId=' . $this -> data[0]['TaskId'], $this -> id);\n\t\t}\n\t}", "public function operation($operation);", "function user_edit($user_info)\n {\n }", "public function updateScreenedPhotoCount($user,$source,$appPhotos,$delPhotos,$markedForEditingPhotos,$szInterfaceName='')\r\n\t{\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\t$sql=\"UPDATE MIS.PHOTO_SCREEN_STATS SET \";\r\n\r\n\t\t\t$source = strtoupper($source);\r\n\t\t\t$source_photos=$source.\"_PHOTOS\";\r\n\t\t\t$source_del=$source.\"_DEL\";\r\n\t\t\t$source_del_photos=$source.\"_DEL_PHOTOS\";\r\n\t\t\t$source_marked_for_editing = $source.\"_MARKED_FOR_EDITING\";\r\n\t\t\t\r\n\t\t\t$arrSql = array();\r\n\t\t\t$arrSql[]=\"$source=$source+1\";\r\n\t\t\tif($appPhotos)\r\n\t\t\t\t$arrSql[]=\" $source_photos=$source_photos+:APPPHOTOS\";\r\n\t\t\tif($delPhotos && $appPhotos)\r\n\t\t\t\t$arrSql[]=\"$source_del_photos=$source_del_photos+:DELPHOTOS\";\r\n\t\t\telseif($delPhotos && !$appPhotos)\r\n\t\t\t\t$arrSql[]=\"$source_del=$source_del+1 ,$source_del_photos=$source_del_photos+:DELPHOTOS\";\r\n\t\t\tif($markedForEditingPhotos )\r\n\t\t\t\t$arrSql[]=\"$source_marked_for_editing=$source_marked_for_editing+:MARKED_FOR_EDITING\";\r\n\t\t\tif(strlen($szInterfaceName))\r\n\t\t\t{\r\n\t\t\t\t$arrSql[]=\"INTERFACE_NAME=:INTERFACENAME\";\r\n\t\t\t}\r\n\t\t\t$sql .= implode(\" , \",$arrSql);\r\n\t\t\t$sql.=\" WHERE SCREENED_BY = :USER AND DATE=CURDATE() AND INTERFACE_NAME=:INTERFACENAME \";\r\n\r\n\t\t\t$res=$this->db->prepare($sql);\r\n\t\t\t$res->bindValue(\":USER\", $user, PDO::PARAM_STR);\r\n\t\t\tif($appPhotos)\r\n\t\t\t\t$res->bindValue(\":APPPHOTOS\", $appPhotos, PDO::PARAM_INT);\r\n\t\t\t\t\tif($delPhotos)\r\n\t\t\t\t\t\t$res->bindValue(\":DELPHOTOS\", $delPhotos, PDO::PARAM_INT);\r\n\t\t\tif($markedForEditingPhotos)\r\n\t\t\t\t$res->bindValue(\":MARKED_FOR_EDITING\",$markedForEditingPhotos,PDO::PARAM_INT);\r\n\t\t\tif(strlen($szInterfaceName))\r\n\t\t\t{\r\n\t\t\t\t$res->bindValue(\":INTERFACENAME\",$szInterfaceName,PDO::PARAM_STR);\r\n\t\t\t}\r\n\t\t\tif($appPhotos || $delPhotos || $markedForEditingPhotos)\r\n\t\t\t\t$res->execute();\r\n\r\n\t\t\tif($res->rowCount()==0)\r\n\t\t\t{\r\n\t\t\t\t$columns = \"DATE,SCREENED_BY,$source \";\r\n\t\t\t\t$values = \"CURDATE(),:USER,'1' \";\r\n\t\t\t\tif($appPhotos)\r\n\t\t\t\t{\r\n\t\t\t\t\t$columns.=\",$source_photos\";\r\n\t\t\t\t\t$values.=\",:APPPHOTOS\";\r\n\t\t\t\t}\r\n\t\t\t\telseif($delPhotos && !$appPhotos)\r\n\t\t\t\t{\r\n\t\t\t\t\t$columns.=\",$source_del \";\r\n\t\t\t\t\t$values.=\",'1' \";\r\n\t\t\t\t}\r\n\t\t\t\tif($delPhotos)\r\n\t\t\t\t{\r\n\t\t\t\t\t$columns.=\",$source_del_photos\";\r\n\t\t\t\t\t$values.=\",:DELPHOTOS\";\r\n\t\t\t\t}\r\n\t\t\t\tif($markedForEditingPhotos)\r\n\t\t\t\t{\r\n\t\t\t\t\t$columns.=\",$source_marked_for_editing \";\r\n\t\t\t\t\t$values.=\",:MARKED_FOR_EDITING \";\r\n\t\t\t\t}\r\n\t\t\t\tif(strlen($szInterfaceName))\r\n\t\t\t\t{\r\n\t\t\t\t\t$columns.=\",INTERFACE_NAME\";\r\n\t\t\t\t\t$values.=\",:INTERFACE_NAME\";\r\n\t\t\t\t}\r\n\t\t\t\t$sql2 = \"INSERT INTO MIS.PHOTO_SCREEN_STATS($columns) VALUES($values)\";\r\n\t\t\t\t\t\t$res2=$this->db->prepare($sql2);\r\n\r\n\t\t\t\tif($appPhotos)\r\n\t\t\t\t\t$res2->bindValue(\":APPPHOTOS\", $appPhotos, PDO::PARAM_INT);\r\n\t\t\t\tif($delPhotos)\r\n\t\t\t\t\t$res2->bindValue(\":DELPHOTOS\", $delPhotos, PDO::PARAM_INT);\r\n\t\t\t\tif($markedForEditingPhotos)\r\n\t\t\t\t\t$res2->bindValue(\":MARKED_FOR_EDITING\",$markedForEditingPhotos,PDO::PARAM_INT);\r\n\t\t\t\t$res2->bindValue(\":USER\", $user, PDO::PARAM_STR);\r\n\t\t\t\tif(strlen($szInterfaceName))\r\n\t\t\t\t{\r\n\t\t\t\t\t$res2->bindValue(\":INTERFACE_NAME\",$szInterfaceName,PDO::PARAM_STR);\r\n\t\t\t\t}\r\n\t\t\t\tif($appPhotos || $delPhotos || $markedForEditingPhotos)\r\n\t\t\t\t\t$res2->execute();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}catch(Exception $e)\r\n\t\t{\r\n\t\t\t$szClassName = __CLASS__;\r\n\t\t\tthrow new jsException($e,\"Something went wrong in updateScreenedPhotoCount method of $szClassName\");\r\n\t\t}\r\n\t}", "public function update(Request $request ,$ac)\n {\n \n $activity = Activity::find($ac);\n $activity->name = $request->name;\n $activity->description = $request->description;\n $activity->image= $request->image;\n $activity->post_by = $request->post_by;\n \n $activity->save;\n return redirect('/data')->with('success_message','edit berhasil');\n }", "public function setOperation($operation)\n {\n $this->operation = $operation;\n }", "public function update($id, $type, $data, $userId);", "public function update(User $user, Negocio $negocio)\n {\n }", "protected function updateObject()\n {\n $gatewayData = $this->encodeDataToJson();\n\n $query = $this->db->getQuery(true);\n\n $query\n ->update($this->db->quoteName(\"#__crowdf_intentions\"))\n ->set($this->db->quoteName(\"user_id\") . \"=\" . $this->db->quote($this->user_id))\n ->set($this->db->quoteName(\"project_id\") . \"=\" . $this->db->quote($this->project_id))\n ->set($this->db->quoteName(\"reward_id\") . \"=\" . $this->db->quote($this->reward_id))\n ->set($this->db->quoteName(\"unique_key\") . \"=\" . $this->db->quote($this->unique_key))\n ->set($this->db->quoteName(\"gateway\") . \"=\" . $this->db->quote($this->gateway))\n ->set($this->db->quoteName(\"gateway_data\") . \"=\" . $this->db->quote($gatewayData))\n ->set($this->db->quoteName(\"auser_id\") . \"=\" . $this->db->quote($this->auser_id))\n ->set($this->db->quoteName(\"session_id\") . \"=\" . $this->db->quote($this->session_id))\n ->where($this->db->quoteName(\"id\") .\"=\". (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n }", "public function editUser($id) {\n $postData = Input::all();\n$user_permission = '';\n if (!empty($postData)) {\n\n $username = trim(Input::get('username'));\n $user_result = DB::table('hr_login_credentials')->select('username')->where('username', '=', $username)->where('id', \"!=\", $id)->get();\n if ($user_result) {\n return Redirect::back()->with('erroralert', 'Username already exist.Please try with different username.');\n } else {\n if (Input::has('password_change')) {\n $user_pass = md5(trim(Input::get('old_password')));\n $password = DB::table('hr_login_credentials')->select('password')->where('id', \"=\", $id)->first();\n\n if ($password->password == $user_pass) {\n\n $pass_update = DB::table('hr_login_credentials')->where('id', \"=\", $id)->update(array('password' => md5(Input::get('new_password'))));\n } else {\n return Redirect::back()->with('erroralert', 'Old password did not match.');\n }\n }\n\t\t\t\n\t\t\t\n\t\t\t\t$permission = isset($postData['check']) ? 1 : 2 ;\n\n if (Input::has('company_name')) {\n $updatedBy = 2;\n } else {\n $updatedBy = 1;\n }\n if (Input::has('ac_type')) {\n $acct_types = Input::get('ac_type');\n } else {\n $acct_types = Input::get('hidden_account_type');\n }\nif (isset($postData['permission'])) {\n $user_permission = serialize($postData['permission']);\n }\n\n if (!Input::has('company_name')) {\n $update_array = array('fkCompany_id' => Input::get('company'), 'username' => Input::get('username'), 'muliple_option' => isset($postData['muliple_option']) ? $postData['muliple_option'] : 0, 'account_type' => $acct_types, 'updated_by' => $updatedBy ,'permission'=>$permission, 'user_permission' => $user_permission);\n } else {\n $update_array = array('username' => Input::get('username'), 'account_type' => $acct_types, 'muliple_option' => $postData['muliple_option'], 'updated_by' => $updatedBy,'permission'=>$permission, 'user_permission' => $user_permission);\n }\n\n\n $result = DB::table('hr_login_credentials')->where('id', '=', $id)->update($update_array);\n $getUserDetails = DB::table('hr_login_credentials as t1')\n ->join('hr_company_database as t2', 't2.fkCompany_id', '=', 't1.fkCompany_id')\n ->select('t2.host_address', 't2.db_name', 't2.user_name', 't2.password', 't1.fkUserId')\n ->where('t1.id', $id)\n ->first();\n\n $this->db2->table('hr_emp_info')->where('id', $getUserDetails->fkUserId)->update(array('email_id' => Input::get('username')));\n\n\n if (!Input::has('company_name')) {\n return Redirect::to('config/company-user-settings')->with('successalert', 'User updated Successfully');\n } else {\n return Redirect::to('config/company-user-settings')->with('successalert', 'User updated Successfully');\n }\n }\n }\n\n\n $companies = DB::table('hr_company_dtls as cmp')->select('id', 'company_name', 'customize_approve')->where(array('is_active' => 1, 'delete_status' => 0))->get();\n $user = DB::table('hr_login_credentials as user')\n ->join('hr_company_dtls as comp', 'comp.id', \"=\", 'user.fkCompany_id')\n ->select('user.id', 'user.username', 'user.password', 'user.muliple_option', 'user.ml_settings','user.permission', 'user.account_type', 'comp.id as comp_id')->where('account_status', 1)->where('user.id', '=', $id)->get();\n\n $role = array(1, 2, 3, 4, 5);\n $role_type = Session::has('proxy_user_role') ? Session::get('proxy_user_role') : Session::get('user_role');\n $user_permission = DB::table('hr_login_credentials')\n ->select('user_permission')\n ->where('account_status', 1)->where('id', '=', $id)->first();\n if ($user_permission) {\n $user_permission = unserialize($user_permission->user_permission);\n }\n $cmpny_Id = Session::has('proxy_cpy_id') ? Session::get('proxy_cpy_id') : Session::get('cpy_id');\n $users = DB::table('hr_login_credentials')->select('fkUserId as uid')->whereIn('account_type', $role)->where('account_status', 1)->where('fkCompany_id', $cmpny_Id)->orderBy('fkUserId')->get();\n\n $auth = array();\n if (!empty($users)) {\n foreach ($users as $u) {\n if ($u->uid != 0) {\n $auth[] = $u->uid;\n }\n }\n }\n\n if (in_array($role_type, $role)) {\n if ($auth) {\n $reportTo = $this->db2->table('hr_emp_info')->select('hr_emp_info.id', 'hr_emp_info.first_name', 'hr_emp_info.last_name')->whereIn('id', $auth)->where('local_del', 0)->get();\n } else {\n $reportTo = '';\n }\n } else {\n $reportTo = $this->db2->table('hr_emp_info')->select('hr_emp_info.id', 'hr_emp_info.first_name', 'hr_emp_info.last_name')->where('id', '!=', $id)->whereIn('id', $auth)->where('local_del', 0)->get();\n }\n\t\t$approve = $this->db2->table('hr_multi_approve')->select('approve_module')->orderBy('sort_order')->get();\n\n return View::make('settings.company.editUser')->with(array('user' => $user, 'company' => $companies, 'report' => $reportTo, 'multi'=>$approve, 'user_permission' => $user_permission));\n //return View::make('settings.company.editUser')->with(array('company' => $companies, 'user' => $user));\n }", "public function updatePoinsUserAction()\n {\n \t$this->pointServices->updatePointUser($this->getUser());\n \t\n \treturn new Response(\"OK\");\n }", "public function getUserActivityByIdAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if(isset($data['getoperations']) && $activity){\n $operation = new Workapp_Activity();\n $activity->operations = $operation->getActivityRequiredByOperations($activity);\n }\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('no Activity for this user with current activity_id!');\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function updating(User $user)\n {\n //\n }", "public function update($id)\n {\n\n $this->validate($this->request, User::updateRules());\n \n $user= User::findOrFail($id);\n \n $user->name= $this->request->name;\n $user->image = $this->request->image;\n $user->dob = $this->request->dob;\n $user->phone = $this->request->phone;\n $this->request->privileges && $user->privileges = $this->request->privileges;\n\n $user->save();\n\n return $this->response(202,\"User\", $user );\n\n\n }", "public function edit_post($user_id)\n {\n $auth_token = $this->post('auth_token');\n //$user_id = $this->post('user_id');\n $userData['fname'] = $this->post('fname');\n $userData['lname'] = $this->post('lname');\n $userData['dob'] = $this->post('dob');\n $userData['gender'] = $this->post('gender'); /* Male/Female */\n $userData['address'] = $this->post('address');\n $userData['contact_no'] = $this->post('contact_no');\n $userData['about'] = $this->post('about');\n $userData['updated_date']= time();\n \n //checking auth token\n $record = $this->artists_model->is_valid_token($user_id,$auth_token);\n if($record == 0){\n //redirect to login\n $this->response([\n 'status' => FALSE,\n 'message' => 'Unauthorize user,please login again',\n 'status_code' => 401\n ], REST_Controller::HTTP_UNAUTHORIZED); // UNAUTHORIZED (401) being the HTTP response code\n }\n \n \n \n if( $user_id != '' && $userData['fname'] != '' && $userData['lname'] != '' && $userData['dob'] != '' && $userData['gender'] != '' \n && $userData['address'] != '' && $userData['contact_no'] != '' && $userData['about'] != '')\n {\n $record = $this->artists_model->update_user($user_id,$userData);\n $user_data = $this->artists_model->get_user_details($user_id);\n $message = [\n 'status' => TRUE,\n 'message' => 'User information updated successfully',\n 'user_data' => $user_data,\n 'status_code'=> 200 \n ];\n $this->set_response($message, REST_Controller::HTTP_OK);\n }\n else\n {\n $message = [\n 'status' => FALSE,\n 'message' => 'User information not updated,please enter required fields properly',\n 'status_code'=> 400\n ];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); \n }\n }", "public function update($user_id)\n\t{\n\t\t//\n\t}", "protected function setupUpdateOperation()\n {\n // $this->crud->modifyField('status', 'Enabled');\n //$password = bcrypt('Password');\n //$this->crud->modifyField('password', bcrypt('Password'));\n $this->setupCreateOperation();\n }", "public function updateLocation_post(){\n $user_id = $this->input->post('user_id');\n $latitude = $this->input->post('latitude');\n $longitude = $this->input->post('longitude');\n $data = $this->User_model->update_data('tbl_users',array('latitude'=>$latitude,'longitude'=>$longitude),array('id'=>$user_id));\n\n if($data != 1)\n\n {\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"updateLocation\",\n \"ResponseCode\" => false,\n \"MessageWhatHappen\" => \"Not updated\"\n\n );\n }else{\n $result = array(\n \"controller\" => \"User\",\n \"action\" => \"updateLocation\",\n \"ResponseCode\" => true,\n \"MessageWhatHappen\" => \"Updated successfully\"\n\n );\n }\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "public function update(User $user, Attraction $attraction)\n {\n // dd('i m here','update');\n return ($user->role === \"Guider\" || $user->role === \"Traveler\") && $user->id === $attraction->user_id;\n }", "public function testUpdateTask()\n {\n }", "public function update(Request $request, Instituicao $instituicao)\n {\n //\n }", "public function testUpdateMetadata2UsingPUT()\n {\n }", "public function execute($operation = NULL)\n\t{\n\t\tif (is_null($operation))\n\t\t{\n\t\t\t$modalWindowId = preg_replace('/[^A-Za-z0-9_-]/', '', Core_Array::getGet('modalWindowId', '', 'str'));\n\t\t\t$windowId = $modalWindowId ? $modalWindowId : $this->_Admin_Form_Controller->getWindowId();\n\n\t\t\t$amount = $this->_object->getShopDocumentRelatedAmount();\n\n\t\t\tob_start();\n\n\t\t\tCore_Html_Entity::factory('Script')\n\t\t\t\t->value('$(function() {\n\t\t\t\t\t$(\"#' . $windowId . ' input[name = amount]\").val(\"' . $amount . '\");\n\t\t\t\t\t$(\"#' . $windowId . ' .amount-alert\").addClass(\"hidden\");\n\t\t\t\t})')\n\t\t\t\t->execute();\n\n\t\t\t$this->addMessage(ob_get_clean());\n\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function execute($operation = NULL)\n\t{\n\t\tparent::execute();\n\n\t\t$crm_project_id = Core_Array::getGet('crm_project_id', 0, 'int');\n\t\t$result = Core_Array::getPost('result', 0, 'int');\n\n\t\t$oCrm_Note = $this->_object;\n\n\t\t$oCrm_Project = Core_Entity::factory('Crm_Project', $crm_project_id);\n\t\t$oCrm_Project->add($oCrm_Note);\n\n\t\t$aFiles = Core_Array::getFiles('file', array());\n\n\t\tif (is_array($aFiles) && isset($aFiles['name']))\n\t\t{\n\t\t\t$oCrm_Note->dir = $oCrm_Project->getHref();\n\t\t\t$oCrm_Note->save();\n\n\t\t\t$iCount = count($aFiles['name']);\n\n\t\t\tfor ($i = 0; $i < $iCount; $i++)\n\t\t\t{\n\t\t\t\t$aFile = array(\n\t\t\t\t\t'name' => $aFiles['name'][$i],\n\t\t\t\t\t'tmp_name' => $aFiles['tmp_name'][$i],\n\t\t\t\t\t'size' => $aFiles['size'][$i]\n\t\t\t\t);\n\n\t\t\t\tif (intval($aFile['size']) > 0)\n\t\t\t\t{\n\t\t\t\t\t$oCrm_Note_Attachment = Core_Entity::factory('Crm_Note_Attachment');\n\t\t\t\t\t$oCrm_Note_Attachment->crm_note_id = $oCrm_Note->id;\n\n\t\t\t\t\t$oCrm_Note_Attachment\n\t\t\t\t\t\t->setDir(CMS_FOLDER . $oCrm_Note->dir)\n\t\t\t\t\t\t->setHref($oCrm_Project->getHref())\n\t\t\t\t\t\t->saveFile($aFile['tmp_name'], $aFile['name']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->addMessage(\"<script>$(function() {\n\t\t\t$.adminLoad({ path: '/admin/crm/project/note/index.php', additionalParams: 'crm_project_id=\" . $oCrm_Project->id . \"', windowId: 'crm-project-notes' });\n\t\t});</script>\");\n\t}", "public function update(Request $request, User $user)\n {\n \n }", "public function update(Request $request, User $user)\n {\n \n }", "public function updateUserTodoAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Todo!');\n } else {\n if (isset($data['todo_type'])) {\n $todo->setTodo_type($data['todo_type']);\n }\n if (isset($data['text'])) {\n $todo->setText($data['text']);\n }\n if (!$todo->save()) {\n $this->setErrorResponse('cannot update Todo object');\n }\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n\n $this->_helper->json($todo);\n }", "public function update_opportunity() {\n\t\tif($this->session->userdata('uid')){\n\t\t\ttry {\n\t\t\t\t$given_data = array(\n\t\t\t\t\t'files' \t\t=> $_FILES,\n\t\t\t\t\t'stage_closed_date' => $this->input->post('stage_closed_date'),\n\t\t\t\t\t'stage_value' \t=> $this->input->post('stage_value'),\n\t\t\t\t\t'stage_numbers' => $this->input->post('stage_numbers'),\n\t\t\t\t\t'stage_rate'\t=> $this->input->post('stage_rate'),\n\t\t\t\t\t'stage_score'\t=> $this->input->post('stage_score'),\n\t\t\t\t\t'stage_customer_code'=>$this->input->post('stage_customer_code'),\n\t\t\t\t\t'stage_priority'=> $this->input->post('stage_priority'),\n\t\t\t\t\t'stage_remarks' => $this->input->post('stage_remarks'),\n\t\t\t\t\t'opportunity_id'=> $this->input->post('opportunity_id'),\n\t\t\t\t\t'lead_cust_id' \t=> $this->input->post('lead_cust_id'),\n\t\t\t\t\t'stage_id' \t\t=> $this->input->post('stage_id'),\n\t\t\t\t\t'cycle_id' \t\t=> $this->input->post('cycle_id'),\n\t\t\t\t\t'sell_type' \t=> $this->input->post('sell_type'),\n\t\t\t\t\t'mapping_id'\t=> uniqid(rand()),\n\t\t\t\t\t'user_id'\t\t=> $this->session->userdata('uid'),\n\t\t\t\t\t'contact_list'\t=> $this->input->post('contact_list')\n\t\t\t\t);\n\t\t\t\tif (($given_data['stage_closed_date'] == '0000-00-00') || ($given_data['stage_closed_date'] == '')) {\n\t\t\t\t\t$given_data['stage_closed_date'] = null;\n\t\t\t\t}\n\t\t\t\t$upload = $this->upload_file($given_data);\n\t\t\t\tif ($upload == 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n $opp_data= $this->opp_sales->stage_owner($given_data['opportunity_id']); // gets all data from opportunity details\n $stage_manager_owner_id=$opp_data[0]->stage_manager_owner_id;\n\t\t\t\t$log_attr_data = array(\n\t\t\t\t\t'mapping_id' => $given_data['mapping_id'],\n\t\t\t\t\t'opportunity_id'=> $given_data['opportunity_id'],\n\t\t\t\t\t'stage_id'=> $given_data['stage_id'],\n\t\t\t\t\t'user_id'=> $given_data['user_id'],\n 'opp_numbers'=>$stage_manager_owner_id,\n\t\t\t\t\t'opp_close_date'=> $given_data['stage_closed_date'],\n\t\t\t\t\t'oppo_rate' => $given_data['stage_rate'],\n\t\t\t\t\t'oppo_score' => $given_data['stage_score'],\n\t\t\t\t\t'oppo_customer_code' => $given_data['stage_customer_code'],\n\t\t\t\t\t'oppo_priority' => $given_data['stage_priority'],\n\t\t\t\t\t'timestamp'=> date('Y-m-d H:i:s'),\n\t\t\t\t\t'remarks'=> $given_data['stage_remarks']\n\t\t\t\t);\n\t\t\t\t$this->opp_common->log_attr($log_attr_data);\n\n\n\t\t\t\t$oppo_attr = $this->opp_common->fetch_oppoAttr($given_data['opportunity_id']);\n\t\t\t\tif ($oppo_attr == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$changed_attr = array();\n\t\t\t\t/*if ($oppo_attr[0]->numbers != $given_data['stage_numbers']) {\n\t\t\t\t\t$changed_attr['opportunity_numbers'] = $given_data['stage_numbers'];\n\t\t\t\t}*/\n\t\t\t\tif ($oppo_attr[0]->close_date != $given_data['stage_closed_date']) {\n\t\t\t\t\t$changed_attr['opportunity_date'] = $given_data['stage_closed_date'];\n\t\t\t\t}\n\t\t\t /*\tif ($oppo_attr[0]->value != $given_data['stage_value']) {\n\t\t\t\t\t$changed_attr['opportunity_value'] = $given_data['stage_value'];\n\t\t\t\t}*/\n\t\t\t\tif ($oppo_attr[0]->rate != $given_data['stage_rate']) {\n\t\t\t\t\t$changed_attr['opportunity_rate'] = $given_data['stage_rate'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->score != $given_data['stage_score']) {\n\t\t\t\t\t$changed_attr['opportunity_score'] = $given_data['stage_score'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->customer_code != $given_data['stage_customer_code']) {\n\t\t\t\t\t$changed_attr['opportunity_customer_code'] = $given_data['stage_customer_code'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->priority != $given_data['stage_priority']) {\n\t\t\t\t\t$changed_attr['opportunity_priority'] = $given_data['stage_priority'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->stage != $given_data['stage_id']) {\n\t\t\t\t\t$changed_attr['opportunity_stage'] = $given_data['stage_id'];\n\t\t\t\t}\n\t\t\t\t$this->opp_common->updateOpportunity($changed_attr, $given_data['opportunity_id']);\n\n\t\t\t\t$log_trans_data = array(\n\t\t\t\t\t'mapping_id' => $given_data['mapping_id'],\n\t\t\t\t\t'opportunity_id'=> $given_data['opportunity_id'],\n\t\t\t\t\t'lead_cust_id' => $given_data['lead_cust_id'],\n\t\t\t\t\t'from_user_id'=> $given_data['user_id'],\n\t\t\t\t\t'to_user_id'=> $given_data['user_id'],\n\t\t\t\t\t'cycle_id' => $given_data['cycle_id'],\n\t\t\t\t\t'stage_id' => $given_data['stage_id'],\n\t\t\t\t\t'module' => 'sales',\n\t\t\t\t\t'action' => 'updated',\n\t\t\t\t\t'timestamp'=> date('Y-m-d H:i:s'),\n\t\t\t\t\t'sell_type' => $given_data['sell_type'],\n\t\t\t\t\t'remarks' => $given_data['stage_remarks'],\n\t\t\t\t);\n\t\t\t\t$updateStatus=$this->opp_common->map_opportunity(array(0 => $log_trans_data));\n\t\t\t\t$finalArray = array('errors' => array(), 'status' => $updateStatus);\n\t\t\t\techo(json_encode($finalArray));\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function update(Request $request, UserTrainingAuth $userTrainingAuth)\n {\n //\n }", "protected function setupUpdateOperation()\n {\n// $this->setupCreateOperation();\n $this->addUserFields();\n $this->crud->setValidation(UpdateRequest::class);\n }", "public function testUpdateChallengeActivity()\n {\n }", "public function execute($operation = NULL)\r\n\t{\r\n\t\t$oShopItemParent = Core_Entity::factory('Shop_Item', intval(Core_Array::getPost('shop_item_id', 0)));\r\n\t\t$oShop = $oShopItemParent->Shop;\r\n\t\t$oShopGroup = $oShopItemParent->Shop_Group;\r\n\t\t$oShopDir = $oShop->Shop_Dir;\r\n\r\n\t\t$iIndex = 0;\r\n\t\t$aPropertiesId = array();\r\n\t\t$aData = array();\r\n\t\tforeach($_POST as $key => $sPostData)\r\n\t\t{\r\n\t\t\tif(strpos($key, 'property_') === 0)\r\n\t\t\t{\r\n\t\t\t\t$iPropertyID = explode('_', $key);\r\n\r\n\t\t\t\t$oProperty = Core_Entity::factory('Property')->find($iPropertyID[1]);\r\n\r\n\t\t\t\t$aPropertiesId[] = $iPropertyID[1];\r\n\r\n\t\t\t\t$aList_Items = $oProperty->List->List_Items->getAllByActive(1);\r\n\r\n\t\t\t\tif(isset($_POST[\"property{$oProperty->id}list\"]))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($_POST[\"property{$oProperty->id}list\"] as $value)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$aData[$iIndex][] = array(\r\n\t\t\t\t\t\t\t'property' => $oProperty,\r\n\t\t\t\t\t\t\t'list_item' => Core_Entity::factory('List_Item', $value)\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$iIndex++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sName = Core_Array::getPost('name');\r\n\r\n\t\t$aResult = Core_Array::combine($aData);\r\n\r\n\t\t$iCount = 1;\r\n\r\n\t\tforeach ($aResult as $aTmpResult)\r\n\t\t{\r\n\t\t\t$sTmpName = $sName;\r\n\t\t\tforeach ($aTmpResult as $aTmpList)\r\n\t\t\t{\r\n\t\t\t\t$sTmpName = str_replace(\"{P{$aTmpList['property']->id}}\", $aTmpList['list_item']->value, $sTmpName);\r\n\t\t\t}\r\n\r\n\t\t\t// Вставка модификации\r\n\t\t\t$oShopItem = Core_Entity::factory('Shop_Item');\r\n\r\n\t\t\t$oShopItem->name = $sTmpName;\r\n\t\t\t$oShopItem->modification_id = $oShopItemParent->id;\r\n\t\t\t$oShopItem->shop_group_id = 0;\r\n\t\t\t$oShopItem->price = Core_Array::getPost('price');\r\n\t\t\t$oShopItem->shop_currency_id = Core_Array::getPost('currency');\r\n\t\t\t$oShopItem->shop_measure_id = Core_Array::getPost('measure');\r\n\t\t\t$oShopItem->marking = str_replace(\"{N}\", $iCount++, Core_Array::getPost('marking'));\r\n\t\t\t$oShopItem->shop_id = $oShopItemParent->shop_id;\r\n\t\t\t$oShopItem->save();\r\n\r\n\t\t\t// Копировать основные свойства\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_main_properties')))\r\n\t\t\t{\r\n\t\t\t\t$oShopItem->datetime = $oShopItemParent->datetime;\r\n\t\t\t\t$oShopItem->start_datetime = $oShopItemParent->start_datetime;\r\n\t\t\t\t$oShopItem->end_datetime = $oShopItemParent->end_datetime;\r\n\t\t\t\t$oShopItem->shop_seller_id = $oShopItemParent->shop_seller_id;\r\n\t\t\t\t$oShopItem->shop_producer_id = $oShopItemParent->shop_producer_id;\r\n\t\t\t\t$oShopItem->shop_tax_id = $oShopItemParent->shop_tax_id;\r\n\t\t\t\t$oShopItem->description = $oShopItemParent->description;\r\n\t\t\t\t$oShopItem->text = $oShopItemParent->text;\r\n\t\t\t\t$oShopItem->image_large = $oShopItemParent->image_large;\r\n\t\t\t\t$oShopItem->image_small = $oShopItemParent->image_small;\r\n\t\t\t\t$oShopItem->length = $oShopItemParent->length;\r\n\t\t\t\t$oShopItem->width = $oShopItemParent->width;\r\n\t\t\t\t$oShopItem->height = $oShopItemParent->height;\r\n\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tCore_File::copy($oShopItemParent->getLargeFilePath(), $oShopItem->getLargeFilePath());\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception $e) {}\r\n\r\n\t\t\t\ttry\r\n\t\t\t\t{\r\n\t\t\t\t\tCore_File::copy($oShopItemParent->getSmallFilePath(), $oShopItem->getSmallFilePath());\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception $e) {}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать SEO-поля\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_seo')))\r\n\t\t\t{\r\n\t\t\t\t$oShopItem->seo_title = $oShopItemParent->seo_title;\r\n\t\t\t\t$oShopItem->seo_description = $oShopItemParent->seo_description;\r\n\t\t\t\t$oShopItem->seo_keywords = $oShopItemParent->seo_keywords;\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать поля вкладки \"Экспорт/Импорт\"\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_export_import')))\r\n\t\t\t{\r\n\t\t\t\t$oShopItem->yandex_market = $oShopItemParent->yandex_market;\r\n\t\t\t\t$oShopItem->vendorcode = $oShopItemParent->vendorcode;\r\n\t\t\t\t$oShopItem->yandex_market_bid = $oShopItemParent->yandex_market_bid;\r\n\t\t\t\t$oShopItem->yandex_market_cid = $oShopItemParent->yandex_market_cid;\r\n\t\t\t\t$oShopItem->yandex_market_sales_notes = $oShopItemParent->yandex_market_sales_notes;\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать дополнительные цены для товара\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_prices_to_item')))\r\n\t\t\t{\r\n\t\t\t\t$aShop_Item_Prices = $oShopItemParent->Shop_Item_Prices->findAll();\r\n\r\n\t\t\t\tforeach($aShop_Item_Prices as $oShop_Item_Price)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oShop_Item_Price_Copy = clone $oShop_Item_Price;\r\n\t\t\t\t\t$oShop_Item_Price_Copy->shop_item_id = $oShopItem->id;\r\n\t\t\t\t\t$oShop_Item_Price_Copy->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать специальные цены\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_specials_prices_to_item')))\r\n\t\t\t{\r\n\t\t\t\t$aShop_Specialprices = $oShopItemParent->Shop_Specialprices->findAll();\r\n\r\n\t\t\t\tforeach($aShop_Specialprices as $oShop_Specialprice)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oShop_Specialprice_Copy = clone $oShop_Specialprice;\r\n\t\t\t\t\t$oShop_Specialprice_Copy->shop_item_id = $oShopItem->id;\r\n\t\t\t\t\t$oShop_Specialprice_Copy->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать сопутствующие товары\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_tying_products')))\r\n\t\t\t{\r\n\t\t\t\t\t$aShop_Item_Associated = $oShopItemParent->Shop_Item_Associateds->findAll();\r\n\r\n\t\t\t\t\tforeach($aShop_Item_Associated as $oShop_Item_Associated)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$oShop_Item_Associated_Copy = clone $oShop_Item_Associated;\r\n\t\t\t\t\t\t$oShop_Item_Associated_Copy->shop_item_id = $oShopItem->id;\r\n\t\t\t\t\t\t$oShop_Item_Associated_Copy->save();\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Копировать дополнительные свойства\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_external_property')))\r\n\t\t\t{\r\n\t\t\t\t$aPropertyValues = $oShopItemParent->getPropertyValues();\r\n\t\t\t\tforeach($aPropertyValues as $oPropertyValue)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Не копируем св-во, по которому создается модификация\r\n\t\t\t\t\tif (!in_array($oPropertyValue->property_id, $aPropertiesId))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$oNewPropertyValue = clone $oPropertyValue;\r\n\t\t\t\t\t\t$oNewPropertyValue->entity_id = $oShopItem->id;\r\n\t\t\t\t\t\t$oNewPropertyValue->save();\r\n\r\n\t\t\t\t\t\tif ($oNewPropertyValue->Property->type == 2)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCore_File::copy($oShopItemParent->getItemPath() . $oPropertyValue->file, $oShopItem->getItemPath() . $oPropertyValue->file);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (Exception $e) {}\r\n\r\n\t\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tCore_File::copy($oShopItemParent->getItemPath() . $oPropertyValue->file_small, $oShopItem->getItemPath() . $oPropertyValue->file_small);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcatch (Exception $e) {}\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}\r\n\r\n\t\t\t// Копировать метки\r\n\t\t\tif(!is_null(Core_Array::getPost('copy_tags')))\r\n\t\t\t{\r\n\t\t\t\t$aTags = $oShopItemParent->Tags->findAll();\r\n\t\t\t\tforeach($aTags as $oTag)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oShopItem->add($oTag);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Значения св-в для создаваемых модификаций\r\n\t\t\tforeach ($aTmpResult as $aTmpList)\r\n\t\t\t{\r\n\t\t\t\t$oPropertyValue = $aTmpList['property']->createNewValue($oShopItem->id);\r\n\t\t\t\t$oPropertyValue->value($aTmpList['list_item']->id);\r\n\t\t\t\t$oPropertyValue->save();\r\n\t\t\t}\r\n\r\n\t\t\t$oShopItem->save();\r\n\t\t}\r\n\r\n\t\treturn $this;\r\n\t}", "public function update(Request $request, PagoUser $pagoUser)\n {\n //\n }", "public function voxy_update_user_info()\n {\n $data = $this->input->post();\n\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n if(isset($data['expiration_date']) && $data['expiration_date'] != ''){\n $data['expiration_date'] = strtotime($data['expiration_date']);\n }\n if(isset($data['date_of_next_vpa']) && $data['date_of_next_vpa'] != ''){\n $data['date_of_next_vpa'] = strtotime($data['date_of_next_vpa']);\n }\n if(isset($data['can_reserve_group_sessions']) && $data['can_reserve_group_sessions'] != ''){\n $data['can_reserve_group_sessions'] = strtolower($data['can_reserve_group_sessions']);\n }\n\n if(isset($data['feature_group']) && $data['feature_group'] != ''){\n $api_data = $this->m_voxy_connect->add_user_to_feature_group($data['external_user_id'], $data['feature_group']);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n return $this->ajax_response();\n }\n }\n\n $api_data = $this->m_voxy_connect->update_profile_of_one_user($data['external_user_id'], $data);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Cập nhật thông tin người dùng thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\n }", "public function userEditAction()\n\t{\n $userId = $this->_request->getParam('userId');\n $userplus_obj=new Ep_User_UserPlus();\n $details= $userplus_obj->getUsersDetailsOnId($userId);\n $user_obj = new Ep_User_User();\n $usergrouplist = $user_obj->getUserGroups();\n foreach($usergrouplist as $key=>$value)\n {\n /* if($value['groupName']!='superadmin')*/\n $usergroups[$value['groupName']]=$value['groupName'];\n }\n\n $this->_view->usergroups = $usergroups;\n $this->_view->Userdetails=$details;\n $this->_view->profilepic = \"/FO/profiles/bo/\".$details[0]['identifier'].\"/logo.jpg\";\n\n if($this->_request-> isPost())\n {\n $user_params=$this->_request->getParams(); // print_r($user_params); exit;\n $userplus_obj = new Ep_User_UserPlus();\n $user_obj = new Ep_User_User();\n ////for goroup Id in users table////\n $grouparray = array('superuser'=>1,'ceouser'=>2,'salesuser'=>3, 'chiefeditor'=>4, 'editor'=>5, 'seouser'=>6, 'customercare'=>7, 'partner'=>8, 'facturation'=>9, 'custom'=>10, 'multilingue'=>11);\n $user_obj->login=$user_params[\"login\"] ;\n $user_obj->email=$user_params[\"email\"] ;\n $user_obj->password=$user_params[\"password\"] ;\n $user_obj->status=$user_params[\"status\"] ;\n $user_obj->type=$user_params[\"type\"] ;\n $user_group = $grouparray[$user_params[\"type\"]];\n $user_obj->groupId=$user_group;\n $data_user = array(\"login\"=>$user_obj->login, \"email\"=>$user_obj->email, \"password\"=>$user_obj->password,\n \"status\"=>$user_obj->status, \"type\"=>$user_obj->type, \"groupId\"=>$user_obj->groupId);\n $query_user = \"identifier= '\".$userId.\"'\";\n try\n {\n $userplus_obj->initial=$user_params[\"initial\"] ;\n $userplus_obj->first_name=$user_params[\"first_name\"] ;\n $userplus_obj->last_name=$user_params[\"last_name\"] ;\n $userplus_obj->address=$user_params[\"address\"] ;\n $userplus_obj->city=$user_params[\"city\"] ;\n $userplus_obj->state=$user_params[\"state\"] ;\n $userplus_obj->zipcode=$user_params[\"zipcode\"] ;\n $userplus_obj->country=$user_params[\"country\"] ;\n $userplus_obj->phone_number=$user_params[\"phone_number\"] ;\n\n $data_userplus = array(\"initial\"=>$userplus_obj->initial, \"first_name\"=>$userplus_obj->first_name, \"last_name\"=>$userplus_obj->last_name,\n \"address\"=>$userplus_obj->address, \"city\"=>$userplus_obj->city, \"state\"=>$userplus_obj->state, \"zipcode\"=>$userplus_obj->zipcode,\n \"country\"=>$userplus_obj->country, \"phone_number\"=>$userplus_obj->phone_number);\n $query_userplus = \"user_id= '\".$userId.\"'\";\n\n $user_obj->updateUser($data_user,$query_user);\n $userplus_obj->updateUserPlus($data_userplus,$query_userplus);\n\n $this->_helper->FlashMessenger('Profile Updated Successfully.');\n $this->_redirect(\"/user/bo-users?submenuId=ML10-SL3\");\n // $this->render('user_userdetails');\n }\n catch(Zend_Exception $e)\n {\n echo $e->getMessage();\n $this->_view->error_msg =$e->getMessage().\" D&eacute;sol&eacute;! Mise en erreur.\";\n $this->render('user_useredit');\n }\n }else\n {\n $this->render('user_useredit');\n }\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function test_user_update_no_permission()\n {\n // User login for test\n $user = new User();\n $user->id = 13;\n $this->be($user);\n\n Storage::fake('photos');\n $response =\n $this->json('POST', '/update_user', [\n 'id' => 1,\n 'full_name' => $this->fullname,\n 'email' => $this->email,\n 'f_name' => $this->firstname,\n 'l_name' => $this->lastname,\n 'phone' => $this->phone,\n 'dob' => $this->dob,\n 'gender' => $this->gender,\n 'postal_code' => $this->postal,\n 'image' => UploadedFile::fake()->image('photo1.jpg'),\n ]);\n $response\n ->assertStatus(200)\n ->assertJson([\n $this->all_message => $this->user_update_no_permission,\n ]);\n }", "function editProduct($product, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'price' => $_POST['price'],\n 'description' => $_POST['description'],\n 'cat_id' => $_POST['categories']\n ];\n\n //check if user is updating photo\n if (!is_uploaded_file($_FILES['image']['tmp_name'])) {\n $stmt = $product->update($id, $data);\n header('location: confirm.php?action=Product&type=update&query='.$stmt);\n\n //if user is updating the photo\n } else {\n $img = $_FILES['image'];\n $stmt = $product->update($id, $data, $img);\n header('location: confirm.php?action=Product&type=update&query='.$stmt);\n }\n}", "function user_action_user_edit($env, $vars) {\n $response_json = UserFactory::requestAction($env, $vars['data']['action'], $vars['data']);\n exit($response_json);\n}", "public function act_edit_user()\n {\n $id = strip_tags($this->input->post('id'));\n $email = strip_tags($this->input->post('email'));\n $pass = strip_tags(hash('sha256',$this->input->post('password')));\n\n\n if (validation_edit_admin()) {\n $update_user = $this->dashboard->update('m_admin', array('id' => $id), array('email' => $email, 'password' => $pass));\n if ($update_user) {\n $response = array('error'=>false,'title'=>'Update Berhasil','pesan'=>'');\n echo json_encode($response);\n }\n\n }else{\n $response = array('error'=>true,'title'=>'Update Gagal!','pesan'=>strip_tags(validation_errors()));\n echo json_encode($response);\n }\n }", "function update($user, $notrigger=0)\n {\n \tglobal $conf, $langs;\n\t\t$error=0;\n\n\t\t// Clean parameters\n\n\t\tif (isset($this->fk_commande)) $this->fk_commande=trim($this->fk_commande);\n\t\tif (isset($this->fk_product)) $this->fk_product=trim($this->fk_product);\n\t\tif (isset($this->fk_commandefourndet)) $this->fk_commandefourndet=trim($this->fk_commandefourndet);\n\t\tif (isset($this->qty)) $this->qty=trim($this->qty);\n\t\tif (isset($this->fk_entrepot)) $this->fk_entrepot=trim($this->fk_entrepot);\n\t\tif (isset($this->fk_user)) $this->fk_user=trim($this->fk_user);\n\t\tif (isset($this->comment)) $this->comment=trim($this->comment);\n\t\tif (isset($this->status)) $this->status=trim($this->status);\n\t\tif (isset($this->batch)) $this->batch=trim($this->batch);\n\n\n\n\t\t// Check parameters\n\t\t// Put here code to add a control on parameters values\n\n // Update request\n $sql = \"UPDATE \".MAIN_DB_PREFIX.$this->table_element.\" SET\";\n\n\t\t$sql.= \" fk_commande=\".(isset($this->fk_commande)?$this->fk_commande:\"null\").\",\";\n\t\t$sql.= \" fk_product=\".(isset($this->fk_product)?$this->fk_product:\"null\").\",\";\n\t\t$sql.= \" fk_commandefourndet=\".(isset($this->fk_commandefourndet)?$this->fk_commandefourndet:\"null\").\",\";\n\t\t$sql.= \" qty=\".(isset($this->qty)?$this->qty:\"null\").\",\";\n\t\t$sql.= \" fk_entrepot=\".(isset($this->fk_entrepot)?$this->fk_entrepot:\"null\").\",\";\n\t\t$sql.= \" fk_user=\".(isset($this->fk_user)?$this->fk_user:\"null\").\",\";\n\t\t$sql.= \" datec=\".(dol_strlen($this->datec)!=0 ? \"'\".$this->db->idate($this->datec).\"'\" : 'null').\",\";\n\t\t$sql.= \" comment=\".(isset($this->comment)?\"'\".$this->db->escape($this->comment).\"'\":\"null\").\",\";\n\t\t$sql.= \" status=\".(isset($this->status)?$this->status:\"null\").\",\";\n\t\t$sql.= \" tms=\".(dol_strlen($this->tms)!=0 ? \"'\".$this->db->idate($this->tms).\"'\" : 'null').\",\";\n\t\t$sql.= \" batch=\".(isset($this->batch)?\"'\".$this->db->escape($this->batch).\"'\":\"null\").\",\";\n\t\t$sql.= \" eatby=\".(dol_strlen($this->eatby)!=0 ? \"'\".$this->db->idate($this->eatby).\"'\" : 'null').\",\";\n\t\t$sql.= \" sellby=\".(dol_strlen($this->sellby)!=0 ? \"'\".$this->db->idate($this->sellby).\"'\" : 'null').\"\";\n\n\n $sql.= \" WHERE rowid=\".$this->id;\n\n\t\t$this->db->begin();\n\n\t\tdol_syslog(__METHOD__);\n $resql = $this->db->query($sql);\n \tif (! $resql) { $error++; $this->errors[]=\"Error \".$this->db->lasterror(); }\n\n\t\tif (! $error)\n\t\t{\n\t\t\tif (! $notrigger)\n\t\t\t{\n\t // Uncomment this and change MYOBJECT to your own tag if you\n\t // want this action calls a trigger.\n\n\t //// Call triggers\n\t //$result=$this->call_trigger('MYOBJECT_MODIFY',$user);\n\t //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}\n\t //// End call triggers\n\t\t\t }\n\t\t}\n\n // Commit or rollback\n\t\tif ($error)\n\t\t{\n\t\t\tforeach($this->errors as $errmsg)\n\t\t\t{\n\t dol_syslog(__METHOD__.\" \".$errmsg, LOG_ERR);\n\t $this->error.=($this->error?', '.$errmsg:$errmsg);\n\t\t\t}\n\t\t\t$this->db->rollback();\n\t\t\treturn -1*$error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->commit();\n\t\t\treturn 1;\n\t\t}\n }", "public function testUpdateIdentity()\n {\n }", "public function update(Request $request, $id)\n {\n //\n $user = User::findOrFail($request->user_id);\n $user->cedula = $request->cedula_usuario;\n $user->nombres = $request->nombres_usuario;\n $user->apellidos = $request->apellidos_usuario;\n $user->iniciales = $request->iniciales_usuario;\n $user->telefono = $request->telefono_usuario;\n $user->email = $request->email_usuario;\n $user->permisos = array([\n 'crear_clientes' => isset($request->crear_clientes) ? 'true' : 'false',\n 'ver_clientes' => isset($request->ver_clientes) ? 'true' : 'false',\n 'crear_docs' => isset($request->crear_docs) ? 'true' : 'false',\n 'asignar_metas' => isset($request->asignar_metas) ? 'true' : 'false',\n 'ver_progresos' => isset($request->ver_progresos) ? 'true' : 'false',\n 'ver_comisiones' => isset($request->ver_comisiones) ? 'true' : 'false',\n 'resumen_comisiones' => isset($request->resumen_comisiones) ? 'true' : 'false',\n 'clientes_cerrados' => isset($request->clientes_cerrados) ? 'true' : 'false',\n 'asignar_facturas' => isset($request->asignar_facturas) ? 'true' : 'false',\n 'control_pagos' => isset($request->control_pagos) ? 'true' : 'false',\n 'agendar_servicios' => isset($request->agendar_servicios) ? 'true' : 'false',\n 'horarios_tecnicos' => isset($request->horarios_tecnicos) ? 'true' : 'false',\n 'listado_servicios' => isset($request->listado_servicios) ? 'true' : 'false',\n 'recepcion_docs' => isset($request->recepcion_docs) ? 'true' : 'false',\n 'inventario_docs' => isset($request->inventario_docs) ? 'true' : 'false',\n 'reporte_docs' => isset($request->reporte_docs) ? 'true' : 'false',\n 'crear_novedades' => isset($request->crear_novedades) ? 'true' : 'false',\n 'crear_tecnicos' => isset($request->crear_tecnicos) ? 'true' : 'false',\n 'crear_usuarios' => isset($request->crear_usuarios) ? 'true' : 'false',\n 'reporte_ganancias' => isset($request->reporte_ganancias) ? 'true' : 'false',\n 'gestion_productos' => isset($request->gestion_productos) ? 'true' : 'false',\n 'gastos' => isset($request->gastos) ? 'true' : 'false'\n ]);\n\n if($request->hasFile('foto_usuario')){\n $user->foto = $request->file('foto_usuario')->store('public');\n }\n\n if(isset($request->contrasena_user) && $request->contrasena_user){\n $user->password = bcrypt($request->contrasena_user);\n }\n $user->cargo_id = $request->cargo_usuario;\n switch ($request->cargo_usuario) {\n case '1':\n $user->area_id = '1';\n break;\n case '2':\n $user->area_id = '2';\n break;\n case '3':\n $user->area_id = '3';\n break;\n case '4':\n $user->area_id = '1';\n break;\n case '5':\n $user->area_id = '4';\n break;\n case '6':\n $user->area_id = '5';\n break;\n default:\n $user->area_id = '6';\n break;\n }\n $user->save();\n\n \\Flash::success('Usuario actualizado correctamente.')->important();\n return Redirect::to('/users');\n }", "public function update(User $user) {\n $data = request()->validate([\n 'birth_year' => 'nullable|integer',\n 'address' => 'nullable',\n 'name' => 'nullable|unique:App\\User,name,'.$user->id,\n 'phone_number' => ['nullable' , 'regex:/(([+][(]?[0-9]{1,3}[)]?)|([(]?[0-9]{4}[)]?))\\s*[)]?[-\\s\\.]?[(]?[0-9]{1,3}[)]?([-\\s\\.]?[0-9]{3})([-\\s\\.]?[0-9]{3,4})/'],\n 'about_me' => 'nullable',\n 'profile_pic' => 'sometimes|file|image|max:4000',\n 'multiple_images.*' => 'sometimes|file|image|max:8000',\n 'user_type' => 'required',\n ]);\n// dd((int)$data['birth_year']);\n $user->update([\n 'name' => $data['name'],\n 'birth_year' => $data['birth_year'],\n 'street_name' => $data['address'],\n 'phone_number' => $data['phone_number'],\n 'description' => $data['about_me'],\n 'user_type' => $data['user_type'],\n ]);\n if(!empty(request()->address)) {\n $user->update([\n 'lat' => Geocoder::getCoordinatesForAddress($data['address'])['lat'],\n 'lng' => Geocoder::getCoordinatesForAddress($data['address'])['lng'],\n ]);\n } else {\n $user->update([\n 'lat' => null,\n 'lng' => null,\n ]);\n }\n //check if image is submited\n if(request()->has('profile_pic')) {\n $user->update([\n 'profile_pic' => request()->profile_pic->store('uploads', 'public'),\n ]);\n\n //resize photo\n $image = Image::make(public_path('storage/' . $user->profile_pic))->fit(128,128);\n $image->save();\n }\n\n if($user->user_type == True){\n if(request()->has('multiple_images')) {\n foreach($data['multiple_images'] as $img) {\n $img_name = $img->store('uploads', 'public');\n $img_data[] = $img_name;\n }\n\n if($user->user_gallary) {\n foreach(json_decode($user->user_gallary) as $img) {\n $img_data[] = $img;\n }\n }\n\n $user->update([\n 'user_gallary' => json_encode($img_data),\n ]);\n }\n }\n return redirect('user/' . $user->id);\n }", "private function updateUser () {\n $sql = \"UPDATE users SET avatar = :avatar,\n biography = :biography,\n birthdate = :birthdate,\n email = :email,\n nickname = :nickname,\n location = :location,\n password = :password,\n activated = :activated,\n phone = :phone,\n username = :username,\n website = :website WHERE id_user = :id_user\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':avatar', $this->avatar);\n $query->bindParam(':biography', $this->biography);\n $query->bindParam(':birthdate', $this->birthdate);\n $query->bindParam(':email', $this->email);\n $query->bindParam(':nickname', $this->nickname);\n $query->bindParam(':location', $this->location);\n $query->bindParam(':password', $this->password);\n $query->bindParam(':phone', $this->phone);\n $query->bindParam(':username', $this->username);\n $query->bindParam(':website',$this->website);\n $query->bindParam(':activated',$this->activated);\n $query->bindParam(':id_user',$_SESSION['auth']['id_user']);\n $query->execute();\n }" ]
[ "0.61249185", "0.58328193", "0.58193076", "0.5752877", "0.56352264", "0.55769384", "0.5467263", "0.5408846", "0.5334587", "0.5288759", "0.5287689", "0.5286019", "0.5285567", "0.52485543", "0.5246951", "0.5244131", "0.5220651", "0.51961863", "0.51872283", "0.51818895", "0.51808035", "0.51747674", "0.51599574", "0.5149345", "0.5118729", "0.5094499", "0.5092186", "0.50885206", "0.5088018", "0.506649", "0.5058657", "0.50550145", "0.5052475", "0.5049263", "0.5039079", "0.5029238", "0.50266564", "0.5020907", "0.50116545", "0.5011229", "0.5010232", "0.5009575", "0.5007992", "0.4999889", "0.49974912", "0.49816948", "0.49766478", "0.497302", "0.49699634", "0.49663618", "0.49615106", "0.49615106", "0.4958172", "0.4953079", "0.49492875", "0.4947526", "0.49391636", "0.4938376", "0.49339208", "0.4933862", "0.4930569", "0.4924303", "0.4920521", "0.49147123", "0.49133164", "0.4911385", "0.49102178", "0.49088237", "0.49065587", "0.49024546", "0.49017233", "0.4901304", "0.4900273", "0.48996565", "0.48947117", "0.4892125", "0.48901778", "0.4889338", "0.48831257", "0.48827577", "0.48827577", "0.4878467", "0.48782846", "0.48731968", "0.48688856", "0.48673767", "0.4866503", "0.4865281", "0.48521674", "0.48505405", "0.48485625", "0.4845635", "0.48423824", "0.48406827", "0.48404217", "0.4840145", "0.48352578", "0.48310184", "0.48301873", "0.48277923" ]
0.7738473
0
get list of user agendas
public function getUserAgendasAction() { $agenda = new Workapp_Agenda(); $this->_helper->json($agenda->getAgendaList(array('user_id' => $this->getDeviceSession()->getUserId()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAggsByList() {\n return $this->_get(6);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "function get_user_list(){\n\t\treturn array();\n\t}", "public function allupgraders(){\n // SQL statement\n $sql = \"SELECT * FROM user WHERE special = 1 AND (role = 'account' OR role = 'administrator') \";\n $result = $this->con->query($sql);\n\n // check if there is a user\n $count = $result->num_rows;\n if ($count != 0) {\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }", "public function get_users()\n\t{\n\t\t\n\t\t$query=$this->db->get('ag_users');\n\t\t\n\t\treturn $query->result() ;\n\t}", "public function getUsersList()\n {\n }", "function listUsers($gid)\n {\n return array();\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function getAggsList() {\n return $this->_get(1);\n }", "public function index()\n {\n return UserAgency::with([])\n ->get();\n }", "public function getAggsList() {\n return $this->_get(3);\n }", "public function getUserList(){\n\t\t$this->load->database();\n\t\t$eventlist = $this->db->query(\"SELECT * FROM user \");\n\t\treturn $eventlist;\n\t}", "function listAllUsers($gid)\n {\n return array();\n }", "public function index()\n {\n return $this->user->all();\n }", "public function index()\n {\n return $this->users->getAll('first_name', 'asc', ['departments', 'sectors', 'meta']);\n }", "public function getOrgUsers(){\n $return_array = array();\n $current_campaign=Yii::app()->session->get('current_campaign');\n $campaign = Definition::model()->findByPk($current_campaign);\n if($campaign){\n $users = Users::model()->findAllByAttributes(array('fk_org_id'=>$campaign->fk_org_id));\n foreach($users as $user){\n $return_array[$user->id] = $user->username;\n }\n }\n \n return $return_array;\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public function getAllUsers()\n {\n return \"users from mongo\";\n }", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "public function getAll()\n {\n return $this->appUser->orderBy('first_name')->get()->toArray();\n }", "function users(): array { return $this->users; }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "public function showall()\n { \n $result = $this->user->All();\n\n if (count($result) == 0){\n $result = [\"message\"=>\"Nenhuma Agenda foi identificada !\"];\n }\n return response()->json($result);\n }", "public function list(): array\n {\n return User::all()->toArray();\n }", "public function getTaoUsers()\n {\n return $this->hasMany(ProjectTaouser::className(), ['id' => 'tao_user_id'])->viaTable('tao_user_group', ['tao_group_id' => 'id']);\n }", "function get_users()\n {\n //Unimplemented\n }", "public function getAllUser(){\n return $this->users;\n }", "public function users(){\n\t\t$user = $this->ion_auth->user()->row();\n\n\t\t$query = $this->db->select()\n\t\t\t\t\t\t\t\t\t\t\t ->from('users')\n\t\t\t\t\t\t\t\t\t\t\t ->where('admin_id',$user->id)\n\t\t\t\t\t\t\t\t\t\t\t ->order_by('id', 'asc')\n\t\t\t\t\t\t\t\t\t\t\t ->get();\n\t\t\treturn $query;\n\t}", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "function get_all_agendas()\n {\n $this->db->order_by('idagenda', 'desc');\n return $this->db->get('agenda')->result_array();\n }", "public function getUsers()\n {\n $usuarios = $this->Etapas->getUsers()->usuarios->usuario; //usuarios seg.users\n echo json_encode($usuarios);\n }", "function listUsers() {\n return $this->users;\n }", "function listarAgendadas($id) \n\t{\n\t\t$this->db->select('*');\n\t\t\n\t\t$this->db->from('Auditoria');\n\n\t\t$this->db->where('statusID', $id);\n\n\t\t$this->db->join('Projeto' , 'Projeto.projetoID = Auditoria.projetoID');\n\n\t\t$this->db->join('Departamento' , 'Departamento.departamentoID = Projeto.departamentoID');\n\n\t\t$this->db->join('Unidade' , 'Unidade.unidadeID = Departamento.unidadeID');\n\n\t\t$this->db->join('Usuario' , 'Usuario.usuarioID = Auditoria.auditorID');\n\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query->result();\n\t}", "public function getUsers()\n {\n return Security::getUserList();\n }", "public function getUsers()\n {\n $request = \"SELECT user.*, rank.name as rank_name FROM `user` join rank on user.rank = rank.id order by rank.id\";\n $request = $this->connexion->query($request);\n $newsList = $request->fetchAll(PDO::FETCH_ASSOC);\n // var_dump($newsList);\n return $newsList;\n }", "public function getLTIUsers();", "public function getUserList() {\n $users = DB::select(\"select * from users\");\n $count = DB::table(\"users\") -> count();\n $data = [];\n foreach ($users as $user) {\n array_push($data, array(\n \"id\" => $user -> id,\n \"role\" => ($user -> role == 0)?\"Inactive\":($user -> role == 1?\"Active\":'[ Admin ]'),\n \"fname\" => $user -> fname,\n \"lname\" => $user -> lname,\n \"affiliation\" => $user -> affiliation,\n \"email\" => $user -> email,\n \"created_at\" => $user -> created_at,));\n };\n return array(\"code\" => 0, \"msg\" => \"\", \"count\" => $count, \"data\" => $data);\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public static function allUser() {\n $listado = DB::table('users')->join('role_user', 'role_user.user_id', '=', 'users.id')\n ->join('roles', 'roles.id', '=', 'role_user.role_id')\n ->select('users.*', 'roles.description')\n ->get();\n\n return $listado;\n }", "function get_all()\n\t\t\t{\n\t\t\t\treturn $this->db->order_by('registerDate DESC')->get('cabal_hackuser_list');\n\t\t\t}", "public function users();", "public function users();", "public function users();", "public function users();", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "static function list()\n {\n $user_meta = get_user_meta(get_current_user_id(), self::USER_META_KEY, true);\n $collections = [];\n\n foreach ($user_meta as $id => $attrs) {\n $collections[] = new self($id);\n }\n\n return $collections;\n }", "function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}", "public function getAllWithUsers()\n {\n $sql = \"SELECT \n a.id as 'adid',\n a.userid as 'userid',\n a.title as 'adtitle',\n u.name as 'username'\n from advertisements a \n left join users u ON a.userid = u.id;\";\n\n $conn = $this->dbc->Get();\n $statement = $conn->prepare($sql);\n $statement->execute();\n $data = $statement->fetchAll();\n $conn = null;\n\n return $data;\n }", "public function users_list() {\n return response()->json(User::latest()->get());\n }", "public function getList()\r\n {\r\n $result = $this->query(\r\n \"SHOW USERS\",\r\n $this->getValueBuilder('Aviogram\\InfluxDB\\Entity\\Admin\\User')\r\n ->addField('user', 'getName', 'setName')\r\n ->addField('admin', 'isAdmin', 'setAdmin')\r\n );\r\n\r\n $return = new Collection\\Admin\\User();\r\n\r\n foreach ($result->getSeries() as $serie) {\r\n foreach($serie->getValues() as $value) {\r\n $return->append($value);\r\n }\r\n }\r\n\r\n return $return;\r\n }", "public function getUserList() {\n return $this->users;\n }", "public function artList()\n {\n return User::where('status', 1)->where('role_id', 3)->get();\n }", "public function getUsersListAttribute()\n {\n return User::orderBy('name')->get();\n }", "public static function getUsersLists(){\n \t$data = Doctrine_Query::create()\n \t// ->distinct('u.DeviceToken')\n \t->select(\"u.firstName, u.DeviceToken\")\n \t->from(\"User u\")\n \t->where('u.deleted=0')\n \t->andWhere(\"u.roleId=2\")\n \t->andWhere('u.DeviceToken!= \"NULL\"')\n\t->andWhere(\"u.DeviceToken!= '(null)'\")\n \t->andWhere('u.DeviceToken!=\"\"')\n \t->groupBy('u.DeviceToken')\n \t//->getSqlQuery();\n\t->fetchArray();\n \t\n return $data;\n }", "public function getAllUsers(){\n\t\treturn $this->user;\n\t}", "function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}", "public function getAllAgencies($id) { \n $select = $this->select();\n $select->where(\"user_id = '\".$id.\"' and status=0\" );\n $select->order('id ASC');\n \t\t\t\n\t\treturn $this->fetchAll($select)->toArray();\n\t\t\n }", "public function getUsers()\n {\n return $this->hasMany(User::className(), ['id' => 'user_id'])->viaTable('join_user_collector', ['collector_id' => 'id']);\n }", "function get_userlist() {\r\n \r\n $this->db->order_by('id', 'desc');\r\n $query = $this->db->get('users');\r\n return $query->result_array();\r\n }", "public function index()\n {\n return User::all()->toArray();\n }", "public function index()\n {\n return User::where('role','Organizer')->orderByDesc('id')->get();\n }", "public function getAllUser()\n\t{\n\t\t$data = $this->db->get('admin');\n\t\treturn $data->result_array();\n\t}", "public function meList( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminListByUser($userId);\n\t}", "public function getUsers(){\n\t\t\n\t\t$ar = array();\n\t\t\n\t\t$result = $this->adapter->query(\"select * from vemplist order by ctct_name\")->execute();\n\t\t\n\t\tforeach ($result as $row) \n\t\t\t{\n\t\t\t\t$ar[$row['emp_id']]=$row['ctct_name'];\n\t\t\t}\n\t\t\n\t\treturn $ar;\n\t}", "public function getAllUsersAtivos(){\n\n $this->db->select('*');\n $this->db->from(\"admin_empresa\");\n $this->db->where('status', 1);\n $this->db->order_by(\"id\", 'desc');\n\n return $this->db->get();\n }", "public function index()\n {\n return $this->userRepo->getUsers();\n }", "public function getUsers()\n {\n\t\treturn $this->api->listUsersOfGroup($this->getID());\n }", "public function allUsersJson()\n {\n echo parent::allUsers();\n }", "function getUsers(){\n\t\t$this->users = $this->fileHandler->parseRows($this->userFile, '^', '|');\n\t\t$this->logMsg(SUCCESS, 'users generated');\n\t}", "private function getUsersMailist() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $users = $this->mailist->gets($param);\n\n return $users;\n }", "public function getList($user);", "public function getUsers()\r\n {\r\n return $this->hasMany(User::className(), ['id' => 'user_id'])\r\n ->via('glu');\r\n }", "public function listUsers()\n {\n $query = new Query();\n\n $rows = $query->select(['id', 'name'])\n ->from('users')\n ->orderBy(['date_add' => SORT_DESC])\n ->all();\n\n return $rows;\n }", "public static function getAllUser()\n\t{\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "public function users()\n {\n $users = User::with([\n 'socialAccounts', 'contacts', 'academic', 'companies', 'graduates.academic',\n 'responses', 'achievement.rank', 'rewards', 'preference'\n ])->get();\n\n return response()->json(compact('users'));\n }", "function get_all_groupe_user($params = array())\n {\n $this->db->order_by('id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('groupe_user')->result_array();\n }", "public function getUsers()\n {\n return User::where('user_status', 1)->get();\n }", "function get_author_user_ids()\n {\n }", "function usersList($da){\r\n\t\t\treturn $this->trouverTout();\r\n\t\t}", "public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.name,u.username,u.user_level,u.status,u.last_login,email,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.user_level ORDER BY u.name ASC\";\n $result = find_by_sql($sql);\n return $result;\n }", "function getUsers() {\n\n\tglobal $db;\n\treturn $db->getUsersByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "function getUserList($ac_token, $screen_name, $slug) {\n return self::getInstance()->_getUserList($ac_token, $screen_name, $slug);\n }", "function monitor_list_users() {\n $query = \"select distinct(`wf_user`) from `\".GALAXIA_TABLE_PREFIX.\"instance_activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_user'];\n }\n return $ret;\n }", "public function index() {\n $users = User::all();\n $data = [];\n foreach ($users as $user) {\n $item = new \\stdClass;\n $item->name = $user->profile->name;\n $item->status = $user->attendances()->lastStatus();\n $data[] = $item;\n }\n return $data;\n }", "public function getUserActivityList(){\n return($this->userActivityList);\n }", "public function allForUser($userId);", "public function allForUser($userId);", "private function getUsers()\n {\n $url = $this->base_uri.'user/assignable/multiProjectSearch?projectKeys='.$this->project;\n $users = $this->request($url);\n if (!$this->infos['errorBoolean']) {\n return json_decode($users);\n }\n }", "public function listOrganizations($user) {\n return $user->organizations;\n }", "public function index()\n {\n return response()->responseUtil(User::all(['id', 'name', 'realName', 'openId', 'nickName', 'avatarUrl', 'cellphone', 'officephone','regTime', 'email']));\n }", "public function getUsers()\n {\n return $this->users->getValues();\n }", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "public function getListOfAllUserOrganisations()\n {\n return ['All projects'];\n }", "public function getAllUsers(){\n\n $this->db->select('*');\n $this->db->from(\"admin_empresa\");\n $this->db->where('status <>', 2);\n $this->db->order_by(\"id\", 'desc');\n\n return $this->db->get();\n }", "public function getAll()\n {\n $query = User::query();\n return $query->orderBy('id')->paginate(7);\n }" ]
[ "0.68995154", "0.68806505", "0.68806505", "0.68806505", "0.6733132", "0.6657294", "0.6632748", "0.6617472", "0.6550347", "0.65205324", "0.65205324", "0.65193814", "0.65019816", "0.64741915", "0.64706594", "0.64702153", "0.64681464", "0.6422536", "0.6387641", "0.6364438", "0.6327218", "0.63212496", "0.6320884", "0.63042444", "0.62699866", "0.62557584", "0.62537414", "0.6251466", "0.62488174", "0.62329364", "0.6232263", "0.6211661", "0.62116593", "0.6206837", "0.6200188", "0.61909264", "0.61872745", "0.61812377", "0.6174464", "0.61706585", "0.61592954", "0.6147398", "0.61338204", "0.6133212", "0.6133212", "0.6133212", "0.6133212", "0.6126881", "0.6115837", "0.6115214", "0.61113846", "0.61007255", "0.60901845", "0.6090066", "0.60897887", "0.60772336", "0.6071281", "0.6068982", "0.6065513", "0.6062996", "0.60620576", "0.6061662", "0.6056528", "0.60557806", "0.60527855", "0.6050508", "0.6039594", "0.6037747", "0.60359824", "0.6028861", "0.60279584", "0.6026219", "0.60258764", "0.602495", "0.60239345", "0.6017538", "0.6005753", "0.5998586", "0.599564", "0.59932065", "0.5988652", "0.59855574", "0.5981405", "0.5979851", "0.59764665", "0.59721154", "0.5970651", "0.5964852", "0.5961285", "0.59578836", "0.59578836", "0.5951286", "0.5950382", "0.59462327", "0.5945615", "0.5938486", "0.59375554", "0.59371024", "0.5934805", "0.5933568" ]
0.78612393
0
returns user agenda by agenda_id agenda_id mandatory field
public function getUserAgendaByIdAction() { /** @var Object_Agenda $agenda */ $data = $this->getRequestData(); if (isset($data['agenda_id'])) { $agenda = Object_Agenda::getById($data['agenda_id']); if (!$agenda) { $this->setErrorResponse('no Agenda with this agenda_id!'); } elseif ($this->getDeviceSession()->getUserId() != $agenda->getCreator()->getId()) { $this->setErrorResponse('no Agenda for this user with current agenda_id!'); } } else { $this->setErrorResponse('agenda_id is mandatory field for this request!'); } $this->_helper->json($agenda); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_agenda($idagenda)\n {\n return $this->db->get_where('agenda',array('idagenda'=>$idagenda))->row_array();\n }", "public function getUserAgendasAction()\n {\n $agenda = new Workapp_Agenda();\n $this->_helper->json($agenda->getAgendaList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "function agenda_get_item($event_id)\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n $sql = \"SELECT \tevent.id \t\t\t\t\t\tAS id,\n\t\t\t\t\tevent.title \t\t\t\t\tAS title,\n\t\t\t\t\tevent.description \t\t\t\tAS description,\n\t\t\t\t\tevent.start_date \t\t\t\tAS old_start_date,\n\t\t\t\t\tevent.end_date \t\t\t\t\tAS old_end_date,\n\t\t\t\t\tevent.author_id \t\t\t\tAS author_id,\n\t\t\t\t\trel_event_recipient.visibility \tAS visibility,\n\t\t\t\t\tevent.master_event_id\t\t \tAS master_event_id,\n\t\t\t\t\trel_event_recipient.user_id\t\tAS user_id,\n\t\t\t\t\trel_event_recipient.group_id\tAS group_id\n FROM \" . $tbl . \"\n\n WHERE event.id = \" . (int) $event_id ;\n\n $event = claro_sql_query_get_single_row($sql);\n\n if ($event) return $event;\n else return claro_failure::set_failure('EVENT_ENTRY_UNKNOW');\n\n}", "public function agendadias()\n {\n return $this->hasOne('App\\Models\\AgendaDia', 'id_paciente', 'id');\n }", "public function get_agenda() {\n\t\t$items = $this->agenda_items->get_items();\n\t\t$participants = $this->participants->get_participants();\n\n\t\t// Create agenda\n\t\tforeach ($items as $item) {\n\t\t\tif ($item->is_all_participants) {\n\t\t\t\tforeach ($participants as $participant) {\n\t\t\t\t\t$json_return['items'][] = $this->create_agenda_row($item, $participant);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$json_return['items'][] = $this->create_agenda_row($item, NULL);\n\t\t\t}\n\t\t}\n\n\t\t// Get participants\n\t\tforeach ($participants as $participant) {\n\t\t\t$json_return['participants'][$participant->id] = $participant;\n\t\t}\n\n\t\t$json_return['success'] = TRUE;\n\t\techo json_encode($json_return);\n\t}", "function obtenerSesion_agendar(){\n\t\t\n\t\t$query1 = ('select sesion.id, sesion.checkin, sesion.pagada, sesion.id_servicio, sesion.id_usuario, sesion.id_agenda, sesion.ejecutada, usuario.nombre,\n\t\t\t\t\tusuario.apellido, servicio.descripcion , cliente.nombre as nombre_cliente , cliente.apellido as apellido_cliente from sesion \n\t\t\t\t\tInner JOIN usuario\n\t\t\t\t\ton sesion.id_usuario = usuario.id\n\t\t\t\t\tInner Join servicio\n\t\t\t\t\ton sesion.id_servicio = servicio.id\n\t\t\t\t\tInner Join cliente\n\t\t\t\t\ton sesion.id_cliente = cliente.id\n\t\t\t\t\twhere sesion.id_agenda is NULL'); //QUERY PARA OBTENER TODO DE UNA VEZ.\n\t\t$query = $this->db->query($query1);\n\t\t\n\t\t\n\t //$query = $this->db->get('sesion');\n\t if($query-> num_rows() > 0) return $query->result_array();\n\t else return false ;\n\t \n\t \n\t}", "public function show(Agenda $agenda)\n {\n //\n }", "public function agenda($asesor, $fecha, $filtro)\n {\n $sql = \"SELECT \n l.NombreCompleto,\n e.NombreEmpresa,\n a.HoraInicio,\n a.HoraFinal,\n a.FechaAgenda\n FROM agenda AS a\n INNER JOIN detalleempresa AS de\n on de.idDetalleEmpresa = a.detalleempresa_idDetalleEmpresa\n INNER JOIN empresa AS e \n ON e.idEmpresa = de.Empresa_idEmpresa\n INNER JOIN lineabase AS l\n ON l.idLineabase = de.Linebase_idLineabase\n WHERE l.Usuarios_idUsuarios = '$asesor'\n AND a.FechaAgenda = '$fecha'\n AND l.Filtronegocio_idFiltronegocio = '$filtro'\";\n\n return ejecutarConsultaSimpleFila($sql);\n }", "public function updateUserAgendaAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $agenda->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Agenda!');\n } else {\n if (isset($data['topic'])) {\n $agenda->setTopic($data['topic']);\n }\n if (isset($data['title'])) {\n $agenda->setTitle($data['title']);\n }\n if (isset($data['notes'])) {\n $agenda->setNotes($data['notes']);\n }\n if (isset($data['start_time'])) {\n $agenda->setStart_time($data['start_time']);\n }\n if (isset($data['end_time'])) {\n $agenda->setEnd_time($data['end_time']);\n }\n if (isset($data['with_whom'])) {\n $agenda->setWith_whom($data['with_whom']);\n }\n if (isset($data['with_people'])) {\n $agenda->setWith_people(Object_People::getById($data['with_people']));\n }\n if (isset($data['location'])) {\n $agenda->setLocation($data['location']);\n }\n if (isset($data['alarm'])) {\n $agenda->setAlarm($data['alarm']);\n }\n if (isset($data['repeat_days'])) {\n $agenda->setRepeat_days($data['repeat_days']);\n }\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot update Agenda object');\n }\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n\n $this->_helper->json($agenda);\n }", "public function edit(Agenda $agenda)\n {\n //\n }", "private function get_current_agenda(): AgendaInterface\n {\n return array_key_exists($this->agenda_index, $this->agendas)\n ? $this->agendas[$this->agenda_index]\n : $this->agendas[] = new Weekly();\n }", "public function RetornaIdAgenda ($id) {\n\t\treturn $this->db->get_where(\"evento\", array (\"id_evento\" => $id)) -> row_array();\n\t}", "function obtenerSesionSinAgendar(){\n\t\t\n\t\t\n\t //$array = $array = array('id_agenda' => NULL);\n\t //$query = $this->db->from('sesion')->where($array)->get();\n\t \n\t $query1 = ('select sesion.id, sesion.checkin, sesion.pagada, sesion.id_servicio, sesion.id_usuario, sesion.id_agenda, sesion.ejecutada, usuario.nombre,\n\t\t\t\t\tusuario.apellido, servicio.descripcion from sesion \n\t\t\t\t\tInner JOIN usuario\n\t\t\t\t\ton sesion.id_usuario = usuario.id\n\t\t\t\t\tInner Join servicio\n\t\t\t\t\ton sesion.id_servicio = servicio.id\n\t\t\t\t\twhere (sesion.id_agenda is NULL) ' ); //QUERY PARA OBTENER TODO DE UNA VEZ.\n\t\t$query = $this->db->query($query1);\n\t\t\n\t if($query-> num_rows() > 0) return $query->result_array();\n\t else return false ;\n\t \n\t}", "public function anecdotaid_get(){\n $token = $this->uri->segment(3);\n $id = $this->uri->segment(4);\n\n $perfil = $this->User_model->revisa_perfil_x_token($token);\n\n if ($perfil == FALSE) {\n $respuesta = array(\n 'error' => true,\n 'mensaje' => 'Usuario no permitido.',\n 'data' => null\n );\n\n $this->response($respuesta, REST_Controller::HTTP_UNAUTHORIZED);\n exit;\n }\n\n $anecdota = $this->Anecdota_model->anecdota_x_id($id);\n\n if (isset($anecdota)) {\n $respuesta = array(\n 'error' => FALSE,\n 'mensaje' => 'Registro consultados correctamente.',\n 'data' => $anecdota\n );\n\n $this->response($respuesta);\n } else {\n $respuesta = array(\n 'error' => TRUE,\n 'mensaje' => 'No existen anécdotas todavia!!!',\n 'data' => null\n );\n\n $this->response($respuesta, REST_Controller::HTTP_NOT_FOUND);\n }\n }", "public function deleteUserAgendaAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $agenda->getCreator()->getId()) {\n $agenda->setPublished(false);\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot delete Agenda object!');\n }\n } else {\n $this->setErrorResponse('no Agenda for this user with current agenda_id!');\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function calendarioAction()\n {\n $idPaciente = $this->params()->fromRoute('id');\n $objectManager = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');\n $hydrator = new DoctrineObject(\n $objectManager,\n 'CsnUser\\Entity\\Agendas'\n );\n $agenda = new Agendas();\n $form = new AgendasForm($objectManager);\n if($this->request->isPost()){\n $form->setData($this->request->getPost());\n if($form->isValid()) {\n $data = $form->getData(FormInterface::VALUES_AS_ARRAY);\n $agenda = $hydrator->hydrate($data['agendas'],$agenda);\n $agenda->setUsuariox($objectManager->find('CsnUser\\Entity\\User', $this->identity()->getId()));\n $id = $this->request->getPost('id');\n if(!$id){\n $objectManager->persist($agenda);\n } else {\n $objectManager->find('CsnUser\\Entity\\Agendas',$id);\n $objectManager->persist($agenda);\n }\n $objectManager->flush();\n }\n } \n if($idPaciente){\n $paciente = $objectManager->find('CsnUser\\Entity\\Pacientes', $idPaciente);\n $data = array('form' => $form,'nombre' => $paciente->getNOMBRE(),'apPaterno' => $paciente->getAPELLIDO_PATERNO(),'apMaterno' => $paciente->getAPELLIDO_MATERNO(), 'idPaciente' => $idPaciente,'fecha_nac' => $paciente->getFECHA_NACIMIENTO()); \n } else {\n $data = array('form' => $form);\n }\n $queryrole = $this->getObjectManager()->createQuery(\"SELECT r.id as role FROM CsnUser\\Entity\\User u JOIN u.role r WHERE u.id = \".$this->identity()->getId());\n $role = $queryrole->getArrayResult();\n $query = $this->getObjectManager()->createQuery(\"SELECT u.id,u.firstName,u.lastName FROM CsnUser\\Entity\\User u WHERE u.role = 4\");\n $doctores = $query->getArrayResult();\n $data['doctores'] = $doctores; \n return new ViewModel($data);\n }", "function agenda_get_item_list($course_id, $user_id, $user_group_list, $order='DESC')\n\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n\t$sql = \"SELECT event.id \t\t\t\t\t\tAS id,\n\t\t\t\t event.title \t\t\t\t\t\tAS title,\n\t\t\t\t event.description \t\t\t\tAS description,\n\t\t\t\t event.start_date \t\t\t\tAS start_date,\n\t\t\t\t event.end_date \t\t\t\t\tAS end_date,\n\t\t\t\t event.author_id \t\t\t\t\tAS author_id,\n\t\t\t\t event.master_event_id\t\t\tAS master_event_id,\n\t\t\t\t rel_event_recipient.user_id\t \tAS user_id,\n\t\t\t\t rel_event_recipient.group_id \tAS group_id,\n\t\t\t\t rel_event_recipient.visibility \tAS visibility\n\t\tFROM \" . $tbl . \"\n\t\tWHERE \t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id = \" . (int) $user_id .\")\n\t\t\tOR\n\t\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\t\tAND rel_event_recipient.group_id is NULL)\";\n\t\tforeach($user_group_list as $this_group)\n\t\t{\n\t\t\t$sql .=\" OR\n\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\tAND rel_event_recipient.group_id = \". (int) $this_group .\")\";\n\t\t}\n\n\n\t\t$sql .=\"ORDER BY event.start_date \" . ('DESC' == $order?'DESC':'ASC');\n\n\treturn claro_sql_query_fetch_all($sql);\n}", "public function createUserAgendaAction()\n {\n $data = $this->getRequestData();\n if (isset($data['topic']) && isset($data['title'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/agenda/' . $user->getKey() . \"-agenda\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-agenda\");\n $folder->setParentId(51);\n $folder->save();\n }\n $agenda = new Object_Agenda();\n $agenda->setCreator($user);\n $agenda->setTopic($data['topic']);\n $agenda->setTitle($data['title']);\n $agenda->setNotes(isset($data['notes']) ? $data['notes'] : \"\");\n $agenda->setStart_time(isset($data['start_time']) ? $data['start_time'] : \"\");\n $agenda->setEnd_time(isset($data['end_time']) ? $data['end_time'] : \"\");\n $agenda->setWith_whom(isset($data['with_whom']) ? $data['with_whom'] : \"\");\n $agenda->setWith_people(isset($data['people']) ? Object_People::getById($data['people']) : \"\");\n $agenda->setLocation(isset($data['location']) ? $data['location'] : \"\");\n $agenda->setAlarm(isset($data['alarm']) ? $data['alarm'] : \"\");\n $agenda->setRepeat_days(isset($data['repeat_days']) ? $data['repeat_days'] : array());\n $agenda->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $agenda->setPublished(true);\n $agenda->setParentId($folder->getId());\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot save Agenda object');\n }\n } else {\n $this->setErrorResponse('topic and title is mandatory field for this request!');\n }\n\n $this->_helper->json($agenda);\n }", "public function getIdUsuarioAcalificar()\n {\n return $this->idUsuarioAcalificar;\n }", "function mostrarUsuario($id) {\n //Llamamos a la variable agenda\n global $agenda;\n //Obtenemos el id de la variable agenda\n $usuario = $agenda[$id];\n foreach($usuario as $user) {\n echo $user . '<br/>';\n }\n }", "public function obtenerOrganizador(){\n $sql = \"SELECT uid_agrupamiento FROM \". TABLE_AGRUPAMIENTO .\" WHERE organizador = 1 AND uid_empresa = \". $this->getUID();\n $uid = $this->db->query($sql, 0, 0);\n $uid = ( true === is_countable($uid) && count($uid)>1 ) ? reset($uid) : $uid;\n if( is_numeric($uid) ){\n return new agrupamiento($uid);\n }\n return false;\n }", "function listarAgendadas($id) \n\t{\n\t\t$this->db->select('*');\n\t\t\n\t\t$this->db->from('Auditoria');\n\n\t\t$this->db->where('statusID', $id);\n\n\t\t$this->db->join('Projeto' , 'Projeto.projetoID = Auditoria.projetoID');\n\n\t\t$this->db->join('Departamento' , 'Departamento.departamentoID = Projeto.departamentoID');\n\n\t\t$this->db->join('Unidade' , 'Unidade.unidadeID = Departamento.unidadeID');\n\n\t\t$this->db->join('Usuario' , 'Usuario.usuarioID = Auditoria.auditorID');\n\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query->result();\n\t}", "public function getAnuncio($id){\n $query = \"SELECT fa.idUser, fa.idAnuncio, fa.fecha, fa.precio, fa.titulo, fa.descripcion, \n fa.localizacion, fa.telefono, fa.estado, fa.idComprador, fu.nick, fu.name \n FROM final_anuncio fa INNER JOIN final_usuario fu USING(idUser) WHERE idAnuncio='\".$id.\"'\";\n return $this->con->action($query);\n }", "function getAbogadoID($id){\n $query = \"SELECT\n nombre,\n apellidoP,\n apellidoM,\n email,\n fechaNac, \n valuePermission,\n cuentaBanco,\n costoBase,\n descripcion,\n cedulaPro\n FROM\n usuario\n LEFT JOIN(rol) ON usuario.rol_id = rol.id_rol \n LEFT JOIN(abogado) ON usuario.id_usuario = abogado.usuario_id\n WHERE\n usuario.id_usuario = \".$this->db->escape($id).\" AND\n rol.valuePermission = 1\n \";\n return $this->db->query($query);\n }", "public function getAvaliacaoId()\n {\n return $this->avaliacao_id;\n }", "public function Asesor()\n {\n return $this->hasOne('App\\UserAsesor', 'user_id', 'id');\n }", "public function getIdanestesista0()\n {\n return $this->hasOne(User::className(), ['id' => 'idanestesista']);\n }", "public function agendaFormacion($asesor, $fecha)\n {\n $sql = \"SELECT \n Evento, \n HoraFormacion, \n Participantes\n FROM formaciones\n WHERE usuarios_idUsuarios = '$asesor'\n AND FechaFormacion = '$fecha'\";\n\n return ejecutarConsultaSimpleFila($sql);\n }", "public function anecdota_get() {\n $token = $this->uri->segment(3);\n $calificacionId = $this->uri->segment(4);\n\n $perfil = $this->User_model->revisa_perfil_x_token($token);\n\n if ($perfil == FALSE) {\n $respuesta = array(\n 'error' => true,\n 'mensaje' => 'Usuario no permitido.',\n 'data' => null\n );\n\n $this->response($respuesta, REST_Controller::HTTP_UNAUTHORIZED);\n exit;\n }\n\n $anecdotas = $this->Anecdota_model->anecdota_x_calificacion($calificacionId);\n\n if (isset($anecdotas)) {\n $respuesta = array(\n 'error' => FALSE,\n 'mensaje' => 'Registros consultados correctamente.',\n 'data' => $anecdotas\n );\n\n $this->response($respuesta);\n } else {\n $respuesta = array(\n 'error' => TRUE,\n 'mensaje' => 'No existen anécdotas todavia!!!',\n 'data' => null\n );\n\n $this->response($respuesta, REST_Controller::HTTP_NOT_FOUND);\n }\n \n }", "public function Asesi()\n {\n return $this->hasOne('App\\UserAsesi', 'user_id', 'id');\n }", "function get_assessment_assessor($id_assessor=0,$weekly = 0 ){\r\n $sql = '\r\n SELECT A.* ,\r\n B.name as reg_name , B.number as reg_number,\r\n C.name as assessor_name,\r\n D.date , D.time, D.room, D.number as assessment_number, D.type, D.status as assessment_status, D.position, D.id_moderator,\r\n E.name as mod_name, F.name as type_name\r\n FROM ' . $this->assessment_data . ' AS A \r\n LEFT JOIN ' . $this->registration . ' AS B\r\n ON B.id = A.id_registration \r\n LEFT JOIN ' . $this->assessor . ' AS C\r\n ON C.id = A.id_assessor\r\n LEFT JOIN ' . $this->assessment . ' AS D\r\n ON D.id = A.id_assessment\r\n LEFT JOIN ' . $this->assessor . ' AS E\r\n ON E.id = D.id_moderator\r\n LEFT JOIN ' . $this->assessment_type . ' AS F\r\n ON F.id = D.type\r\n WHERE 1 = 1 ';\r\n if($id_assessor != '0') $sql .=' AND A.id_assessor = '.$id_assessor;\r\n if($weekly == '0') $sql.=' AND YEARWEEK(D.date) = YEARWEEK(NOW()) ';\r\n if($id_assessor == '0') $sql .=' GROUP by A.id_assessment ';\r\n\r\n $sql .=' order by D.DATE ASC ';\r\n $query = $this->db->query($sql);\r\n if(!$query || !$query->num_rows()) return false;\r\n return $query->result();\r\n }", "public static function find($a_user_id, $a_event_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$sql = \"SELECT id FROM adn_ep_assignment\".\n\t\t\t\" WHERE cp_professional_id = \".$ilDB->quote((int)$a_user_id, \"integer\").\n\t\t\t\" AND ep_exam_event_id = \".$ilDB->quote((int)$a_event_id, \"integer\");\n\n\t\t$set = $ilDB->query($sql);\n\t\tif($ilDB->numRows($set))\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($set);\n\t\t\treturn $row[\"id\"];\n\t\t}\n\t}", "function get_events_user( $options=array() ){\n\t\tglobal $gamo, $dbh;\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tif( empty( $options['user_id'] ) ){\n\t\t\t$error = Core::error($this->errors, 1);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'start' => 0,\n\t\t\t\t'number' => 1\n\t\t\t),\n\t\t$options);\n\t\t\n\t\t$action_types_rsvp = Core::r('actions')->action_types_id(array(\n\t\t\t\t'action_key' => 'rsvp_fevent'\n\t\t\t)\n\t\t);\n\t\t\n\t\t$action_types_attend = Core::r('actions')->action_types_id(array(\n\t\t\t\t'action_key' => 'attend_fevent'\n\t\t)\n\t\t);\n\n\t\tif( Core::has_error($action_types_rsvp) or empty($action_types_rsvp) ){\n\t\t\t$error = Core::error($this->errors, 5);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\tif( Core::has_error($action_types_attend) or empty($action_types_attend) ){\n\t\t\t$error = Core::error($this->errors, 5);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\t\n\t\t//error_log(print_r($action_type,true));\n\t\t//error_log(print_r($action_types,true));\n\t\t//error_log(print_r($options['user_id'],true));\n\t\t\n\t\t$sql = \t\"SELECT\n\t\t\tve.id as id,\n\t\t\tdate_time as date,\n\t\t\ttitle as name,\n\t\t\t(\n\t\t\t\tSELECT\n\t\t\t\tint_info\n\t\t\t\tFROM \" . CORE_DB . \".virtual_events_info AS a\n\t\t\t\tWHERE a.event_id = ve.id\n\t\t\t\tAND a.info_type = 'launched'\n\t\t\t) AS launched,\n\t\t\tal.point_value_use+COALESCE( (\n\t\t\t\tSELECT\n\t\t\t\t\tal2.point_value_use\n\t\t\t\tFROM \".CORE_DB.\".actions_log as al2\n\t\t\t\tWHERE \n\t\t\t\t\tal2.user_id = \".$options['user_id'].\"\n\t\t\t\t\tAND al2.action_types_id = \".$action_types_attend.\"\n\t\t\t\t\tAND al2.int_other = ve.id\n\t\t\t\t\tAND al2.active = 1\n\t\t\t),0 ) as points\n\t\t\tFROM \".CORE_DB.\".\".self::$table_name.\" as ve \".\n\t\t\t\"INNER JOIN \".CORE_DB.\".actions_log as al on ve.id=al.int_other \".\n\t\t\t\"WHERE al.action_types_id = \".$action_types_rsvp.\" AND \".\n\t\t\t\"user_id = :user_id AND al.active = 1 AND al.point_value_use IS NOT NULL AND al.point_value_use > 0 ORDER BY date_time ASC LIMIT \".$options['start'].\",\".$options['number'];\n\t\t\n\t\t//error_log($sql);\n\t\t//,\".$action_types_attend.\")\n\t\t\n\t\t$stm = $dbh->prepare($sql);\n\t\tif( empty($stm) ){\n\t\t\t$error = Core::error($this->errors, 2);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\n\t\t$sres = $stm->execute( array(\n\t\t\t\t':user_id' => $options['user_id']\n\t\t) );\n\t\tif( empty($sres) ){\n\t\t\t$error = Core::error($this->errors, 3);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\n\t\t$id = $stm->fetchAll(PDO::FETCH_ASSOC);\n\t\t\n\t\tif( !empty( $id ) ){\n\t\t\n\t\t\treturn $id;\n\t\t\n\t\t}else{\n\t\t\n\t\t\treturn false;\n\t\t\n\t\t}\n\t\t\n\t}", "public function getAsetUser($data) {\n\t\t\t// pr($data);\n $dataImplode = explode(',', $data['Aset_ID']);\n foreach ($dataImplode as $asetid) {\n if($asetid!=\"\"){\n $sql = \"SELECT Aset_ID FROM Aset WHERE UserNm = {$this->UserSes['ses_uoperatorid']} AND Aset_ID = {$asetid} LIMIT 1\";\n // pr($sql);\n $res = $this->sql->_fetch_array($sql, 0);\n if ($res) {\n $dataAsetUser[] = $res['Aset_ID'];\n }\n } }\n\n return $dataAsetUser;\n }", "function get_aula ($id_aula){\n $sql=\"SELECT nombre \n FROM aula \n WHERE id_aula=$id_aula\";\n $aula=toba::db('gestion_aulas')->consultar($sql);\n \n return ($aula[0]['nombre']);\n }", "function findAgency($p_iva){\n global $dbH;\n $dbH->setTable(\"agencies\");\n\n $res = $dbH->read(\"p_iva = ?\",\" limit 1 \",array($p_iva) ,\"id\",$printQuery = false);\n if(Count($res)>0)\n return $res[0][\"id\"];\n else\n return 1;\n}", "function getByEncomienda($encomienda) {\n $db = $this->getAdapter();\n $db->setFetchMode ( Zend_Db::FETCH_OBJ );\n $select = $db->select();\n $select->distinct(true);\n $select->from(array('i' => 'item_encomienda'), array(\"id_item_encomienda\",\"cantidad\", \"detalle\", \"monto\", \"peso\"));\n $select->where(\"i.encomienda='$encomienda' AND i.estado='Activo'\");\n \n// echo $select->__toString();\n $log = Zend_Registry::get(\"log\");\n $log->info(\"recuperando manifiestos :\" . $select->__toString());\n return $db->fetchAll($select);\n }", "public function getAnggota()\n {\n return $this->hasOne(Anggota::className(), ['id' => 'id_anggota']);\n }", "function get_empresa_by_id($empresa_id) {\n\t\t$this -> db -> where('empresa_id', $empresa_id);\n\t\t$this -> db -> from('empresas');\n\t\t$query = $this -> db -> get();\n\t\tif ($query -> num_rows() == 1)\n\t\t\treturn $query -> row();\n\t\treturn NULL;\n\t}", "public function getEventOwnerUser($id)\n {\n $user = User::findOrFail($id);\n if(count($user) > 0){\n\n return $user;\n\n }else{\n\n return false;\n }\n\n }", "public function obtenerEmpresaPorId($empresa_id=0){ \t\n return self::find() \n ->select('candidato_id,ruc,razon_social,correo_electronico,estado,contrasena')\n ->where('empresa_id='.$empresa_id)\n ->one(); \n }", "public function asig_grupo_user()\n {\n return $this->hasOne(AsignaturaGrupoUser::class);\n }", "private function ifoCadUser()\n {\n $infoCadUser = new AdmsRead();\n $infoCadUser->fullRead(\"SELECT env_email_conf, adms_niveis_acesso_id, adms_sits_usuario_id FROM adms_cads_usuarios WHERE id =:id LIMIT :limit\", \"id=1&limit=1\");\n $this->IfoCadUser = $infoCadUser->getResultado();\n\n }", "function get_all_agendas()\n {\n $this->db->order_by('idagenda', 'desc');\n return $this->db->get('agenda')->result_array();\n }", "function getUserDetailForSessionAttend($user_id=null,$is_cancel=false){\r\n\t\tif($user_id==null) return array();\r\n\t\t$this->db->select(TBL_USERS.'.id,'.TBL_USERS.'.email,'.TBL_USER_INFORMATION.'.sales_rip as parent_report_id,'.TBL_USERS.'.password,'.TBL_USERS.'.job_title,'.TBL_USERS.'.role,'.TBL_USER_INFORMATION.'.*,'.TBL_MST_COUNTRIES.'.title as country,'.TBL_MST_STATES.'.title as state,'.TBL_MST_CITIES.'.title as city,'.TBL_EVENT_REGISTRATION.'.session_id,'.TBL_EVENT_REGISTRATION.'.is_cancel,'.TBL_EVENT_REGISTRATION.'.is_attend');\r\n\t\t$this->db->from(TBL_USERS);\r\n\t\t$this->db->where(array(TBL_USERS.'.id'=>$user_id));\r\n\t\t$this->db->join(TBL_USER_INFORMATION,TBL_USER_INFORMATION.'.tbl_users_id='.TBL_USERS.'.id');\r\n\t\t$this->db->join(TBL_EVENT_REGISTRATION, TBL_EVENT_REGISTRATION.'.tbl_users_id='.TBL_USERS.\".id\",'left');\r\n\t\t$this->db->join(TBL_MST_COUNTRIES, TBL_MST_COUNTRIES.'.id='.TBL_USER_INFORMATION.\".mst_countries_id\",'left');\r\n\t\t$this->db->join(TBL_MST_STATES, TBL_MST_STATES.'.id='.TBL_USER_INFORMATION.\".mst_states_id\",'left');\r\n\t\t$this->db->join(TBL_MST_CITIES, TBL_MST_CITIES.'.id='.TBL_USER_INFORMATION.\".mst_cities_id\",'left');\r\n\t\tif($is_cancel==false){\r\n\t\t\t$this->db->where(array(TBL_EVENT_REGISTRATION.'.is_cancel'=>false));\r\n\t\t}\r\n\t\t$this->db->order_by(TBL_EVENT_REGISTRATION.'.is_cancel asc');\r\n\t\t//echo $this->db->_compile_select();die;\r\n\t\t$recordSet = $this->db->get();\r\n\t\t$data=$recordSet->result() ;\r\n \t\treturn $data;\r\n\t}", "public function ajaxDatatableAgendamento()\n {\n $dia = date('d') + 1;\n $sql = \"\n SELECT\n a.idAgendamento,\n a.dataInicio,\n a.dataFim,\n idUsuario,\n u.nome_usuario,\n e.razaoSocial AS empresa\n FROM \n z_sga_fluxo_agendamento_acesso a\n LEFT JOIN\n z_sga_usuarios u\n ON a.idUsuario = u.z_sga_usuarios_id\n LEFT JOIN\n z_sga_empresa e\n ON a.idEmpresa = e.idEmpresa\n WHERE\n dataInicio >= '\".date(\"Y-m-$dia\").\"' \n ORDER BY\n dataInicio ASC\";\n\n try{\n $sql = $this->db->query($sql);\n return array(\n 'return' => true,\n 'result' => $sql->fetchAll()\n );\n }catch (Exception $e){\n return array(\n 'result' => false,\n 'error' => $e->getMessage()\n );\n }\n }", "public function empleado()\n {\n return \\App\\Models\\Empleado::where('user_id', $this->user_id)->first();\n }", "public function getEdicao()\n\t\t{\n\t\t\t\treturn $this->edicao;\n\t\t}", "public function getEmpresas($id)\n {\n $email = $id;\n $empresas = User::select('cat_empresa.ID', 'cat_empresa.DESCRIPCION')\n ->join('cat_usuarioempresa', 'cat_usuarioempresa.USER_ID', '=', 'users.id')\n ->join('cat_empresa', 'cat_empresa.ID', '=', 'cat_usuarioempresa.EMPRESA_ID')\n ->where('users.email', '=', $email)\n ->where('users.activo', '=', 1) \n ->where('cat_usuarioempresa.ANULADO', '=', 0) \n ->get()\n ->toArray();\n \n if (count($empresas) > 0) {\n array_unshift($empresas, ['ID' => '', 'DESCRIPCION' => 'Seleccione una Empresa']);\n } else {\n array_unshift($empresas, ['ID' => '', 'DESCRIPCION' => 'Usuario no Asignado a Empresa']);\n //dd('vacio'); \n }\n\n return $empresas;\n }", "function showAllData($userID){\n $result = false;\n\n $alldateAgenda = \"(SELECT events.date FROM events WHERE FKusers = '$userID') UNION\n (SELECT `event-recurrence`.date FROM `event-recurrence` INNER JOIN events ON events.ID = `event-recurrence`.FKevents WHERE FKusers = '$userID')\";\n\n require_once 'model/dbConnector.php';\n\n $result = executeQuerySelect($alldateAgenda);\n\n return $result;\n}", "public function getIdAnexo()\n {\n return $this->id_anexo;\n }", "public function update(Agenda $agenda)\n {\n //\n }", "public function showAnnonceParUser(){\n $db = $this->getPDO();\n\n $sql = \"SELECT * FROM annonces INNER JOIN utilisateurs ON annonces.utilisateur_id = utilisateurs.id_utilisateur INNER JOIN categories ON annonces.categorie_id = categories.id_categorie INNER JOIN regions ON annonces.regions_id = regions.id_regions WHERE utilisateur_id = ?\";\n $this->id_annonce = $_SESSION['id_utilisateur'];\n\n $request = $db->prepare($sql);\n $request->bindParam(1, $this->id_annonce);\n $request->execute();\n\n return $request->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getEnteredBy()\n {\n return $this->hasOne(User::className(), ['id' => 'EnteredBy']);\n }", "function getEntrada($id){\r\n $query=\"SELECT e.*, c.nombre as 'Nombre de categoria', u.nombre as 'Usuario nombre', u.apellido as 'Usuario apellido', u.id as 'Usuario_id' FROM entrada e INNER JOIN categorias c ON e.categoria_id=c.id INNER JOIN users u ON u.id=e.usuario_id HAVING e.id=$id\";\r\n $sql= mysqli_query($_SESSION['connection'], $query);\r\n return mysqli_fetch_assoc($sql);\r\n }", "public function addAgendaRevisaoAcesso($data)\n {\n // Cria a query para o insert\n $sql = \"\n INSERT INTO\n z_sga_fluxo_agendamento_acesso(\n dataInicio,\n dataFim,\n situacao,\n idSolicitante, \n idEmpresa, \n idUsuario \n )VALUES \";\n\n for($i = 0; $i < count($data['idUsuario']); $i++):\n $expUser = explode('-',$data['idUsuario'][$i]);\n $dataInicio = trim(str_replace('/','-',$expUser[2]));\n $dataFim = str_replace('/','-',$expUser[3]);\n //$sql .= \"('\" . $data['data'] . \"', 0,\" . $data['idSolicitante'] . \",\" . trim($expUser[1]).\",'\" . trim($expUser[0]) . (($i + 1 == count($data['idUsuario'])) ? \"')\" : \"'),\");\n $sql .= \"('\" . $dataInicio . \"', '\" . $dataFim . \"', 0,\" . $data['idSolicitante'] . \",\" . trim($expUser[1]).\",'\" . trim($expUser[0]) . (($i + 1 == count($data['idUsuario'])) ? \"')\" : \"'),\");\n endfor;\n \n // Executa a query e retorna o resultado\n try{\n $this->db->query($sql);\n return array('return' => true);\n }catch (Exception $e){\n return array(\n 'return' => false,\n 'error' => $e->getMessage()\n );\n }\n }", "function rel_cliente_ag(){\r\n\t\t$db = banco();\r\n\t\t\r\n\t\t$query =\"SELECT user.cod, user.name, user.cpf, cliente.fone, especialidade.nom_espec, consulta.dt_consul, consulta.aprovado, consulta.presente\r\n\t\t\t\tFROM user, cliente, consulta, especialidade\r\n\t\t\t\tWHERE user.cod = cliente.cod_clien AND\r\n\t\t\t\t\t user.cod = consulta.cod_clien AND\r\n\t\t\t\t\t consulta.cd_esp = especialidade.cod_espec\r\n\t\t\t\t\t \r\n\t\t\t\t\";\r\n\t\t$row = $db->query($query);\r\n\t\t$db->close();\r\n\t\treturn $row;\t\r\n\t}", "public function protectNote($args) {\n if (!SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_READ)) {\n throw new Zikula_Exception_Fatal($this->__('Sorry! No authorization to access this module.'));\n }\n\n $aid = $this->request->getPost()->get('aid', '');\n if (!$aid) {\n throw new Zikula_Exception_Fatal($this->__('no note id'));\n }\n\n $daid = $this->request->getPost()->get('daid', '');\n\n //get the note\n $note = ModUtil::apiFunc('IWagendas', 'user', 'get', array('aid' => $aid));\n if ($note == false)\n throw new Zikula_Exception_Fatal($this->__('Event not found'));\n if ($note['daid'] != 0) {\n //Estem entrant a una agenda multiusuari\n //Carreguem les dades de l'agenda\n $agenda = ModUtil::apiFunc('IWagendas', 'user', 'getAgenda', array('daid' => $note['daid']));\n // Check whether the user can access the agenda for this action\n $te_acces = ModUtil::func('IWagendas', 'user', 'te_acces', array('daid' => $agenda['daid'],\n 'grup' => $agenda['grup'],\n 'resp' => $agenda['resp'],\n 'activa' => $agenda['activa']));\n }\n if (strpos($agenda['gAccessLevel'], '$owne|' . UserUtil::getVar('uid') . '$') === false &&\n $agenda['gAccessLevel'] != '') {\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n } else {\n //Check if user can access the agenda\n if ($daid != 0) {\n // If the user has no access, show an error message and stop execution\n if ($te_acces < 3 || ($te_access == 3 && $anotacio['usuari'] != UserUtil::getVar('uid')))\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n } else {\n //Comprovem si l'usuari està protegint realment la seva a notació\n if ($note['usuari'] != UserUtil::getVar('uid'))\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n }\n }\n $protegida = ($note['protegida'] == 1) ? 0 : 1;\n $items = array('protegida' => $protegida);\n // Edit note and set it as protected\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid)\n throw new Zikula_Exception_Fatal($this->__('Error'));\n $alt = ($protegida == 1) ? $this->__('Delete protection against automatic deletion for this event') : $this->__('Protected? ');\n return new Zikula_Response_Ajax(array('aid' => $aid,\n 'protecteda' => $protegida,\n 'alt' => $alt));\n }", "function getArticuloByAutor( $autor_id ){\n \n if( $autor_id == NULL) return false; // no pasa id devuelve false;\n\n $sql = \"SELECT articulo.id, articulo.titulo, articulo.contenido, articulo.imagen_1, articulo.subtitulo, articulo.fecha, articulo.autor_id, autor.nombre autor, genero.nombre genero, articulo.activo \n from articulo\n inner join autor on autor_id=autor.id\n inner join genero on genero_id=genero.id WHERE articulo.autor_id = $autor_id ORDER BY `articulo`.`id` DESC\";\n \n return ejecutarConsulta($sql);\n\n }", "function getUserById($id){\n\t\tglobal $db;\n\t\t$query = \"SELECT * FROM t_attendees WHERE id=\" . $id;\n\t\t$result = mysqli_query($db, $query);\n\t\t$user = mysqli_fetch_assoc($result);\n\t\treturn $user;\n\t}", "function delete_agenda($idagenda)\n {\n return $this->db->delete('agenda',array('idagenda'=>$idagenda));\n }", "function _makeAgenda($agenda){\n return [\n 'text' => $agenda->title,\n 'description' => $agenda->description,\n 'video' => $agenda->video == 1 ? true : false,\n 'videoURL' => $agenda->videoURL,\n 'videoBackgroundImage' => $agenda->videoBackgroundImage,\n 'redirectTo' => url('/agenda/'.$agenda->slug),\n 'videoBackgroundImageURL' => $agenda->videoBackgroundImageURL,\n ];\n }", "public function ajaxDatatableAgendamentoInativo()\n { \n $sql = \"\n SELECT\n a.idAgendamento,\n a.dataInicio,\n a.dataFim,\n idUsuario,\n u.nome_usuario,\n e.razaoSocial AS empresa\n FROM \n z_sga_fluxo_agendamento_acesso a\n LEFT JOIN\n z_sga_usuarios u\n ON a.idUsuario = u.z_sga_usuarios_id\n LEFT JOIN\n z_sga_empresa e\n ON a.idEmpresa = e.idEmpresa\n WHERE \n a.situacao = 0\n AND dataInicio <= NOW()\n ORDER BY\n dataInicio ASC\";\n\n try{\n $sql = $this->db->query($sql);\n return array(\n 'return' => true,\n 'result' => $sql->fetchAll()\n );\n }catch (Exception $e){\n return array(\n 'result' => false,\n 'error' => $e->getMessage()\n );\n }\n }", "public function getAnApplicant($application_id);", "public function completeNote($args) {\n if (!SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_READ)) {\n throw new Zikula_Exception_Fatal($this->__('Sorry! No authorization to access this module.'));\n }\n\n $aid = $this->request->getPost()->get('aid', '');\n if (!$aid) {\n throw new Zikula_Exception_Fatal($this->__('no note id'));\n }\n\n $daid = $this->request->getPost()->get('daid', '');\n\n //get the note\n $note = ModUtil::apiFunc('IWagendas', 'user', 'get', array('aid' => $aid));\n if ($note == false) {\n throw new Zikula_Exception_Fatal($this->__('Event not found'));\n }\n \n // Get the color configuration and assign them to the view object\n $colors = explode('|', ModUtil::getVar('IWagendas', 'colors'));\n //Comprovem que l'usuari pugui accedir a l'agenda\n if ($daid != 0) {\n //Estem entrant a una agenda multiusuari\n //Carreguem les dades de l'agenda\n $agenda = ModUtil::apiFunc('IWagendas', 'user', 'getAgenda', array('daid' => $daid));\n // Check whether the user can access the agenda for this action\n $te_acces = ModUtil::func('IWagendas', 'user', 'te_acces', array('daid' => $daid,\n 'grup' => $agenda['grup'],\n 'resp' => $agenda['resp'],\n 'activa' => $agenda['activa']));\n // If the user has no access, show an error message and stop execution\n if ($te_acces < 3 || ($te_access == 3 && $note['usuari'] != UserUtil::getVar('uid'))) {\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n }\n }\n if ($note['daid'] == $daid) {\n $completa = ($note['completa'] == 1) ? 0 : 1;\n $items = array('completa' => $completa);\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid) {\n throw new Zikula_Exception_Fatal($this->__('Error'));\n }\n } else {\n $uid = UserUtil::getVar('uid');\n $completedByUser = ($note['completedByUser'] == '') ? '$' : $note['completedByUser'];\n if (strpos($completedByUser, '$' . $uid . '$') !== false) {\n $completedByUser = str_replace('$' . $uid . '$', '', $completedByUser);\n $completa = 0;\n } else {\n $completedByUser .= '$' . $uid . '$';\n $completa = 1;\n }\n $items = array('completedByUser' => $completedByUser);\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid) {\n //Success\n //LogUtil::registerStatus ($this->__('Protection status updated'));\n throw new Zikula_Exception_Fatal($this->__('Error'));\n }\n }\n if ($completa == 1) {\n $alt = ($daid != 0) ? $this->__('Show') : $this->__('Mark as not completed');\n $bgcolor = $colors[14];\n } else {\n $alt = ($daid != 0) ? $this->__('Hide') : $this->__('Mark as completed');\n $bgcolor = $colors[13];\n }\n \n return new Zikula_Response_Ajax(array('aid' => $aid,\n 'completed' => $completa,\n 'daid' => $daid,\n 'alt' => $alt,\n 'bgcolor' => '#' . $bgcolor));\n }", "public function controlAviso()\n {\n $em = $this->getEntityManager();\n $q = $em->createQuery('SELECT r1 FROM Cespi\\Bundle\\IsoBundle\\Entity\\RegistroCargadoDato r1 '\n . ' WHERE r1.createdAt = (SELECT MAX(r2.createdAt) from Cespi\\Bundle\\IsoBundle\\Entity\\RegistroCargadoDato r2 where r2.idRegistroCargado = r1.idRegistroCargado group by r2.idRegistroCargado)'\n . ' and r1.control_envio_email = true ORDER BY r1.idRegistroCargado, r1.createdAt DESC');\n return $q->getResult();\n }", "function get_ua($id_des){\n $sql=\"select uni_acad from designacion where id_designacion=\".$id_des;\n $res= toba::db('designa')->consultar($sql); \n return $res[0]['uni_acad'];\n }", "public function getAgendaAlarmListAction(){\n /** @var Object_Agenda $agenda */\n $this->getDeviceSession()->getUserId();\n $agenda = new Object_Agenda();\n $this->_helper->json($agenda->getClass()->getFieldDefinition('Alarm'));\n }", "public function agenda(Request $request){\n $term = DB::select(\"select vt_id termid, vt_name term from cm_appln_valterm\");\n\n $agenda = DB::select(\"\nselect ob_id, vt_id,vt_name,ob_desc,ob_listyear,DATE_FORMAT(ob_meetingdate, '%d/%m/%Y') ob_meetingdate, DATE_FORMAT(ob_notis8date, '%d/%m/%Y') ob_notis8date,\nob_notis8hijridate,DATE_FORMAT(ob_notis9date, '%d/%m/%Y') ob_notis9date,\nob_notis9hijridate, DATE_FORMAT(ob_notis10date, '%d/%m/%Y') ob_notis10date,ob_notis10hijridate, DATE_FORMAT(ob_notis8printdate, '%d/%m/%Y') ob_notis8printdate,\nDATE_FORMAT(ob_enforcedate, '%d/%m/%Y') ob_enforcedate ,DATE_FORMAT(vt_termdate, '%d/%m/%Y') vt_termdate ,DATE_FORMAT(ob_vallistrevdate, '%d/%m/%Y') ob_vallistrevdate ,DATE_FORMAT(ob_noticeobjdate, '%d/%m/%Y') ob_noticeobjdate \nfrom cm_objection inner join cm_appln_valterm on vt_id = ob_vt_id\n \"); \n App::setlocale(session()->get('locale')); \n\n return view(\"objection.meeting\")->with(array('term'=> $term,'agenda'=> $agenda));\n }", "public function getVenda()\n {\n return $this->venda;\n }", "protected function getAssoId()\r\n {\r\n return $this->get('asso_am.asso_selector')->getAssoId();\r\n }", "function obtener_aulas_x (){\n //Hay que tener en cuenta el usuario que se loguea\n// $nombre_usuario=toba::usuario()->get_id();\n// $sql=\"SElECT t_a.nombre, t_a.id_aula \n// FROM aula t_a \n// JOIN administrador t_admin ON (t_a.id_sede=t_admin.id_sede)\n// WHERE t_admin.nombre_usuario='$nombre_usuario'\";\n $sql=\"SELECT nombre, id_aula FROM aula WHERE (NOT eliminada)\";\n return toba::db('gestion_aulas')->consultar($sql);\n \n }", "function getArticuloByGenero( $genero_id ){\n \n if( $genero_id == NULL) return false; // no pasa id devuelve false;\n\n $sql = \"SELECT articulo.id, articulo.titulo, articulo.contenido, articulo.imagen_1, articulo.subtitulo, articulo.fecha, articulo.autor_id, autor.nombre autor, genero.nombre genero, articulo.activo \n from articulo\n inner join autor on autor_id=autor.id\n inner join genero on genero_id=genero.id WHERE articulo.genero_id = $genero_id ORDER BY `articulo`.`id` DESC\";\n \n return ejecutarConsulta($sql);\n\n }", "function get_aseguradoras() {\n \t$aseguradoras = $this->db->select('empresas.empresa_id, empresas.nombre, tp.tipo_empresa_id, tp.tipo_empresa, tp.descripcion')\n ->where('tp.tipo_empresa_id', 4) //ASEGURADORAS TIENE ID 4\n ->join('tipo_empresa AS tp', 'tp.tipo_empresa_id = empresas.tipo_empresa_id')\n ->get('empresas');\n\t if($aseguradoras->num_rows() > 0) \n\t {\n\t \treturn $aseguradoras;\n\t }\n\t \n\t \n\t return false;\n }", "public function show($id)\n {\n $agenda = $this->repository->find($id);\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $agenda,\n ]);\n }\n\n return view('admin.agendas.show', compact('agenda'));\n }", "public function listar(){\n $eventos = \n DB::table('agendas')->where('id_usuario', auth()->user()->id )->orwhere('cliente', auth()->user()->id )->get();\n\n // $eventos = Agenda::all();\n // dd($eventos);\n $eve=[];\n\n foreach($eventos as $evento){\n\n\n $eve[] = [\n\n \"id\"=>$evento->id,\n \"start\"=>$evento->fecha . \" \" . $evento->hora_inicio,\n \"end\"=>$evento->fecha . \" \". $evento->hora_final,\n \"title\"=>$evento->titulo,\n \"backgroundColor\"=>$evento->estado == 1 ? \"#7ACF2A\" : \"#CF2A2A\",\n \"textColor\"=>\"#fff\",\n \"extendedProps\"=>[\n \"id_usuario\"=>$evento->id_usuario,\n \"precio\"=>$evento->precio,\n\n\n ]\n\n ]; \n\n\n }\n\n return response()->json($eve);\n\n}", "function agenda_liste_avertir($id_agenda, $annee_choisie, $mois_choisi) {\n\n\t$message = NULL;\n\n\t$contexte_aff = agenda_definir_contexte(0);\n\t$debut_saison = $contexte_aff['debut_saison'];\n\t$type_saison = $contexte_aff['type_saison'];\t\t\n\n\tif (intval($debut_saison) != 1) \n\t\t$annee_choisie = (intval($mois_choisi) < intval($debut_saison)) ? $annee_choisie : strval(intval($annee_choisie)+1);\n\n\t$count_evt = count(agenda_recenser_evenement(0));\n\t$count_evt_filtre = agenda_liste_afficher(0);\n\n\tif ($count_evt == 0)\n\t\t$message = _T('sarkaspip:msg_0_evt_agenda');\n\telse\n\t\tif ($count_evt_filtre == 0)\n\t\t\tif (intval($debut_saison) == 1)\n\t\t\t\t$message = _T('sarkaspip:msg_0_evt_annee').'&nbsp;'.$annee_choisie;\n\t\t\telse\n\t\t\t\tif ($type_saison == 'annee')\n\t\t\t\t\t$message = _T('sarkaspip:msg_0_evt_saison').'&nbsp;'.$annee_choisie;\n\t\t\t\telseif ($type_saison == 'periode')\n\t\t\t\t\t$message = _T('sarkaspip:msg_0_evt_saison').'&nbsp;'.strval(intval($annee_choisie)-1).'-'.$annee_choisie;\n\t\t\t\telse // $type_saison == 'periode_abregee'\n\t\t\t\t\t$message = _T('sarkaspip:msg_0_evt_saison').'&nbsp;'.substr(strval(intval($annee_choisie)-1),2,2).'-'.substr($annee_choisie,2,2);\n\n\treturn $message;\n}", "function get_events_by_user_id($id, $retrieval_type) {\n\t\t\t\t\t\t\t\t\t\t\n\t\tif ($retrieval_type == 'owned') \n\t\t{\n\t\t\t$data = $this->db->query('SELECT * FROM event ev JOIN \n\t\t\t\t\t\t\t\t\t\t(SELECT event_id FROM event_owner ow \n\t\t\t\t\t\t\t\t\t\t\tWHERE ow.owner_id = '.$id.') AS f \n\t\t\t\t\t\t\t\t\t\t\tUSING(event_id)');\n\t\t\t\n\t\t}\n\t\telse if ($retrieval_type == 'rsvp') \n\t\t{\n\t\t\t$query = 'SELECT event_title FROM event ev JOIN (SELECT event_id FROM event_owner ow WHERE ow.owner_id = '.$id.') AS f USING(event_id)';\n\t\t\t$data = $this->db->query('SELECT * FROM event ev JOIN \n\t\t\t\t\t\t\t\t\t\t(SELECT event_id FROM attendee a \n\t\t\t\t\t\t\t\t\t\t\tWHERE a.user_id = '.$id.') AS f \n\t\t\t\t\t\t\t\t\t\tUSING(event_id) WHERE event_title NOT IN ('.$query.')');\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn $data->result();\n\t}", "public function getAnAnime($id) {\n\t\t$result = null;\n\n\t\tforeach ($this->getAnimes() as $anime) {\n\t\t\tif ($anime->getId() == $id) {\n\t\t\t\t$result = $anime;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function get_usuario_expediente( $id ) {\n\t\t$condicion = array(\n\t\t\t'ab_usuarios.IdUsuario' => $id,\n\t\t);\n\t\t\n\t\t$this->db->order_by( 'Fecha', 'DESC' );\n\t\t$this->db->join( 'ab_expediente', 'ab_expediente.IdUsuario = ab_usuarios.IdUsuario', 'LEFT' );\n\t\t$consulta = $this->db->get_where( 'ab_usuarios', $condicion ); \n\t\t\n\t\treturn $consulta;\n\t}", "public function attend() {\n\n $attr = array(\n 'events' => $this->db->query(\"SELECT id, title\n FROM events\n WHERE DATE_FORMAT(event_date, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m')\n ORDER BY event_date DESC\")->result(),\n 'department' => $this->db->query(\"SELECT CONCAT(IF(is_pt = 1, CONCAT('PT. ', REPLACE(name, 'PT. ', '')), REPLACE(name, 'PT. ', '')), ' (', team, ')') AS 'name',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t CONCAT('t', ansena_team.id) AS 'id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t FROM ansena_team \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t LEFT JOIN ansena_department ON ansena_department.id = ansena_team.dept_id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t UNION ALL \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t SELECT IF(is_pt = 1, CONCAT('PT. ', REPLACE(name, 'PT. ', '')), REPLACE(name, 'PT. ', '')) AS 'name',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t CONCAT('d', ansena_department.id) AS 'id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t FROM ansena_department \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t LEFT OUTER JOIN ansena_team ON ansena_team.dept_id = ansena_department.id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE ansena_team.id IS NULL\")->result()\n \n );\n \n $this->layout_lib->template_with_custom_navbar('analisa/navbar-sub-attend', 'analisa/attend', $attr);\n \n }", "public function SeeOneUserEvents($id) {\n\n try{\n $select5 = $this->connexion->prepare(\"SELECT * \n FROM cp_user_has_group A, cp_event_has_group B\n JOIN cp_event C \n ON C.event_id = B.event_event_id \n WHERE A.user_user_id = :userID\n AND A.group_group_id = B.group_group_id \");\n \n $select5->bindValue(':userID', $id, PDO::PARAM_INT);\n $select5->execute();\n $select5->setFetchMode(PDO::FETCH_ASSOC);\n $array = $select5->FetchAll();\n $select5->closeCursor(); \n\n\n return $array;\n } catch (Exception $e) {\n echo 'Message:' . $e->getMessage();\n }\n\n }", "public function agendaClient() {\n $response = $this->database->query('SELECT id, lastName, firstName, birthDate, CASE WHEN `card` = true THEN \\'oui\\' ELSE \\'non\\' END AS `card`, cardNumber FROM `clients`');\n $data = $response->fetchAll(PDO::FETCH_OBJ); \n return $data; //la fonction retourne data.\n }", "public function getCreatedBy(): ?ParticipantInterface;", "public function active_add_response($id,$team_id= null){\n\t\t\t$users_list = User::wherePermissionIs('create_agenda')->get();\n\t\t\t$collection = collect($users_list);\n\t\t\t//converting array(\"1\",\"2\") to array(1,2) -- string to number conversion\n\t\t\t$can_create_agenda = array_map('intval',explode(',',$collection->implode('id', ', ')));\n\t\t\t$workspace_id = auth()->user()->workspace_id;\n\t\t\t$agendas = AgendaMast::where(['team_id' => null,'workspace_id' => $workspace_id])->get();\n\t\t\t//fetch all users for stand alone agenda\n\t\t\t$users = User::where('workspace_id',$workspace_id)->get();\n\t\t\t$team = null;\n\t\t\t$focusAgenda = AgendaMast::with(['response_grps'=>function($query){\n\t\t\t$query->orderBy('date','desc');\n\t\t\t}])->where('id', $id)->first();\n\t\t\t$focusAgenda->action_type = 'UserResponses';\n\t\t\treturn view('pms.agenda.index', compact('focusAgenda','agendas','team','can_create_agenda','users'));\n }", "public function getAgroclimatologia_idagroclimatologia(){\n return $this->agroclimatologia_idagroclimatologia;\n }", "public function getOneEmpresa($id){\n\n \t$this->db->where($this->primary_key, $id);\n \treturn $this->db->get($this->administracao);\n }", "protected function getUserAuto()\n {\n $attributes = $this->getUserAttributes();\n\n // Try to find user user if authclient_id is null based on ldap fields objectguid and e-mail\n $query = User::find();\n $query->where(['auth_mode' => $this->getId()]);\n\n if ($this->idAttribute !== null) {\n $query->andWhere(['IS', 'authclient_id', new \\yii\\db\\Expression('NULL')]);\n }\n\n $conditions = ['OR'];\n if (isset($attributes['email']) && !empty($attributes['email'])) {\n $conditions[] = ['email' => $attributes['email']];\n }\n if (isset($attributes['objectguid']) && !empty($attributes['objectguid'])) {\n $conditions[] = ['guid' => $attributes['objectguid']];\n }\n if (isset($attributes['uid']) && !empty($attributes['uid'])) {\n $conditions[] = ['username' => $attributes['uid']];\n }\n if ($conditions)\n $query->andWhere($conditions);\n\n return $query->one();\n }", "function getEOIUser($eoiid, $userid)\n {\n $ay_res= array();\n \n $this->db->select('*');\n $this->db->from('eoi_user');\n $this->db->where('eoiid', $eoiid);\n $this->db->where('userid', $userid);\n $query= $this->db->get();\n \n\n foreach($query->result() as $row)\n {\n $ay_res[]= $row->eoiid; \n $ay_res[]= $row->userid; \n $ay_res[]= $row->subdate; \n $ay_res[]= $row->title; \n $ay_res[]= $row->org; // 4 \n $ay_res[]= $row->doc1; \n $ay_res[]= $row->doc2; \n $ay_res[]= $row->is_proposal; \n }\n return $ay_res; \n }", "public function getAnioCalendario(){\n return $this->anioCalendario;\n }", "function selAporte($idadministra){\r\n\t$sql = \"SELECT * FROM aportes WHERE administra_idadministra = $idadministra\";\r\n\t$ej = mysql_query($sql);\r\n\tif($dt = mysql_fetch_array($ej)){\r\n\treturn $dt;\r\n\t}\r\n}", "function getUserEmail($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id='$id'\", 'user_email');\n}", "function getIdUsuario($email) {\r\n $this->db->select('id_usuario');\r\n $this->db->where('email_usuario', $email);\r\n $this->db->limit(1);\r\n $consulta = $this->db->get('usuario');\r\n if ($consulta->num_rows() > 0) {\r\n $resultadoConsulta = $consulta->result();\r\n foreach ($resultadoConsulta as $campoDeLaTabla) {\r\n $salida = $campoDeLaTabla->id_usuario;\r\n }\r\n } else {\r\n $salida = FALSE;\r\n }\r\n return $salida; \r\n \r\n }", "function get_egresos($egreso_id)\r\n {\r\n $egresos = $this->db->query(\"\r\n SELECT\r\n i.*, u.*\r\n\r\n FROM\r\n egresos i, usuario u\r\n\r\n WHERE\r\n i.usuario_id = u.usuario_id\r\n and i.egreso_id=\".$egreso_id.\"\r\n\r\n ORDER BY `egreso_id` DESC\r\n\r\n \r\n \")->result_array();\r\n\r\n return $egresos;\r\n }", "public function autorPedido()\n {\n return $this->belongsTo(User::class, 'user_id'); // FK de esta tabla\n }", "public function show($id)\n {\n $agenda = Agenda::find($id);\n if(is_null($agenda)){\n abort(404);\n }\n return response()->json([\n 'status' => true,\n 'data' => $agenda\n ]);\n }", "public function getIdAluno()\n {\n return $this->id_aluno;\n }", "function get_aut_idautor(){return $this->aut_idautor;}", "public function get_antiguedad_empleado($args = [])\n\t{\n\t\t$condiciones = \"\";\n\n\t\tif (elemento($args, 'empleado')) {\n\t\t\t$condiciones .= \" and a.id=\".$args[\"empleado\"];\n\t\t}\n\n\t\tif (elemento($args, 'empresa')) {\n\t\t\t$condiciones .= \" and a.idempresadebito=\".$args[\"empresa\"];\n\t\t}\n\n\t\t$fecha = $args['fal'];\n\n\n\t\t$sql = <<<EOT\nselect \n\ta.id as codigo, \n concat(a.nombre, ifnull(a.apellidos,'')) as nombre,\n DATE_FORMAT(a.ingreso, '%d/%m/%Y') as ingreso,\n a.idempresadebito,\n b.nomempresa,\n TIMESTAMPDIFF(DAY, a.ingreso, '{$fecha}') as dias,\n TIMESTAMPDIFF(MONTH, a.ingreso, '{$fecha}') as meses,\n TIMESTAMPDIFF(YEAR, a.ingreso, '{$fecha}') as anios\nfrom plnempleado a\njoin empresa b on b.id = a.idempresadebito\nwhere a.ingreso is not null\n{$condiciones}\norder by b.nomempresa, a.nombre;\nEOT;\n\n\t\t$tmp = $this->db->query($sql)->fetchAll();\n\t\t$res = [];\n\n\t\tforeach ($tmp as $key => $value) {\n\t\t\tif (isset($res[$value['idempresadebito']])) {\n\t\t\t\t$res[$value['idempresadebito']]['empleados'][] = $value;\n\t\t\t} else {\n\t\t\t\t$res[$value['idempresadebito']] = [\n\t\t\t\t\t'nombre' => $value['nomempresa'],\n\t\t\t\t\t'empleados' => [$value]\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\treturn $res;\n\t}", "function get_rel_gasto_evento($id) {\n\t\t$this->db->select ( 'participacao.id_participacao,\n\t\t\tparticipacao_requer_material.quantidade, \t\n\t\t\tmaterial.nome_material,\n\t\t\tmaterial.preco_material' );\n\t\t$this->db->from ( 'participacao,participacao_requer_material,material' );\n\t\t$this->db->where ( 'participacao_requer_material.id_participacao=participacao.id_participacao' );\n\t\t$this->db->where ( 'participacao_requer_material.sku=material.sku' );\n\t\t$this->db->where ( 'participacao.id_evento = ' . \"'\" . $id . \"'\" );\n\t\n\t\t$query = $this->db->get ();\n\t\n\t\tif ($query->num_rows () != 0) {\n\t\t\treturn $query->result ();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.6476513", "0.64205766", "0.60329634", "0.5883638", "0.58533025", "0.5789469", "0.5707381", "0.567456", "0.5634952", "0.56299263", "0.55947834", "0.55942774", "0.55843526", "0.5545008", "0.5500775", "0.54885435", "0.5475679", "0.5436372", "0.54354286", "0.5380971", "0.5369262", "0.5364822", "0.53396666", "0.5324966", "0.53227544", "0.53179616", "0.5294186", "0.52804923", "0.52518976", "0.5240465", "0.519181", "0.5191717", "0.5168938", "0.51681525", "0.5161762", "0.51357615", "0.51079893", "0.51023597", "0.50960165", "0.50847125", "0.50846756", "0.50760055", "0.5058975", "0.50569046", "0.5054762", "0.50448245", "0.5036426", "0.50360763", "0.50350547", "0.50310004", "0.5021595", "0.5020194", "0.5012069", "0.49980187", "0.4994165", "0.49898037", "0.497215", "0.4971687", "0.49631613", "0.49578315", "0.49567762", "0.495381", "0.49417943", "0.4934761", "0.49115947", "0.49098122", "0.49005428", "0.48892707", "0.48886263", "0.48843688", "0.48823267", "0.48797294", "0.48782974", "0.4875053", "0.4864336", "0.48594052", "0.48469746", "0.48461714", "0.48437235", "0.484177", "0.48381844", "0.48346463", "0.48285788", "0.48268467", "0.48131633", "0.4812972", "0.48031846", "0.4802618", "0.47944677", "0.47941422", "0.47911924", "0.47868878", "0.4781216", "0.47797367", "0.47781637", "0.47772485", "0.47755346", "0.47739077", "0.47734222", "0.47713932" ]
0.7112671
0
delete user agenda by agenda_id agenda_id mandatory field
public function deleteUserAgendaAction() { /** @var Object_Agenda $agenda */ $data = $this->getRequestData(); if (isset($data['agenda_id'])) { $agenda = Object_Agenda::getById($data['agenda_id']); if (!$agenda) { $this->setErrorResponse('no Agenda with this agenda_id!'); } elseif ($this->getDeviceSession()->getUserId() == $agenda->getCreator()->getId()) { $agenda->setPublished(false); if (!$agenda->save()) { $this->setErrorResponse('cannot delete Agenda object!'); } } else { $this->setErrorResponse('no Agenda for this user with current agenda_id!'); } } else { $this->setErrorResponse('agenda_id is mandatory field for this request!'); } $this->_helper->json(array('deleted' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "function delete_agenda($idagenda)\n {\n return $this->db->delete('agenda',array('idagenda'=>$idagenda));\n }", "public static function deleteAgendaWithRights($user, $agenda)\n {\n if ($user->pivot->delete_calendar)\n {\n // delete the tasks of the calendar\n $tasks = $agenda->tasks()->get();\n foreach ($tasks as $task) {\n $task->delete();\n }\n\n $agenda->delete();\n }\n else\n // FIXME: DB c'est mal.\n DB::table('agenda_user')->where('user_id', '=', $user->id)->delete();\n\n }", "public function delete($tienda);", "public function delete(): void\n {\n $this->record(new AgendaWasDeleted($this->identity));\n }", "public function destroy(Agenda $agenda)\n {\n //\n }", "public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }", "public function delete(User $user, Evento $evento)\n {\n //\n }", "public function delete(User $user, Meeting $meeting)\n {\n //\n }", "public function delete_user($user);", "public function delete($user){\n }", "public function delete($usuario_has_hojaruta);", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function delete(User $user, Attendance $attendance)\n {\n //\n }", "public function delete(User $user, AcademicYear $academicYear)\n {\n //\n }", "public function delete($calendario);", "public function delete(User $user, Grupo $grupo)\n {\n //\n }", "public function delIdentity()\n\t{\n\t\t// Verifier l'adhesion\n\t\t$q = new Bn_query('u2a', '_asso');\n\t\t$q->setFields('u2a_adherentid');\n\t\t$q->addWhere('u2a_userid='. $this->getVal('id', -1));\n\t\t$adheId = $q->getOne();\n\t\t$q->deleteRow();\n\t\t$q->setTables('adherents');\n\t\t$q->deleteRow('adhe_id=' . $adheId);\n\t}", "function deleteEvent($eventToDelete, $userID){\n\n $date = $eventToDelete[\"date\"];\n\n require_once 'model/dbConnector.php';\n\n //supprimer uniquement l'event choisi\n if($eventToDelete[\"sup\"] != \"\"){\n\n if($eventToDelete[\"recurrence\"] != 0){\n\n $suppQuery2='DELETE from `event-recurrence` where ID = :id';\n $suppData2= array(\":id\" => $eventToDelete['sup']);\n\n $result = executeQueryInsert($suppQuery2, $suppData2);\n\n }\n else{\n $suppQuery='DELETE from events where ID = :id AND FKusers = :idUser';\n $suppData= array(\":id\" => $eventToDelete['sup'], \":idUser\" => $userID);\n\n $result = executeQueryInsert($suppQuery, $suppData);\n }\n\n }\n //supprimer l'event et toutes les recurrences\n if($eventToDelete[\"supAll\"] != \"\"){\n\n $suppQuery2='DELETE from `event-recurrence` where FKevents = :id';\n $suppData2= array(\":id\" => $eventToDelete['supAll']);\n\n $result2 = executeQueryInsert($suppQuery2, $suppData2);\n\n $suppQuery='DELETE from events where ID = :id AND FKusers = :idUser';\n $suppData= array(\":id\" => $eventToDelete['supAll'], \":idUser\" => $userID);\n\n $result = executeQueryInsert($suppQuery, $suppData);\n\n }\n //supprimer l'event choisi et les suivantes recurrences\n if($eventToDelete[\"supAfter\"] != \"\"){\n\n $suppQuery=\"DELETE FROM `event-recurrence` WHERE FKevents = :id AND date > '$date' \";\n $suppData= array(\":id\" => $eventToDelete['supAfter']);\n\n $result = executeQueryInsert($suppQuery, $suppData);\n\n }\n\n return $result;\n}", "public function delete(){\n\t\t$sql = new Sql();\n\t\t$sql->query(\"DELETE FROM TB_USUARIOS WHERE idusuario=:ID\", array(\n\t\t\t':ID'=>$this->getIdusuario()\n\t\t));\n\n\t\t$this->setIdusuario(null);\n\t\t$this->setDeslogin(null);\n\t\t$this->setDessenha(null);\n\t\t$this->setDtcadastro(new DateTime());\n\t}", "public function delete_user($id)\n\t{\n\t\t$termination_date = date(\"Y-m-d H:i\");\n\t\t$dbres = $this->db->query(\"update user SET delete_status='1',termination_date='$termination_date' where id = $id \");\n\t\tredirect(site_url() . 'sys/get_employees?msg_del=success');\n\t}", "public function delete($user)\n {\n\n }", "function eliminar_autonomo()\n\t{\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$this->eliminar();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t\t$this->manejador_interface->mensaje(\"El proyecto '{$this->identificador}' ha sido eliminado\");\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\t$this->manejador_interface->error( \"Ha ocurrido un error durante la eliminacion de TABLAS de la instancia:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t$e->getMessage() );\n\t\t}\n\t}", "public function delete($id) {\n \t\n \t$oCriteria = new CdtSearchCriteria();\n\t\t$oCriteria->addFilter('encomienda_oid', $id, '=');\n\t\t$oCriteria->addNull('fechaHasta');\n\t\t$managerEncomiendaEstado = ManagerFactory::getEncomiendaEstadoManager();\n\t\t$oEncomiendaEstado = $managerEncomiendaEstado->getEntity($oCriteria);\n\t\tif (($oEncomiendaEstado->getTipoEstadoEncomienda()->getOid()!=CPIQ_ESTADO_ENCOMIENDA_SOLICITADA)) {\n\t\t\t\n\t\t\tthrow new GenericException( CPIQ_MSG_ENCOMIENDA_ELIMINAR_PROHIBIDO );\n\t\t}\n\t\telse{\n\t\t\n\t \t$encomiendaEstadoDAO = DAOFactory::getEncomiendaEstadoDAO();\n\t $encomiendaEstadoDAO->deleteEncomiendaEstadoPorEncomienda($id);\n\t \t\n\t $encomiendaProfesionalDAO = DAOFactory::getEncomiendaProfesionalDAO();\n\t $encomiendaProfesionalDAO->deleteEncomiendaProfesionalPorEncomienda($id);\n\t \n\t $encomiendaRegistroDAO = DAOFactory::getEncomiendaRegistroDAO();\n\t $encomiendaRegistroDAO->deleteEncomiendaRegistroPorEncomienda($id);\n\t \n\t $encomiendaEspecialidadDAO = DAOFactory::getEncomiendaEspecialidadDAO();\n\t $encomiendaEspecialidadDAO->deleteEncomiendaEspecialidadPorEncomienda($id);\n\t \n\t \n\t \n\t \tparent::delete( $id );\n\t\t}\n\t\t\n }", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function delete(User $user, MuzaiEducation $muzaiEducation)\n {\n //\n }", "public function delete(User $user, ExamRoom $examRoom)\n {\n //\n }", "public function delete()\n{//delete\n $sql = \"DELETE FROM pefs_database.pef_assessor WHERE ase_id = ?\";\n $this->db->query($sql,array($this->ase_id)); \n}", "public function delete(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::delete(): Attempt to delete a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\t//Delete the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t\t$st = $conn->prepare ( \"DELETE FROM \".TABLENAME_GROUPS.\" WHERE id = :id LIMIT 1\" );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\t$st->execute();\r\n\t\t\t$conn = null;\t\t\r\n\t\t}", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public function actionUserdelete()\n {\n $timeLimit = time() - 0;\n $deactivateRequests = DeactivateAccount::find()->where(['processingDate' => null])->andWhere('creationDate < '.$timeLimit)->all();\n\n foreach ($deactivateRequests as $request)\n {\n $user = $request->user;\n\n if ($user->last_login <= $request->creationDate+3)\n {\n $user->setScenario('status');\n $user->status = User::STATUS_DELETED;\n $user->save();\n\n Campaign::updateAll(['status' => Campaign::STATUS_DELETED], 'userId = :userId', [':userId' => $user->id]);\n }\n\n $request->setScenario('processing');\n $request->processingDate = time();\n $request->save();\n }\n }", "abstract public function deleteByUser($userDao);", "public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }", "private function deleteUserDepartments($email)\r\n {\r\n $sqlQuery = \"DELETE FROM user_department WHERE useremail = '$email'\";\r\n $this->_dbHandle->exec($sqlQuery);\r\n }", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "function deleteUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$this->db->delete('usuarios');\n\t}", "public function delete(User $user, Jadwal $jadwal)\n {\n //\n }", "public function forceDelete(User $user, EduDocument $eduDocument)\n {\n //\n }", "public function delete($actividades_fuera);", "public function delete(){\n\t\t\t$sql = new sql();\n\n\t\t\t$sql->query(\"DELETE FROM tb_usuarios WHERE idusuario= :ID\", array(\n\t\t\t\t\":ID\"=>$this->getIdusuario()\n\t\t\t));\n\n\t\t\t$this->setIdusuario(0);\n\t\t\t$this->setDeslogim(\"\");\n\t\t\t$this->setDessenha(\"\");\n\t\t\t$this->setDtcadastro(new DateTime());\n\t\t}", "function delete($aid_id, $productive_baseline_id) {\n// 'id' => $aid_id,\n// 'sincronizado' => 0,\n// 'activo' => 0\n// ));\n// if ($this->TechnicalAid->save($datos)) {\n// $this->Session->setFlash('Registro Borrado correctamente', 'flash_custom');\n// $this->redirect(array('controller' => 'TechnicalAids', 'action' => 'index', $productive_baseline_id));\n// } else {\n// $this->Session->setFlash('Error Guardando datos');\n// }\n if ($this->TechnicalAid->delete($aid_id)) {\n $this->Session->setFlash('Registro Borrado correctamente', 'flash_custom');\n $this->redirect(array('controller' => 'TechnicalAids', 'action' => 'index', $productive_baseline_id));\n } else {\n $this->Session->setFlash('Error Guardando datos');\n }\n }", "public function actionDelete($id)\n {\n///\n$nombre=Yii::$app->user->identity->username;\n$connection = \\Yii::$app->db;\n$db = $connection->createCommand(\"INSERT INTO auditoria (id, user, modelo, accion, fechahora) VALUES (NULL, '$nombre', 'PropiedadDet', 'Borrar', NOW());\")->execute();\n///\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function deleteUser($id){\n$sql = \"DELETE FROM utilisateurs WHERE id = :id\";\n $stmt= $this->pdo->prepare($sql);\n $stmt->execute([\n 'id' => $id\n ]);\n}", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function delete()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['enabled'] = 0;\n $update['data']['active'] = 0;\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/logout','refresh');\n\n }", "public function delete($data)\n {\n $id=$data->input('id');\n $employee = Employee::find($id);\n $employee-> delete_flag = true; \n $employee-> deleted_at = date('Y-m-d H:i:s');;\n $employee->save();\n\n }", "function del($ar){\n $p = new XParam($ar, array());\n $oid = $p->get('oid');\n $lnkuser = selectQuery('select lnkuser from '.$this->xset->getTable().' where KOID=\\''.$oid.'\\'')->fetch(PDO::FETCH_COLUMN);\n // satus du compte \n updateQuery('update '.$this->xset->getTable().' set STATUS=\\'INACTIVE\\' where KOID=\\''.$oid.'\\'');\n // date du users\n updateQuery('update USERS set DATET=\\''.date('Y-m-d').'\\' where KOID=\\''.$lnkuser.'\\'');\n }", "public function forceDelete(User $user, Evento $evento)\n {\n //\n }", "function eliminarDiaryUser($id) {\n $sql = \"DELETE FROM diario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "public function delete($id) {\n \n \t$oUserUserGroupAO = CYTSecureDAOFactory::getUserUserGroupDAO();\n $oUserUserGroupAO->deleteUserUserGroupForUser($id);\n\t\tparent::delete( $id );\n\t\t\n \t\n }", "public function destroy($usuario_id)\n {\n }", "public function delete($id)\n {\n $asignacion = DocentGroupClass::findOrFail($id);\n // dd($asignacion);\n\n if (empty($asignacion)) {\n Alert::error('Asiganción no encontrada en nuestros registros')->persistent('Cerrar');\n return redirect(route('estructura.index'));\n }\n $asignacion->delete();\n\n Alert::info('Asignación eliminada de nuestros registros!')->persistent(\"Cerrar\");\n return redirect(route('estructura.index'));\n }", "function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}", "function admin_delete($id = null, $dept=null) {\n\t\tif (!$id) {\n\t\t\t$this->Session->setFlash(__('Invalid id for user', true));\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\t\t$dept_obj = ClassRegistry::init('DepartmentsUser');\n\t\t$all_depts = $dept_obj->find('all',array('conditions'=>array('DepartmentsUser.user_id'=>$id)));\n\n\t\t$this->User->id=$id;\n\n\t\tif($this->User->saveField('status',2)){\n\t\t\tif(!empty($all_depts)){\n\t\t\t foreach($all_depts as $depts){\n\t\t\t\t $dept_obj->delete($depts['DepartmentsUser']['id']);\n\t\t\t }\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('User deleted', true));\n\t\t\t$this->redirect(array('action'=>'index'));\n\t\t}\n\t\t$this->Session->setFlash(__('User was not deleted', true));\n\t\t$this->redirect(array('action' => 'index'));\n\t}", "function delete_ajudante($id_ajud)\n {\n return $this->db->delete('ajudante',array('id_ajud'=>$id_ajud));\n }", "public function deleteUser($userId);", "public function deleteUser()\n {\n $this->delete();\n }", "public function delete(User $user)\n {\n //\n }", "public function delete_user($user){\n if(empty($user->email))\n {\n $this->res->SetObject(RCD::EC_EMPTY, RCD::ED_EMPTY, FALSE, NULL);\n }\n $where = array('id'=>$id);\n $this->db->where(array('id' => $user['id']));\n if($this->db->delete(self::user))\n {\n $this->res->SetObject(RCD::SC, RCD::SD, FALSE, NULL);\n }\n else\n {\n $this->res->SetObject(RCD::EC_DELETE, RCD::ED_DELETE, TRUE, NULL);\n }\n }", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "function evento_pessoa_delete($idevento){\r\n\r\n\t\t$this->idevento = $idevento;\r\n\t\t$this->status = 2;\r\n\t\t$bd = Crud_Evento::conexao();\r\n\t\t$sql = \"UPDATE evento set status = :status WHERE idevento = :idevento\";\r\n\t\t$stmt = $bd->prepare( $sql );\r\n\t\t$stmt->bindParam(':idevento',$this->idevento,PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(':status', $this->status, PDO::PARAM_INT);\r\n\r\n\t\t\r\n\r\n\t\t$bd = Crud_Evento::conexao();\r\n\r\n\t\t$sql = \"DELETE FROM evento_pessoa WHERE idevento = :idevento \";\r\n\t\t$stmt = $bd->prepare($sql);\r\n\t\t$stmt->bindParam(':idevento',$idevento, PDO::PARAM_INT);\r\n\r\n\t\t$result = $stmt->execute();\r\n\r\n\t}", "public function deleteUser(request $request){\n \n $afi = User::find($request->id);\n $afi->delete();\n \n }", "public function delete($id_user){\n\t\t\t \n\t\t\t$this -> query = \"DELETE FROM usuari WHERE id='$id_user'\";\n\t\t\t$this -> executa_query();\n\t\t}", "function admin_delete($id=null){\n\t $id = base64_decode($id);\n\t $this->UserGroup->id = $id;\n $this->UserGroup->delete($id);\n $this->Session->setFlash('User Group deleted sucessfully.','message/green');\n $this->redirect(array('action' => 'index'));\n }", "function del($ar) {\n if(parent::del($ar)) {\n $p = new XParam($ar, array());\n $oid = $p->get('oid');\n // suppression des abonnements\n updateQuery(\"delete from OPTS where user like '$oid'\");\n // suppression des regles de secuite inutiles\n updateQuery(\"delete from ACL4 where AGRP like '$oid'\");\n // suppression des enregistrements dans les logs\n XArchives::appendOid($oid, 'LOGS.user', true);\n XArchives::appendOid($oid, 'LOGS.object', true);\n if(!empty($GLOBALS['XLOCK'])) {\n\t$GLOBALS['XLOCK']->cleanLocksForUser($oid);\n }\n }\n }", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "public function delete($user_id) {\n # anime they have submitted.\n \n # Get all the anime this user has submitted.\n $user_anime = $this->anime_model->get_anime_from_user($user_id);\n \n foreach($user_anime as $anime) {\n # Make each anime inactive\n $this->anime_model->make_anime_inactive($anime['id']);\n }\n \n # Make the user's profile inactive\n $this->user_model->make_inactive($user_id);\n \n # Log the user out\n $this->logout();\n }", "public function delete($id = NULL){\n if($id != NULL){\n $this->Usuarios_model->deleteUsuario($id);\n redirect(base_url().\"administrador/usuarios\");\n }\n }", "public function deleteEntrada(){\r\n\t\t$id_entrada = $_POST['id_entrada'];\r\n\t\t$valor['entradas'] = $this->menu_model->deleteEntradaByID($id_entrada);\t\t\r\n\t}", "public function delete(){\n $this->update(['deleted_by', Auth::user()->id]);\n return parent::delete();\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function delete()\n{\n $query = \"DELETE FROM \" . $this->table_name . \" WHERE `user_id`=:user_id\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n // unique ID of record to be edited\n $this->user_id=htmlspecialchars(strip_tags($this->user_id));\n $stmt->bindParam(':user_id', $this->user_id);\n\n \n if($stmt->execute()){\n return true;\n }\n \n // return false if email does not exist in the database\n $this->errmsg=implode(\",\",$stmt->errorInfo());\n return false;\n}", "public function eliminar_agenda($idveh)\r\n {\r\n \r\n return $this->db->delete('agenda', array('patente' => $idveh));\r\n\r\n }", "function delete_empresa($id)\n {\n return $this->db->delete('empresas',array('id'=>$id));\n }", "public function forceDelete(User $user, Meeting $meeting)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "function eliminar_reserva($id_sede,$id_area,$fecha,$hora) {\n $this->db->where('fecha =',$fecha);\n $this->db->where('id_sede =',$id_sede);\n $this->db->where('id_area =',$id_area);\n $this->db->where('hora =',$hora);\n $this->db->delete('edicion');\n }", "public function deleteEvent() {\n $event = EventDCI::find(Input::get('id'));\n if($event->user_id == Auth::user()->id) {\n /* Sending email to all boss that have relation with the services */\n $departments_sended_mail = array();\n foreach ($event->services()->wherePivot('deleted_at', '=', NULL)->get() as $service) {\n /* Getting the departments associated to the services */\n $department = $service->department()->first();\n\n if(!in_array($department->id, $departments_sended_mail)) {\n /* Getting the users associated to a department that they are bosses */\n $users = $department->users()->where('user_type_id', '=', 3)->where('status', '=', 1)->get();\n\n if($users->isEmpty()) {\n /* Getting the admin users */\n $users = User::where('user_type_id', '=', 4)->where('status', '=', 1)->get();\n }\n\n /* Sending email to bosses or admins (users) */\n foreach ($users as $user) {\n Mail::send('emails.notification.deleteevent',\n array(\n 'event' => $event->name,\n ),\n function($message) use($user) {\n $message->to($user->email)->subject('Evento eliminado - DCI');\n }\n\n );\n }\n\n array_push($departments_sended_mail, $department->id);\n }\n }\n $event->delete();\n return Redirect::to('dashboard')->with('alert', 'Evento eliminado exitosamente ' . $event->id_dci);\n }\n else {\n return Redirect::to('dashboard')->with('alert', 'Usted no tiene permisos para eliminar este evento' . $event->id_dci);\n }\n\n }", "public static function setDeleteUser($request,$id){\r\n\t\t// Obtem o feedback do banco de dados pelo id\r\n\t\t$obUser = EntityUser::getUserById($id);\r\n\r\n\t\t//VALIDANDO A INSTANCIA\r\n\t\tif(!$obUser instanceof EntityUser){\r\n\t\t\t$request->getRouter()->redireect('/admin/users');\r\n\t\t}\r\n\r\n\t\t//Exclui o deedback\r\n\t\t$obUser->excluir();\r\n\r\n\t\t\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users?status=deleted');\r\n \t}", "function delete_user($user_id) {\r\n\t\t$owned_groups = $this->group_model->get_groups($user_id, 'owner');\r\n\t\t$owned_events = $this->event_model->get_events_by_user_id($user_id, 'owned');\r\n\t\t\r\n\t\tfor ($x = 0; $x < sizeof($owned_groups); $x++) {\r\n\t\t\t$this->group_model->delete_group($owned_groups[$x]->org_id);\r\n\t\t}\r\n\t\t\r\n\t\tfor ($x = 0; $x < sizeof($owned_events); $x++) {\r\n\t\t\t$this->group_model->delete_event($owned_events[$x]->event_id);\r\n\t\t}\r\n\t\t\r\n\t\t$this->db->delete('user', array('user_id'=> $user_id));\r\n\t\t$this->db->delete('attendee', array('user_id' => $user_id));\r\n\t\t$this->db->delete('bulletin', array('bulletin_user_id' => $user_id));\r\n\t\t$this->db->delete('member', array('user_id' => $user_id));\r\n\t\t$this->db->delete('owner', array('user_id' => $user_id));\r\n\t}", "function deleteuser_vizitki($user_id) {\n\tglobal $database;\n\n\t// DELETE vizitki ENTRIES AND COMMENTS\n\t$database->database_query(\"DELETE FROM se_vizitkientries, se_vizitkicomments USING se_vizitkientries LEFT JOIN se_vizitkicomments ON se_vizitkientries.vizitkientry_id=se_vizitkicomments.vizitkicomment_vizitkientry_id WHERE se_vizitkientries.vizitkientry_user_id='$user_id'\");\n\n\t// DELETE COMMENTS POSTED BY USER\n\t$database->database_query(\"DELETE FROM se_vizitkicomments WHERE vizitkicomment_authoruser_id='$user_id'\");\n\n\t// DELETE STYLE\n\t$database->database_query(\"DELETE FROM se_vizitkistyles WHERE vizitkistyle_user_id='$user_id'\");\n\n}", "function delete_user_events_by_user_event_id($user_id, $event_id) {\n\tglobal $cxn;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"DELETE FROM user_events\n\t\t\t\tWHERE user_id = ? AND\n\t\t\t\t event_id = ?\";\n\t\t\t\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\n\t\t$stmt->bind_param(\"ii\", $user_id, $event_id);\n\t\t$stmt->execute();\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error deleting user events , user id: \" . $user_id . \" event id: \" .$event_id;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn $errArr;\n}", "public function actionDeleteUserRegistrationExpire() {\n $connection = Yii::app()->db;\n $sqlRaw = \"DELETE FROM s_user_registration WHERE status_id = 1 AND registration_date < \" . strtotime(\"-30 day\");\n Yii::app()->db->createCommand($sqlRaw)->execute();\n $sqlRaw2 = \"DELETE FROM `s_user_registration` WHERE id NOT IN (select id from h_applicant) AND registration_date < \" . strtotime(\"-30 day\");\n Yii::app()->db->createCommand($sqlRaw2)->execute();\n }", "function eliminar_empresa($empresa_id) {\n\t\t$this -> db -> where('empresa_id', $empresa_id);\n\t\t//La empresa owner no se puede eliminar\n\t\t$this -> db -> where('owner', 0);\n\t\t$data['activated'] = 0;\n\n\t\t//Audit field\n\t\t$data['user'] = $this->auth_frr->is_logged_in();\n\n\t\tif ($this -> db -> update('empresas', $data)) {\n\t\t\t//Eliminamos los usuarios que hayan pertenecido a esa empresa\n\t\t\t$this -> db -> where('empresa_id', $empresa_id);\n\t\t\tif ($this -> db -> update('users', $data))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t} else\n\t\t\treturn false;\n\t}" ]
[ "0.715543", "0.69624174", "0.6918893", "0.6646469", "0.6639103", "0.65732485", "0.6475622", "0.6389911", "0.6358775", "0.6268467", "0.62640965", "0.61863035", "0.6173356", "0.61718524", "0.6158144", "0.6153846", "0.6145026", "0.61276495", "0.6118396", "0.6106012", "0.60884684", "0.60821265", "0.6045825", "0.60439414", "0.603817", "0.6009142", "0.60052687", "0.5984122", "0.5980893", "0.59804595", "0.597383", "0.59521526", "0.59435177", "0.5934755", "0.59192306", "0.59085566", "0.5892027", "0.588837", "0.5882527", "0.58813316", "0.5877223", "0.58763134", "0.58754486", "0.5874547", "0.58629155", "0.58568615", "0.5851223", "0.5847724", "0.5841995", "0.5835213", "0.5834522", "0.5833807", "0.58231443", "0.5821792", "0.581996", "0.5811947", "0.5811826", "0.5810919", "0.5805419", "0.5803303", "0.5803264", "0.58005154", "0.5791282", "0.57897097", "0.5789419", "0.57880914", "0.5787873", "0.5785119", "0.5772598", "0.5772263", "0.5771951", "0.57713133", "0.57713133", "0.57713133", "0.57700515", "0.57638603", "0.57542884", "0.57518744", "0.5749669", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.574773", "0.5746466", "0.57457286", "0.57449174", "0.5742119", "0.5729851", "0.5723685", "0.572323", "0.5713578" ]
0.7972361
0
this action creates user agenda topic and title is mandatory field notes, start_time, end_time, with_whom, people, location, alarm, repeat_days is optional field
public function createUserAgendaAction() { $data = $this->getRequestData(); if (isset($data['topic']) && isset($data['title'])) { $user = Object_User::getById($this->getDeviceSession()->getUserId()); $folder = Object_Folder::getByPath('/agenda/' . $user->getKey() . "-agenda"); if (!$folder) { $folder = new Object_Folder(); $folder->setKey($user->getKey() . "-agenda"); $folder->setParentId(51); $folder->save(); } $agenda = new Object_Agenda(); $agenda->setCreator($user); $agenda->setTopic($data['topic']); $agenda->setTitle($data['title']); $agenda->setNotes(isset($data['notes']) ? $data['notes'] : ""); $agenda->setStart_time(isset($data['start_time']) ? $data['start_time'] : ""); $agenda->setEnd_time(isset($data['end_time']) ? $data['end_time'] : ""); $agenda->setWith_whom(isset($data['with_whom']) ? $data['with_whom'] : ""); $agenda->setWith_people(isset($data['people']) ? Object_People::getById($data['people']) : ""); $agenda->setLocation(isset($data['location']) ? $data['location'] : ""); $agenda->setAlarm(isset($data['alarm']) ? $data['alarm'] : ""); $agenda->setRepeat_days(isset($data['repeat_days']) ? $data['repeat_days'] : array()); $agenda->setKey(Pimcore_File::getValidFilename($user->getKey() . "-" . $data['title'] . "-" . time())); $agenda->setPublished(true); $agenda->setParentId($folder->getId()); if (!$agenda->save()) { $this->setErrorResponse('cannot save Agenda object'); } } else { $this->setErrorResponse('topic and title is mandatory field for this request!'); } $this->_helper->json($agenda); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $validated = request()->validate([\n 'title' => 'required',\n 'day' => 'required|date',\n 'start_date' => 'required|date_format:H:i',\n 'end_date' => 'required|date_format:H:i',\n 'id_paciente' => 'required|integer',\n 'id_personal' => 'required|integer',\n ]);\n\n Agenda::create($validated);\n\n $paciente = Paciente::find($validated['id_paciente']);\n $colaborador = Personal::find($validated['id_personal']);\n\n \\Mail::to($paciente->correo)->send(new AgendaCreate($validated, $paciente, $colaborador));\n\n return redirect()->route('agenda.index')->with('success', 'Hora agendada correctamente');\n }", "public function createTopic($user, $title, $content) {\n\t\t$topic = parent::create([\n\t\t\t\"section_id\"\t=> $this->getID(),\n\t\t\t\"title\"\t\t\t=> $title\n\t\t]);\n\n\t\t$topic->createComment($user, $content);\n\n\t\treturn $topic;\n\t}", "public function testCreate()\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n //test creation as admin\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with admin');\n\n //test creation as user\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with user');\n\n\n\n }", "function agenda_add_item($course_id, $author_id=NULL, $title='', $description='', $start_date=NULL, $end_date=NULL, $repeat, $repeat_type, $visibility='SHOW' )\n{\n\t$final_result = true;\n\t$result = array();\n\n\t$formated_start_day = date(\"Y-m-d\",$start_date);\n\t$formated_start_hour = date(\"H:i:s\",$start_date);\n\t$formated_end_day = date(\"Y-m-d\",$end_date);\n\t$formated_end_hour = date(\"H:i:s\",$end_date);\n\n $tbl = get_conf('mainTblPrefix') . 'event';\n $sql = \"INSERT INTO \" . $tbl . \"\n SET title \t = '\" . addslashes(trim($title)) . \"',\n description = '\" . addslashes(trim($description)) . \"',\n start_date = '\" . $formated_start_day . ' ' . $formated_start_hour . \"',\n end_date = '\" . $formated_end_day . ' ' . $formated_end_hour . \"',\n author_id = '\" . $author_id . \"'\";\n\t$event_id = claro_sql_query_insert_id($sql);\n\tif ($event_id == false)$result[] = $event_id;\n\n $tbl = get_conf('mainTblPrefix') . 'rel_event_recipient';\n\t$sql = \"INSERT INTO \" . $tbl . \"\n SET event_id \t= '\" . (int) $event_id . \"',\n course_id\t= '\" . $course_id . \"',\n\t\t\tvisibility\t= '\" . ($visibility=='HIDE'?'HIDE':'SHOW') . \"'\"; \n $result[] = claro_sql_query_insert_id($sql);\n\n\tif ($repeat > 1)\n\t{\n\t\t$tbl = get_conf('mainTblPrefix') . 'event';\n\t\t$sqlSet = array();\n\t\t\n $sql = \"UPDATE \" . $tbl . \"\n SET master_event_id = '\" . (int) $event_id . \"'\n WHERE `id` = \" . (int) $event_id ;\n\t\t$result[] = claro_sql_query($sql);\n\n\t\tfor($i=1; $i < $repeat; $i++)\n\t\t{\n\t\t\t$start_date_elements = explode(\"-\",$formated_start_day);\n\t\t\t$end_date_elements = explode(\"-\",$formated_end_day);\n\n\t\t\tif ($repeat_type == get_lang('Each week')) //find the new date depending on the repeat event type\n\t\t\t{\n\t\t\t\t$start_timestamp \t = mktime(0,0,0,$start_date_elements[1],$start_date_elements[2]+7*$i,$start_date_elements[0]);\n\t\t\t\t$end_timestamp \t\t = mktime(0,0,0,$end_date_elements[1],$end_date_elements[2]+7*$i,$end_date_elements[0]);\n\t\t\t}\n\t\t\tif ($repeat_type == get_lang('Each day')) //find the new date depending on the repeat event type\n\t\t\t{\n\t\t\t\t$start_timestamp \t = mktime(0,0,0,$start_date_elements[1],$start_date_elements[2]+1*$i,$start_date_elements[0]);\n\t\t\t\t$end_timestamp \t\t = mktime(0,0,0,$end_date_elements[1],$end_date_elements[2]+1*$i,$end_date_elements[0]);\n\t\t\t}\n\t\t\tif ($repeat_type == get_lang('Each month')) //find the new date depending on the repeat event type\n\t\t\t{\n\t\t\t\t$start_timestamp \t = mktime(0,0,0,$start_date_elements[1]+1*$i,$start_date_elements[2],$start_date_elements[0]);\n\t\t\t\t$end_timestamp \t\t = mktime(0,0,0,$end_date_elements[1]+1*$i,$end_date_elements[2],$end_date_elements[0]);\n\t\t\t}\n\n\t\t\t$repeat_start_date \t = strftime('%Y-%m-%d',$start_timestamp) . ' ' .$formated_start_hour;\n\t\t\t$repeat_end_date\t = strftime('%Y-%m-%d',$end_timestamp) . ' ' . $formated_end_hour;\n\t\t\t\t\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'event';\n\t\t\t$sql = \"INSERT INTO \" . $tbl . \"\n \t\t\t\tSET title \t = '\" . addslashes(trim($title)) . \"',\n \t\t\t\t\tdescription = '\" . addslashes(trim($description)) . \"',\n \t\t\t\t\tauthor_id = '\" . (int) $author_id . \"',\n \t\t\t\t\tstart_date = '\" . $repeat_start_date . \"',\n \t\t\t\t\tend_date = '\" . $repeat_end_date . \"',\n \t\t\t\t\tmaster_event_id = '\" . (int) $event_id . \"'\";\n\t\t\t$repeat_event_id = claro_sql_query_insert_id($sql);\n\t\t\tif ($repeat_event_id == false)$result[] = $repeat_event_id;\n\t\t\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'rel_event_recipient';\n\t\t\t$sql = \"INSERT INTO \" . $tbl . \"\n \t\t\t\tSET event_id \t= '\" . (int) $repeat_event_id . \"',\n \t\t\t\t\tcourse_id\t= '\" . $course_id . \"',\n \t\t\t\t\tvisibility\t= '\" . ($visibility=='HIDE'?'HIDE':'SHOW') . \"'\"; \n\t\t\t$result[] = claro_sql_query_insert_id($sql);\n\t\t}\n\t}\n\tif (is_array($result) && !empty($result))\n\t{\n\t\tforeach($result as $this_result)\n\t\t{\n\t\t\tif ($this_result==false) $final_result=false;\n\t\t}\n\t}\n return $final_result;\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 createAction()\n {\n if ($this->getRequest()->isPost())\t\t\t//avoids direct access without having an ID pass\n {\n $this->view->title = ' - Thema';\n\n $this->view->topicID = $_POST[\"topicID\"];\t\t//sends topicID to view\n $this->view->topicName = $_POST[\"topicName\"];\t//sends topicName to view\n }\n else\n {\n $this->_redirect('/');\t\t\t\t//goes to mainpage\n }\n }", "public function create()\n\t{\n\t\tlog::info('inside create method of user-notifications controller');\n\t}", "public function actionCreate()\n {\n $model = new Agenda();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "function post() {\n\t\n\t\n\t\tif(! local_channel())\n\t\t\treturn;\n\t\n\t\t$channel = \\App::get_channel();\n\t\n\t\tif((argc() > 2) && (argv(1) === 'complete') && intval(argv(2))) {\n\t\t\t$ret = array('success' => false);\n\t\t\t$r = q(\"select * from event where etype = 'task' and uid = %d and id = %d limit 1\",\n\t\t\t\tintval(local_channel()),\n\t\t\t\tintval(argv(2))\n\t\t\t);\n\t\t\tif($r) {\n\t\t\t\t$event = $r[0];\n\t\t\t\tif($event['event_status'] === 'COMPLETED') {\n\t\t\t\t\t$event['event_status'] = 'IN-PROCESS';\n\t\t\t\t\t$event['event_status_date'] = NULL_DATE;\n\t\t\t\t\t$event['event_percent'] = 0;\n\t\t\t\t\t$event['event_sequence'] = $event['event_sequence'] + 1;\n\t\t\t\t\t$event['edited'] = datetime_convert();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$event['event_status'] = 'COMPLETED';\n\t\t\t\t\t$event['event_status_date'] = datetime_convert();\n\t\t\t\t\t$event['event_percent'] = 100;\n\t\t\t\t\t$event['event_sequence'] = $event['event_sequence'] + 1;\n\t\t\t\t\t$event['edited'] = datetime_convert();\n\t\t\t\t}\n\t\t\t\t$x = event_store_event($event);\n\t\t\t\tif($x)\n\t\t\t\t\t$ret['success'] = true;\n\t\t\t}\n\n\t\t\tjson_return_and_die($ret);\n\t\t}\n\t\n\t\tif(argc() == 2 && argv(1) === 'new') {\n\t\t\t$text = escape_tags(trim($_REQUEST['summary']));\n\t\t\tif(! $text)\n\t\t\t\treturn array('success' => false);\n\t\t\t$event = array();\n\t\t\t$event['account'] = $channel['channel_account_id'];\n\t\t\t$event['uid'] = $channel['channel_id'];\n\t\t\t$event['event_xchan'] = $channel['channel_hash'];\n\t\t\t$event['etype'] = 'task';\n\t\t\t$event['nofinish'] = true;\n\t\t\t$event['created'] = $event['edited'] = $event['dtstart'] = datetime_convert();\n\t\t\t$event['adjust'] = 1;\n\t\t\t$event['allow_cid'] = '<' . $channel['channel_hash'] . '>';\n\t\t\t$event['summary'] = escape_tags($_REQUEST['summary']);\n\t\t\t$x = event_store_event($event);\n\t\t\tif($x)\n\t\t\t\t$x['success'] = true;\n\t\t\telse\n\t\t\t\t$x = array('success' => false);\n\t\t\tjson_return_and_die($x);\n\t\t}\t\n\t}", "public function create()\n\t{\n\t\t//\n\t\treturn view('checkup_shedules.create');\n\t}", "public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}", "function addEvent($date,$title,$user_id,$fname,$address,$contact,$email,$location,$vlocation,$hour,$minutes,$choice,$tier,$flavor,$info,$confirmation){\r\n\t//Include db configuration file\r\n\tinclude 'dbConfig.php';\r\n\t$currentDate = date(\"Y-m-d H:i:s\");\r\n\t//Insert the event data into database\r\n\t$insert = $db->query(\"INSERT INTO cakemaker (title,date,created,modified,user_id,fname,address,contact,email,location,vlocation,hour,minutes,choice,tier,flavor,info,confirmation) VALUES ('\".$title.\"','\".$date.\"','\".$currentDate.\"','\".$currentDate.\"','\".$user_id.\"','\".$fname.\"','\".$address.\"','\".$contact.\"','\".$email.\"','\".$location.\"','\".$vlocation.\"','\".$hour.\"','\".$minutes.\"','\".$choice.\"','\".$tier.\"','\".$flavor.\"','\".$info.\"','\".$confirmation.\"')\");\r\n\tif($insert){\r\n\t\techo 'ok';\r\n\t}else{\r\n\t\techo 'err';\r\n\t}\r\n}", "function ticketCreate($creator, $cat, $topic, $text)\r\n{\r\n\tglobal $db, $_cfg;\r\n\tif (!is_array($creator))\r\n\t{\r\n\t\t$usr = opReadUser($creator);\r\n\t\tif (!$usr)\r\n\t\t\treturn 'user_not_found';\r\n\t\t$creator = array('uID' => $creator, 'Name' => $usr['aName'], 'Mail' => $usr['uMail']);\r\n\t}\r\n//\tif (!validMail($frommail))\r\n//\t\treturn 'mail_wrong';\r\n\tif (!$topic)\r\n\t\treturn 'topic_empty';\r\n\tif (!$text)\r\n\t\treturn 'text_empty';\r\n\t$tid = $db->insert('Tickets', array(\r\n\t\t'tuID' => $creator['uID'],\r\n\t\t'tTS' => timeToStamp(),\r\n//\t\t'tTID' => ???,\r\n\t\t'tName' => $creator['Name'],\r\n\t\t'tMail' => $creator['Mail'],\r\n\t\t'tCat' => $cat,\r\n\t\t'tTopic' => $topic,\r\n\t\t'tText' => $text,\r\n\t\t'tPriority' => 1,\r\n\t\t'tState' => 1,\r\n\t\t'tLTS' => timeToStamp()\r\n\t));\r\n\t$creator['id'] = $tid;\r\n\t$creator['topic'] = $topic;\r\n\t$creator['text'] = $text;\r\n\t$creator['url'] = fullURL(moduleToLink('tickets/admin/ticket'));\r\n\tsendMailToAdmin('NewTicket', $creator);\r\n\treturn $tid;\r\n}", "public function actionCreate()\n {\n if(\\Yii::$app->user->isGuest) {\n \treturn $this->redirect(Yii::$app->params['default']);\n }\n\t\t\n\t\tif(\\Yii::$app->user->identity->jabatan !== \"Administrator\")\t {\n\t\t\treturn $this->redirect(Yii::$app->params['default'].'index.php/home');\t\n\t\t}\n\t\t\n $model = new Pengumuman();\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \t\\Yii::$app->getSession()->setFlash('success', \"Announcement is successfully created.\");\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createUserTodoAction()\n {\n $data = $this->getRequestData();\n if (isset($data['todo_type'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/todo/' . $user->getKey() . \"-todo\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-todo\");\n $folder->setParentId(30);\n $folder->save();\n }\n $todo = new Object_Todo();\n $todo->setCreator($user);\n $todo->setTodo_type($data['todo_type']);\n $todo->setText(isset($data['text']) ? $data['text'] : \"\");\n $todo->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . time()));\n $todo->setPublished(true);\n $todo->setParentId($folder->getId());\n if (!$todo->save()) {\n $this->setErrorResponse('cannot save Todo object!');\n }\n } else {\n $this->setErrorResponse('todo_type is mandatory field for this request!');\n }\n\n $this->_helper->json($todo);\n }", "public function add_task($data)\n {\n $datafields = array\n ('start' => array('req' => false, 'def' => 'NULL')\n ,'end' => array('req' => false, 'def' => 'NULL')\n ,'gid' => array('req' => true)\n ,'title' => array('req' => false, 'def' => '')\n ,'location' => array('req' => false, 'def' => '')\n ,'description' => array('req' => false, 'def' => '')\n ,'importance' => array('req' => false, 'def' => '1')\n ,'completion' => array('req' => false, 'def' => '0')\n ,'type' => array('req' => false, 'def' => '0')\n ,'status' => array('req' => false, 'def' => '0')\n ,'uuid' => array('req' => false, 'def' => basics::uuid())\n );\n foreach ($datafields as $k => $v) {\n if (!isset($data[$k])) {\n if ($v['req'] === true) {\n return false;\n }\n $data[$k] = $v['def'];\n } else {\n $data[$k] = $this->esc($data[$k]);\n }\n }\n // Am I the owner?\n if ($this->getGroupOwner($data['gid']) != $this->uid) {\n // If not, I should have write permissions through a share\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $data['gid']);\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n $query = 'INSERT '.$this->Tbl['cal_task'].' SET `uid`='.$this->uid.',`gid`='.$data['gid']\n .',`starts`='.($data['start'] == 'NULL' ? 'NULL' : '\"'.$data['start'].'\"')\n .',`ends`='.($data['end'] == 'NULL' ? 'NULL' : '\"'.$data['end'].'\"')\n .',`title`=\"'.$data['title'].'\",`location`=\"'.$data['location'].'\"'\n .',`description`=\"'.$data['description'].'\",`uuid`=\"'.$data['uuid'].'\"'\n .',`importance`='.doubleval($data['importance']).',`completion`='.doubleval($data['completion'])\n .',`type`='.doubleval($data['type']).',`status`='.doubleval($data['status']);\n if (!$this->query($query)) {\n return false;\n }\n $newId = $this->insertid();\n // Make sure, the end of an event is NOT before its beginning\n $this->query('UPDATE '.$this->Tbl['cal_task'].' SET `ends`=`starts` WHERE `ends`<`starts` AND id='.$newId);\n\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n $query .= '('.doubleval($newId).',\"tsk\",'.$this->uid.',\"'.$this->esc($v['mode']).'\",'.doubleval($v['time'])\n .',\"'.$this->esc($v['text']).'\",\"'.$this->esc($v['smsto']).'\",\"'.$this->esc($v['mailto']).'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n return $newId;\n }", "function create_event( $options=array() ){\n\t\t\t//length = 255, present\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'title_unique' => 1\n\t\t\t), $options\n\t\t);\n\t\t\n\t\tif( empty( $options['title'] ) or empty( $options['description'] ) or empty( $options['date'] ) ){\n\t\t\t$error = Core::error($this->errors, 1);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\t\n\t\t$values['title'] = $this->validate_title( array('title' => $options['title']) );\n\t\tif(Core::has_error( $values['title'] )){\n\t\t\treturn $values['title'] ;\n\t\t}\n\t\t\n\t\t$values['description'] = $this->validate_description( array('description' => $options['description']) );\n\t\tif(Core::has_error( $values['description'] )){\n\t\t\treturn $values['description'];\n\t\t}\n\t\t\n\t\t$values['date_time'] = $this->validate_event_date( array('date' => $options['date']) );\n\t\tif(Core::has_error( $values['date_time'] )){\n\t\t\treturn $values['date_time'];\n\t\t}\n\t\t\n\t\tif($options['title_unique']){\n\t\t\t//TODO:Check if the title unique\n\t\t\tif( Core::db_count( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => array(\n\t\t\t\t\t'title' => $values['title']\n\t\t\t\t)\n\t\t\t))){\n\t\t\t\t$error = Core::error($this->errors, 7);\n\t\t\t\t$error['error_msg'] .= 'Event title must be unique. ';\n\t\t\t\t$error['error_msg'] .= $error_append;\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$result = Core::db_insert( array(\n\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t'values' => $values\n\t\t));\n\t\t\n\t\tif( Core::has_error($result) or empty($result) ){\n\t\t\t$result['error_msg'] .= $error_append;\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\t\n\t}", "public function create()\n {\n return view('admin.topic.create');\n }", "public function createUserActivityAction()\n {\n $data = $this->getRequestData();\n if (isset($data['title'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/activities/' . $user->getKey() . \"-activities\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-activities\");\n $folder->setParentId(3);\n $folder->save();\n }\n\n $activity = new Object_Activity();\n $activity->setCreator($user);\n $activity->setTitle($data['title']);\n $activity->setPhoto(isset($data['photo']) ? Asset_Image::getById($data['photo']) : \"\");\n $activity->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $activity->setPublished(true);\n $activity->setParentId($folder->getId());\n if (!$activity->save()) {\n $this->setErrorResponse('cannot save Activity object');\n }\n } else {\n $this->setErrorResponse('title is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }", "public function postCreate()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, Announcement::$rules);\n\n $input['user_id'] = Sentry::getUser()->id;\n $input['publish'] = isset($input['publish'])?$input['publish']:'0';\n\t\tif ($validation->passes())\n\t\t{\n\n\t\t\t$this->announcement->create($input);\n\n\t\t\treturn Redirect::route('announcements');\n\t\t}\n\n\t\treturn Redirect::route('create/announcement')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function create()\n {\n // $crud = new Events();\n // $crud->photo ='anniv.png';\n // $crud->title = 'Sogod Founding Anniversary Concert';\n // $crud->descriptions = 'secret';\n // $crud->venue = 'Sogod Covered Court';\n // $crud->date = date('04/02/2018');\n // $crud->time = time('h:i:s');\n\n // $crud->save(); \n }", "public function create_topic() {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'is_guardian_blocked' => 'integer|min:0|max:1',\n 'status' => 'integer|min:0|max:1',\n 'is_featured' => 'integer|min:0|max:1',\n 'content' => 'string'\n ]);\n\n $is_guardian_blocked = 0;\n $is_featured = 0;\n $status = 0;\n\n $topic = new Topic;\n $topic->franchise_id = $this->franchise_id;\n $topic->club_id = $this->club_id;\n $topic->title = $this->request['title'];\n\n if( isset($this->request['is_guardian_blocked']) && !empty($this->request['is_guardian_blocked']) ) {\n $is_guardian_blocked = $this->request['is_guardian_blocked'];\n }\n\n if( isset($this->request['status']) && !empty($this->request['status']) ) {\n $status = $this->request['status'];\n }\n\n if( isset($this->request['is_featured']) && !empty($this->request['is_featured']) ) {\n $is_featured = $this->request['is_featured'];\n }\n\n if( isset($this->request['content']) && !empty($this->request['content']) ) {\n $topic->content = $this->request['content'];\n }\n\n $topic->is_guardian_blocked = $is_guardian_blocked;\n $topic->is_featured = $is_featured;\n $topic->created_by = $this->user_id;\n $topic->status = $status;\n\n $topic->save();\n\n return response()->json($topic, 200);\n }", "public function actionCreate()\r\n\t{\r\n\r\n $groupId = Yii::app()->request->getParam('groupId');\r\n\r\n $model=new GroupTopic;\r\n $model->group_id = $groupId ;\r\n $model->creator_id = user()->getId() ;\r\n\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['GroupTopic']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['GroupTopic'];\r\n\r\n $model->created = time() ;\r\n\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "public function create()\n {\n return view('topic.create');\n }", "public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }", "public function created(User $user)\n {\n $user->notify(new UserNotification($user));\n $user->tasks()->create([\n 'title' => 'Welcome to TODO Website',\n 'description' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.',\n ]);\n }", "public function create()\n \t{\n \t\t$topicTitle = TopicOfTheDayTitle::all();\n \t\t$t = Tag::all();\n $tags = array();\n foreach($t as $tag)\n {\n $ts['text'] = '#'.$tag->name;\n $tags[] = $ts;\n }\n\n return response()->json(['tags' => $tags, 'topicTitle' => $topicTitle]);\n \t}", "public function actionCreate() {\n $model = new Task;\n\n $reqModel = Yii::app()->getRequest()->getPost('Task');\n\n $user = new UserTask();\n $user->user_id = Yii::app()->user->id;\n $reqUser = Yii::app()->getRequest()->getPost('UserTask', array('user_id' => Yii::app()->user->id));\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if ($reqModel !== null) {\n $model->attributes = $reqModel;\n $user->attributes = $reqUser;\n if ($model->validate()) {\n if (is_array($reqUser['user_id'])) {\n if ($reqUser !== null) {\n $userIds = $reqUser['user_id'];\n $assoc = Yii::app()->getRequest()->getPost('Assoc', array('multiple' => '0'));\n if ($assoc['multiple'] === '1') {\n foreach ($userIds as $userId) {\n $task = new Task;\n $task->attributes = $reqModel;\n if ($task->save()) {\n UserTask::associate($task->id, $userId);\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.associate.success'));\n $this->_sendAssociationNotification(array($userId), $task->id);\n $this->_sendEmailAssociationNotification(array($userId), $task->id);\n }\n }\n } else {\n if ($model->save()) {\n foreach ($userIds as $userId) {\n UserTask::associate($model->id, $userId);\n }\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.create.success'));\n $this->_sendAssociationNotification($userIds, $model->id);\n $this->_sendEmailAssociationNotification($userIds, $model->id);\n }\n }\n }\n $this->redirect(array('view', 'id' => $model->id));\n } else {\n //this is bad but we need to check this part\n $user->addError('user_id', Yii::t('app', 'Task.associate.failure.user'));\n }\n }\n } else {\n $model->start_date = date('Y-m-d');\n $model->status = TaskStatus::model()->default()->find()->id;\n $model->type = TaskType::model()->default()->find()->id;\n }\n\n $this->render('create', array(\n 'model' => $model,\n 'user' => $user,\n 'projectId' => Yii::app()->getRequest()->getQuery('project_id')\n ));\n }", "function invite_workshop_attendees_create(){\n\t\t$this->content_data['uri'] = base_url('workshops/invite/register');\n $this->content_data['get_dropdown_all_titles'] = _get_dropdown_all_titles();\t\t\n\t\t$this->content_data['submit_button'] = lang('invite_').lang('attendee');\t\t\t\t\n\t\t$this->panel_title = 'ADD WORKSHOP ATTENDEES';\n\t\t$this->add_external_css(array(\"/themes/core/css/bootstrap-datetimepicker.css\"));\n\t\t$this->add_external_js(array(\"/themes/core/js/date-time-picker/moment.js\", \"/themes/core/js/date-time-picker/transition.js\", \"/themes/core/js/date-time-picker/collapse.js\", \"/themes/core/js/date-time-picker/bootstrap-datetimepicker.js\", \"/themes/core/js/views/training/workshops/workshops.js\"));\n\t\t$this->data = $this->includes;\t\t\n\t\t$this->content_data['workshopId'] = $this->id;\n\t\t$this->data['content'] = $this->load->view('training/workshops/workshop_attendees_add', $this->content_data, true);\n \t $this->load->view($this->template, $this->data);\n }", "public function create()\n\t{\n\t\t//\n\t\tdd('Day la trang create');\n\t}", "public function create()\n {\n $data = array();\n $data['title'] = $_POST['title'];\n $data['content'] = $_POST['content'];\n $data['time'] = $_POST['time'];\n \n $this->model->create($data);\n header('location:'. URL .'index');\n }", "public function createTask()\n\t{\n\t\tif ( $this->taskValidate() ) {\n\t\t\tTask::create([\n\t\t\t\t\t'name' => htmlspecialchars($_POST['inputTaskName']),\n\t\t\t\t\t'email' => htmlspecialchars($_POST['inputTaskMail']),\n\t\t\t\t\t'text' => htmlspecialchars($_POST['inputTaskText'])\n\t\t\t\t]);\n\t\t}\n\t\t// to index\n\t\t\theader('Location: /');\n\t}", "function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }", "public function create(Request $request)\n {\n $rules = [\n 'group_id' => 'required',\n 'title' => 'required',\n 'content' => 'required'\n ];\n $this->validate($request, $rules);\n $input = $request->all();\n $input['user_id'] = $this->thisUserId();\n $topic = Topic::create($input);\n\n if ($topic) {\n $topic = Topic::with('photos','author')->find($topic->id);\n return $this->apiSuccess($topic);\n } else {\n return $this->apiError(\"save topic wish error\",1001);\n }\n }", "public function executeTopicCreate(sfWebRequest $request)\n {\n $this->forward404Unless($request->isMethod(sfRequest::POST));\n\n $this->form = new ForumTopicsForm();\n\n $flagForumsId = '';\n\t\t$flagForumsId = $request->getPostParameter('flagForumsId');\n\t\t$this->flagForumsId = $flagForumsId;\n $this->processTopicForm($request, $this->form, $flagForumsId);\n\n //$this->processTopicForm($request, $this->form);\n $this->setTemplate('topicNew');\n }", "public function create(User $user)\n {\n return User::isAdmin($user);\n return $user->tipouser->permission()->get()->contains(\"nomePermissao\",\"Adicionar Eventos\");\n }", "function newEntry( $args = null, $entry = null)\n { \n\t\t// default duration of a new activity\n\t\t$duration = (int)($_SESSION[$this->appName]['preferences']['duration']?$_SESSION[$this->appName]['preferences']['duration']:'3600');\n\n \t// no predefined activity time\n if( is_numeric($args['activity_start']) == true )\n {\n\t\t\t// when a user clicks on the visual calendar\n\t\t\t// the format is number of seconds not string date/time\n\t\t \t$entry['activity_start'] = gmdate( 'Y-m-d H:i:s', $args['activity_start']);\n\t $entry['activity_end'] = gmdate( 'Y-m-d H:i:s', (int)$args['activity_start']+$duration);\n\t unset($args['activity_start']);\n\t }\n\t else if( isset($args['activity_start']) == false )\n\t {\n\t \t// when a new activity is created as a related record\n\t\t\t$start = round((int)(strtotime('+0 hour')/60),-1)*60;\n\t $entry['activity_start'] = gmdate( 'Y-m-d H:i', $start);\n\t $entry['activity_end'] = gmdate( 'Y-m-d H:i', $start+$duration);\n\t\t} \n\t\t\n\t\t$entry['type_id'] = $_SESSION[$this->appName]['preferences']['type_id']?$_SESSION[$this->appName]['preferences']['type_id']:'CA';\n\t\t$entry['status_id'] = $_SESSION[$this->appName]['preferences']['status_id']?$_SESSION[$this->appName]['preferences']['status_id']:'SC';\n $entry['priority_id'] = $_SESSION[$this->appName]['preferences']['priority_id']?$_SESSION[$this->appName]['preferences']['priority_id']:'NO'; \n $entry['reminder_email'] = $_SESSION[$this->appName]['preferences']['reminder_email']?$_SESSION[$this->appName]['preferences']['reminder_email']:''; \n $entry['reminder_popup'] = $_SESSION[$this->appName]['preferences']['reminder_popup']?$_SESSION[$this->appName]['preferences']['reminder_popup']:''; \n\t\t$entry['is_allday'] = 'N';\n\n\t\treturn parent::newEntry( $args, $entry);\n }", "function _os2dagsorden_create_agenda_meeting_create_user_form_submit($form, &$form_state) {\r\n // Create user.\r\n $values = $form_state['values'];\r\n $email = $values['email'];\r\n $full_name = $values['firstname'] . ' ' . $values['lastname'];\r\n $password = user_password(8);\r\n $fields = array(\r\n 'name' => $email,\r\n 'pass' => $password,\r\n 'mail' => $email,\r\n 'status' => 1,\r\n 'init' => 'email address',\r\n 'field_user_full_name' => array(LANGUAGE_NONE => array(array('value' => $full_name))),\r\n 'field_user_external' => array(LANGUAGE_NONE => array(array('value' => 1))),\r\n );\r\n $account = user_save('', $fields);\r\n // Send notification email.\r\n drupal_mail('user', 'password_reset', $email, NULL, array('account' => $account), variable_get('site_mail', ''));\r\n\r\n $form_state['input'] = (array) json_decode($form_state['meeting_data']);\r\n $participants = explode(',', $form_state['input']['participants_hidden']);\r\n $participants[] = $account->uid;\r\n $participants = array_diff($participants, array(''));\r\n $form_state['input']['participants_hidden'] = implode(',', $participants);\r\n if (isset($form_state['input']['start_date'])) {\r\n $timestamp = strtotime($form_state['input']['start_date']);\r\n $form_state['input']['start_date'] = array (\r\n 'date' => date('d/m/Y', $timestamp),\r\n 'time' => date('H:i', $timestamp)\r\n );\r\n }\r\n $form_state['page_num'] = 1;\r\n $form_state['rebuild'] = TRUE;\r\n\r\n}", "public static function add_event($title, $content, $start, $end, $duration, $recursion = NULL, $reference_obj_id = NULL, $admin_event_visibility = null) {\r\n global $uid, $langNotValidInput, $is_admin;\r\n $refobjinfo = References::get_ref_obj_field_values($reference_obj_id);\r\n // insert\r\n $period = \"\";\r\n $enddate = null;\r\n $d1 = DateTime::createFromFormat('d-m-Y H:i', $start);\r\n $d2 = DateTime::createFromFormat('d-m-Y H:i:s', $start);\r\n $d3 = DateTime::createFromFormat('d-m-Y H:i', $end);\r\n $d4 = DateTime::createFromFormat('d-m-Y H:i:s', $end);\r\n $title = trim($title);\r\n if (empty($title) || !(($d1 && $d1->format('d-m-Y H:i') == $start) || ($d2 && $d2->format('d-m-Y H:i:s') == $start))) {\r\n return array('success' => false, 'message' => $langNotValidInput);\r\n }\r\n $start = $d1->format('Y-m-d H:i');\r\n $end = $d3->format('Y-m-d H:i');\r\n if (!empty($recursion)) {\r\n $period = \"P\".$recursion['repeat'].$recursion['unit'];\r\n $enddate = $recursion['end'];\r\n $d1 = DateTime::createFromFormat('d-m-Y', $enddate);\r\n if (!($d1 && $d1->format('d-m-Y') == $enddate)) {\r\n return array('success' => false, 'message' => $langNotValidInput);\r\n } else {\r\n $enddate = $d1->format('Y-m-d H:i');\r\n }\r\n }\r\n\r\n // Make sure $duration has both hours and minutes part\r\n $parts = explode(':', $duration);\r\n if (empty($parts[0])) {\r\n $parts[0] = '0';\r\n }\r\n if (!isset($parts[1])) {\r\n $duration = '0:' . $parts[0];\r\n } else {\r\n if (empty($parts[1])) {\r\n $parts[1] = '00';\r\n }\r\n $duration = $parts[0] . ':' . $parts[1];\r\n }\r\n\r\n if (is_null($admin_event_visibility)) {\r\n $eventid = Database::get()->query(\"INSERT INTO personal_calendar \"\r\n . \"SET content = ?s, title = ?s, user_id = ?d, start = ?t, end =?t, duration = ?t, \"\r\n . \"recursion_period = ?s, recursion_end = ?t, \"\r\n . \"reference_obj_module = ?d, reference_obj_type = ?s, reference_obj_id = ?d, reference_obj_course = ?d\",\r\n purify($content), $title, $uid, $start, $end, $duration, $period, $enddate, $refobjinfo['objmodule'], $refobjinfo['objtype'], $refobjinfo['objid'], $refobjinfo['objcourse'])->lastInsertID;\r\n if (isset($eventid) && !is_null($eventid)) {\r\n Database::get()->query(\"UPDATE personal_calendar SET source_event_id = id WHERE id = ?d\",$eventid);\r\n }\r\n }\r\n elseif ($is_admin) {\r\n $eventid = Database::get()->query(\"INSERT INTO admin_calendar \"\r\n . \"SET content = ?s, title = ?s, user_id = ?d, start = ?t, end = ?t, duration = ?t, \"\r\n . \"recursion_period = ?s, recursion_end = ?t, \"\r\n . \"visibility_level = ?d\",\r\n purify($content), $title, $uid, $start, $end, $duration, $period, $enddate, $admin_event_visibility)->lastInsertID;\r\n if (isset($eventid) && !is_null($eventid)) {\r\n Database::get()->query(\"UPDATE admin_calendar SET source_event_id = id WHERE id = ?d\",$eventid);\r\n }\r\n }\r\n\r\n\r\n /* Additional events generated by recursion */\r\n if (isset($eventid) && !is_null($eventid) && !empty($recursion)) {\r\n $sourceevent = $eventid;\r\n $interval = new DateInterval($period);\r\n $startdatetime = new DateTime($start);\r\n $enddatetime = new DateTime($recursion['end'].\" 23:59:59\");\r\n $newdate = date_add($startdatetime, $interval);\r\n while($newdate <= $enddatetime) {\r\n\r\n $tmp_date = $newdate->format('Y-m-d');\r\n $tmp_time = date('H:i:s',strtotime($end));\r\n $end = date('Y-m-d H:i:s', strtotime(\"$tmp_date $tmp_time\"));\r\n\r\n if (is_null($admin_event_visibility)) {\r\n $neweventid = Database::get()->query(\"INSERT INTO personal_calendar \"\r\n . \"SET content = ?s, title = ?s, user_id = ?d, start = ?t, end = ?t, duration = ?t, \"\r\n . \"recursion_period = ?s, recursion_end = ?t, \"\r\n . \"source_event_id = ?d, reference_obj_module = ?d, reference_obj_type = ?s, \"\r\n . \"reference_obj_id = ?d, reference_obj_course = ?d\",\r\n purify($content), $title, $uid, $newdate->format('Y-m-d H:i'), $end, $duration, $period, $enddate, $sourceevent, $refobjinfo['objmodule'], $refobjinfo['objtype'], $refobjinfo['objid'], $refobjinfo['objcourse'])->lastInsertID;\r\n } else {\r\n $neweventid = Database::get()->query(\"INSERT INTO admin_calendar \"\r\n . \"SET content = ?s, title = ?s, user_id = ?d, start = ?t, end = ?t, duration = ?t, \"\r\n . \"recursion_period = ?s, recursion_end = ?t, \"\r\n . \"source_event_id = ?d, visibility_level = ?d\",\r\n purify($content), $title, $uid, $newdate->format('Y-m-d H:i'), $end, $duration, $period, $enddate, $sourceevent, $admin_event_visibility)->lastInsertID;\r\n }\r\n $newdate = date_add($startdatetime, $interval);\r\n }\r\n }\r\n if (is_null($admin_event_visibility)) {\r\n Log::record(0, MODULE_ID_PERSONALCALENDAR, LOG_INSERT, array('user_id' => $uid, 'id' => $eventid,\r\n 'title' => $title,\r\n 'content' => ellipsize_html(canonicalize_whitespace(strip_tags($content)), 50, '+')));\r\n } else {\r\n Log::record(0, MODULE_ID_ADMINCALENDAR, LOG_INSERT, array('user_id' => $uid, 'id' => $eventid,\r\n 'title' => $title,\r\n 'content' => ellipsize_html(canonicalize_whitespace(strip_tags($content)), 50, '+')));\r\n }\r\n return array('success' => true, 'message' => '', 'event' => $eventid);\r\n }", "function os2dagsorden_create_agenda_meeting_create_user_form($form, &$form_state) {\r\n $form_state['meeting_data'] = json_encode($form_state['values']);\r\n $form[] = array(\r\n '#markup' => '<h1 class=\"title\">' . t('External user') . '</h1>',\r\n );\r\n\r\n $form[] = array(\r\n '#markup' => '<div class=\"node\">',\r\n );\r\n $form['firstname'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Firstname'),\r\n '#size' => 60,\r\n '#maxlength' => 128,\r\n '#required' => TRUE,\r\n );\r\n $form['lastname'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Lastname'),\r\n '#size' => 60,\r\n '#maxlength' => 128,\r\n '#required' => TRUE,\r\n );\r\n $form['email'] = array(\r\n '#type' => 'textfield',\r\n '#title' => t('Email'),\r\n '#size' => 60,\r\n '#maxlength' => 128,\r\n '#required' => TRUE,\r\n '#element_validate' => array('_os2dagsorden_create_agenda_meeting_create_user_form_email_validate'),\r\n );\r\n $form['save_bullet_point'] = array(\r\n '#type' => 'submit',\r\n '#value' => t('Save'),\r\n '#submit' => array('_os2dagsorden_create_agenda_meeting_create_user_form_submit'),\r\n );\r\n $form[] = array(\r\n '#markup' => '</div>',\r\n );\r\n $form['#attached']['css'] = array(\r\n drupal_get_path('module', 'os2dagsorden_create_agenda') . '/css/form_theme.css',\r\n );\r\n return $form;\r\n}", "public function action_create($atr = null, $event_id = null)\n {\n if (Auth::has_access('comment.create'))\n {\n is_null($atr) and Response::redirect('/');\n is_null($event_id) and Response::redirect('/');\n\n $this->template->page_title = 'Pievieno komentāru!';\n $this->template->content = View::forge('comment/create');\n if ($atr == 'w' )\n {\n // 'whole' stands for comment to whole event\n $this->template->content->form_title = 'Pievieno komentāru pasākumam';\n }\n elseif ($atr == 'l')\n {\n // 'l' stands for comment to event location\n $this->template->content->form_title = 'Pievieno komentāru norises vietai';\n }\n elseif ($atr == 'd')\n {\n // 'd' stands for comment to event date\n $this->template->content->form_title = 'Pievieno komentāru norises laikam';\n }\n elseif ($atr == 'p')\n {\n // 'p' stands for comment to event participants\n $this->template->content->form_title = 'Pievieno komentāru dalībnieku skaitam';\n }\n elseif ($atr == 'f')\n {\n // 'f' stands for comment to event fee\n $this->template->content->form_title = 'Pievieno komentāru dalības maksai';\n }\n elseif ($atr == 't')\n {\n // 't' stands for comment to event takeaway\n $this->template->content->form_title = 'Pievieno komentāru līdzi ņemamajām lietām';\n }\n elseif ($atr == 'dc')\n {\n // 'dc' stands for comment to event dress code\n $this->template->content->form_title = 'Pievieno komentāru ģebšanās sitlam';\n }\n elseif ($atr == 'a')\n {\n // 'a' stands for comment to event assistants\n $this->template->content->form_title = 'Pievieno komentāru nepieciešamajiem palīgiem';\n }\n\n if (Input::method() == 'POST')\n {\n // comment submited, validate it\n if (Input::post('comment') and Input::post('comment') != '')\n {\n // check if comment isn't too long\n if (strlen(Input::post('comment')) <= 300)\n {\n // comments length is valid, create it\n $user_id = Auth::instance()->get_user_id();\n $user_id = $user_id[1];\n\n $comment = array(\n 'author_id' => $user_id,\n 'event_id' => $event_id,\n 'attribute' => $atr,\n 'message' => Input::post('comment'),\n 'created_at' => Date::time()->get_timestamp()\n );\n\n $new_comment = Model_Orm_Comment::forge($comment);\n $new_comment->save();\n\n Session::set_flash('success', 'Komentārs veiksmīgi pievienots');\n Response::redirect('event/view/'.$event_id);\n }\n else\n {\n // comment too long\n $errors[] = 'Komentāra ziņa nevar būt garāka par 300 simboliem!';\n Session::set_flash('errors', $errors);\n }\n }\n else\n {\n // comment not set\n $errors[] = 'Ievadi komentāru!';\n Session::set_flash('errors', $errors);\n }\n }\n }\n else\n {\n Response::redirect('/');\n }\n }", "public function create()\n {\n $userInfo= Auth::user()->initials; \n $now = Carbon::now()->settings([\n 'locale' => 'fr_FR',\n 'timezone' => 'Europe/Paris',\n ]);\n $weekDays = array(\n $now->startOfWeek()->addDays(7)->isoFormat('ddd D.MM'),\n $now->startOfWeek()->addDay()->isoFormat('ddd D.MM'),\n $now->startOfWeek()->addDays(2)->isoFormat('ddd D.MM'),\n $now->startOfWeek()->addDays(3)->isoFormat('ddd D.MM'),\n $now->startOfWeek()->addDays(4)->isoFormat('ddd D.MM'),\n );\n $now2 = Carbon::now()->settings([\n 'locale' => 'fr_FR',\n 'timezone' => 'Europe/Paris',\n ]);\n $weekDates = array(\n $now2->startOfWeek()->addDays(7)->format('Y-m-d H:i:s'),\n $now2->startOfWeek()->addDay()->format('Y-m-d H:i:s'),\n $now2->startOfWeek()->addDays(2)->format('Y-m-d H:i:s'),\n $now2->startOfWeek()->addDays(3)->format('Y-m-d H:i:s'),\n $now2->startOfWeek()->addDays(4)->format('Y-m-d H:i:s'),\n );\n\n $now3 = Carbon::now()->settings([\n 'locale' => 'fr_FR',\n 'timezone' => 'Europe/Paris',\n ]);\n $weekNum = $now3->addDays(7)->weekOfYear;\n $planning = Planning::where('weeknumber', $weekNum)->where('user_id', Auth::user()->id)->get();\n $startWeek= $now3->startOfWeek()->isoFormat('D.MM.YYYY');\n $endweek=$now->startOfWeek()->addDays(4)->isoFormat('DD.MM.YYYY');\n return view('am.create', ['userInfo'=>$userInfo, \n 'weekDays' => $weekDays, \n 'weekDates'=>$weekDates,\n 'weeknum'=>$weekNum,\n 'startWeek'=>$startWeek, \n 'endWeek'=>$endweek,\n 'planning' => $planning]);\n }", "public function createTask ($summary, $description, $project, $assignee, $type, $priority, $status, $component, $version) {\r\n\t\t$db = new DB();\r\n\t\t$db->connect();\r\n\t\t\r\n\t\t$summary = $db->esc($summary);\r\n\t\t$description = $db->esc($description);\r\n\t\t$project = $db->esc($project);\r\n\t\t$assignee = $db->esc($assignee);\r\n\t\t$type = $db->esc($type);\r\n\t\t$priority = $db->esc($priority);\r\n\t\t$status = $db->esc($status);\r\n\t\t$component = $db->esc($component);\r\n\t\t$version = $db->esc($version);\r\n\t\t\r\n\t\tif ($assignee == 0) {\r\n\t\t\t$assignee = \"null\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$assignee = \"'\".$assignee.\"'\";\r\n\t\t}\r\n\t\t\r\n\t\tif ($component == 0) {\r\n\t\t\t$component = \"null\";\r\n\t\t}\r\n\t\t\r\n\t\tif ($version == 0) {\r\n\t\t\t$version = \"null\";\r\n\t\t}\r\n\t\t\r\n\t\t$sql = \"INSERT INTO `task` (`summary`, `description`, `status_id`, `project_id`, `creator_id`, \r\n\t\t\t\t `assignee_id`, `createDate`, `tasktype_id`, `priority`, `active`, `component_id`, `version_id`) \r\n\t\t\t\tVALUES ('$summary', '$description', '$status', '$project', '\".$_SESSION['nobug'.RANDOMKEY.'userId'].\"',\r\n\t\t\t\t$assignee, '\".$db->toDate(time()).\"', '$type', '$priority', '1', $component, $version);\";\r\n\t\t$db->query($sql);\t\r\n\t}", "public function CreateTask()\n {\n\n $data = $this->GetParamsFromRequestBody('create');\n\n if (!isset($data['status'])) {\n $data['status'] = \"open\";\n }\n\n $data['createdby'] = $this->loggedUser->getId();\n\n $this->insertArrayIntoDatabase('todo_task', $data);\n $id = mysql_insert_id();\n\n $this->response = array(\n \"status\" => 0,\n \"id\" => $id\n );\n $this->responseStatus = 201;\n }", "function add_event($input = array()) {\r\n \r\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\r\n \r\n // check if user is logged in\r\n if (!isset($_SESSION['active']) || $_SESSION['active'] === false) {\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=login&error=err_login_to_add_event\");\r\n return;\r\n }\r\n \r\n require(HOME_DIR . 'libs/event.class.php');\r\n $event = new event;\r\n \r\n\r\n $event->creator_id = $_SESSION['user_id'];\r\n // check if title is empty\r\n if (empty($input['title'])) {\r\n $this->tpl->assign('ERROR_TITLE', 'err_title_empty');\r\n return;\r\n }\r\n $event->title = $input['title'];\r\n \r\n // check description\r\n if (empty($input['description'])) {\r\n $this->tpl->assign('ERROR_DESCRIPTION', 'err_description_empty');\r\n return;\r\n }\r\n $event->description = $input['description'];\r\n\r\n // check label\r\n $label = $input['label'];\r\n $label = json_decode($label);\r\n $event->label = $label;\r\n \r\n // check date\r\n $event->fixed_date = isset($input['fixed_date']) ? 1 : 0;\r\n $event->start_date = date('Y-m-d', mktime($input['start_date']));\r\n $event->start_time = date('h:i', mktime($input['start_time']));\r\n\r\n // check location\r\n $event->fixed_location = isset($input['fixed_location']) ? 1 : 0;;\r\n \r\n // handle number of participants\r\n $event->limited_number_of_participants = isset($input['limited_number_of_participants']) ? 1 : 0;\r\n $event->max_number_of_participants = $input['max_number_of_participants'];\r\n \r\n // handle reservations\r\n $event->advance_reservation_required = isset($input['advance_reservation_required']) ? 1 : 0; \r\n $event->confirm_reservations = isset($input['advance_reservation_required']) && isset($input['confirm_reservations']) ? 1 : 0;\r\n\r\n $event->insert_into_db();\r\n header(\"location: \" . $_SERVER['PHP_SELF'] . \"?action=dashboard&message=event_successfully_created\"); \r\n } \r\n }", "public function create() {\n $data[''] \t\t= $this->input->post('date_from'); \n $data[''] \t\t= $this->input->post('date_to');\n\t\t\n\t\t$SendData = array(\n\t\t'' => '',\n\t\t'' => ''\n\t\t);\n \n\t\t\n Template::set('toolbar_title', lang(\"atndnce_proces_title\"));\n Template::set_view('attendance_processing/attendance_processing_form');\n Template::render();\n\t\t\n }", "public function indexApCreate(){\n //This will be used to display in the Wizard of available Realms in the Create screens of Vouchers; Permanent Users; and Devices\n $user = $this->Aa->user_for_token($this);\n if(!$user){ //If not a valid user\n return;\n }\n $this->_doApListFor($user,'create'); \n }", "public function create()\n\t{\n\t\t$title = array(\n\t\t\t'active' => self::active,\n\t\t\t'title' => self::title,\n\t\t\t'slug' => self::slug\n\t\t);\n\t\treturn view('admin.announcements.create', compact('title'));\n\t}", "public function run()\n {\n Topic::create([\n 'name' => 'Чому варто купляти великий будинок?',\n ]);\n Topic::create([\n 'name' => 'Чи потребую я бдуинок?',\n ]);\n Topic::create([\n 'name' => 'Квартира чи Будинок?',\n ]);\n Topic::create([\n 'name' => 'Чому варто бути обережним при купівлі квартири?',\n ]);\n Topic::create([\n 'name' => 'Чи варто мати свій сад?',\n ]);\n\n }", "public function create()\n {\n\n $email_id = date('Y-m-d_H-i-s') . '.' . $this->template;\n $email_data = [\n 'title' => $this->template, \n 'data' => serialize($this->data), \n 'email' => $this->to,\n 'id' => $email_id,\n 'date' => date('Y-m-d H:i:s')\n ];\n\n Storage::putYAML('statamify/emails/' . $email_id, $email_data);\n\n }", "public function postCreate(Request $request) {\n\n $this->validate($request,[\n 'title' => 'required|min:3',\n 'details' => 'required|min:4'\n ]);\n\n # Mass Assignment\n $data = $request->only('title','details');\n $data['user_id'] = \\Auth::id();\n\n # One way to add the data\n #$announcement = new \\App\\Announcement($data);\n #$announcement->save();\n\n # An alternative way to add the data\n $announcement = \\App\\Announcement::create($data);\n\n # Save Tags\n $announcement->save();\n\n \\Session::flash('message','Your announcement was added');\n\n return redirect('/announcements');\n }", "public function create()\n {\n //\n return view('announcements.create');\n }", "function createTopic($name)\n\t{\n\t\tif(trim($name) == \"\")return $this->message(FORUM_URES_MEZO);\n\t\tif($this->isHavePriv(FORUM_PRIV_TOPIC_CREATE))\n\t\t\treturn mysql_query(\t\"INSERT INTO `\".$this->prefix.\"topic`(`topic_name`,`topic_cat`,`topic_created_by`,`topic_created_time`) \".\n\t\t\t\t\t\t\t\"VALUES('\".specChars($name,\"forum::createTopic\").\"',\".$this->cat_id.\",\".$this->akt_user.\",\".time().\")\");\n\t\telse return $this->message(FORUM_MESSAGE_PRIV_ERROR);\n\t}", "public function actionCreate() {\n $test = $this->tests->add($this->user->id);\n $values['test_id'] = $test->id;\n $this->questions->add($values);\n $this->redirect('Test:edit', $test->id);\n }", "public function create_task()\n {\n $title = $this->input->post('title');\n $start_date = $this->input->post('start_date');\n $due_date = $this->input->post('due_date');\n $description = $this->input->post('description');\n $user_id = $this->session->userdata('USER_ID');\n \n // get inputs - task category\n // $task_cat_name = $this->input->post('name');\n $task_cat_name = \"Medical Aid\";\n $task_cat_description =$this->input->post('description');\n \n \n // get inputs - task status\n //$task_status_name = $this->input->post('name');\n $task_status_name = \"Open\";\n $task_status_description =$this->input->post('description');\n \n \n \n $this->db->trans_start();\n \n // new task\n $this->new_task_data($title,$start_date,$due_date,$description, $user_id);\n // new task category\n $this->create_task_category($task_cat_name, $task_cat_description);\n // new task status\n $this->create_task_status($task_status_name, $task_status_description);\n \n // get all tasks\n $this->fetch_all_tasks();\n \n // update task details\n //$this->update_task($id);\n \n // delete task\n // $this->delete_task();\n \n // Complete transaction\n $this->db->trans_complete();\n \n return $this->db->trans_status();\n }", "function addActivityToTicket()\n\t{\n\t\t$input=JFactory::getApplication()->input;\n\t\t$ticketid=$input->post->get('ticketid','','INT');\n\t\t$chatlog=$input->post->get('chatlog','','STRING');\n\n\t\t$params=JComponentHelper::getParams('com_jbolo');\n\t\t//show username OR name\n\t\tif($params->get('chatusertitle')){\n\t\t\t$chatusertitle='username';\n\t\t}else{\n\t\t\t$chatusertitle='name';\n\t\t}\n\n\t\t$user=JFactory::getUser();\n\t\t$support_user_name=$user->name;\n\t\t$support_user_username=$user->username;\n\n\t\t$nid=JFactory::getApplication()->input->get('nid');\n\t\t$nodesHelper=new nodesHelper();\n\t\t$participants=$nodesHelper->getNodeParticipants($nid,$user->id,0);\n\t\t$participants=$participants['participants'];\n\t\tforeach($participants as $p)\n\t\t{\n\t\t\tif($p->uid\t!=$user->id)\n\t\t\t{\n\t\t\t\t$ticket_user=JFactory::getUser($p->uid);\n\t\t\t\t$ticket_user_name=$ticket_user->name;\n\t\t\t\t$ticket_user_username=$ticket_user->username;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//print_r($chatlog);die;\n\n\t\tif($chatusertitle=='username'){\n\t\t\t$chatlog=str_replace($support_user_username.\" : \",\"<br/><b>\".$support_user_username.\" : </b>\",$chatlog);\n\t\t}else{\n\t\t\t$chatlog=str_replace($support_user_name.\" : \",\"<br/><b>\".$support_user_name.\" : </b>\",$chatlog);\n\t\t}\n\n\t\tif($chatusertitle=='username'){\n\t\t\t$chatlog=str_replace($ticket_user_username.\" : \",\"<br/><b>\".$ticket_user_username.\" : </b>\",$chatlog);\n\t\t}else{\n\t\t\t$chatlog=str_replace($ticket_user_name.\" : \",\"<br/><b>\".$ticket_user_name.\" : </b>\",$chatlog);\n\t\t}\n\n\t\tif($chatlog && $ticketid)\n\t\t{\n\t\t\t$db=JFactory::getDBO();\n\t\t\t$sql=\"SELECT id FROM #__support_ticket WHERE ticketmask=\".$ticketid;\n\t\t\t$db->setQuery( $sql );\n\t\t\t$id_ticket=$db->loadResult();\n\n\t\t\t$sql=\"INSERT INTO #__support_note(`id_ticket`, `id_user`, `date_time`, `note`, `show`)\n\t\t\t\tVALUES('\".$id_ticket.\"', '\".$user->id.\"', '\".date(\"Y-m-d H:i:s\").\"', \".$db->quote( $chatlog ).\", '1')\";\n\t\t\t$db->setQuery( $sql );\n\t\t\t$db->execute();\n\t\t\tif($db->getErrorMsg()){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function updateUserAgendaAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $agenda->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Agenda!');\n } else {\n if (isset($data['topic'])) {\n $agenda->setTopic($data['topic']);\n }\n if (isset($data['title'])) {\n $agenda->setTitle($data['title']);\n }\n if (isset($data['notes'])) {\n $agenda->setNotes($data['notes']);\n }\n if (isset($data['start_time'])) {\n $agenda->setStart_time($data['start_time']);\n }\n if (isset($data['end_time'])) {\n $agenda->setEnd_time($data['end_time']);\n }\n if (isset($data['with_whom'])) {\n $agenda->setWith_whom($data['with_whom']);\n }\n if (isset($data['with_people'])) {\n $agenda->setWith_people(Object_People::getById($data['with_people']));\n }\n if (isset($data['location'])) {\n $agenda->setLocation($data['location']);\n }\n if (isset($data['alarm'])) {\n $agenda->setAlarm($data['alarm']);\n }\n if (isset($data['repeat_days'])) {\n $agenda->setRepeat_days($data['repeat_days']);\n }\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot update Agenda object');\n }\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n\n $this->_helper->json($agenda);\n }", "public function run()\n {\n Subject::create([\n \t'name' => 'programacion',\n \t'description' => \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit ex deleniti, sit cumque necessitatibus repellendus consequuntur optio illo ad. Accusamus veritatis, expedita nam rerum error pariatur magni ullam atque sapiente?\"\n\n ]);\n\n Subject::create([\n \t'name' => 'matematicas',\n \t'description' => \"Lorem ipsum dolor sit amet, consectetur adipisicing elit. Suscipit ex deleniti, sit cumque necessitatibus repellendus consequuntur optio illo ad. Accusamus veritatis, expedita nam rerum error pariatur magni ullam atque sapiente?\"\n\n ]);\n }", "public function create()\n {\n if (Sentry::check()) {\n // Find active user and set default variables to null\n $user = Sentry::getUser();\n $groups = null;\n $schoolName = null;\n\n // Permission checks\n if ($user->hasAnyAccess(['school', 'event'])) {\n\n // If user is a superAdmin, show all possible groups to add an event to\n if ($user->hasAccess(['school'])) {\n $groups = Group::where('school_id', '<>', '')->get();\n $opening = '';\n } else {\n // If the user isn't a superAdmin, only show the groups to which the user has permissions\n $user->load('school.groups.appointments');\n $groups = $user->school->groups;\n $opening = $user->school->opening;\n }\n\n // Transform recieved objectList (from database) into array to send with view\n $smartgroup = [];\n foreach ($groups as $group) {\n $smartgroup[$group->id] = $group->name;\n }\n\n // Show the form where users can add appointments\n return View::make('calendar.create')->with('groups', $smartgroup)->with('opening', $opening);\n\n } else {\n // If no permissions, redirect the user to the calendar index page\n return Redirect::route('calendar.index');\n }\n } else {\n return Redirect::route('landing');\n }\n }", "public function create(){\n $this->isAuthorize();\n\n // Load the Create View\n $userID = $this->request->session()->get('userID');\n //echo $userID;die();\n $allEvents = Apt_event::where('userID','=',$userID)->pluck('evtName', 'id');\n //DB::enableQueryLog();\n $allEmployee = DB::table('users AS u')\n ->join('role_user AS ur', 'u.id', '=', 'ur.id')\n ->select('u.id','u.name')\n ->where('ur.userType', '=', 4)\n ->where('ur.parentID', '=', $userID)\n ->orderBy('ur.user_id', 'ASC')\n ->pluck('name', 'id');\n //dd(DB::getQueryLog());\n return view('appointments.timeslot.create', compact('allEvents', 'allEmployee'));\n }", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n } \n $this->Notes->add($user);\n }", "public function create()\n\t{\n\t \n\t \n\t return view('admin.schedule.create');\n\t}", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_time/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_time.create')\n;\n\t}", "public function create()\n {\n return view('system-mgmt/evento/create');\n }", "public function create()\n {\n \n echo \"Syntax: POST: /api?telefon=*telefon*&id_agencija=*id*<br>/api?email=*email*&id_agencija=*id*\";\n \n }", "public function createAnswer()\n {\n $this->is_answer = true;\n $this->topic->is_answered = true;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "function create( $obj )\n\t{\n\t\t$data = array(\n\t\t\t'user_id' => $obj->user_id,\n\t\t\t'action_text' => $obj->action_text,\n\t\t\t'action_created' => getNow()\n\t\t);\n\n\t\t// Insert the data\n\t\tif ( $this->db->insert( 'actions', $data ) )\n\t\t{\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function create($title,$body,$time_to_trigger,$status)\n {\n try {\n // Dispensing a new reminder bean\n $reminder = R::dispense('reminder');\n\n // Setting related properties.\n $reminder->title = $title;\n $reminder->body = $body;\n $reminder->time_to_trigger = $time_to_trigger;\n $reminder->status = $status;\n $reminder->user_id = $this->user_id;\n\n // Storing our reminder\n R::store($reminder);\n\n // Setting a flash for the user\n Flash::set('Your reminder has been created.','success');\n\n // And returning true\n return true;\n } catch(\\Exception $e) {\n\n // Letting the user know that there was a problem.\n Flash::set('There was an error processing your request');\n return false;\n } catch(RedException $e) {\n\n // Letting the user know that there was a problem.\n Flash::set('There was an error processing your request');\n return false;\n }\n }", "public function create()\n {\n $this->page->setTitle('Agenda Create');\n return view('data-entry.agenda.create')->with([\n 'page' => $this->page\n ]);\n }", "function createReminder($user_id, $time, $timezone, $subject, $content, $repeat = false) {\n\tif($timezone !== false) {\n\t\t@date_default_timezone_set($timezone);\n\t}\n\t\n\tif($repeat !== \"hour\" && $repeat !== \"week\" && $repeat !== \"day\" && $repeat !== \"month\") {\n\t\t$repeat = '';\n\t}\n\t\n\t$user_id = escape($user_id);\n\t$time = strtotime($time);\n\t$subject = escape($subject);\n\t$content = escape($content);\n\t\n\tif($time === false) {\n\t\treturn \"failed to parse time\";\n\t} else if($time < time()) {\n\t\treturn \"time needs to be in the future\";\n\t} else if(strlen($subject) > 256) {\n\t\treturn \"subject is too long\";\n\t} else if(strlen($content) > 10000) {\n\t\treturn \"content is too long\";\n\t}\n\t\n\tmysql_query(\"INSERT INTO reminders (user_id, time, title, content, `repeat`) VALUES ('$user_id', '$time', '$subject', '$content', '$repeat')\");\n\treturn true;\n}", "public function create()\n {\n \treturn view('admin.subject.add');\n }", "public function create() {\n \n if (!Session::has('users')) {\n return redirect()->intended('/auth/login');\n }\n $uid = Session::get('users')->id;\n /* Right mgmt start */\n $rightId = 2;\n $currentChannelId = $this->rightObj->getCurrnetChannelId($rightId);\n $channels = $this->rightObj->getAllowedChannels($rightId);\n if (!$this->rightObj->checkRights($currentChannelId, $rightId))\n return redirect('/dashboard');\n /* Right mgmt end */\n $postAs = AuthorType::where('valid', '=', '1')->orderBy('label')->get();\n $p1 = DB::table('author_type')->where('valid', '1')->pluck('label', 'author_type_id');\n //$country = Country::where('valid', '=', '1')->get();\n //$states = State::where('valid', '=', '1')->orderBy('name')->get();\n $newstype = DB::table('news_type')->where('valid', '1')->get();\n $category = DB::table('category')->where('valid', '1')->where('parent_id','0')->orderBy('name')->get();\n $album = DB::table('album')->orderBy('id','desc')->get();\n $whatsup = DB::table('tbl_whatsapp_article')->select(DB::raw('count(id) as cn'),'publish_date','publish_time')->where('publish_date',date('Y-m-d'))->first();\n $timestamp = strtotime($whatsup->publish_time) + 60*60 + 60*60;\n $whtasuptime = date('H:i:s', $timestamp);\n //$campaign = DB::table('campaign')->where('channel_id', $currentChannelId)->where('valid', '1')->get();\n return view('articles.create', compact('channels', 'p1','album', 'postAs', 'country', 'states', 'newstype', 'category', 'event', 'campaign', 'tags', 'currentChannelId','whatsup','whtasuptime'));\n }", "public function actionCreate($type=null)\r\n {\r\n $model = new Announce();\r\n if ($model->load(Yii::$app->request->post())) {\r\n $user = Yii::$app->user->identity;\r\n\r\n $model->author = $user->username;\r\n $model->author_id = $user->id;\r\n\r\n if ($model->save()) {\r\n Yii::$app->session->setFlash('success', '发布公告成功');\r\n return $this->json();\r\n } else {\r\n return $this->json(null, '发布公告失败,请重试',0);\r\n }\r\n\r\n } else {\r\n\r\n $model->type = $type;\r\n return $this->renderAjax('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function createTask(){\n //date_default_timezone_set('Europe/Paris');\n $bdd = $this->connectDB();\n\t\t//faire les contrôles de saisie en JS\n $team=htmlspecialchars($_POST['create-task-team']);\n $flow=htmlspecialchars($_POST['create-task-flow']);\n $title=htmlspecialchars($_POST['create-task-title']);\n $priority=htmlspecialchars($_POST['create-task-priority']);\n $description=htmlspecialchars($_POST['create-task-description']);\n if (isset($_POST['create-task-assignee'])){\n $assignee=htmlspecialchars($_POST['create-task-assignee']);\n }else{\n $assignee='';\n }\n\n //get task status\n $req=$bdd->prepare('SELECT status.id AS status_id FROM status, flow WHERE flow.id=status.id_flow AND status.position=0 AND flow.id= ?');\n $req->execute(array($flow));\n\n if ($req->rowCount()){\n $row = $req->fetch();\n $status=$row['status_id'];\n }\n\n $creator=$_SESSION['id'];\n $last_modifier=$_SESSION['id'];\n $creation_date=date(\"Y-m-d H:i:s\");\n $last_modif_date=date(\"Y-m-d H:i:s\");\n $target_date=$_POST['create-task-target'];\n\n\n //insert record in table task\n\t\t$inserttask=$bdd->prepare('INSERT INTO task(title,description,creator,creation_date,assignee,last_modifier,last_modification_date,target_delivery_date,team,flow,status,priority) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)');\n\t\t$inserttask->execute(array($title,$description,$creator,$creation_date,$assignee,$last_modifier,$last_modif_date,$target_date,$team,$flow,$status,$priority));\n\n //update history\n $history_manager=new historyManager();\n $history_manager->addEvent($team,'task_creation',$bdd->lastInsertId());\n\n $bdd=null;\n }", "function createNote();", "public function create()\n {\n $user = Auth::user();\n if($user->hasRole('admin')) {\n return view('announcements.create')->with(['title' => 'Ankündigung erstellen', 'active' => $this->active]);\n } else {\n return Redirect::route('announcements.index')->with('message', 'Herst! Das darfst du nicht...');\n }\n }", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $this->Notes->add($user);\n }", "function Create()\n\t{\n\t\tif (!ss9024kwehbehb($this)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\t$this->FilterData();\n\n\t\tif (!$this->Validate('create')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$processed_unique_token = API_USERS::generateUniqueToken(SENDSTUDIO_LICENSEKEY . $this->username);\n\t\t$processed_password = API_USERS::generatePasswordHash($this->password, $processed_unique_token);\n\n\t\tif (!is_array($this->eventactivitytype)) {\n\t\t\t$this->eventactivitytype = array();\n\t\t}\n\n\t\tif ($this->trialuser == '1') {\n\t\t\t$agency_variables = get_agency_license_variables();\n\n\t\t\t$this->admintype = 'c';\n\t\t}\n\n\t\t$query = \"\n\t\t\tINSERT INTO [|PREFIX|]users (\n\t\t\t\tgroupid, username, password, unique_token, status, emailaddress, fullname,\n\t\t\t\ttrialuser, admintype, listadmintype, templateadmintype, segmentadmintype,\n\t\t\t\teditownsettings, usertimezone,\n\t\t\t\ttextfooter, htmlfooter,\n\t\t\t\tinfotips,\n\t\t\t\tsmtpserver, smtpusername, smtppassword, smtpport,\n\t\t\t\tcreatedate, lastloggedin,\n\t\t\t\tenableactivitylog, usewysiwyg, xmlapi, xmltoken,\n\t\t\t\tgettingstarted, googlecalendarusername, googlecalendarpassword,\n\t\t\t\teventactivitytype,\n\t\t\t\tadminnotify_email, adminnotify_send_flag, adminnotify_send_threshold,\n\t\t\t\tadminnotify_send_emailtext, adminnotify_import_flag, adminnotify_import_threshold, adminnotify_import_emailtext\n\t\t\t) VALUES (\n\t\t\t\t\" . intval($this->groupid) . \", '\" . $this->Db->Quote($this->username) . \"', '\" . $this->Db->Quote($processed_password) . \"', '\" . $this->Db->Quote($processed_unique_token) . \"', '\" . intval($this->status) . \"', '\" . $this->Db->Quote($this->emailaddress) . \"', '\" . $this->Db->Quote($this->fullname) . \"',\n\t\t\t\t'\" . ($this->trialuser == '1' ? '1' : '0') . \"', '\" . $this->Db->Quote($this->admintype) . \"', '\" . $this->Db->Quote($this->listadmintype) . \"', '\" . $this->Db->Quote($this->templateadmintype) . \"', '\" . $this->Db->Quote($this->segmentadmintype) . \"',\n\t\t\t\t'\" . intval($this->editownsettings) . \"', '\" . $this->Db->Quote($this->usertimezone) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->textfooter) . \"', '\" . $this->Db->Quote($this->htmlfooter) . \"',\n\t\t\t\t'\" . intval($this->infotips) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->smtpserver) . \"', '\" . $this->Db->Quote($this->smtpusername) . \"', '\" . $this->Db->Quote(base64_encode($this->smtppassword)) . \"', \" . intval($this->smtpport) . \",\n\t\t\t\t\" . time() . \", 0,\n\t\t\t\t'\" . intval($this->enableactivitylog) . \"', '\" . intval($this->usewysiwyg) . \"', '\" . intval($this->xmlapi) . \"', '\" . $this->Db->Quote($this->xmltoken) . \"'\n\t\t\t\t,\" . intval($this->gettingstarted) . \", '\" . $this->Db->Quote($this->googlecalendarusername) . \"', '\" . $this->Db->Quote($this->googlecalendarpassword) . \"', '\" . serialize($this->eventactivitytype) . \"',\n\t\t\t\t'\" . $this->Db->Quote($this->adminnotify_email) . \"', '\" . intval($this->adminnotify_send_flag) . \"', '\" . intval($this->adminnotify_send_threshold) . \"', '\" . $this->Db->Quote($this->adminnotify_send_emailtext) . \"',\n\t\t\t\t'\" . intval($this->adminnotify_import_flag) . \"', '\" . intval($this->adminnotify_import_threshold) . \"', '\" . $this->Db->Quote($this->adminnotify_import_emailtext) . \"'\n\t\t\t)\n\t\t\";\n\n\t\t// We want to get the userid once it is created.\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$query .= ' RETURNING userid';\n\t\t}\n\n\t\t$this->Db->StartTransaction();\n\t\t$result = $this->Db->Query($query);\n\n\t\tif (!$result) {\n\t\t\t$this->Db->CommitTransaction();\n\t\t\treturn false;\n\t\t}\n\n\t\tif (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {\n\t\t\t$userid = $this->Db->FetchOne($result, 'userid');\n\t\t} else {\n\t\t\t$userid = $this->Db->LastId(SENDSTUDIO_TABLEPREFIX . 'users_sequence');\n\t\t}\n\n\t\t$this->userid = $userid;\n\t\t\n\t\t$status = (create_user_dir($userid) === true);\n\n\t\tif (!$status) {\n\t\t\t$this->Db->RollbackTransaction();\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->Db->CommitTransaction();\n\t\t$this->_cacheUserTypeCount = false;\n\t\treturn $userid;\n\t}", "public function create_($user_id, $content) \n\t{ \n\t\t$this->clear();\n\t\t$this->user_id = $user_id;\n\t\t$this->content = $content;\n\t\t$this->date_published = time();\n\t\treturn $this->save();\n\n\t}", "public function create()\n\t{\n\t\t// Set the title\n\t\t$this->template->title(lang('calendars:button:new_calendar'));\n\n\t\t// If this is a post, set the str_id\n\t\tif ($_POST)\n\t\t{\n\n\t\t\t// Set the str_id\n\t\t\t$_POST['str_id'] = rand_string(10);\n\n\t\t\t// Set default colors\n\t\t\tif ( empty($_POST['bg_color']) ) $_POST['bg_color'] = '3366cc';\n\t\t\tif ( empty($_POST['text_color']) ) $_POST['text_color'] = 'ffffff';\n\t\t\tif ( ! isset($_POST['sharing']) ) $_POST['sharing'] = NULL;\n\t\t}\n\n\t\t/* Start normal Streams_Core stuff\n\t\t----------------------------------------------------------------------------*/\n\n\t\t// Set some shit\n\t\t$extra = array(\n\t\t\t'return'\t\t\t=> 'admin/calendars',\n\t\t\t'success_message'\t=> lang('calendars:success:new_calendar'),\n\t\t\t'failure_message'\t=> lang('calendars:error:new_calendar'),\n\t\t\t'title'\t\t\t\t=> lang('calendars:button:new_calendar'),\n\t\t);\n\n\t\t// We will set these ourselves\n\t\t$skip = array('str_id');\n\n\t\t// Build it\n\t\t$this->streams->cp->entry_form('calendars', 'calendars', $mode = 'new', null, true, $extra, $skip, $this->_tabs);\n\t}", "public function create()\n\t{\n\t\treturn View::make('administrator.events.create')->with('page_title','Create New Event');\n\t\t\n\t}", "public function createTicket()\n {\n Zendesk::tickets()->create([\n 'subject' => 'Subject',\n 'comment' => [\n 'body' => 'Ticket content.'\n ],\n 'priority' => 'normal'\n ]);\n return \"success\";\n }", "function createactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $name = $this->input->post('name');\n $multiplicity = $this->input->post('multiplicity');\n $severity = $this->input->post('severity');\n $unit = $this->input->post('unit');\n $desc = $this->input->post('desc');\n $this->m_activities->create($wl_id, $name, $multiplicity, $severity, $unit, $desc);\n $this->activities();\n }", "public function create()\n {\n return view('backend.topics.create');\n }", "public function create()\n {\n return view('admin.announcements.create');\n }", "public function create(): void {\n\t\t$rawdata = array(\n\t\t\t'datetime' => $this->request->request->get('datetime', null),\n\t\t\t'priority' => $this->request->request->getInt('priority', 1),\n\t\t\t'description' => $this->request->request->get('description'),\n\t\t);\n\n\t\t$rawdata['datetime'] ??= new DateTime();\n\n\t\tif ($rawdata['description'] !== '') {\n\t\t\tpreg_match('/^(.+?) ?(?:\\\\[(\\\\d+)\\\\]|)$/', strip_tags($rawdata['description'] ?? ''), $matches);\n\t\t\t$rawdata['description'] = $matches[1];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'name' => $rawdata['description'],\n\t\t\t'donereward' => $matches[2] ?? 0,\n\t\t\t'priority' => $rawdata['priority'],\n\t\t\t'duedate' => $rawdata['datetime'],\n\t\t\t'user' => $this->user\n\t\t);\n\n\t\t$task = $this->di_repo->new(TaskModel::class, $data);\n\n\t\tif (($validResult = $task->valid()) === true) {\n\t\t\tif (!$task->save()) {\n\t\t\t\tthrow new RuntimeException('Could not save new task valid?:'.var_export($task->valid(), true));\n\t\t\t}\n\n\t\t\t$this->view->set('errors', false);\n\t\t} else {\n\t\t\t$this->view->set('errors', $validResult->getAll());\n\t\t}\n\n\t\t$this->respondTo('json');\n\t}", "public function create($workfromhomeObj, $data, $userId, $url) {\n $user = $this->query->find('Users\\Entity\\User', $userId);\n $data['user'] = $user;\n $data['dateOfSubmission'] = \"now\";\n $data['status'] = WorkFromHomeEntity::STATUS_SUBMITTED;\n $this->query->setEntity('Requests\\Entity\\WorkFromHome')->save($workfromhomeObj, $data);\n $text = $user->name . ' is Asking for a work from home request from ' . $data['startDate'] . ' to ' . $data['endDate'];\n $this->notificationsModel->create($text, $url);\n }", "public function create()\n {\n return redirect()->route('topic.index');\n }", "public function create()\n\t{\n\t\treturn view('events.create');\n\t}", "public function actionCreate() {}", "public function actionCreate() {}", "public function run()\n {\n Announcement::create([\n 'title' => 'Pengumuman Libur',\n 'announcement_category_id' => 1,\n 'slug' => Str::slug('Pengumuman Libur'),\n 'body' => '<p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus consequat commodo risus eu malesuada. Aliquam eu libero tincidunt, egestas massa in, ullamcorper lorem. Maecenas sit amet aliquet risus. Praesent varius augue a tempor lobortis. Cras auctor ac arcu a porta. Sed sodales laoreet dui, at feugiat magna porttitor non. Sed egestas, justo a consequat egestas, quam sapien malesuada justo, non tempus sapien ante congue odio. In arcu magna, suscipit nec pellentesque ac, maximus sit amet velit. Phasellus sit amet urna a nunc efficitur hendrerit et non velit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus placerat finibus purus a mollis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent vitae posuere sapien.</p><p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">Donec auctor urna nibh, vitae facilisis nunc porttitor quis. Nunc non metus turpis. Nullam ornare feugiat orci, at ornare sem dignissim eu. Maecenas mattis augue eu luctus aliquet. Vivamus felis tellus, eleifend eget scelerisque sed, bibendum sit amet justo. Suspendisse potenti. Integer congue at felis vel tristique. Ut vel bibendum mauris, ac blandit orci. Curabitur sollicitudin nunc eu mi lobortis pulvinar. In sit amet dolor eget elit posuere placerat vel quis tellus. Praesent facilisis pharetra tellus, et pretium urna faucibus in. Phasellus mauris metus, euismod ut arcu nec, gravida auctor augue. Duis a congue lacus, vitae placerat nibh. Praesent semper diam eget bibendum efficitur. Aliquam rutrum turpis eros, hendrerit sollicitudin leo faucibus non.</p><p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">In porta cursus ante at iaculis. Sed scelerisque eu tellus nec ultricies. Fusce iaculis finibus nisi et sollicitudin. Nunc vitae tortor sit amet mauris pulvinar pulvinar. Aliquam erat volutpat. Sed maximus, tortor ut eleifend cursus, odio leo blandit ligula, nec eleifend velit nunc vel sem. Donec tincidunt nulla erat, eget rhoncus elit egestas vel. Phasellus porttitor porta rutrum. Sed auctor cursus urna, a pulvinar nibh pellentesque dapibus. Phasellus in ex ligula. Pellentesque vitae lacus et nulla vestibulum venenatis. Donec sed enim nibh.</p>'\n ]);\n\n\n Announcement::create([\n 'title' => 'Pengumuman Pengambilan Rapor',\n 'announcement_category_id' => 1,\n 'slug' => Str::slug('Pengumuman Pengambilan Rapor'),\n 'body' => '<p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus consequat commodo risus eu malesuada. Aliquam eu libero tincidunt, egestas massa in, ullamcorper lorem. Maecenas sit amet aliquet risus. Praesent varius augue a tempor lobortis. Cras auctor ac arcu a porta. Sed sodales laoreet dui, at feugiat magna porttitor non. Sed egestas, justo a consequat egestas, quam sapien malesuada justo, non tempus sapien ante congue odio. In arcu magna, suscipit nec pellentesque ac, maximus sit amet velit. Phasellus sit amet urna a nunc efficitur hendrerit et non velit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus placerat finibus purus a mollis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent vitae posuere sapien.</p><p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">Donec auctor urna nibh, vitae facilisis nunc porttitor quis. Nunc non metus turpis. Nullam ornare feugiat orci, at ornare sem dignissim eu. Maecenas mattis augue eu luctus aliquet. Vivamus felis tellus, eleifend eget scelerisque sed, bibendum sit amet justo. Suspendisse potenti. Integer congue at felis vel tristique. Ut vel bibendum mauris, ac blandit orci. Curabitur sollicitudin nunc eu mi lobortis pulvinar. In sit amet dolor eget elit posuere placerat vel quis tellus. Praesent facilisis pharetra tellus, et pretium urna faucibus in. Phasellus mauris metus, euismod ut arcu nec, gravida auctor augue. Duis a congue lacus, vitae placerat nibh. Praesent semper diam eget bibendum efficitur. Aliquam rutrum turpis eros, hendrerit sollicitudin leo faucibus non.</p><p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">In porta cursus ante at iaculis. Sed scelerisque eu tellus nec ultricies. Fusce iaculis finibus nisi et sollicitudin. Nunc vitae tortor sit amet mauris pulvinar pulvinar. Aliquam erat volutpat. Sed maximus, tortor ut eleifend cursus, odio leo blandit ligula, nec eleifend velit nunc vel sem. Donec tincidunt nulla erat, eget rhoncus elit egestas vel. Phasellus porttitor porta rutrum. Sed auctor cursus urna, a pulvinar nibh pellentesque dapibus. Phasellus in ex ligula. Pellentesque vitae lacus et nulla vestibulum venenatis. Donec sed enim nibh.</p>'\n ]);\n\n\n Announcement::create([\n 'title' => 'Pengumuman Beasiswa',\n 'announcement_category_id' => 2,\n 'slug' => Str::slug('Pengumuman Beasiswa'),\n 'body' => '<p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus consequat commodo risus eu malesuada. Aliquam eu libero tincidunt, egestas massa in, ullamcorper lorem. Maecenas sit amet aliquet risus. Praesent varius augue a tempor lobortis. Cras auctor ac arcu a porta. Sed sodales laoreet dui, at feugiat magna porttitor non. Sed egestas, justo a consequat egestas, quam sapien malesuada justo, non tempus sapien ante congue odio. In arcu magna, suscipit nec pellentesque ac, maximus sit amet velit. Phasellus sit amet urna a nunc efficitur hendrerit et non velit. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus placerat finibus purus a mollis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent vitae posuere sapien.</p><p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">Donec auctor urna nibh, vitae facilisis nunc porttitor quis. Nunc non metus turpis. Nullam ornare feugiat orci, at ornare sem dignissim eu. Maecenas mattis augue eu luctus aliquet. Vivamus felis tellus, eleifend eget scelerisque sed, bibendum sit amet justo. Suspendisse potenti. Integer congue at felis vel tristique. Ut vel bibendum mauris, ac blandit orci. Curabitur sollicitudin nunc eu mi lobortis pulvinar. In sit amet dolor eget elit posuere placerat vel quis tellus. Praesent facilisis pharetra tellus, et pretium urna faucibus in. Phasellus mauris metus, euismod ut arcu nec, gravida auctor augue. Duis a congue lacus, vitae placerat nibh. Praesent semper diam eget bibendum efficitur. Aliquam rutrum turpis eros, hendrerit sollicitudin leo faucibus non.</p><p style=\"margin-right: 0px; margin-bottom: 15px; margin-left: 0px; padding: 0px; text-align: justify; color: rgb(0, 0, 0); font-family: &quot;Open Sans&quot;, Arial, sans-serif; font-size: 14px;\">In porta cursus ante at iaculis. Sed scelerisque eu tellus nec ultricies. Fusce iaculis finibus nisi et sollicitudin. Nunc vitae tortor sit amet mauris pulvinar pulvinar. Aliquam erat volutpat. Sed maximus, tortor ut eleifend cursus, odio leo blandit ligula, nec eleifend velit nunc vel sem. Donec tincidunt nulla erat, eget rhoncus elit egestas vel. Phasellus porttitor porta rutrum. Sed auctor cursus urna, a pulvinar nibh pellentesque dapibus. Phasellus in ex ligula. Pellentesque vitae lacus et nulla vestibulum venenatis. Donec sed enim nibh.</p>'\n ]);\n }", "public function create()\n {\n return view('admin.add_announcement');\n }", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function vxTopicCreateCheck($options, $User) {\n\t\t$rt = array();\n\t\t\n\t\t$rt['out_of_money'] = false;\n\t\t\n\t\tswitch ($options['mode']) {\n\t\t\tcase 'board':\n\t\t\t\t$rt['mode'] = 'board';\n\t\t\t\t\n\t\t\t\t$board_id = $rt['board_id'] = $options['board_id'];\n\t\t\t\t\n\t\t\t\t$Node = new Node($rt['board_id'], $this->db);\n\t\t\t\t$Section = new Node($Node->nod_pid, $this->db);\n\t\t\t\tbreak;\n\n\t\t\tcase 'section':\n\t\t\t\t$rt['mode'] = 'section';\n\t\t\t\t\n\t\t\t\t$section_id = $rt['section_id'] = $options['section_id'];\n\t\t\t\t\n\t\t\t\t$Section = new Node($rt['section_id'], $this->db);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$rt['exp_amount'] = 0;\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['tpc_title_value'] = '';\n\t\t/* tpc_title_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow\n\t\t3 => invalid characters\n\t\t999 => unspecific */\n\t\t$rt['tpc_title_error'] = 0;\n\t\t$rt['tpc_title_error_msg'] = array(1 => '你忘记写标题了', 2 => '你的这个标题太长了', 3 => '你的标题中含有不被允许的字符');\n\t\t\n\t\t$rt['tpc_pid_value'] = 0;\n\t\t$rt['tpc_pid_error'] = 0;\n\t\t$rt['tpc_pid_error_msg'] = array(1 => '请选择一个讨论区');\n\t\t\n\t\t$rt['tpc_description_value'] = '';\n\t\t/* tpc_description_error:\n\t\t0 => no error\n\t\t2 => overflow\n\t\t999 => unspecific */\n\t\t$rt['tpc_description_error'] = 0;\n\t\t$rt['tpc_description_error_msg'] = array(2 => '你的这个描述太长了');\n\t\t\n\t\t$rt['tpc_content_value'] = '';\n\t\t/* tpc_content_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow\n\t\t999 => unspecific */\n\t\t$rt['tpc_content_length'] = 0;\n\t\t$rt['tpc_content_error'] = 0;\n\t\t$rt['tpc_content_error_msg'] = array(1 => '你忘记写内容了', 2 => '你的这篇主题的内容太长了');\n\t\t\n\t\tif (isset($_POST['tpc_title'])) {\n\t\t\t$rt['tpc_title_value'] = make_single_safe($_POST['tpc_title']);\n\t\t\tif (strlen($rt['tpc_title_value']) > 0) {\n\t\t\t\tif (mb_strlen($rt['tpc_title_value'], 'utf-8') > 50) {\n\t\t\t\t\t$rt['tpc_title_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['tpc_title_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['tpc_title_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\t\n\t\tif ($rt['mode'] == 'section') {\n\t\t\tif (isset($_POST['tpc_pid'])) {\n\t\t\t\t$rt['tpc_pid_value'] = intval($_POST['tpc_pid']);\n\t\t\t\t$sql = \"SELECT nod_id FROM babel_node WHERE nod_pid = {$rt['section_id']} AND nod_id = {$rt['tpc_pid_value']}\";\n\t\t\t\t$rs = mysql_query($sql, $this->db);\n\t\t\t\tif (mysql_num_rows($rs) != 1) {\n\t\t\t\t\t$rt['tpc_pid_error'] = 1;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t\tmysql_free_result($rs);\n\t\t\t} else {\n\t\t\t\t$rt['tpc_pid_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['tpc_pid_value'] = $rt['board_id'];\n\t\t}\n\t\t\n\t\t\n\t\tif (isset($_POST['tpc_description'])) {\n\t\t\t$rt['tpc_description_value'] = make_multi_safe($_POST['tpc_description']);\n\t\t\tif (strlen($rt['tpc_description_value']) > 1000) {\n\t\t\t\t$rt['tpc_description_error'] = 2;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($_POST['tpc_content'])) {\n\t\t\t$rt['tpc_content_value'] = make_multi_safe($_POST['tpc_content']);\n\t\t\t$rt['tpc_content_length'] = mb_strlen($rt['tpc_content_value'], 'UTF-8');\n\t\t\tif ($rt['tpc_content_length'] > 0) {\n\t\t\t\tif ($rt['tpc_content_length'] > 10240) {\n\t\t\t\t\t$rt['tpc_content_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['tpc_content_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['tpc_content_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif ($rt['tpc_content_error'] == 0) {\n\t\t\t$tpc_content_length = mb_strlen($rt['tpc_content_value'], 'utf-8');\n\t\t\tif ($tpc_content_length > 500) {\n\t\t\t\t$rt['exp_amount'] = -(intval(($tpc_content_length / 500) * (BABEL_TPC_PRICE)));\n\t\t\t} else {\n\t\t\t\t$rt['exp_amount'] = -(BABEL_TPC_PRICE);\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['exp_amount'] = -(BABEL_TPC_PRICE);\n\t\t}\n\t\t\n\t\tif ((abs($rt['exp_amount']) * 1.2) > $User->usr_money) {\n\t\t\t$rt['errors']++;\n\t\t\t$rt['out_of_money'] = true; \n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "public function create()\n\t{\n\t\t$image = $this->uploadImage();\n if ($image) {\n $this->data('image', $image);\n }\n\t\t$this->data([\n\t\t\t'story_title' => $this->request->post('story_title'),\n\t\t\t'story_name' => $this->request->post('story_name'),\n\t\t\t'details' => $this->request->post('details'),\n\t\t\t'status' => $this->request->post('status'),\n\t\t\t'created_at' => date('Y-m-d H:i:s'),\n\t\t])->insert($this->table);\n\t}", "public function completeNote($args) {\n if (!SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_READ)) {\n throw new Zikula_Exception_Fatal($this->__('Sorry! No authorization to access this module.'));\n }\n\n $aid = $this->request->getPost()->get('aid', '');\n if (!$aid) {\n throw new Zikula_Exception_Fatal($this->__('no note id'));\n }\n\n $daid = $this->request->getPost()->get('daid', '');\n\n //get the note\n $note = ModUtil::apiFunc('IWagendas', 'user', 'get', array('aid' => $aid));\n if ($note == false) {\n throw new Zikula_Exception_Fatal($this->__('Event not found'));\n }\n \n // Get the color configuration and assign them to the view object\n $colors = explode('|', ModUtil::getVar('IWagendas', 'colors'));\n //Comprovem que l'usuari pugui accedir a l'agenda\n if ($daid != 0) {\n //Estem entrant a una agenda multiusuari\n //Carreguem les dades de l'agenda\n $agenda = ModUtil::apiFunc('IWagendas', 'user', 'getAgenda', array('daid' => $daid));\n // Check whether the user can access the agenda for this action\n $te_acces = ModUtil::func('IWagendas', 'user', 'te_acces', array('daid' => $daid,\n 'grup' => $agenda['grup'],\n 'resp' => $agenda['resp'],\n 'activa' => $agenda['activa']));\n // If the user has no access, show an error message and stop execution\n if ($te_acces < 3 || ($te_access == 3 && $note['usuari'] != UserUtil::getVar('uid'))) {\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n }\n }\n if ($note['daid'] == $daid) {\n $completa = ($note['completa'] == 1) ? 0 : 1;\n $items = array('completa' => $completa);\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid) {\n throw new Zikula_Exception_Fatal($this->__('Error'));\n }\n } else {\n $uid = UserUtil::getVar('uid');\n $completedByUser = ($note['completedByUser'] == '') ? '$' : $note['completedByUser'];\n if (strpos($completedByUser, '$' . $uid . '$') !== false) {\n $completedByUser = str_replace('$' . $uid . '$', '', $completedByUser);\n $completa = 0;\n } else {\n $completedByUser .= '$' . $uid . '$';\n $completa = 1;\n }\n $items = array('completedByUser' => $completedByUser);\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid) {\n //Success\n //LogUtil::registerStatus ($this->__('Protection status updated'));\n throw new Zikula_Exception_Fatal($this->__('Error'));\n }\n }\n if ($completa == 1) {\n $alt = ($daid != 0) ? $this->__('Show') : $this->__('Mark as not completed');\n $bgcolor = $colors[14];\n } else {\n $alt = ($daid != 0) ? $this->__('Hide') : $this->__('Mark as completed');\n $bgcolor = $colors[13];\n }\n \n return new Zikula_Response_Ajax(array('aid' => $aid,\n 'completed' => $completa,\n 'daid' => $daid,\n 'alt' => $alt,\n 'bgcolor' => '#' . $bgcolor));\n }", "public function vxTopicCreateInsert($board_id, $user_id, $tpc_title, $tpc_description, $tpc_content, $expense_amount) {\n\t\tif (get_magic_quotes_gpc()) {\n\t\t\t$tpc_title = stripslashes($tpc_title);\n\t\t\t$tpc_title = mysql_real_escape_string($tpc_title);\n\t\t\t\n\t\t\t$tpc_description = stripslashes($tpc_description);\n\t\t\t$tpc_description = mysql_real_escape_string($tpc_description);\n\t\t\t\n\t\t\t$tpc_content = stripslashes($tpc_content);\n\t\t\t$tpc_content = mysql_real_escape_string($tpc_content);\n\t\t} else {\n\t\t\t$tpc_title = mysql_real_escape_string($tpc_title);\n\t\t\t$tpc_description = mysql_real_escape_string($tpc_description);\n\t\t\t$tpc_content = mysql_real_escape_string($tpc_content);\n\t\t}\n\t\t$sql = \"INSERT INTO babel_topic(tpc_pid, tpc_uid, tpc_title, tpc_description, tpc_content, tpc_created, tpc_lastupdated, tpc_lasttouched) VALUES({$board_id}, {$user_id}, '{$tpc_title}', '{$tpc_description}', '{$tpc_content}', \" . time() . \", \" . time() . ', ' . time() . ')';\n\t\tmysql_query($sql, $this->db);\n\t\tif (mysql_affected_rows($this->db) == 1) {\n\t\t\treturn $this->User->vxPay($this->User->usr_id, $expense_amount, 2);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function create()\n\t{\n\t\t$this->auth->restrict('Aide.Content.Create');\n $categories = $this->categories_model->list_categories();\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_aide())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('aide_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'aide');\n\n\t\t\t\tTemplate::set_message(lang('aide_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/content/aide');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('aide_create_failure') . $this->aide_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('aide', 'aide.js');\n\n Template::set('categories', $categories);\n\t\tTemplate::set('toolbar_title', lang('aide'));\n\t\tTemplate::render();\n\t}", "function insertpost(){\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\tif(isset($_POST['sub'])){\r\n\t\t\t\t\t\t\t\t\t\tglobal $con;\r\n\t\t\t\t\t\t\t\t\t\tglobal $user_id;\r\n\t\t\t\t\t\t\t\t\t\t$title=$_POST['title'];\r\n\t\t\t\t\t\t\t\t\t\t$content=$_POST['content'];\r\n\t\t\t\t\t\t\t\t\t\t$topic=$_POST['topic'];\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$insert=\"insert into posts(user_id,topic_id,post_title,post_content,post_date)values('$user_id','$topic','$title','$content',NOW())\";\r\n\t\t\t\t\t\t\t\t\t\t$run=mysqli_query($con,$insert);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif($run){\r\n\t\t\t\t\t\t\t\t\t\t\t$update=\"update users set posts='yes' where user_id='$user_id'\";\r\n\t\t\t\t\t\t\t\t\t\t\t$run_update=mysqli_query($con,$update);\r\n\t\t\t\t\t\t\t\t\t\t\techo\"<h2>Posted to Timeline,amazing!!</h2>\";\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}\r\n\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}\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\t\r\n\t\t\t\t\t\t\t\t}" ]
[ "0.60620725", "0.59856796", "0.59508497", "0.5948515", "0.59474134", "0.59170127", "0.58462083", "0.57646793", "0.57549375", "0.57342803", "0.56651634", "0.56649005", "0.5657301", "0.56073606", "0.55998707", "0.55939907", "0.5581165", "0.55803645", "0.5545269", "0.553988", "0.553712", "0.55305374", "0.5528152", "0.55185074", "0.55144644", "0.55110496", "0.55107725", "0.5497023", "0.54798687", "0.54725456", "0.546947", "0.54114807", "0.54063517", "0.54043406", "0.53986406", "0.53874993", "0.53776836", "0.53685683", "0.5367112", "0.53668576", "0.53490305", "0.53489506", "0.53457993", "0.5328817", "0.5324551", "0.53218096", "0.5314481", "0.53139347", "0.53092134", "0.5308571", "0.53085446", "0.5304907", "0.5303279", "0.5300866", "0.5286447", "0.52851355", "0.528494", "0.5281982", "0.5278766", "0.52729887", "0.52725166", "0.5267042", "0.5266239", "0.52612674", "0.5258475", "0.5251048", "0.5248775", "0.52478385", "0.52478254", "0.5246958", "0.5240448", "0.5233325", "0.5231724", "0.5229634", "0.5222913", "0.5216956", "0.5216389", "0.5211057", "0.5205333", "0.52032965", "0.520193", "0.51952237", "0.519428", "0.5186644", "0.51865363", "0.51798004", "0.5179558", "0.51717484", "0.51695967", "0.5169276", "0.5169276", "0.51639235", "0.5152823", "0.5152156", "0.5151032", "0.51450837", "0.514366", "0.5142156", "0.51396686", "0.5137545" ]
0.7705836
0
this action updates user agenda by agenda_id topic and title is mandatory field notes, start_time, end_time, with_whom, people, location, alarm, repeat_days is optional field
public function updateUserAgendaAction() { /** @var Object_Agenda $agenda */ $data = $this->getRequestData(); if (isset($data['agenda_id'])) { $agenda = Object_Agenda::getById($data['agenda_id']); if (!$agenda) { $this->setErrorResponse('no Agenda with this agenda_id!'); } elseif ($this->getDeviceSession()->getUserId() != $agenda->getCreator()->getId()) { $this->setErrorResponse('you have no rights to change this Agenda!'); } else { if (isset($data['topic'])) { $agenda->setTopic($data['topic']); } if (isset($data['title'])) { $agenda->setTitle($data['title']); } if (isset($data['notes'])) { $agenda->setNotes($data['notes']); } if (isset($data['start_time'])) { $agenda->setStart_time($data['start_time']); } if (isset($data['end_time'])) { $agenda->setEnd_time($data['end_time']); } if (isset($data['with_whom'])) { $agenda->setWith_whom($data['with_whom']); } if (isset($data['with_people'])) { $agenda->setWith_people(Object_People::getById($data['with_people'])); } if (isset($data['location'])) { $agenda->setLocation($data['location']); } if (isset($data['alarm'])) { $agenda->setAlarm($data['alarm']); } if (isset($data['repeat_days'])) { $agenda->setRepeat_days($data['repeat_days']); } if (!$agenda->save()) { $this->setErrorResponse('cannot update Agenda object'); } } } else { $this->setErrorResponse('agenda_id is mandatory field for this request!'); } $this->_helper->json($agenda); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Agenda $agenda)\n {\n //\n }", "public function createUserAgendaAction()\n {\n $data = $this->getRequestData();\n if (isset($data['topic']) && isset($data['title'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n\n $folder = Object_Folder::getByPath('/agenda/' . $user->getKey() . \"-agenda\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-agenda\");\n $folder->setParentId(51);\n $folder->save();\n }\n $agenda = new Object_Agenda();\n $agenda->setCreator($user);\n $agenda->setTopic($data['topic']);\n $agenda->setTitle($data['title']);\n $agenda->setNotes(isset($data['notes']) ? $data['notes'] : \"\");\n $agenda->setStart_time(isset($data['start_time']) ? $data['start_time'] : \"\");\n $agenda->setEnd_time(isset($data['end_time']) ? $data['end_time'] : \"\");\n $agenda->setWith_whom(isset($data['with_whom']) ? $data['with_whom'] : \"\");\n $agenda->setWith_people(isset($data['people']) ? Object_People::getById($data['people']) : \"\");\n $agenda->setLocation(isset($data['location']) ? $data['location'] : \"\");\n $agenda->setAlarm(isset($data['alarm']) ? $data['alarm'] : \"\");\n $agenda->setRepeat_days(isset($data['repeat_days']) ? $data['repeat_days'] : array());\n $agenda->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['title'] . \"-\" . time()));\n $agenda->setPublished(true);\n $agenda->setParentId($folder->getId());\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot save Agenda object');\n }\n } else {\n $this->setErrorResponse('topic and title is mandatory field for this request!');\n }\n\n $this->_helper->json($agenda);\n }", "function update_agenda($idagenda,$params)\n {\n $this->db->where('idagenda',$idagenda);\n return $this->db->update('agenda',$params);\n }", "function agenda_update_item($event_id, $title=NULL,$description=NULL, $start_date=NULL, $end_date=NULL, $author_id=NULL, $course_id, $update_repeat='this', $visibility='SHOW')\n{\n\t$final_result = true;\n\t$result = array();\n\t$repeat_type = get_lang('Each week');\n\n\t$formated_start_day = date(\"Y-m-d\",$start_date);\n\t$formated_start_hour = date(\"H:i:s\",$start_date);\n\t$formated_end_day = date(\"Y-m-d\",$end_date);\n\t$formated_end_hour = date(\"H:i:s\",$end_date);\n\t$today = date(\"Y-m-d H:i:s\",mktime());\n\n $sqlSet = array();\n if(!is_null($course_id)) $sqlSet[] = \"rel_event_recipient.course_id \t = '\" . addslashes(trim($course_id)) . \"' \";\n if(!is_null($title)) $sqlSet[] = \"event.title \t\t\t\t\t\t = '\" . addslashes(trim($title)) . \"' \";\n if(!is_null($description))$sqlSet[] = \"event.description \t\t\t\t = '\" . addslashes(trim($description)) . \"' \";\n if(!is_null($author_id)) $sqlSet[] = \"event.author_id \t\t\t\t = '\" . addslashes(trim($author_id)) . \"' \";\n\tif(!is_null($visibility)) $sqlSet[] = \"rel_event_recipient.visibility = '\" . ($visibility=='HIDE'?'HIDE':'SHOW') . \"'\";\n\tif(!is_null($start_date)) $sqlSet[] = \"event.start_date = '\" . $formated_start_day . ' ' . $formated_start_hour . \"' \";\n\tif(!is_null($end_date)) $sqlSet[] = \"event.end_date = '\" . $formated_end_day . ' ' . $formated_end_hour . \"' \";\n\n\tif ($update_repeat == 'this') //update this event\n\t{\n\t\tif (count($sqlSet)>0)\n\t\t{\n\t\t\t$sqlSet[] = \"event.master_event_id\t= NULL \"; //separates this event from a group of events \n\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t\t\t. ' ON event.id = rel_event_recipient.event_id'; //update only the selected event\n\n\t\t\t$sql = \"UPDATE \" . $tbl . \"\n \t\t\t\tSET \" . implode(', ',$sqlSet) .\"\n \t\t\t\tWHERE event.id = \" . (int) $event_id ;\n\t\t\t$result[] = claro_sql_query($sql);\t\t\t\n\t\t}\n\t}\n\tif ($update_repeat=='from_this') //update from the selected event\n\t{\n\t\t$tbl = get_conf('mainTblPrefix') . 'event'; //get the master_event_id and the start_date from the selected event\n\t\t$sql = \"SELECT master_event_id,\n\t\t\t\t\t\t start_date\n\t\t\t FROM \" . $tbl . \"\n\t\t\t WHERE id = \" .(int) $event_id;\n\t\t$original_event = claro_sql_query_fetch_all($sql);\n\t\tif ($original_event == false)$result[] = $original_event;\n\n\t\tforeach($original_event as $this_original_event)\n\t\t{\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'event'; //find the id of all events after the selected event\n\t\t\t$sql = \"SELECT id,\n\t\t\t\t\t\t\tstart_date,\n\t\t\t\t\t\t\tend_date\n\t\t\t\t\tFROM \" . $tbl . \"\n\t\t\t\t\tWHERE master_event_id = \" .(int) $this_original_event['master_event_id'] .\"\n\t\t\t\t\t\tAND start_date >= '\" . $this_original_event['start_date'] . \"'\n\t\t\t\t\tORDER BY start_date ASC\";\n\t\t\t$event_id_list = claro_sql_query_fetch_all($sql);\n\n\t\t\tif ($event_id_list == false)$result[] = $event_id_list;\n\t\t\t$nb_event = count($event_id_list);\n\n\t\t\tif ($nb_event>1) //find the repeat_type for this event\n\t\t\t{\n\t\t\t\t$first_comp = strtotime($event_id_list[0]['start_date']);\n\t\t\t\t$second_comp = strtotime($event_id_list[1]['start_date']);\n\t\t\t\t$day_numbers =($second_comp-$first_comp)/(24*60*60);\n\n\t\t\t\tif ($day_numbers==7) $repeat_type=get_lang('Each week');\n\t\t\t\tif ($day_numbers==1) $repeat_type=get_lang('Each day');\n\t\t\t\tif ($day_numbers==28 || $day_numbers==29 || $day_numbers==30 || $day_numbers==31) $repeat_type=get_lang('Each month');\n\t\t\t}\t\t\n\n\t\t\tforeach($event_id_list as $this_event_id)\n\t\t\t{\n\t\t\t\t$result[] = agenda_delete_item($this_event_id['id'],'this'); //delete the events after the selected event\n\t\t\t}\n\t\t\t$result[] = agenda_add_item($course_id, $author_id, $title, $description, $start_date, $end_date, $nb_event,$repeat_type, $visibility ); //create the new updated events\n\t\t}\n\t}\n\tif (is_array($result) && !empty($result))\n\t{\n\t\tforeach($result as $this_result)\n\t\t{\n\t\t\tif ($this_result==false) $final_result=false;\n\t\t}\n\t}\n return $final_result;\n}", "public function update() {\n $hasduedate = isset($this->mumie->duedate) && $this->mumie->duedate > 0;\n if (!$this->event && $hasduedate) {\n $this->create_calendar_event(\n self::EVENT_TYPE,\n $this->mumie->duedate\n );\n } else if ($this->event && $hasduedate) {\n $update = new \\stdClass();\n $update->name = $this->title;\n $update->timestart = $this->mumie->duedate;\n $this->event->update($update, false);\n } else if ($this->event && !$hasduedate) {\n $this->event->delete();\n }\n }", "public function testUpdate(): void\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n\n //Test update as admin\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title3', 'My content2', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title3',$res2->title, 'Test discussion update as admin');\n\n //Test update as user\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title4', 'My content3', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title4',$res2->title,'Test discussion update as user');\n\n }", "function update() {\n\t\t$vars = $this->params['url'];\n\t\t$this->Event->id = $vars['id'];\n\t\t$this->Event->saveField('start', $vars['start']);\n\t\t$this->Event->saveField('end', $vars['end']);\n\t\t$this->Event->saveField('all_day', $vars['allday']);\n\t}", "public function completeNote($args) {\n if (!SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_READ)) {\n throw new Zikula_Exception_Fatal($this->__('Sorry! No authorization to access this module.'));\n }\n\n $aid = $this->request->getPost()->get('aid', '');\n if (!$aid) {\n throw new Zikula_Exception_Fatal($this->__('no note id'));\n }\n\n $daid = $this->request->getPost()->get('daid', '');\n\n //get the note\n $note = ModUtil::apiFunc('IWagendas', 'user', 'get', array('aid' => $aid));\n if ($note == false) {\n throw new Zikula_Exception_Fatal($this->__('Event not found'));\n }\n \n // Get the color configuration and assign them to the view object\n $colors = explode('|', ModUtil::getVar('IWagendas', 'colors'));\n //Comprovem que l'usuari pugui accedir a l'agenda\n if ($daid != 0) {\n //Estem entrant a una agenda multiusuari\n //Carreguem les dades de l'agenda\n $agenda = ModUtil::apiFunc('IWagendas', 'user', 'getAgenda', array('daid' => $daid));\n // Check whether the user can access the agenda for this action\n $te_acces = ModUtil::func('IWagendas', 'user', 'te_acces', array('daid' => $daid,\n 'grup' => $agenda['grup'],\n 'resp' => $agenda['resp'],\n 'activa' => $agenda['activa']));\n // If the user has no access, show an error message and stop execution\n if ($te_acces < 3 || ($te_access == 3 && $note['usuari'] != UserUtil::getVar('uid'))) {\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n }\n }\n if ($note['daid'] == $daid) {\n $completa = ($note['completa'] == 1) ? 0 : 1;\n $items = array('completa' => $completa);\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid) {\n throw new Zikula_Exception_Fatal($this->__('Error'));\n }\n } else {\n $uid = UserUtil::getVar('uid');\n $completedByUser = ($note['completedByUser'] == '') ? '$' : $note['completedByUser'];\n if (strpos($completedByUser, '$' . $uid . '$') !== false) {\n $completedByUser = str_replace('$' . $uid . '$', '', $completedByUser);\n $completa = 0;\n } else {\n $completedByUser .= '$' . $uid . '$';\n $completa = 1;\n }\n $items = array('completedByUser' => $completedByUser);\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid) {\n //Success\n //LogUtil::registerStatus ($this->__('Protection status updated'));\n throw new Zikula_Exception_Fatal($this->__('Error'));\n }\n }\n if ($completa == 1) {\n $alt = ($daid != 0) ? $this->__('Show') : $this->__('Mark as not completed');\n $bgcolor = $colors[14];\n } else {\n $alt = ($daid != 0) ? $this->__('Hide') : $this->__('Mark as completed');\n $bgcolor = $colors[13];\n }\n \n return new Zikula_Response_Ajax(array('aid' => $aid,\n 'completed' => $completa,\n 'daid' => $daid,\n 'alt' => $alt,\n 'bgcolor' => '#' . $bgcolor));\n }", "public function update_task($data)\n {\n if (!isset($data['id']) || !$data['id']) {\n return false;\n }\n\n //\n // Permissions\n //\n if (!empty($data['gid'])) {\n $targetGroupId = $data['gid'];\n } else {\n $oldEvent = $this->get_task($data['id']);\n $targetGroupId = $oldEvent['gid'];\n }\n // Am I the owner?\n if ($this->getGroupOwner($targetGroupId) != $this->uid) {\n // If not, I should have write permissions through a share\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $targetGroupId);\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n //\n //\n\n $query = 'UPDATE '.$this->Tbl['cal_task'].' SET lastmod=NOW()';\n foreach (array('start' => 'starts', 'end' => 'ends', 'title' => 'title', 'location' => 'location'\n ,'description' => 'description', 'importance' => 'importance', 'gid' => 'gid'\n ,'completion' => 'completion', 'type' => 'type', 'status' => 'status'\n ) as $k => $v) {\n if (!isset($data[$k])) {\n continue;\n }\n $query .= ',`'.$v.'`='.(('NULL' == $data[$k] || is_null($data[$k])) ? 'NULL' : '\"'.$this->esc($data[$k]).'\"');\n }\n $this->query($query.' WHERE uid='.$this->uid.' AND id='.$data['id']);\n // Reminders set\n $this->query('DELETE FROM '.$this->Tbl['cal_reminder'].' WHERE `uid`='.$this->uid.' AND `ref`=\"tsk\" AND `eid`='.$data['id']);\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n $query .= '('.doubleval($data['id']).',\"tsk\",'.$this->uid.',\"'.$this->esc($v['mode']).'\"'\n .','.doubleval($v['time']).',\"'.$this->esc($v['text']).'\"'\n .',\"'.$this->esc($v['smsto']).'\",\"'.$this->esc($v['mailto']).'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n return true;\n }", "public function edit(Agenda $agenda)\n {\n //\n }", "public function modifyAgenda($args) {\n if (!SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_ADMIN)) {\n throw new Zikula_Exception_Fatal($this->__('Sorry! No authorization to access this module.'));\n }\n\n $daid = $this->request->getPost()->get('daid', '');\n\n $char = $this->request->getPost()->get('charx', '');\n if (!$char) {\n throw new Zikula_Exception_Fatal($this->__('no char defined'));\n }\n\n //Get agenda information\n $item = ModUtil::apiFunc('IWagendas', 'user', 'getAgenda', array('daid' => $daid));\n if ($item == false) {\n throw new Zikula_Exception_Fatal($this->__('The agenda was not found'));\n }\n $value = ($item[$char]) ? 0 : 1;\n //change value in database\n $items = array($char => $value);\n if (!ModUtil::apiFunc('IWagendas', 'admin', 'editAgenda', array('daid' => $daid,\n 'items' => $items))) {\n throw new Zikula_Exception_Fatal($this->__('Error'));\n }\n return new Zikula_Response_Ajax(array('daid' => $daid));\n }", "public function update($id)\n {\n if (Sentry::check()) {\n // Find active user\n $user = Sentry::getUser();\n $event = Appointment::find($id);\n\n // Check if User belongs to group/school which the appointment is from\n if ($user->hasAccess('school') || ($user->hasAccess(\n 'event'\n ) && $user->school_id == $event->group->school_id)\n ) {\n $endDate = new DateTime();\n // Check if endDate isn't blank\n if (Input::get('end-date') == '') {\n $endDate = null;\n }\n\n $validator = Validator::make(\n [\n 'group' => Input::get('group'),\n 'description' => Input::get('description'),\n 'start-date' => Input::get('start-date'),\n 'end-date' => $endDate,\n 'start-time' => Input::get('start-time'),\n 'end-time' => Input::get('end-time'),\n 'title' => Input::get('title'),\n 'day' => Input::get('day')\n ],\n [\n 'group' => 'required',\n 'description' => 'required',\n 'start-date' => 'date',\n 'end-date' => 'date',\n 'start-time' => 'required|date_format:H:i',\n 'end-time' => 'required|date_format:H:i',\n 'title' => 'required'\n ]\n );\n\n if ($validator->fails()) {\n return Redirect::route('event.edit', $id)->withInput()->withErrors($validator);\n } else {\n $title = e(Input::get('title'));\n $description = e(Input::get('description'));\n $location = e(Input::get('location'));\n $group_id = Input::get('group');\n $start_date = e(Input::get('start-date'));\n $end_date = e(Input::get('end-date'));\n $start_time = e(Input::get('start-time'));\n $end_time = e(Input::get('end-time'));\n $parents = Input::get('par');\n\n // TODO: Handle All day events, or decide to remove it alltogether\n // TODO: Update date/time if needed\n // If the event isn't the whole day, determine the end date/time\n //$event->allday = false;\n\n // Handle datetime\n if(!$start_date) {\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.required', ['attribute ' => 'start-date '])\n );\n\n return Redirect::back()->withErrors($validator)->withInput();\n } else {\n $sd = new DateTime($start_date . ' ' . $start_time);\n\n if ($end_date == '') {\n $end_date = $start_date;\n }\n $ed = new DateTime($end_date . ' ' . $end_time);\n\n // Check if end date is before start date, if so, return with error\n if ($sd >= $ed) {\n\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.after', ['attribute ' => 'end-date ', 'date' => Input::get('start-date')])\n );\n\n // Redirect back with inputs and validator instance\n return Redirect::back()->withErrors($validator)->withInput();\n }\n }\n\n // Recurring events handling\n if ($event->parent_id) {\n if($parents) {\n $parent = AppParent::find($event->parent_id);\n // Update parent event\n $parent->title = $title;\n $parent->description = $description;\n $parent->location = $location;\n $parent->group_id = $group_id;\n $parent->save();\n\n Appointment::where('parent_id', $parent->id)->update([\n 'title' => $title,\n 'description' => $description,\n 'location' => $location,\n 'group_id' => $group_id\n ]);\n } else {\n // If event had a parent_id, but the checkbox was unchecked, unlink event from parent\n $event->parent_id = null;\n }\n }\n\n $event->title = $title;\n $event->description = $description;\n $event->location = $location;\n $event->group_id = $group_id;\n $event->start_date = $sd;\n $event->end_date = $ed;\n $event->save();\n\n return Redirect::route('calendar.index');\n }\n } else {\n // If no permissions, redirect the user to the calendar index page\n return Redirect::route('calendar.index');\n }\n } else {\n return Redirect::route('landing');\n }\n }", "public function editassigntimeAction()\n {\n $prevurl = getenv(\"HTTP_REFERER\");\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n $requestId = $user_params['requestId'];\n $requestsdetail = $ftvrequest_obj->getRequestsDetails($requestId);\n\n ($user_params['editftvspentdays'] == '') ? $days=0 : $days=$user_params['editftvspentdays'];\n ($user_params['editftvspenthours'] == '') ? $hours=0 : $hours=$user_params['editftvspenthours'];\n ($user_params['editftvspentminutes'] == '') ? $minutes=0 : $minutes=$user_params['editftvspentminutes'];\n ($user_params['editftvspentseconds'] == '') ? $seconds=0 : $seconds=$user_params['editftvspentseconds'];\n\n /*if($user_params['addasigntime'] == 'addasigntime') ///when time changes in mail content in publish ao popup//\n {\n /*$editdate = date('Y-m-d', strtotime($user_params['editftvassigndate']));\n $edittime = date('H:i:s', strtotime($user_params['editftvassigntime']));\n $editdatetime =$editdate.\" \".$edittime;\n $data = array(\"assigned_at\"=>$editdatetime);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $parameters['ftvType'] = \"chaine\";\n // $newseconds = $this->allToSeconds($user_params['editftvspentdays'],$user_params['editftvspenthours'],$user_params['editftvspentminutes'],$user_params['editftvspentseconds']);\n echo \"<br>\".$format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n echo \"<br>\".$requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n echo \"<br>\".$assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n echo $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }\n elseif($user_params['subasigntime'] == 'subasigntime')\n {\n $format = \"P\".$days.\"DT\".$hours.\"H\".$minutes.\"M\".$seconds.\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }*/\n $inpause = $ftvpausetime_obj->inPause($requestId);\n $requestsdetail[0]['inpause'] = $inpause;\n $ptimes = $ftvpausetime_obj->getPauseDuration($requestId);\n $assigntime = $requestsdetail[0]['assigned_at'];\n //echo $requestId; echo $requestsdetail[0]['assigned_at'];\n\n if(($requestsdetail[0]['status'] == 'done' || $inpause == 'yes') && $requestsdetail[0]['assigned_at'] != null)\n {\n if($requestsdetail[0]['status'] == \"closed\")\n $time1 = ($requestsdetail[0]['cancelled_at']); /// created time\n elseif ($requestsdetail[0]['status'] == \"done\")\n $time1 = ($requestsdetail[0]['closed_at']); /// created time\n else{\n if($inpause == 'yes') {\n $time1 = ($requestsdetail[0]['pause_at']);\n }else {\n $time1 = (date('Y-m-d H:i:s'));///curent time\n }\n }\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $time2 = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $time2 = $requestsdetail[0]['assigned_at'];\n }\n $difference = $this->timeDifference($time1, $time2);\n\n }elseif($requestsdetail[0]['assigned_at'] != null){\n $time1 = (date('Y-m-d H:i:s'));///curent time\n\n $pausedrequests = $ftvpausetime_obj->pausedRequest($requestId);\n if($pausedrequests == 'yes')\n {\n $updatedassigntime = $this->subDiffFromDate($requestId, $requestsdetail[0]['assigned_at']);\n }else{\n $updatedassigntime = $requestsdetail[0]['assigned_at'];\n }\n $time2 = $updatedassigntime;\n $difference = $this->timeDifference($time1, $time2);\n }\n ////when user trying to edit the time spent///\n if($user_params['editftvassignsubmit'] == 'editftvassignsubmit') ///when button submitted in popup//\n {\n $newseconds = $this->allToSeconds($days,$hours,$minutes,$seconds);\n $previousseconds = $this->allToSeconds($difference['days'],$difference['hours'],$difference['minutes'],$difference['seconds']);\n if($newseconds > $previousseconds){\n $diffseconds = $newseconds-$previousseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $requestsdetail[0]['assigned_at'];\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->sub(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }elseif($newseconds < $previousseconds){\n $diffseconds = $previousseconds-$newseconds;\n $difftime = $this->secondsTodayshours($diffseconds);\n $format = \"P\".$difftime['days'].\"DT\".$difftime['hours'].\"H\".$difftime['minutes'].\"M\".$difftime['seconds'].\"S\";\n $time=new DateTime($requestsdetail[0]['assigned_at']);\n $time->add(new DateInterval($format));\n $assigntime = $time->format('Y-m-d H:i:s');\n $data = array(\"assigned_at\"=>$assigntime);////////updating\n $query = \"identifier= '\".$requestId.\"'\";\n $ftvrequest_obj->updateFtvRequests($data,$query);\n $this->_redirect($prevurl);\n }else\n $this->_redirect($prevurl);\n }\n /*$this->_view->reqasgndate = date(\"d-m-Y\", strtotime($reqdetails[0]['assigned_at']));\n $this->_view->reqasgntime = date(\"g:i A\", strtotime($reqdetails[0]['assigned_at']));*/\n $this->_view->days = $difference['days'];\n $this->_view->hours = $difference['hours'];\n $this->_view->minutes = $difference['minutes'];\n $this->_view->seconds = $difference['seconds'];\n $this->_view->requestId = $user_params['requestId'];\n $this->_view->requestobject = $requestsdetail[0]['request_object'];\n $this->_view->current_duration= $difference['days'].\"j \".$difference['hours'].\"h \".$difference['minutes'].\"m \".$difference['seconds'].\"s \";\n\n $this->_view->extendparttime = 'no';\n $this->_view->extendcrtparttime = 'no';\n $this->_view->editftvassigntime = 'yes';\n $this->_view->nores = 'true';\n $this->_view->render(\"ongoing_extendtime_writer_popup\");\n\n }", "function agenda_add_item($course_id, $author_id=NULL, $title='', $description='', $start_date=NULL, $end_date=NULL, $repeat, $repeat_type, $visibility='SHOW' )\n{\n\t$final_result = true;\n\t$result = array();\n\n\t$formated_start_day = date(\"Y-m-d\",$start_date);\n\t$formated_start_hour = date(\"H:i:s\",$start_date);\n\t$formated_end_day = date(\"Y-m-d\",$end_date);\n\t$formated_end_hour = date(\"H:i:s\",$end_date);\n\n $tbl = get_conf('mainTblPrefix') . 'event';\n $sql = \"INSERT INTO \" . $tbl . \"\n SET title \t = '\" . addslashes(trim($title)) . \"',\n description = '\" . addslashes(trim($description)) . \"',\n start_date = '\" . $formated_start_day . ' ' . $formated_start_hour . \"',\n end_date = '\" . $formated_end_day . ' ' . $formated_end_hour . \"',\n author_id = '\" . $author_id . \"'\";\n\t$event_id = claro_sql_query_insert_id($sql);\n\tif ($event_id == false)$result[] = $event_id;\n\n $tbl = get_conf('mainTblPrefix') . 'rel_event_recipient';\n\t$sql = \"INSERT INTO \" . $tbl . \"\n SET event_id \t= '\" . (int) $event_id . \"',\n course_id\t= '\" . $course_id . \"',\n\t\t\tvisibility\t= '\" . ($visibility=='HIDE'?'HIDE':'SHOW') . \"'\"; \n $result[] = claro_sql_query_insert_id($sql);\n\n\tif ($repeat > 1)\n\t{\n\t\t$tbl = get_conf('mainTblPrefix') . 'event';\n\t\t$sqlSet = array();\n\t\t\n $sql = \"UPDATE \" . $tbl . \"\n SET master_event_id = '\" . (int) $event_id . \"'\n WHERE `id` = \" . (int) $event_id ;\n\t\t$result[] = claro_sql_query($sql);\n\n\t\tfor($i=1; $i < $repeat; $i++)\n\t\t{\n\t\t\t$start_date_elements = explode(\"-\",$formated_start_day);\n\t\t\t$end_date_elements = explode(\"-\",$formated_end_day);\n\n\t\t\tif ($repeat_type == get_lang('Each week')) //find the new date depending on the repeat event type\n\t\t\t{\n\t\t\t\t$start_timestamp \t = mktime(0,0,0,$start_date_elements[1],$start_date_elements[2]+7*$i,$start_date_elements[0]);\n\t\t\t\t$end_timestamp \t\t = mktime(0,0,0,$end_date_elements[1],$end_date_elements[2]+7*$i,$end_date_elements[0]);\n\t\t\t}\n\t\t\tif ($repeat_type == get_lang('Each day')) //find the new date depending on the repeat event type\n\t\t\t{\n\t\t\t\t$start_timestamp \t = mktime(0,0,0,$start_date_elements[1],$start_date_elements[2]+1*$i,$start_date_elements[0]);\n\t\t\t\t$end_timestamp \t\t = mktime(0,0,0,$end_date_elements[1],$end_date_elements[2]+1*$i,$end_date_elements[0]);\n\t\t\t}\n\t\t\tif ($repeat_type == get_lang('Each month')) //find the new date depending on the repeat event type\n\t\t\t{\n\t\t\t\t$start_timestamp \t = mktime(0,0,0,$start_date_elements[1]+1*$i,$start_date_elements[2],$start_date_elements[0]);\n\t\t\t\t$end_timestamp \t\t = mktime(0,0,0,$end_date_elements[1]+1*$i,$end_date_elements[2],$end_date_elements[0]);\n\t\t\t}\n\n\t\t\t$repeat_start_date \t = strftime('%Y-%m-%d',$start_timestamp) . ' ' .$formated_start_hour;\n\t\t\t$repeat_end_date\t = strftime('%Y-%m-%d',$end_timestamp) . ' ' . $formated_end_hour;\n\t\t\t\t\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'event';\n\t\t\t$sql = \"INSERT INTO \" . $tbl . \"\n \t\t\t\tSET title \t = '\" . addslashes(trim($title)) . \"',\n \t\t\t\t\tdescription = '\" . addslashes(trim($description)) . \"',\n \t\t\t\t\tauthor_id = '\" . (int) $author_id . \"',\n \t\t\t\t\tstart_date = '\" . $repeat_start_date . \"',\n \t\t\t\t\tend_date = '\" . $repeat_end_date . \"',\n \t\t\t\t\tmaster_event_id = '\" . (int) $event_id . \"'\";\n\t\t\t$repeat_event_id = claro_sql_query_insert_id($sql);\n\t\t\tif ($repeat_event_id == false)$result[] = $repeat_event_id;\n\t\t\n\t\t\t$tbl = get_conf('mainTblPrefix') . 'rel_event_recipient';\n\t\t\t$sql = \"INSERT INTO \" . $tbl . \"\n \t\t\t\tSET event_id \t= '\" . (int) $repeat_event_id . \"',\n \t\t\t\t\tcourse_id\t= '\" . $course_id . \"',\n \t\t\t\t\tvisibility\t= '\" . ($visibility=='HIDE'?'HIDE':'SHOW') . \"'\"; \n\t\t\t$result[] = claro_sql_query_insert_id($sql);\n\t\t}\n\t}\n\tif (is_array($result) && !empty($result))\n\t{\n\t\tforeach($result as $this_result)\n\t\t{\n\t\t\tif ($this_result==false) $final_result=false;\n\t\t}\n\t}\n return $final_result;\n}", "public function protectNote($args) {\n if (!SecurityUtil::checkPermission('IWagendas::', '::', ACCESS_READ)) {\n throw new Zikula_Exception_Fatal($this->__('Sorry! No authorization to access this module.'));\n }\n\n $aid = $this->request->getPost()->get('aid', '');\n if (!$aid) {\n throw new Zikula_Exception_Fatal($this->__('no note id'));\n }\n\n $daid = $this->request->getPost()->get('daid', '');\n\n //get the note\n $note = ModUtil::apiFunc('IWagendas', 'user', 'get', array('aid' => $aid));\n if ($note == false)\n throw new Zikula_Exception_Fatal($this->__('Event not found'));\n if ($note['daid'] != 0) {\n //Estem entrant a una agenda multiusuari\n //Carreguem les dades de l'agenda\n $agenda = ModUtil::apiFunc('IWagendas', 'user', 'getAgenda', array('daid' => $note['daid']));\n // Check whether the user can access the agenda for this action\n $te_acces = ModUtil::func('IWagendas', 'user', 'te_acces', array('daid' => $agenda['daid'],\n 'grup' => $agenda['grup'],\n 'resp' => $agenda['resp'],\n 'activa' => $agenda['activa']));\n }\n if (strpos($agenda['gAccessLevel'], '$owne|' . UserUtil::getVar('uid') . '$') === false &&\n $agenda['gAccessLevel'] != '') {\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n } else {\n //Check if user can access the agenda\n if ($daid != 0) {\n // If the user has no access, show an error message and stop execution\n if ($te_acces < 3 || ($te_access == 3 && $anotacio['usuari'] != UserUtil::getVar('uid')))\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n } else {\n //Comprovem si l'usuari està protegint realment la seva a notació\n if ($note['usuari'] != UserUtil::getVar('uid'))\n throw new Zikula_Exception_Fatal($this->__('You are not allowed to administrate the agendas'));\n }\n }\n $protegida = ($note['protegida'] == 1) ? 0 : 1;\n $items = array('protegida' => $protegida);\n // Edit note and set it as protected\n $lid = ModUtil::apiFunc('IWagendas', 'user', 'editNote', array('aid' => $aid,\n 'daid' => $daid,\n 'items' => $items));\n if (!$lid)\n throw new Zikula_Exception_Fatal($this->__('Error'));\n $alt = ($protegida == 1) ? $this->__('Delete protection against automatic deletion for this event') : $this->__('Protected? ');\n return new Zikula_Response_Ajax(array('aid' => $aid,\n 'protecteda' => $protegida,\n 'alt' => $alt));\n }", "public function AgendaUpdate(Request $request)\n {\n $id = $request->id;\n // Las sguientes variables se crearan para luego concatenarlas con el fin de darle el forato de un datetime(año,mes,dia) ya que\n // llegan con un difrente por el request\n $año =substr($request->FechaAgenda, -4);\n $dia =substr($request->FechaAgenda, 0, 2);\n $mes = substr(substr($request->FechaAgenda, 3, 3), 0, 2);\n $fecha = $año.'-'.$mes.'-'.$dia;\n $AgendaUpdate = Agenda::find($id);\n $AgendaUpdate->titulo = $request->EditTitulo;\n $AgendaUpdate->fecha_inicio = $fecha.' '.date('H:i:s', strtotime($request->HoraInicioAgenda));\n $AgendaUpdate->fecha_fin = $fecha.' '.date('H:i:s', strtotime($request->HoraFinAgenda));\n $AgendaUpdate->save();\n\n // return ( $fecha.\" \".date(\"H:i:s\",strtotime($request->HoraFinAgenda)));\n return redirect('/index2');\n }", "function updateTask() {\n\t\t$rating = $this -> getTaskRating();\n\t\tif (!is_null($this -> data)) {\n\t\t\tif (!empty($this -> data)) {\n\t\t\t\t//if user has not missed any events and not added any events rate his task with 1\n\t\t\t\tif ($this -> missed == 0) {\n\t\t\t\t\tif (empty($this -> rating)) {\n\t\t\t\t\t\t$rating = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE Task SET rating =\" . $rating . \", isRated=1, missed=\" . $this -> missed . \" WHERE TaskId=\" . $this -> data[0]['TaskId'];\n\t\t\t\t$stmt = $this -> DB -> prepare($sql);\n\t\t\t\tif ($stmt -> execute()) {\n\t\t\t\t\t$this -> updateUser();\n\t\t\t\t} else {\n\t\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\t\tnew Email('failed', 'update task with id=' . $this -> data[0]['TaskId'] . ' error' . $stmt -> errorInfo(), $this -> id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tinclude_once \"Email.php\";\n\t\t\t\tnew Email('failed', 'update task, data is empty error', $this -> id);\n\t\t\t}\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'update task, data is empty', $this -> id);\n\t\t}\n\t}", "public function update(Requests\\AgendaRequest $request, $id)\n {\n $agenda = Agenda::find($id);\n if(is_null($agenda)){\n abort(404);\n }\n $t = $agenda->update($request->all());\n if(!$t){\n abort(500);\n }\n Session::flash('agenda-edited','Agenda teredit');\n return redirect(action('AgendaController@index'));\n }", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function TimeIt_operation_updateEvent(&$obj, $params)\n{\n $online = isset($params['online']) ? $params['online'] : 0;\n $obj['status'] = $online;\n //print_r($params);exit();\n $para = array();\n $para['obj'] = &$obj;\n if($params['repeat'] == '1') {\n if(!isset($obj['cid']) && isset($obj['data']['cid'])) {\n $obj['cid'] = $obj['data']['cid'];\n } else if(!isset($obj['cid']) && !isset($obj['data']['cid'])) {\n $obj['cid'] = pnModGetVar('TimeIt', 'defaultCalendar');\n }\n $para['noRecurrences'] = true;\n $prozi = new TimeIt_Recurrence_Processor(new TimeIt_Recurrence_Output_DB(), $obj);\n $prozi->doCalculation();\n } else if($params['deleterepeats'] == '1') {\n pnModAPIFunc('TimeIt', 'user', 'deleteAllRecurrences', array('obj'=>$obj));\n $obj['data']['cid'] = $obj['cid']; // backup calendar id because $obj['cid'] won't be saved\n $para['noRecurrences'] = true;\n }\n \n return pnModAPIFunc('TimeIt', 'user', 'update', $para);\n}", "public function update() {\n\n //GETS TASK, DEPENDING ON TASK ID (ID)\n $data=Tasks::find(request('task_id'));\n\n //GETS REQUEST AND REPLACES TASK TITLE & DESCRIPTION\n $data->task=request('task');\n $data->description=request('description');\n\n //SAVES DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$data->NotepadID\");\n }", "public function update(User $user, Meeting $meeting)\n {\n //\n }", "function updateEvent($eventToModify,$userID){\n\n $date = $eventToModify['date'];\n $place = $eventToModify['lieu'];\n $event = $eventToModify['event'];\n $startTime = $eventToModify['startTime'];\n $endTime = $eventToModify['endTime'];\n $type = $eventToModify['type'];\n $recurrence = $eventToModify['recurrence'];\n $IDOfEvent = $eventToModify['upd'];\n $qty = $eventToModify['qty'];\n\n $strSeparator = '\\'';\n\n $i=0;\n if(isset($recurrence[$i])){\n $recurrence = $recurrence[$i];\n }\n else{\n $i++;\n }\n\n $updateEventQuery = 'UPDATE events SET `name` = :name, `place` = :place, `date` = :date, `start time` = :startTime, `end time` = :endTime, `type` = :type, `recurrence` = :recurrence, `FKusers` = :userID\n WHERE ID = '.$strSeparator.$IDOfEvent.$strSeparator.' AND FKusers = '.$strSeparator.$userID.$strSeparator;\n $updateEventData = array(\":name\" => $event, \":place\" => $place, \":date\" => $date, \":startTime\" => $startTime, \":endTime\" => $endTime, \":type\" => $type, \":recurrence\" => $recurrence, \":userID\" => $userID);\n\n require_once 'model/dbConnector.php';\n $result = executeQueryInsert($updateEventQuery, $updateEventData);\n\n $idEvent = $IDOfEvent;\n\n $selectAllEventsQuery=\"SELECT recurrence FROM events WHERE ID ='$idEvent'\";\n \trequire_once 'model/dbConnector.php';\n\n \t$oldRecurrence = executeQuerySelect($selectAllEventsQuery);\n\n\n if($oldRecurrence != $recurrence){\n\n $suppOldRecurrenceQuery='DELETE from `event-recurrence` WHERE FKevents = :id';\n $suppOldRecurrenceData= array(\":id\" => $idEvent);\n\n $result3 = executeQueryInsert($suppOldRecurrenceQuery, $suppOldRecurrenceData);\n\n if($recurrence == 1){\n //jours\n for($qty;$qty>=2;$qty--){\n\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1D'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n //mois\n if($recurrence == 2){\n for($qty;$qty>=2;$qty--){\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1M'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n //année\n if($recurrence == 3){\n for($qty;$qty>=2;$qty--){\n $date = new DateTime(\"{$date}\");\n $date->add(new DateInterval('P1Y'));\n $date -> format('Y-m-d');\n $date = $date->format('Y-m-d');\n\n $addEventQuery2 = 'INSERT INTO `event-recurrence` (`date`, `FKevents`) VALUES (:date, :FKevents)';\n $addEventData2 = array(\":date\" => $date, \":FKevents\" => $idEvent);\n\n $result2 = executeQueryInsert($addEventQuery2,$addEventData2);\n }\n }\n }\n\n return $result;\n}", "public function update(Request $request, $id)\n {\n $time = explode(\" - \", $request->input('time'));\n \n // $adminevent=$request->all();\n // dd($adminevent);\n $adminevent = Event::find($id);\n $adminevent->title = $request->title;\n $adminevent->start =$request ->start;\n $adminevent->end =$request ->end;\n $adminevent->color = $request->color;\n $adminevent->save();\n \n $request->session()->flash('success', 'The event was successfully edit!');\n return redirect('/adminevent');\n }", "public function update(Request $request, $id)\n {\n /*$this->validate($request, [\n 'name' => 'required',\n 'email' => 'required|unique:users,email,'. $id .'|max:255',\n ]);*/\n\n $event = Event::find($id);\n $event->name = $request->input('name');\n $event->description = $request->input('description');\n $event->date = $request->input('date');\n $event->hour = $request->input('hour');\n $event->minimum_quorum = $request->input('minimum_quorum');\n $event->max_capacity = $request->input('max_capacity'); \n //$event->user_id = $request->input('user_id');\n //tipo_evento_id\n //user_id\n //publico_id \n $event->save();\n return redirect()->action('EventController@index');\n }", "public function postEventedit();", "function updateEvent($id, $name, $description, $type, $start, $end)\n{\n require_once(\"model/database.php\");\n $query = \"UPDATE events SET name = :name, description = :description, type = :type, start = :start, end = :end WHERE id = :id ;\";\n return executeQueryIUDAffected($query, createBinds([[\":id\", $id, PDO::PARAM_INT], [\":name\", $name], [\":description\", $description], [\":type\", $type], [\":start\", $start], [\":end\", $end]]));\n}", "function daily_update_property_email(){\n\t\t$meta_post = $this->InteractModal->get_update_post_meta();\n\t\tif(!empty($meta_post)){\n\t\t\t$data = array();\n\t\t\tforeach($meta_post as $meta_details){\n\t\t\t\t$user_id = $this->InteractModal->get_post_meta($meta_details['post_id'],'initiator_id');\n\t\t\t\t$data[$user_id][]= $meta_details['meta_key'];\n\t\t\t}\n\t\t}\t\t\n\t\t$get_data=$this->InteractModal->get_today_data();\n\t\t$id=2;\n\t\tif(!empty($get_data)){\n\t\t\t$result = array();\n\t\t\tforeach ($get_data as $element) {\n\t\t\t\t$result[$element['user_id']][]= $element['task_type'];\n\t\t\t}\n\t\t\tif(!empty($data) && (!empty($result))){\n\t\t\t\t$results = array_merge($data,$result);\n\t\t\t}\n\t\t\t$user_id= '';\n\t\t\tif(!empty($results)){\n\t\t\t\tforeach($result as $user_id=>$value):\n\t\t\t\t\t$update_details='';\n\t\t\t\t\t$value = array_unique($value);\n\t\t\t\t\tforeach($value as $values):\t\t\t\t\t\t\n\t\t\t\t\t\t$update_details=$update_details.'Today '.ucwords($values).' Successfully.<br>';\n\t\t\t\t\tendforeach;\n\t\t\t\t\tif(!empty($user_id)){\n\t\t\t\t\t\t$where = array( 'id' =>$user_id);\n\t\t\t\t\t\t$user_data=$this->InteractModal->single_field_value('users',$where);\n\t\t\t\t\t\techo $email= $user_data[0]['user_email'];\n\t\t\t\t\t\techo \"<br>\";\n\t\t\t\t\t\t$company_id = $this->InteractModal->get_user_meta( $user_id, 'company_id');\n\t\t\t\t\t\t///get auto email content data \n\t\t\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_'.$id );\n\t\t\t\t\t\tif(($status_template ==1)){\n\t\t\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_'.$id );\n\t\t\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_'.$id );\n\t\t\t\t\t\t\t$user_name = $this->InteractModal->get_user_meta( $user_id, 'concerned_person');\n\t\t\t\t\t\t\t$phone_number = $this->InteractModal->get_user_meta( $user_id, 'phone_number');\n\t\t\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \t\t\t\t\t\t\n\t\t\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phone_number,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t\t\t$content = $content.'<br>'.$update_details;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template_list = $this->InteractModal->get_email_template($id);\n\t\t\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t\t\t$content = $update_details; \n\t\t\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->send_email($email_data);\n\t\t\t\t\t} \n\t\t\t\tendforeach;\n\t\t\t}\n\t\t}\n\t}", "public function update(Request $request, TiendaApi $tiendaApi)\n {\n //\n }", "public function update(Request $request, AgendaItemSpeaker $agendaItemSpeaker)\n {\n //\n }", "public function edit(TiendaApi $tiendaApi)\n {\n //\n }", "public function setUpdate($id){\n $agenda = array('nome' => $this->input->post('nome'),\n 'email' => $this->input->post('email'),\n 'telefone' => $this->input->post('telefone'),\n 'celular' => $this->input->post('celular'));\n if ($this->AgendaModel->update($id,$agenda)){\n echo json_encode(array('success'=>true));\n } else {\n echo json_encode(array('msg'=>'Ocorreio um erro, ao atualizar o registro.'));\n }\n \n }", "public function update_event($data)\n {\n if (!isset($data['id']) || !$data['id']) {\n return false;\n }\n //\n // Permissions\n //\n if (!empty($data['gid'])) {\n $targetGroupId = $data['gid'];\n } else {\n $oldEvent = $this->get_event($data['id']);\n $targetGroupId = $oldEvent['gid'];\n }\n // Am I the owner?\n if ($this->getGroupOwner($targetGroupId) != $this->uid) {\n // If not, I should have write permissions through a share\n $perms = $GLOBALS['DB']->getUserSharedFolderPermissions($this->uid, 'calendar', $targetGroupId);\n if (empty($perms) || empty($perms['write'])) {\n // No, I haven't\n return false;\n }\n }\n //\n //\n\n $query = 'UPDATE '.$this->Tbl['cal_event'].' SET lastmod=NOW()';\n $datafields = array('start' => 'starts', 'end' => 'ends',\n 'title' => 'title', 'description' => 'description', 'location' => 'location',\n 'type' => 'type', 'status' => 'status', 'opaque' => 'opaque', 'gid' => 'gid'\n );\n foreach ($datafields as $k => $v) {\n if (!isset($data[$k])) {\n continue;\n }\n $query .= ',`'.$v.'`=\"'.$this->esc($data[$k]).'\"';\n }\n $query .= ' WHERE id='.$data['id'];\n\n $this->query($query);\n\n $this->query('DELETE FROM '.$this->Tbl['cal_reminder'].' WHERE `uid`='.$this->uid.' AND `ref`=\"evt\" AND `eid`='.$data['id']);\n $this->query('DELETE FROM '.$this->Tbl['cal_repetition'].' WHERE `ref`=\"evt\" AND `eid`='.$data['id']);\n if (isset($data['reminders']) && !empty($data['reminders'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_reminder'].' (`eid`,`ref`,`uid`,`mode`,`time`,`text`,`smsto`,`mailto`) VALUES ';\n $k = 0;\n foreach ($data['reminders'] as $v) {\n if ($k) {\n $query .= ',';\n }\n if ($v['mode'] == '-') {\n continue;\n }\n\n if (!isset($v['smsto'])) {\n $v['smsto'] = '';\n }\n if (!isset($v['mailto'])) {\n $v['mailto'] = '';\n }\n\n $query .= '('.doubleval($data['id']).',\"evt\",'.$this->uid.',\"'.$this->esc($v['mode']).'\"'\n .','.doubleval($v['time']).',\"'.$this->esc($v['text']).'\"'\n .',\"'.$this->esc($v['smsto']).'\",\"'.$this->esc($v['mailto']).'\")';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n }\n if (isset($data['repetitions']) && !empty($data['repetitions'])) {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES ';\n $k = 0;\n foreach ($data['repetitions'] as $v) {\n if ($k) {\n $query .= ',';\n }\n $query .= '('.doubleval($data['id']).',\"evt\",\"'.$this->esc($v['type']).'\",'.doubleval($v['repeat'])\n .','.(!is_null($v['extra']) ? '\"'.$this->esc($v['extra']).'\"' : '\"\"')\n .','.(!is_null($v['until']) ? '\"'.$this->esc($v['until']).'\"' : 'NULL').')';\n $k++;\n }\n if ($k > 0) {\n $this->query($query);\n }\n } else {\n $query = 'INSERT INTO '.$this->Tbl['cal_repetition'].' (`eid`,`ref`,`type`,`repeat`,`extra`,`until`) VALUES '\n .'('.doubleval($data['id']).',\"evt\",\"-\",0,\"\",NULL)';\n $this->query($query);\n }\n return true;\n }", "function update_event_notice($userId, $promotionId, $storeId, $attendStatus, $eventStatus, $scheduledTime, $baseUrl)\n\t{\n\t\tlog_message('debug', '_event/update_event_notice');\n\t\tlog_message('debug', '_event/update_event_notice:: [1] userId='.$userId.' promotionId='.$promotionId.' storeId='.$storeId.' attendStatus='.$attendStatus.' eventStatus='.$eventStatus.' scheduledTime='.json_encode($scheduledTime));\n $msg='';\n\n $status = $this->_query_reader->get_row_as_array('get_previous_attend_status',array(\n 'promotion_id'=>$promotionId,\n\t\t 'user_id'=>$userId\n ));\n\n log_message('debug', '_event/update_event_notice:: [2] status='.json_encode($status));\n\n $result = $this->_query_reader->run('add_promotion_notice',array(\n 'promotion_id'=>$promotionId,\n 'user_id'=>$userId,\n 'store_id'=>$storeId,\n 'attend_status'=>$attendStatus,\n 'event_status'=>$eventStatus\n ));\n\n # Get details of the event\n $eventDetails = $this->get_event_details($userId, $promotionId);\n $eventDetails = $eventDetails[0];\n log_message('debug', '_event/update_event_notice:: [3] eventDetails='.json_encode($eventDetails));\n\n # If user response maybe(pending) and need reservation then schedule two reminder to send out in the future\n\t\tif($attendStatus == 'pending' && !empty($eventDetails) && $eventDetails['requires_reservation'] == 'Y'){\n\n $templateVariables = array('storename'=>$eventDetails['store_name'],\n 'promotiontitle'=>$eventDetails['promotion_title'],\n 'eventlink'=>$baseUrl.\"c/\".encrypt_value($eventDetails['event_id'].\"--\".format_id($userId).\"--reserve\"));\n\n $template = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'first_event_reminder')\n ));\n log_message('debug', '_event/update_event_notice:: [4] template='.json_encode($template));\n\n $reminder1 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'schedule_send',\n \t\t\t\t\t\t'message'=>array(\n \t\t\t\t\t\t\t'senderType'=>'user',\n \t\t\t\t\t\t\t'sendToType'=>'list',\n \t\t\t\t\t\t\t'sendTo'=>array($userId),\n 'template'=>$template,\n 'templateId'=>$template['id'],\n \t\t\t\t\t\t\t'subject'=>$template['subject'],\n \t\t\t\t\t\t\t'body'=>$template['details'],\n 'sms'=>$template['sms'],\n \t\t\t\t\t\t\t'saveTemplate'=>'N',\n \t\t\t\t\t\t\t'scheduledSendDate'=>$scheduledTime[0],\n \t\t\t\t\t\t\t'sendDate'=>'',\n \t\t\t\t\t\t\t'methods'=>array(\"system\",\"email\",\"sms\"),\n 'templateVariables'=> $templateVariables\n \t\t\t\t\t\t),\n \t\t\t\t\t\t'userId'=>$userId,\n \t\t\t\t\t\t'organizationId'=>'',\n \t\t\t\t\t\t'organizationType'=>''\n \t\t\t));\n\n $template = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'second_event_reminder')\n ));\n log_message('debug', '_event/update_event_notice:: [5] template='.json_encode($template));\n\n $reminder2 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'schedule_send',\n \t\t\t\t\t\t'message'=>array(\n \t\t\t\t\t\t\t'senderType'=>'user',\n \t\t\t\t\t\t\t'sendToType'=>'list',\n \t\t\t\t\t\t\t'sendTo'=>array($userId),\n 'template'=>$template,\n 'templateId'=>$template['id'],\n \t\t\t\t\t\t\t'subject'=>$template['subject'],\n \t\t\t\t\t\t\t'body'=>$template['details'],\n 'sms'=>$template['sms'],\n \t\t\t\t\t\t\t'saveTemplate'=>'N',\n \t\t\t\t\t\t\t'scheduledSendDate'=>$scheduledTime[1],\n \t\t\t\t\t\t\t'sendDate'=>'',\n \t\t\t\t\t\t\t'methods'=>array(\"system\",\"email\",\"sms\"),\n 'templateVariables'=>$templateVariables\n \t\t\t\t\t\t),\n \t\t\t\t\t\t'userId'=>$userId,\n \t\t\t\t\t\t'organizationId'=>'',\n \t\t\t\t\t\t'organizationType'=>''\n \t\t\t));\n\n\t\t}\n\n # If the status was pending then delete the reminder messages\n if( $status['attend_status'] == 'pending' && !empty($eventDetails) && $eventDetails['requires_reservation'] == 'Y' && $result) {\n\n $template1 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'first_event_reminder')\n ));\n\n $template2 = server_curl(MESSAGE_SERVER_URL, array('__action'=>'get_row_as_array',\n 'query' => 'get_message_template',\n 'variables' => array('message_type'=>'second_event_reminder')\n ));\n\n $result = $this->_query_reader->run('delete_reminder_messages',array(\n 'user_id'=>$userId,\n 'store_name'=>$eventDetails['store_name'],\n 'template_id'=>implode(\"','\", array($template1['id'],$template2['id']))\n ));\n\n # If the event doesn't need reservation then delete record if user change their mind to maybe or not going\n } else if ( $status['attend_status'] == 'confirmed' && !empty($eventDetails) && $eventDetails['requires_reservation'] == 'N' && $result){\n\n $result = $this->_query_reader->run('delete_reservation_record',array(\n 'user_id'=>$userId,\n 'promotion_id'=>$promotionId\n ));\n }\n\n\t\tlog_message('debug', '_event/update_event_notice:: [6] result='.json_encode($result));\n return array('result'=>(!empty($result) && $result? 'SUCCESS': 'FAIL'), 'msg'=>$msg);\n\t}", "public function action_update()\n {\n\t $this->template = View::forge('template-admin');\n\n\t\t$get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"update\"] = Model_Event::find_by('id',$id);\n\t\t$data[\"category\"] = Model_Category::find_all();\n\t\t$this->template->title = \"イベント更新\";\n\t\t$this->template->content = View::forge('event/update', $data);\n }", "public function deleteUserAgendaAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $agenda->getCreator()->getId()) {\n $agenda->setPublished(false);\n if (!$agenda->save()) {\n $this->setErrorResponse('cannot delete Agenda object!');\n }\n } else {\n $this->setErrorResponse('no Agenda for this user with current agenda_id!');\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function update($meeting)\n {\n\n }", "public static function update_event($eventid, $title, $start, $end, $duration, $content, $recursivelly = false, $recursion = NULL, $reference_obj_id = NULL) {\r\n global $uid, $langNotValidInput;\r\n\r\n if($recursivelly && !is_null($recursion)){\r\n $oldrec = Calendar_Events::get_event_recursion($eventid, 'personal');\r\n $p = \"P\".$recursion['repeat'].$recursion['unit'];\r\n $e = DateTime::createFromFormat('d-m-Y', $recursion['end'])->format('Y-m-d');\r\n if($oldrec->recursion_period != $p || $oldrec->recursion_end != $e){\r\n Calendar_Events::delete_recursive_event($eventid, 'personal');\r\n return Calendar_Events::add_event($title, $content, $start, $end, $duration, $recursion, $reference_obj_id);\r\n }\r\n }\r\n if(!is_null($recursion) && !Calendar_Events::is_recursive($eventid, 'personal')){\r\n Calendar_Events::delete_event($eventid, 'personal');\r\n return Calendar_Events::add_event($title, $content, $start, $end, $duration, $recursion, $reference_obj_id);\r\n }\r\n\r\n $refobjinfo = References::get_ref_obj_field_values($reference_obj_id);\r\n\r\n $d1 = DateTime::createFromFormat('d-m-Y H:i', $start);\r\n $d2 = DateTime::createFromFormat('d-m-Y H:i:s', $start);\r\n $d3 = DateTime::createFromFormat('d-m-Y H:i', $end);\r\n $d4 = DateTime::createFromFormat('d-m-Y H:i:s', $end);\r\n $title = trim($title);\r\n if (empty($title) || !(($d1 && $d1->format('d-m-Y H:i') == $start) || ($d2 && $d2->format('d-m-Y H:i:s') == $start))) {\r\n return array('success' => false, 'message' => $langNotValidInput);\r\n }\r\n\r\n $where_clause = ($recursivelly)? \"WHERE source_event_id = ?d\":\"WHERE id = ?d\";\r\n $startdatetimeformatted = ($recursivelly)? $d1->format('H:i'):$d1->format('Y-m-d H:i');\r\n $start_date_update_clause = ($recursivelly)? \"start = CONCAT(date_format(start, '%Y-%m-%d '),?t), \":\"start = ?t, \";\r\n $end = ($recursivelly)? $d3->format('H:i'):$d3->format('Y-m-d H:i');\r\n $end_date_update_clause = ($recursivelly)? \"end = CONCAT(date_format(end, '%Y-%m-%d '),?t), \":\"end = ?t, \";\r\n Database::get()->query(\"UPDATE personal_calendar SET \"\r\n . \"title = ?s, \"\r\n . $start_date_update_clause\r\n . $end_date_update_clause\r\n . \"duration = ?t, \"\r\n . \"content = ?s, \"\r\n . \"reference_obj_module = ?d, \"\r\n . \"reference_obj_type = ?s, \"\r\n . \"reference_obj_id = ?d, \"\r\n . \"reference_obj_course = ?d \"\r\n . $where_clause,\r\n $title, $startdatetimeformatted, $end, $duration, purify($content), $refobjinfo['objmodule'], $refobjinfo['objtype'], $refobjinfo['objid'], $refobjinfo['objcourse'], $eventid);\r\n\r\n Log::record(0, MODULE_ID_PERSONALCALENDAR, LOG_MODIFY, array('user_id' => $uid, 'id' => $eventid,\r\n 'title' => $title,\r\n 'content' => ellipsize_html(canonicalize_whitespace(strip_tags($content)), 50, '+')));\r\n return array('success' => true, 'message' => '', 'event' => $eventid);\r\n }", "public function AlteraAgenda ($id, $evento) {\n\t\t$this->db->where('id_evento', $id);\n\t\t$this->db->update('evento', $evento);\n\t\treturn TRUE;\n\t}", "public function updateSingleEvent() {\n\t\ttry {\n\t\t\t$id = Request::input('id');\n\t\t\t$before_end_date = Request::input('beforeEndDate');\n\t\t\t$after_start_date = Request::input('afterStartDate');\n\t\t\t$current_date = Request::input('currentDate');\n\t\t\t$original_event = ConnectContent::findOrFail($id);\n\n\t\t\t//Replicate the event for before, after and current\n\t\t\t$before = $original_event->replicate();\n\t\t\t$after = $original_event->replicate();\n\n\t\t\t$current = $original_event->replicate();\n\n\t\t\t//Update the time of this single current event\n\t\t\t$current->start_time = getMySQLTimeFormat(Request::input('start_time'));\n\t\t\t$current->end_time = getMySQLTimeFormat(Request::input('end_time'));\n\t\t\t$current->start_date = Request::input('start_date');\n\t\t\t$current->end_date = Request::input('end_date');\n\t\t\t$current->what = Request::input('what');\n\t\t\t$current->who = Request::input('who');\n\n\t\t\t//We split the talk show timelines into before and after current date\n\t\t\t$before->end_date = $before_end_date;\n\t\t\t$after->start_date = $after_start_date;\n\n\t\t\t$current->start_date = $current->end_date = $current_date;\n\n\t\t\tif($current->content_type_id == ContentType::GetMusicMixContentTypeID()) {\n\t\t\t\t$current->mix_title = Request::input('mix_title') ? Request::input('mix_title') : $current->mix_title;\n\t\t\t}\n\n\t\t\t$before->save();\n\t\t\t$after->save();\n\t\t\t$current->save();\n\t\t\t\n\t\t\tif (\\Auth::User()->station->is_private) {\n\t\t\t\t$before->updateContentToTagsLinkStatic();\n\t\t\t\t$after->updateContentToTagsLinkStatic();\n\t\t\t\t$current->updateContentToTagsLinkStatic();\n\t\t\t} else {\n\t\t\t\t$before->updateContentToTagsLink();\n\t\t\t\t$after->updateContentToTagsLink();\n\t\t\t\t$current->updateContentToTagsLink();\n\t\t\t}\n\n\t\t\t//Replicate attachments for new before and after talk show recurrences\n\t\t\t$attachments = ConnectContentAttachment::where('content_id', $id)\n\t\t\t\t->get();\n\t\t\tforeach($attachments as $attachment) {\n\t\t\t\t$attachment_for_before = $attachment->replicate();\n\t\t\t\t$attachment_for_before->content_id= $before->id;\n\t\t\t\t$attachment_for_after = $attachment->replicate();\n\t\t\t\t$attachment_for_after ->content_id = $after->id;\n\t\t\t\t$attachment_for_current = $attachment->replicate();\n\t\t\t\t$attachment_for_current->content_id= $current->id;\n\t\t\t\t$attachment_for_before->save();\n\t\t\t\t$attachment_for_after->save();\n\t\t\t\t$attachment_for_current->save();\n\t\t\t\t//Should we delete the original attachments?\n\t\t\t}\n\n\n\t\t\t$original_event->removeConnectContent();\n\n\t\t\t$is_complete = false;\n\t\t\t$images = ConnectContentAttachment::where('content_id', '=', $current['id'])->whereIn('type', ['image', 'video', 'logo'])->first();\n\n\t\t\tif(count($images) > 0 && !empty($current['who']) && !empty($current['what']) && $current['action_id'] && !empty($current['action_params']) && $current['is_ready']) {\n\t\t\t\t$is_complete = true;\n\t\t\t}\n\n\t\t\t$current->is_complete = $is_complete;\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Talk Show Updated', 'data' => array('id'=> $id, 'before' => $before, 'after' => $after, 'current' => $current)));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "public function updateUserTodoAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Todo!');\n } else {\n if (isset($data['todo_type'])) {\n $todo->setTodo_type($data['todo_type']);\n }\n if (isset($data['text'])) {\n $todo->setText($data['text']);\n }\n if (!$todo->save()) {\n $this->setErrorResponse('cannot update Todo object');\n }\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n\n $this->_helper->json($todo);\n }", "public static function updateGroupEvent($request, $id, $event){\n $allDay = false;\n $start = \"\";\n $end = \"\";\n\n\n if($request->has('allDay')){\n $allDay = true;\n }else{\n $allDay = false;\n }\n\n\n if($request->eventStartDate == null && !$request->eventEndDate == null){\n $start = $request->oldStart;\n $end = $request->eventEndDate;\n }else if(!$request->eventStartDate == null && $request->eventEndDate == null){\n $start = $request->eventStartDate;\n $end = $request->oldEnd;\n }else if($request->eventStartDate == null && $request->eventEndDate == null){\n $start = $request->oldStart;\n $end = $request->oldEnd;\n }else{\n $start = $request->eventStartDate;\n $end = $request->eventEndDate;\n }\n\n\n\n $time_start = new DateTime($start);\n $time_end = new DateTime($end);\n $query = GroupEvents::where('user_id', $id)\n ->where('id', $event)\n ->update([\n 'event_title' => $request->eventTitle,\n 'event_description' => $request->eventDesc,\n 'full_day' => $allDay,\n 'time_start' => $time_start,\n 'time_end' => $time_end,\n 'color' => $request->eventColor,\n 'location' => $request->eventLocation,\n ]);\n }", "public function update($userId, $goalId)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $announcement = Announcement::find($id);\n if ($announcement != null) {\n if (date($announcement->planned_time) < now()) {\n return redirect()->route('announcements.index');\n } else {\n if ($request->get('planned_time_on') == true) {\n $date = new DateTime($request->get('planned_time'));\n $hours = new DateTime($request->get('planned_time_time'));\n $planned_time = $date->format('Y-m-d') . ' ' . $hours->format('H:i:s');\n $request->merge(['planned_time' => $planned_time]);\n } else {\n $request->merge(['planned_time' => date_create('now')->format('Y-m-d H:i:s')]);\n $request->merge(['planned_time_on' => false]);\n }\n $request->merge(['user_id' => $request->user()->id]);\n $request->validate(['body' => 'required|string|max:65535', 'planned_time' => 'required_unless:planned_time_on,false|date_format:Y-m-d H:i:s|sometimes', 'planned_time_on' => 'boolean']);\n $announcement->update($request->all());\n return redirect()->route('announcements.index')->with('success', 'Announcement Edited successfully!');\n\n }\n }\n return abort('404', 'Announcement Not Found!');\n }", "function edit_notes()\n {\n $query = $this->pdo->prepare('UPDATE note SET description=:description, updated_at=NOW() WHERE id=:id');\n $query->execute(array( ':description' => $_POST['edit-note-text'] ,':id' => $_POST['edit-note-id']));\n \n }", "public function updateEvent($id)\n {\n $id = (int)$id;\n $this->checkID($id);\n\n if ($this->input->post('start') === null) {\n $response = array(\"status\" => false, \"message\" => 'Please provide necessary data.');\n\n $this->send(400, $response);\n }\n\n $reqData = array(\n 'start' => $this->input->post('start'),\n 'id' => $id,\n 'updated_by' => $this->session->get('username'),\n 'course_desc' => $this->input->post('courseDesc'),\n 'certified_by' => $this->input->post('certifiedBy'),\n 'all_day_event' => (int)$this->input->post('allday'),\n 'end' => $this->input->post('end'),\n );\n\n $updated = $this->model->updateEvent($reqData);\n if ($updated === true) {\n $response = array(\"status\" => true, \"message\" => 'Event updated.');\n $this->send(200, $response);\n } else {\n $response = array(\"status\" => false, \"message\" => 'Event not updated.');\n $this->send(500, $response);\n }\n }", "public function update(Request $request, $id)\n {\n $event = EventCalendar::find($id);\n $event->title = $request->title;\n $starting_date = strtotime($request->starting_date);\n $event->starting_date = date('Y-m-d',$starting_date).' 00:00:01';\n $ending_date = strtotime($request->ending_date);\n $event->ending_date = date('Y-m-d', $ending_date).' 23:59:59';\n $event->school_id = school_id();\n $event->session = get_schools();\n if($event->save()) {\n flash(translate('event_has_been_updated_successfully'))->success();\n }\n \n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $date = date(\"Y-m-d h:m:s\");\n \n $edit = role_priviledge::getPriviledge(2);\n $publish = role_priviledge::getPriviledge(4);\n \n $record = faq::findOrFail($id);\n \n \n \n if($edit == '1')\n {\n \n $record->name = request('name');\n $record->description = request('description');\n $record->updated_at = $date;\n \n\n $record->save();\n \n Flash::success('FAQ was editted successfully.');\n return redirect()->route('faq.index');\n }\n else\n {\n Flash::warning('No Permission to Edit FAQ.');\n return redirect()->route('faq.index');\n }\n }", "public function update($id)\n\t{\n\t\tlog::info('inside update method of user-notifications controller');\n\t}", "public function anuncioUpdate($cliente_ref, $titulo, $descricao,$categoria, $telFixo, $telCel, $email, $descricaoBreve,$anunId,$whats){\n\n $this->setAnuncioWhats($whats);\n $this->setAnuncioClienteRef($cliente_ref);\n $this->setAnuncioTitulo($titulo);\n $this->setAnuncioDescricao($descricao);\n $this->setAnuncioCategoria($categoria);\n $this->setAnuncioTelFixo($telFixo);\n $this->setAnuncioTelCel($telCel);\n $this->setAnuncioEmail($email);\n $this->setAnuncioBreveDescricao($descricaoBreve);\n\n\n $sql = sprintf($this->update,$this->getAnuncioTitulo(), $this->getAnuncioDescricao(), $this->getAnuncioCategoria(), $this->getAnuncioTelFixo(), $this->getAnuncioTelCel(), $this->getAnuncioEmail(), $this->getAnuncioBreveDescricao(),$this->getAnuncioWhats(), $this->getAnuncioClienteRef(), $anunId);\n\n if($this->runQuery($sql)){\n\n } else {\n\n echo \"Não foi possível realizar a atualização do Anuncio.\" . $sql;\n }\n\n\n\n }", "public function updateAction() {\n \n $this->_form->customSubmitBtn = $this->xhr; \n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n $data = $this->_model->readNote($this->id)->toArray();\n $this->_form->populate($data);\n \n $this->result = Main_Forms_Handler::onPost($this->_form,\n $this->post,\n $this->_model,\n \"updateNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note updated.\",\n $this->xhr);\n \n \n $this->_onSubmit();\n \n }", "function update($room, $fromTime, $toTime, $subject, $category, $description, $allday, $recurrence_type, $recurence_id, $id){\n\nif($recurence_id == 0){\n edit_reservation($room, $id, $fromTime, $toTime, $subject, $category, $description, $allday, 0);\n \n} elseif($recurence_id > 0) {\n edit_reservations($recurence_id, $subject, $category, $description);\n}\n\n\n\n\n}", "public function update(Request $request, Event $event)\n {\n $this->validate($request,[\n 'title'=>'required',\n 'signup_start'=>'required|date|after:today',\n 'signup_end'=>'required|date|after:today',\n 'prize_date'=>'required|date|after:today',\n 'signup_num'=>'required',\n ],[\n 'start_time.after'=>'起始日期必须是今天之后!'\n ]);\n// dd($request->start_time);\n $event->update([\n 'title'=>$request->title,\n 'content'=>$request->contents??0,\n 'signup_start'=>strtotime($request->signup_start),\n 'signup_end'=>strtotime($request->signup_end),\n 'prize_date'=>$request->prize_date,\n 'signup_num'=>$request->signup_num,\n 'is_prize'=>intval($request->is_prize),\n ]);\n return redirect('event')->with('success','修改成功!');\n }", "public function editTopic(Request $request){\n if($user = Auth::user()) {\n // check if user is admin\n $is_admin = Auth::user()->is_admin;\n \n if ( $is_admin == 1 ){\n \n if ( $request->topic_id != 0){\n $topic_id = $request->topic_id;\n // echo $topic_id;\n if (Topic::where('id', $topic_id )->exists()) {\n $topic = Topic::find($topic_id);\n $topic->topic_name = is_null($request->topic_name) ? $topic->topic_name : $request->topic_name;\n $topic->topic_body = is_null($request->topic_body) ? $topic->topic_body : $request->topic_body;\n $topic->topic_tags = is_null($request->topic_tags) ? $topic->topic_tags : $request->topic_tags;\n $topic->topic_categories = is_null($request->topic_categories) ? $topic->topic_categories : $request->topic_categories;\n $topic->topic_full_body_text = is_null($request->topic_full_body_text) ? $topic->topic_full_body_text : $request->topic_full_body_text;\n $topic->topic_image = is_null($request->topic_image) ? $topic->topic_image : $request->topic_image;\n\n $topic->save();\n \n return response()->json([\n \"message\" => \"records updated successfully\"\n ], 200);\n } else {\n return response()->json([\n \"message\" => \"topic not found\"\n ], 404);\n \n }\n \n }\n }else{\n return response()->json([\n \"message\" => \"you dont have permissions\"\n ], 400);\n }\n }else{\n return response()->json([\n \"message\" => \"you dont have permissions\"\n ], 400);\n }\n }", "public function update(Request $request, $id)\n {\n\n\n $request->validate([\n 'event-title' => 'required',\n 'event-message' => 'required',\n 'eventStart-date' => 'required',\n 'event-time' => 'required'\n\n ]);\n\n $event = Event::find($id);\n if(Auth::check()){\n $logged_in_user = Auth::user()->name;\n }\n $registra = $event->event_registra;\n \n if(Gate::allows('update-event',$registra)){\n\n $title = request('event-title');\n $startDate = request('eventStart-date');\n $endDate = request('eventEnd-date');\n $time = request('event-time');\n $event_description = request('event-message');\n\n $event_description = preg_replace(\"/^<p.*?>/\", \"\", $event_description);\n $event_description = preg_replace(\"|</p>$|\", \"\", $event_description);\n $time = preg_replace('/\\s+/', '', $time) ;\n\n\n\n $event_details = $this->getEventdetails($id);\n foreach($event_details as $data)\n {\n $this->old_title = $data->title;\n $this->old_content = $data->description;\n $this->old_sdate = $data->start_date;\n $this->old_edate = $data->end_date;\n $this->old_stime = $data->start_time;\n }\n \n switch(true){\n case($title != $this->old_title):\n $changes[] = \"changed \".$this->old_title.\"\";\n break;\n case($startDate != $this->old_sdate):\n $changes[] = \"changed \".$this->old_sdate.\"\";\n break;\n case($endDate != $this->old_edate):\n $changes[] = \"changed \".$this->old_edate.\"\";\n break;\n case($time != $this->old_stime):\n $changes[] = \"changed \".$this->old_stime.\"\";\n break;\n }\n\n \n\n $event->title = $title;\n $event->start_date = $startDate;\n $event->end_date = $endDate;\n $event->start_time = $time;\n $event->description = $event_description;\n $event->event_registra = $logged_in_user;\n $registraEmail = Auth::user()->email;\n $registraPhone = Auth::user()->contact;\n $subject = \"Updated Event \".$this->old_title.\"\";\n\n $event_update_status = $event->save();\n\n if($event_update_status){\n\n $users = User::all();\n\n ($endDate == \"\")?\n $endDate_of_event = \"the same day\" : $endDate_of_event = $endDate;\n\n\n $data = array(\n 'title' => $title,\n 'description' => $event_description,\n 'start_date' => $startDate,\n 'end_date' => $endDate_of_event,\n 'time' => $time,\n 'registra' => $logged_in_user,\n 'registra_email' => $registraEmail,\n 'registraMobileNo' => $registraPhone,\n 'subject' => $subject,\n );\n\n $action = \"Updated an event with the title '\".$title.\"'\";\n LogsController::logger($action, $this->date_of_action);\n\n $notified = Notification::send($users, new EventNotifier($data));\n \n $central = new CentralController();\n\n if($central->is_connectedToInternet() == 1)\n {\n Mail::send('pages.mail.mail_event', $data, function($message) use ($title,$event_description, $startDate,$endDate_of_event,\n $time, $logged_in_user,$registraEmail,$registraPhone,$subject)\n { \n $message->from($registraEmail, 'Dallington');\n $message->to($registraEmail, 'Henry')->subject($subject);\n }); \n\n if(Mail::failures()){\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified with in the app notification but not via email because of internet connection issues');\n\n } \n\n else{\n\n return redirect('events')->with('event-success','Event has been updated successfully & all users of the system have been notified within the app notification & email'); \n }\n\n }\n\n else if($central->is_connectedToInternet() == 0)\n {\n return redirect('events')->with('event-success','Event has been updated successfully and all users of the system have been notified only in app notification');\n\n }\n\n\n\n }\n else\n {\n return redirect('events')->with('event-fail','Event has not been updated!');\n}\n\n}\n else\n {\n return redirect('/events')->with('event-fail','You cannot edit this event since you are not the one who created it!');\n}\n\n}", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'channel_id', 'link', 'start_time', 'end_time','hits', 'status'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Gou_Service_Notice::updateNotice($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function getUserAgendaByIdAction()\n {\n /** @var Object_Agenda $agenda */\n $data = $this->getRequestData();\n if (isset($data['agenda_id'])) {\n $agenda = Object_Agenda::getById($data['agenda_id']);\n if (!$agenda) {\n $this->setErrorResponse('no Agenda with this agenda_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $agenda->getCreator()->getId()) {\n $this->setErrorResponse('no Agenda for this user with current agenda_id!');\n }\n } else {\n $this->setErrorResponse('agenda_id is mandatory field for this request!');\n }\n $this->_helper->json($agenda);\n }", "public function update(Request $request)\n {\n\n $meeting = Meeting::findOrFail($request->meeting_id);\n $schedule = Schedule::findOrFail($request->schedule_id);\n\n //$this->authorize('AtenderCita', $schedule);\n\n $meeting->update([\"estado\"=>\"1\", \"observacion_med\" => $request->observacion]);\n $schedule->update([\"estado\"=>\"2\"]);\n\n return redirect()->route('horarios.index')->with('mensaje','La cita ha finalizado correctamente');\n\n }", "public function pausetimeAction()\n {\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvtime_obj = new Ep_Ftv_FtvPauseTime();\n if($user_params['type'] == 'pause')\n {\n ////for goroup Id in users table////\n $ftvtime_obj->ftvrequest_id=$user_params['requestId'];\n $ftvtime_obj->pause_at=date('Y-m-d H:i:s') ;\n $ftvtime_obj->resume_at=null;\n $ftvtime_obj->insert();\n }\n else\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id= '\".$user_params['requestId'].\"' AND resume_at is null\";\n $ftvtime_obj->updateFtvPauseTime($data,$query);\n }\n }", "function editTask() {\r\n\t\t$id = $_POST[\"taskid\"];\r\n \tif($_POST[\"title\"] == \"\" || $_POST[\"description\"] == \"\" || $_POST[\"duration\"] == \"\"){\r\n \t\techo \"Please fill in the field\";\r\n \t} else if (!is_numeric($_POST[\"duration\"])){\r\n \t\techo \"Duration can only contain numbers\";\r\n \t}\r\n \telse{\r\n \t\t$title = htmlspecialchars($_POST['title']);\r\n \t\t$description = htmlspecialchars($_POST['description']);\r\n \t\t$duration = htmlspecialchars($_POST['duration']);\r\n\t\t\t$conn = databaseConnection();\r\n\t\t\t$stmt = $conn->prepare(\"UPDATE tasks\r\n\t\t\t\t\tSET title = :title, description = :description, duration = :duration\r\n\t\t\t\t\tWHERE taskid= :id;\");\r\n\t\t\t$stmt->bindParam(':title', $title);\r\n\t\t\t$stmt->bindParam(':description', $description);\r\n\t\t\t$stmt->bindParam(':id', $id);\r\n\t\t\t$stmt->bindParam(':duration', $duration);\r\n\t\t\t$stmt->execute();\r\n\t\t\t$conn = null;\r\n\t\t\theader( \"Location: todo.php\" );\r\n \t};\t\r\n\t}", "public function update($id)\n {\n $request = request();\n\n //make sure the end date is in the future or equal to the start date,\n //but don't allow for an end date to be less than the start date.\n $validator = Validator::make($request->all(), [\n 'end' => 'required|date|after_or_equal:start'\n ]);\n\n if ($validator->fails()) {\n // set error message\n session()->flash('alert-danger', 'You can not make an event that has an end date before the start date!');\n\n return redirect()->back()->withInput();\n }\n\n $item = EventFacade::withoutGlobalScopes()->belongsToSite()->find($id);\n\n $data = $request->except('image', 'gallery', 'tags');\n\n // deal with post tags\n if ($request->has('tags')) {\n $tags = $request->input('tags');\n $item->addTags($tags);\n }\n\n $item->fill($data);\n\n $item->save();\n\n // set success message\n session()->flash('alert-success', 'Event saved successfully!');\n\n return redirect()->route('admin.event.edit', [$id]);\n }", "function update_project_task_timestamp($name, $description, $status, $taskId, $projectId, $timestampStart, $timestampEnd){\n\n global $connection;\n global $errors;\n global $data;\n\n //Get user\n $user = $_SESSION['$user'];\n\n //Query for updating project task\n $query = \"UPDATE task_table \n SET name = '$name', description = '$description', status = '$status', \n updated_by = '$user', date_start = '$timestampStart', date_end = '$timestampEnd'\n WHERE id = '$taskId'\";\n\n //Check if there is any errors\n if(!$result = mysqli_query($connection, $query)){\n $errors['sql'] = mysqli_error($connection);\n }\n else{\n $data['status'] = preg_replace(\"/_/i\", \" \", $status);\n update_project($projectId);\n }\n}", "function update_project_task($name, $description, $status, $taskId, $projectId){\n\n global $connection;\n global $errors;\n global $data;\n\n //Get user\n $user = $_SESSION['$user'];\n\n //Query for updating project task\n $query = \"UPDATE task_table \n SET name = '$name', description = '$description', status = '$status', \n updated_by = '$user', date_start = null, date_end = null\n WHERE id = '$taskId'\";\n\n //Check if there is any errors\n if(!$result = mysqli_query($connection, $query)){\n $errors['sql'] = mysqli_error($connection);\n }\n else{\n $data['status'] = preg_replace(\"/_/i\", \" \", $status);\n update_project($projectId);\n }\n}", "public function ics_update()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'minute_interval',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 60\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// If we are not currently in the time range, scram\n\t\t// -------------------------------------\n\n\t\t$time = date('Hi', time());\n\n\t\tif ($this->P->value('time_range_start', 'time') !== FALSE AND\n\t\t\t$this->P->value('time_range_start', 'time') > $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: It is not time to update icalendar data yet.');\n\t\t\treturn;\n\t\t}\n\t\telse if ($this->P->value('time_range_end', 'time') !== FALSE AND\n\t\t\t\t$this->P->value('time_range_end', 'time') < $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: The time to update icalendar data has passed.');\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->P->value('calendar_id') == '')\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// For those who prefer names over numbers\n\t\t\t// -------------------------------------\n\n\t\t\tif ($this->P->value('calendar_name') != '')\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendar_id_from_name($this->P->value('calendar_name'));\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Just a site ID -- get all calendars\n\t\t\t// -------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendars_by_site_id($this->P->value('site_id'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ids = explode('|', $this->P->value('calendar_id'));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Only look at calendars that are due for an update\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($ids) AND $this->P->value('minute_interval') !== FALSE)\n\t\t{\n\t\t\t$ids = $this->data->get_calendars_needing_update(\n\t\t\t\t$ids,\n\t\t\t\t$this->P->value('minute_interval')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Leave if empty\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Nobody is due for an update');\n\t\t\treturn;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Go get those data!\n\t\t// -------------------------------------\n\n\t\t$this->actions();\n\n//ee()->TMPL->log_item('Calendar: Fetching data');\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$this->actions->import_ics_data($id);\n\t\t}\n\t}", "function editUnote ($id_note,$operation) {\n\n if ($operation == \"delete\") {\n $query = \"DELETE FROM notes WHERE id_notes = '$id_note' AND ( creator = '{$_SESSION['login']}' OR id_schedule IN ( SELECT schedule.id FROM schedule INNER JOIN uschedule ON schedule.id = uschedule.id_schedule WHERE ( uschedule.login = '{$_SESSION['login']}' AND uschedule.rank = 2 ) OR schedule.administrator = '{$_SESSION['login']}' ) )\";\n $result = mysql_query($query) or die (mysql_error());\n return true;\n }\n\n /*\n * VEREFICADOR 1:\n * Procura a nota com o ID passado pela função, busca a agenda que essa nota está e verefica se o usuário da sessão está nela.\n * Retorna info da nota se ela pertence a uma agenda sua.\n * ( Verefica se não se trata de uma nota inválida para você ).\n */\n $query = \"SELECT * FROM notes WHERE id_notes = '$id_note' AND id_schedule IN ( SELECT schedule.id FROM schedule INNER JOIN uschedule ON schedule.id = uschedule.id_schedule WHERE uschedule.login = '{$_SESSION['login']}' )\";\n $result = mysql_query($query) or die (mysql_error());\n $get_note_info = mysql_fetch_assoc($result);\n if ($get_note_info == null) {\n $_SESSION['mensagem'] = \"Anotação não pertence as suas agendas!\";\n return false;\n } else {\n $alert_notes_time = $get_note_info['date'];\n }\n\n /* VEREFICADOR 2: Verefica se a anotação da Url já está salva nas notas do usuário. */\n $note_exist = false;\n $query = \"SELECT * FROM unotes WHERE id_notes = '$id_note' AND login = '{$_SESSION['login']}'\";\n $result = mysql_query($query) or die (mysql_error());\n while ($coluna = mysql_fetch_array($result)) {\n $note_exist = true;\n }\n\n /* Pegar o tempo de alerta padrão do usuário */\n $query = \"SELECT * FROM user WHERE login = '{$_SESSION['login']}'\";\n $result = mysql_query($query) or die (mysql_error());\n while ($coluna = mysql_fetch_array($result)) { $alert_user_time=$coluna['alert_time']; }\n\n /* Gera um horário de alerta baseado na data da nota e o tempo padrão do usuário */\n $alert_new_time = date(\"Y-m-d H:i:s\", strtotime($alert_notes_time) - $alert_user_time*60);\n\n /* Se encontrado algum dado: */\n if (!$note_exist && $operation == \"change\") {\n $query = \"INSERT INTO unotes(id_notes,login,alarm) VALUES('$id_note','{$_SESSION['login']}','$alert_new_time')\";\n $result = mysql_query($query) or die (mysql_error());\n return true;\n } else if ($note_exist && $operation == \"change\") {\n $query = \"DELETE FROM unotes WHERE id_notes = '$id_note' AND login = '{$_SESSION['login']}'\";\n $result = mysql_query($query) or die (mysql_error());\n return true;\n } else {\n $_SESSION['mensagem'] = \"Error!\";\n }\n\n return false;\n}", "public function postEdit($id)\n\t{\n\n\t\t$input = array_except(Input::all(), '_method');\n\t\t$validation = Validator::make($input, Announcement::$rules);\n\n // If validation fails, we'll exit the operation now.\n if ($validation->fails()) {\n // Ooops.. something went wrong\n return Redirect::back()->withInput()->withErrors($validation);\n }\n \t$announcement = $this->announcement->find($id);\n// var_dump($input);return;\n $input['publish'] = isset($input['publish'])?$input['publish']:'0';\n if ($announcement->update($input)) {\n // Redirect to the announcements page\n return Redirect::to(\"announcements/$id/edit\")->with('success', Lang::get('announcements/message.update.success'));\n }\n\n // Redirect to the announcements management page\n return Redirect::to(\"announcements/$id/edit\")->with('error', Lang::get('tweets/message.update.error'));\n\t}", "public function updated(AppointmentNote $note)\n {\n //\n }", "public function update(Request $request, $id)\n {\n try {\n $input = $request->only('subject', 'description', 'priority', 'custom_field_1', 'custom_field_2', 'custom_field_3', 'custom_field_4', 'status');\n $input['start_date'] = !empty($request->input('start_date')) ? $this->commonUtil->uf_date($request->input('start_date')) : null;\n $input['due_date'] = !empty($request->input('due_date')) ? $this->commonUtil->uf_date($request->input('due_date')) : null;\n $members = $request->input('user_id');\n \n $project_id = $request->get('project_id');\n $project_task = ProjectTask::where('project_id', $project_id)\n ->findOrFail($id);\n\n $project_task->update($input);\n $task_members = $project_task->members()->sync($members);\n\n // send notification to task members\n if (!empty($task_members['attached'])) {\n //check if user is a creator then don't notify him\n foreach ($task_members['attached'] as $key => $value) {\n if ($value == $project_task->created_by) {\n unset($task_members['attached'][$key]);\n }\n }\n //Used for broadcast notification\n $project_task['title'] = __('project::lang.task');\n $project_task['body'] = strip_tags(__(\n 'project::lang.new_task_assgined_notification',\n [\n 'created_by' => $request->user()->user_full_name,\n 'subject' => $project_task->subject,\n 'task_id' => $project_task->task_id\n ]\n ));\n $project_task['link'] = action('\\Modules\\Project\\Http\\Controllers\\ProjectController@show', ['id' => $project_task->project_id]);\n \n $this->projectUtil->notifyUsersAboutAssignedTask($task_members['attached'], $project_task);\n }\n\n $output = [\n 'success' => true,\n 'msg' => __('lang_v1.success')\n ];\n } catch (Exception $e) {\n \\Log::emergency(\"File:\" . $e->getFile(). \"Line:\" . $e->getLine(). \"Message:\" . $e->getMessage());\n\n $output = [\n 'success' => false,\n 'msg' => __('messages.something_went_wrong')\n ];\n }\n\n return $output;\n }", "public function updateOne($query, $body, $category_id, $date, $id){\n $stmt = $this->pdo->prepare($query);\n $stmt->execute([$body, $category_id, $date, $id]);\n }", "public function updateAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Donnees du tournoi\r\n\t\t$oEvent->setVal('name', Bn::getValue('nameevent'));\r\n\t\t$oEvent->setVal('date', Bn::getValue('dateevent'));\r\n\t\t$oEvent->setVal('organizer', Bn::getValue('organizer'));\r\n\t\t$oEvent->setVal('place', Bn::getValue('place'));\r\n\t\t$oEvent->setVal('numauto', Bn::getValue('numauto'));\r\n\t\t$oEvent->setVal('firstday', Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('lastday', Bn::getValue('lastday'));\r\n\t\t$season = Oseason::getSeason(Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('season', $season);\r\n\t\t$oEvent->save();\t\t\r\n\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\t\t$oExtras->setVal('regionid', Bn::getValue('regionid'));\r\n\t\t$oExtras->setVal('deptid', Bn::getValue('deptid'));\r\n\t\t$oExtras->save();\r\n\r\n\t\t// Message de fin\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\t\t$body->addWarning(LOC_LABEL_PREF_REGISTERED);\r\n\t\t$d = $body->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonCancel('btnCancel', LOC_BTN_CLOSE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$res = array('content' => $body->toHtml(),\r\n\t\t\t\t\t'title' => LOC_ITEM_GENERAL);\r\n\t\techo Bn::toJson($res);\r\n\t\treturn false;\r\n\t}", "public function edit_postAction() {\n\t\t$info = $this->getPost(array('id', 'status'));\n\t\t$ret = Activity_Service_ShareQq::update($info, intval($info['id']));\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功.');\n\t}", "public function update(Request $request, $id)\n {\n try{\n if($request->input('paciente_id') != ''){ #Atualizar\n $paciente = Paciente::find($request->input('paciente_id'));\n $paciente->telefone = $request->input('telefone');\n $paciente->celular = $request->input('celular');\n }else{ # Insere\n $dadoPaciente['nome'] = strtoupper(removeAcentos($request->input('nome_paciente')));\n $dadoPaciente['telefone'] = $request->input('telefone');\n $dadoPaciente['celular'] = $request->input('celular');\n $paciente = new Paciente($dadoPaciente);\n }\n $paciente->save();\n $dados['data'] = $request->input('data_marcar');\n $dados['plano_saude'] = $request->input('plano');\n $dados['especialidade_id'] = $request->input('especialidade');\n $dados['medico_id'] = $request->input('medico');\n $dados['horario'] = $request->input('horario_marcado');\n $dados['paciente_id'] = $paciente->id;\n $dados['marcou_user_id'] = Auth::id();\n $dados['unidade_id'] = $request->input('unidade_id');\n $data = explode('/',$request->input('data_marcar'));\n $agenda = Agenda::find($id);\n if($agenda->agenda_status_id == 2){ # Desistiu\n $dados['agenda_status_id'] = 1; # Marcado\n }\n if($agenda->update($dados)){\n $msg = 'alert-success|Consulta alterada com sucesso!';\n }else{\n $msg = 'alert-warning|Erro ao alterar consulta! Se o erro persistir, entre em contato com o administrador.';\n }\n }catch(Throwable $e){\n report($e);\n $msg = 'alert-warning|Erro ao alterar consulta! Se o erro persistir, entre em contato com o administrador.';\n }\n return redirect()->route('agenda.index', ['dia' => $data[0],'mes'=>$data[1],'ano'=>$data[2]])->with('alertMessage', $msg);\n }", "public function update_topic($data, $id){\n if(!$this->get_topic($id)){\n return false;\n }\n \n $this->db->where('id', $id);\n $this->db->update('pet_talk_topics', $data);\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n $reqModel = Yii::app()->getRequest()->getPost('Task');\n\n $user = new UserTask();\n\n $defaultUsers = array('user_id' => array());\n $assocUsers = UserTask::model()->findAllByAttributes(array('task_id' => $id));\n foreach ($assocUsers as $u)\n array_push($defaultUsers['user_id'], $u->user_id);\n\n $reqUser = Yii::app()->getRequest()->getPost('UserTask', $defaultUsers);\n $user->attributes = $reqUser;\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if ($reqModel !== null) {\n $model->attributes = $reqModel;\n if ($model->save()) {\n if ($reqUser !== null) {\n $user_ids = $reqUser['user_id'];\n $newUsers = UserTask::merge($model->id, $user_ids);\n $this->_sendAssociationNotification($newUsers, $model->id);\n $this->_sendEmailAssociationNotification($newUsers, $model->id);\n }\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.update.success.{id}', array('{id}' => $model->calc_id)));\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'user' => $user,\n ));\n }", "public function update($id)\n\t{\n\t\t\n $event = CalendarEvent::find($id);\n $directory = 'img/uploads/';\n $image = Input::file('img');\n \n $event->title = Input::get('title');\n $event->description = Input::get('description');\n $event->date = Input::get('date');\n $event->price = Input::get('price');\n $event->start_time = Input::get('start_time');\n if (!empty(Input::get('end_time'))) {\n $event->end_time = Input::get('end_time');\n } else {\n $event->end_time = null;\n }\n\n $event->location = Input::get('location');\n $event->address = Input::get('address');\n $event->city = Input::get('city');\n $event->state = Input::get('state');\n $event->zip = Input::get('zip');\n $event->user_id = 1;\n if (Input::hasFile('img')) {\n $event->img = $image->move($directory);\n }\n $event->save();\n\n Session::flash('successMessage', 'You updated ' . $event->title . ' event successfully');\n return Redirect::action('EventsController@index');\n\t}", "public function updateActById(){\n\t\ttry {\n $stmt=$this->db()->prepare(\"UPDATE trabajador set \n activo=:activo, fecha_baja=:fecha_baja WHERE nif=:nif\");\n\t\t\t$stmt->bindValue(':nif', $this->nif);\n $stmt->bindValue(':activo', $this->activo);\n\t\t\t$stmt->bindValue(':fecha_baja', $this->fecha_baja);\n $_SESSION['errMsg']['error'] = \"Usuario dado de baja\";\n\t\t\t$_SESSION['errMsg']['color']= \"alert-success\";\n\t\t\t$stmt->execute();\n\t\t} catch(PDOException $e) {\n $_SESSION['errMsg']['error'] = \"No se ha podido dar de baja el usuario\";\n\t\t\t$_SESSION['errMsg']['color']= \"alert-danger\";\n }\n }", "public function update(AgendaUpdateRequest $request, $id)\n {\n try {\n\n $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_UPDATE);\n\n $agenda = $this->repository->update($request->all(), $id);\n\n $response = [\n 'message' => 'Agenda updated.',\n 'data' => $agenda->toArray(),\n ];\n\n if ($request->wantsJson()) {\n\n return response()->json($response);\n }\n\n return redirect()->back()->with('message', $response['message']);\n } catch (ValidatorException $e) {\n\n if ($request->wantsJson()) {\n\n return response()->json([\n 'error' => true,\n 'message' => $e->getMessageBag()\n ]);\n }\n\n return redirect()->back()->withErrors($e->getMessageBag())->withInput();\n }\n }", "public function setAction($table, $body) {\n \t$user_id = $body['user'];\n\t$topic_subject = $body['topic'];\n\t\t\n if (strcmp($table, 'topics') == 0) {\n $sql = 'INSERT INTO `topics` (`topic_subject`, `topic_by`)';\n $values = \" VALUES ('$topic_subject', '$user_id')\";\n\t \n\t $result = $this->db->query($sql . $values);\n\t \n\t if ($result) {\n\t \t$sql = \"SELECT * FROM $table ORDER BY `topic_id` DESC LIMIT 1\";\n\t\t \n\t\treturn $this->db->query($sql);\n\t }\n }\n }", "public function update($attream);", "public function SaveAgenda ($agenda) {\n\t\t$this->db->insert(\"evento\", $agenda);\n\t}", "public function update(Request $request, $id)\n {\n $agenda = Agenda::find($id)->with('odontologo')->first();\n $agenda->Fecha = $request->Fecha;\n $agenda->Hora = $request->Hora;\n $agenda->Disponibilidad = $request->Disponibilidad;\n $agenda->IdOdontol = $agenda->odontologo->id;\n $agenda->save();\n\n BitacoraController::store($request, \"Datos de la Agenda Modificadados\");\n return redirect()->route('agendas.index')\n ->with('success', 'Funcion completada existosamente');\n\n }", "public function noticia_update_action()\r\n {\r\n $post = new PostFix();\r\n $id_post = Inputs::input($_POST['id_post']);\r\n $post->updateInfo($id_post, $_POST['titulo'], $_POST['subtitulo'], $_POST['corpo'], $_POST['id_user']);\r\n header(\"Location:\" . BASE_URL . \"noticias/noticia_update_form/?id=\" . $id_post);\r\n exit;\r\n }", "function updateUser($celestaid,$paid_amount,$ev_id,$user_data){\n $events_registered=json_decode($user_data[\"events_registered\"]);\n $email=$user_data[\"email\"];\n $events_charge=$user_data[\"events_charge\"];\n $amount_paid=$user_data[\"amount_paid\"];\n $events_charge+=$paid_amount;\n $amount_paid+=$paid_amount;\n\n $events=array();\n foreach($events_registered as $event){\n\t\t\t$evs_id=$event->ev_id;\n\t\t\t$amount=$event ->amount;\n\t\t\t$ev_name=$event ->ev_name;\n\t\t\t$team_name=$event ->team_name;\n\t\t\t$cap_name=$event ->cap_name;\n\n $add_event=array();\n $add_event[\"ev_id\"]=$evs_id;\n $add_event[\"ev_name\"]=$ev_name;\n \n if(!empty($team_name)){\n $add_event[\"team_name\"]=$team_name;\n $add_event[\"cap_name\"]=$cap_name;\n }\n\n if($evs_id==$ev_id){\n $add_event[\"amount\"]=$paid_amount;\n }else{\n $add_event[\"amount\"]=$amount;\n }\n $events[]=$add_event;\n }\n $events=json_encode($events);\n $sql=\"UPDATE users set events_registered='$events', events_charge=$events_charge, amount_paid=$amount_paid WHERE celestaid='$celestaid'\";\n $result=query($sql);\n\n confirm($result);\n }", "public function updating(Empleado $empleado)\n {\n //\n }", "public function getEventedit($id , $values = array() , $message = \"\");", "function do_updatestream($user)\r\n\t{\r\n $modified_by=$user['userid'];\r\n foreach(array(\"stream_id\",\"st_title\",\"st_description\",\"st_status\") as $i)\r\n\t\t\t$$i=$this->input->post($i);\r\n if($st_title=='') die(\"Please enter title\");\r\n\t\t$modified_time = time();\r\n $this->db->query(\"update m_streams set title=?,description=?,modified_by=?,modified_time=?,status=? where id=?\",array($this->prep($st_title),$this->prep($st_description),$modified_by,$modified_time,$st_status,$stream_id));\r\n \r\n\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Stream Updated\");\r\n\t\tredirect(\"admin/streams\");\r\n\t}", "public function update($id=null, $data=array())\n\t{\n\t\tif ($id)\n\t\t{\n\t\t\t$trigger_data = array('article_id'=>$id, 'data'=>$data);\n\t\t\tEvents::trigger('before_news_update', $trigger_data);\n\t\t}\n\n\t\t$return = parent::update($id, $data);\n\n\t\tif ($return)\n\t\t{\n\t\t\t$trigger_data = array('user_id'=>$id, 'data'=>$data);\n\t\t\tEvents::trigger('after_news_update', $trigger_data);\n\t\t}\n\n\t\treturn $return;\n\t}", "public function update(Request $request, Topic $topic)\n {\n //\n }", "public function update_event_attendee($id, $name = null, $email = null, $status = 0, $role = null, $type = null)\n {\n if (is_null($name) && is_null($email)) {\n return true; // Nothing to do\n }\n $query = 'UPDATE '.$this->Tbl['cal_attendee'].' SET eid=eid'\n .(!is_null($name) ? ',`name`=\"'.$this->esc($name).'\"' : '')\n .(!is_null($email) ? ',`email`=\"'.$this->esc($email).'\"' : '')\n .(!is_null($status) ? ',`status`=\"'.$this->esc($status).'\"' : '')\n .(!is_null($role) ? ',`role`=\"'.$this->esc($role).'\"' : '')\n .(!is_null($type) ? ',`type`=\"'.$this->esc($type).'\"' : '')\n .' WHERE `id`='.doubleval($id);\n return $this->query($query);\n }", "function update_task_angular($mysqli, $id, $name, $description, $jobtype_id, $start_time, \n\t\t\t\t\t\t\t $weekday_id, $apikey, $payload, $url, $format_id, $zip, $zip_destination, \n\t\t\t\t\t\t\t $copy, $copy_destination,$publishfiletowebserver,$webfolder,$webfilename, \n\t\t\t\t\t\t\t $ftp, $ftp_server, $ftp_user, $ftp_password, $interval_id, \n\t\t\t\t\t\t\t $folder, $filename, $notification, $notificationemails,$enabled) {\n\t$sql = \"UPDATE tasks\n\t\t\tset name = '$name',\n\t\t\tdescription = '$description',\n\t\t\tjobtype_id = $jobtype_id,\";\n\t\t\tif($start_time == \"\") {\n\t\t\t\t$sql .= \"start_time = null,\";\n\t\t\t} else {\n\t\t\t\t$sql .= \"start_time = '$start_time',\";\n\t\t\t}\n\t\t\t$sql .= \"weekday_id = $weekday_id,\n\t\t\tapikey = '$apikey',\n\t\t\tpayload = '$payload',\n\t\t\turl = '$url',\n\t\t\tformat_id = $format_id,\n\t\t\tzip = $zip,\n\t\t\tzip_destination = '$zip_destination',\n\t\t\tpublishfiletowebserver = $publishfiletowebserver,\n\t\t\twebfolder = '$webfolder',\n\t\t\twebfilename = '$webfilename',\n\t\t\tcopy = $copy,\n\t\t\tcopy_destination = '$copy_destination',\n\t\t\tftp = $ftp,\n\t\t\tftp_server = '$ftp_server',\n\t\t\tftp_user = '$ftp_user',\n\t\t\tftp_password = '$ftp_password',\n\t\t\tinterval_id = $interval_id,\n\t\t\tfolder = '$folder',\n\t\t\tfilename = '$filename',\n\t\t\tnotification = $notification,\n\t\t\tnotificationemails = '$notificationemails',\n\t\t\tenabled = $enabled\n\t\t\tWHERE id = $id\";\n\t$result = mysqli_query($mysqli,$sql);\n\tmysqli_close($mysqli);\n\t//echo $sql;\n\treturn $result;\n}", "public function update(Request $request, $id) {\n // validate the data\n $this->validate($request, array(\n 'date' => 'required|date|date_format:\"Y-m-d H:i:s',\n 'title' => 'required|max:255',\n 'category' => 'required'\n ));\n\n // store in the database\n $event = Event::find($id);\n if ($event && $event->status && $event->user_id == Auth::id()) { // check if event belgongs to this user\n $event->date = $request->date;\n $event->title = $request->title;\n if ($request->description != '') {\n $event->description = $request->description;\n }\n if (Auth::check()) { // check if logged in\n $event->user_id = Auth::id(); // assing user id\n }\n $event->slug = ($request->title != '' ? str_slug($request->title) : time()); // slug from title or timestamp\n if ($request->category > 0) {\n $event->category_id = $request->category;\n }\n $event->timezone = $request->timezone;\n if ($request->private == 'on') {\n $event->is_private = true;\n }\n // redirect to the specified resource if event is saved\n if ($event->save()) {\n Session::flash('success', 'Edited!');\n return redirect(route('events.edit', $event->id)); // redirect to user events\n }\n }\n return redirect(route('profile.events')); // redirect to user events\n }", "public function edit(AgendaItemSpeaker $agendaItemSpeaker)\n {\n //\n }", "public function update(Request $request, AutoReply $reply)\n {\n $this->validate($request, [\n 'did_id' => [\n 'required',\n Rule::exists('did', 'id')->where('account_id', $request->user()->account_id),\n ],\n 'source' => 'required|string',\n 'keyword' => 'nullable|string',\n 'text' => 'nullable|string',\n 'info' => 'nullable|string',\n 'mms' => 'nullable|image|max:10240',\n 'mms_url' => 'nullable|url',\n 'date' => 'nullable|array',\n 'date.date' => 'nullable|date_format:Y-m-d',\n 'date.from' => 'nullable|date_format:H:i',\n 'date.to' => 'nullable|date_format:H:i',\n 'weekdays' => 'nullable|array',\n 'weekdays.*.from' => 'nullable|date_format:H:i',\n 'weekdays.*.to' => 'nullable|date_format:H:i',\n 'enabled' => 'required|boolean',\n 'action' => 'nullable|in:update_first_name,update_last_name,update_name,schedule,appointment_register,appointment_cancel',\n ]);\n\n if ( ! Auth::user()->account->limits('long_messaging', false)) {\n $this->validate($request, ['text' => 'nullable|string|max:160',]);\n }\n\n if ($request->hasFile('mms') && Auth::user()->account->limits('mms', false)) {\n $mms = [\n 'mms' => url('storage/' . request()\n ->file('mms')\n ->storePublicly(\"accounts/{$request->user()->account_id}/mms\", 'public')),\n ];\n } elseif ($request->has('mms_url') && Auth::user()->account->limits('mms', false)) {\n $mms = ['mms' => $request->input('mms_url')];\n } else {\n $mms = [];\n }\n\n if ($request->has('keyword')) {\n $request->merge(['keyword' => snake_case($request->input('keyword'))]);\n }\n\n $weekdays = null;\n foreach ($request->input('weekdays', []) as $k => $v) {\n $weekdays[$k] = $v;\n $weekdays[$k]['status'] = isset($v['status']);\n }\n\n $reply->fill(array_merge($request->only([\n 'did_id',\n 'source',\n 'keyword',\n 'text',\n 'info',\n 'date',\n 'enabled',\n 'action',\n ]), $mms, ['weekdays' => $weekdays]));\n\n $reply->save();\n\n return response()->json(['message' => 'AutoReply successfully updated']);\n }", "public function updateEvento($idev, $idu,$passwordOwner, $tit, $data,$ora, $b_desc, $tipo, $categ, $city){\r\n if($this->isOwnerOfEvent($idu, $passwordOwner, $idev)){ \r\n if($idev !='' && $tit!='' && $data !='' && $b_desc!=''&& isset($tipo)&& isset($categ) && $city!=''){\r\n $t = $this->giveNomeTypeEvent($tipo);\r\n if($t != ''){\r\n $c = $this->giveNomeCatEvent($categ);\r\n if($c != ''){\r\n $city = mb_strtoupper($city, 'UTF-8');\r\n $city = self::$conn->real_escape_string($idu);\r\n $b_desc = self::escapeCharacters($b_desc);\r\n $b_desc = self::$conn->real_escape_string($b_desc);\r\n $tit = self::escapeCharacters($tit);\r\n $tit = self::$conn->real_escape_string($tit);\r\n $data = self::$conn->real_escape_string($data);\r\n $ora = self::$conn->real_escape_string($ora);\r\n $query = 'UPDATE '.$this->tables['eventoTable'] .\" SET titolo='$tit', dataEv='$data'\".\r\n \", breveDesc='$b_desc', tipo=$tipo, categ=$categ, city='$city' , ora='$ora' \".\r\n \" WHERE id ='$idev' AND creator='$idu'\";\r\n \r\n return self::$conn->query($query) ; \r\n }\r\n } \r\n } \r\n }\r\n return false;\r\n }", "function edit_reservation($room, $reservation_id, $fromTime, $toTime, $subject, $category, $description='', $allDay=0, $recurrence_id=0) {\n global $USER, $DB;\n\n\n if (!check_availability_excluding_id($room, $fromTime, $toTime,$reservation_id)) {\n $reservation = new stdClass();\n\n $reservation->id = $reservation_id;\n $reservation->subject = $subject;\n $reservation->startdate = $fromTime;\n $reservation->enddate = $toTime;\n $reservation->alldayevent = $allDay;\n $reservation->meetingorganizer = $USER->id;\n $reservation->categories = $category;\n $reservation->description = $description;\n $reservation->active = 1;\n $reservation->confirm = 0;\n $reservation->recurrence_id = $recurrence_id;\n\n return $DB->update_record('roomscheduler_reservations', $reservation);\n } else {\n return false;\n }\n}", "public function calendar_edit_item($ews, $event_id, $event_change_key, $subject, $body, $bodytype, $start_date, $end_date, $location, $attendees, $allday, $importance, $sensitivity, $cancelled)\n\t {\n $request = new EWSType_UpdateItemType();\n\t\t$request->ConflictResolution = 'AlwaysOverwrite';\n\t\t$request->MessageDisposition = 'SaveOnly';\n\t\tif(!empty($attendees)){\n\t\t\t$request->SendMeetingInvitationsOrCancellations = 'SendToChangedAndSaveCopy';\n\t\t}else{\n\t\t\t$request->SendMeetingInvitationsOrCancellations = 'SendToNone';\n\t\t}\n\n\t\t$request->ItemChanges = new EWSType_NonEmptyArrayOfItemChangesType();\n\t\t$request->ItemChanges->ItemChange->ItemId->Id = $event_id;\n\t\t$request->ItemChanges->ItemChange->ItemId->ChangeKey = $event_change_key;\n\t\t$request->ItemChanges->ItemChange->Updates = new EWSType_NonEmptyArrayOfItemChangeDescriptionsType();\n\t\t\n\t\t//popoulate update array\n\t\t$updates = array(\n\t\t\t'calendar:Start' => $start_date, //e.g. 2012-06-12T12:30:00+00:00\n\t\t\t'calendar:End'\t=> $end_date, //e.g. 2012-06-12T12:30:00+00:00\n\t\t\t'calendar:Location' => $location,\n\t\t\t'calendar:IsAllDayEvent' => $allday, //boolean true\n\t\t\t'calendar:IsCancelled' => $cancelled,\n\t\t\t'item:Importance' => $importance,\n\t\t\t'item:Sensitivity' => $sensitivity,\n\t\t\t'item:Subject' => $subject,\n\t\t);\n\t\t$n = 0;\n\t\t$request->ItemChanges->ItemChange->Updates->SetItemField = array();\n\n\t\tforeach($updates as $furi => $update){\n\t\t\tif($update){\n\t\t\t\t$prop = array_pop(explode(':',$furi));\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->FieldURI->FieldURI = $furi;\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->$prop = $update;\n\t\t\t\t$n++;\n\t\t\t}\n\t\t}\n\t\t//Update Attendees\n\t\t//Note: Only the organizer can update or change attendees, if you try to update an event that you are not the organizer of that has atendees you will recieve the error: \"Set action is invalid for property\"\n\t\tif(!empty($attendees)){\n\t\t\t$attendees = explode(\";\",$attendees);\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->FieldURI->FieldURI = 'calendar:RequiredAttendees';\n\t\t\tfor($i = 0; $i < count($attendees)-1; $i++){\n\t\t\t\t$toattend = explode(\"|\",$attendees[$i]);\n\t\t\t\t//Name of Attendee\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->Mailbox->Name = $toattend[0];\n\t\t\t\t//Email Address of Attendee\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->Mailbox->EmailAddress = $toattend[1];\n\t\t\t\t//Routing Type \n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->Mailbox->RoutingType = 'SMTP';\n\t\t\t\t//Responds Type of attendee\n\t\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->RequiredAttendees->Attendee[$i]->ResponseType = $toattend[2];\n\t\t\t}\n\t\t\t$n++;\t\n\t\t}\n\t\t//Update body\n\t\tif(!empty($body)){\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->FieldURI->FieldURI = 'item:Body';\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->Body->BodyType = $bodytype;\n\t\t\t$request->ItemChanges->ItemChange->Updates->SetItemField[$n]->CalendarItem->Body->_ = $body;\n\t\t\t$n++;\n\t\t}\n\t\t//print_r($request); die();\n\t\t\n\t\t$response = $ews->UpdateItem($request);\n\t\t\n\t\t//$responseCode = $response->ResponseMessages->UpdateItemResponseMessage->ResponseCode;\n\t\t//$id = $response->ResponseMessages->UpdateItemResponseMessage->Items->CalendarItem->ItemId->Id;\n\t\t//$changeKey = $response->ResponseMessages->UpdateItemResponseMessage->Items->CalendarItem->ItemId->ChangeKey;\t\n\t\t\n\t\t$event_data = array();\n\t\tarray_push($event_data,$response->ResponseMessages->UpdateItemResponseMessage);\n\t\treturn $event_data;\n\t\t//print_r($event_data);\n\t}", "function update_event($event_id,$event_title,$event_des,$event_place,$event_date,$event_detail){\n\tmysql_query(\"UPDATE `events` SET `event_title` = '$event_title' , `event_des` = '$event_des' , `event_place` = '$event_place' , `event_date` = '$event_date' , `event_detail` = '$event_detail' WHERE `event_id` = $event_id\");\n}", "function modifyEvent($values)\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('UPDATE bdd_satisfevent.events SET Title = ?, Date = ? WHERE idEvents = ?');\n $request->execute(array($values['Title'], $values['Date'], $values['idEvents']));\n}", "public function update($usrid)\n\t{\n\t\t// set Status to Accept/Decline\n\t\t\n\t\t$eid = Input::get('eid');\n\t\t$ans = Input::get('answer');\n\t\tif ($ans == 'accept'){\n\t\t\tDB::update(\"update joinevent set status = ? where event_id = ? and user_id = ?\"\n\t\t\t\t,array($ans,$eid,$usrid));\n\t\t}else{\n\t\t\tDB::delete(\"delete from joinevent where event_id = ? and user_id = ?\"\n\t\t\t\t,array($eid,$usrid));\n\t\t}\n\n\t\treturn Redirect::to('/myevent/'.$eid);\n\t\t\n\t}", "protected function editTaskAction() {}" ]
[ "0.6632084", "0.62234235", "0.6192552", "0.6128543", "0.59022623", "0.58283335", "0.5775609", "0.5708071", "0.568348", "0.5634259", "0.5601615", "0.55923986", "0.559096", "0.5513196", "0.5408754", "0.5382171", "0.5377417", "0.5375388", "0.5340474", "0.53366035", "0.5314729", "0.5306313", "0.5299379", "0.5272234", "0.52450603", "0.52396744", "0.52324104", "0.52121276", "0.520129", "0.5200845", "0.5191756", "0.519076", "0.5167857", "0.5159866", "0.51425785", "0.5126236", "0.5125518", "0.5124213", "0.5119579", "0.510405", "0.5100904", "0.5092134", "0.5079771", "0.506855", "0.50626", "0.506041", "0.50468755", "0.5039817", "0.5029215", "0.502714", "0.5016972", "0.5015399", "0.50041956", "0.49983153", "0.49962142", "0.49855536", "0.49854964", "0.4982133", "0.49761784", "0.49542752", "0.49529868", "0.49492908", "0.49459195", "0.49434677", "0.49376348", "0.49311998", "0.49290687", "0.49288493", "0.49203864", "0.49155965", "0.49099326", "0.49037734", "0.49033225", "0.48958588", "0.4895658", "0.48943254", "0.48914528", "0.48912737", "0.48865092", "0.48847097", "0.4879326", "0.48708662", "0.48672828", "0.48640442", "0.4860175", "0.48586565", "0.48579803", "0.4857971", "0.48569655", "0.48526397", "0.48493618", "0.4843136", "0.48402336", "0.48400164", "0.48388416", "0.48385838", "0.48350626", "0.483456", "0.4826292", "0.48242715" ]
0.7529481
0
this method gets topic type list
public function getAgendaTopicTypeListAction(){ /** @var Object_Agenda $agenda */ $this->getDeviceSession()->getUserId(); $agenda = new Object_Agenda(); $this->_helper->json($agenda->getClass()->getFieldDefinition('Topic')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTopicRecordTypes() {\n \treturn $this->manager->getTopicRecordTypes();\n\t}", "public function getTopicSearchRecordTypes() {\n \treturn $this->manager->getTopicSearchRecordTypes();\n\t}", "protected function getTypes() {}", "function getTypeslist ()\r\n\t{\r\n\t\t$query = 'SELECT id, name'\r\n\t\t\t\t. ' FROM #__flexicontent_types'\r\n\t\t\t\t. ' WHERE published = 1'\r\n\t\t\t\t. ' ORDER BY name ASC'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$types = $this->_db->loadObjectList();\r\n\t\treturn $types;\r\n\t}", "public function getTopics()\n {\n return [\n 'topicName' => 1\n ];\n }", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypes();", "public function getTypesList() {\n \t//maybe someday sorts them by course, student progress?\n \t$course_id = Auth::user()->course_id;\n Debugbar::info($course_id);\n $course = Course::find($course_id);\n Debugbar::info($course);\n $typesList = $course->questions;\n Debugbar::info($typesList);\n \treturn $typesList;\n }", "public function get_types()\n {\n }", "public static function getTypes();", "function getTopicInfos($topics, $type)\n{\n\t$db = database();\n\n\t$topicData = [];\n\t$boards_index = [];\n\n\t$db->fetchQuery('\n\t\tSELECT \n\t\t\tmf.subject, ml.body, ml.id_member, t.id_last_msg, t.id_topic, t.id_board, t.id_member_started,\n\t\t\tmem.signature, COALESCE(mem.real_name, ml.poster_name) AS poster_name, COUNT(a.id_attach) as num_attach\n\t\tFROM {db_prefix}topics AS t\n\t\t\tINNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)\n\t\t\tINNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)\n\t\t\tLEFT JOIN {db_prefix}members AS mem ON (mem.id_member = ml.id_member)\n\t\t\tLEFT JOIN {db_prefix}attachments AS a ON(a.attachment_type = {int:attachment_type} AND a.id_msg = t.id_last_msg)\n\t\tWHERE t.id_topic IN ({array_int:topic_list})\n\t\tGROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9',\n\t\t[\n\t\t\t'topic_list' => $topics,\n\t\t\t'attachment_type' => 0,\n\t\t]\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$topicData, &$boards_index, $type) {\n\t\t\t// all the boards for these topics, used to find all the members to be notified\n\t\t\t$boards_index[] = $row['id_board'];\n\n\t\t\t// And the information we are going to tell them about\n\t\t\t$topicData[$row['id_topic']] = [\n\t\t\t\t'subject' => $row['subject'],\n\t\t\t\t'body' => $row['body'],\n\t\t\t\t'last_id' => (int) $row['id_last_msg'],\n\t\t\t\t'topic' => (int) $row['id_topic'],\n\t\t\t\t'board' => (int) $row['id_board'],\n\t\t\t\t'id_member_started' => (int) $row['id_member_started'],\n\t\t\t\t'name' => $type === 'reply' ? $row['poster_name'] : User::$info->name,\n\t\t\t\t'exclude' => '',\n\t\t\t\t'signature' => $row['signature'],\n\t\t\t\t'attachments' => (int) $row['num_attach'],\n\t\t\t];\n\t\t}\n\t);\n\n\treturn [$boards_index, $topicData];\n}", "protected function _listTypes()\n {\n global $config;\n $types = objects::types();\n\n $result = array();\n foreach ($types as $type) {\n $infos = objects::infos($type);\n $result[$type] = $infos['name'];\n }\n return $result;\n }", "private function resource_type_list() {\n\n\t\t$this->load_site_settings();\n\n\t\tif($this->res_list != false) {\n\t\t\treturn $this->res_list;\n\t\t}\n\n\t\tif(is_array($this->settings['eeck_resourcetypes'])) {\n\t\t\t$this->res_list = array();\n\n\t\t\tforeach($this->settings['eeck_resourcetypes'] as $res) {\n\t\t\t\t$this->res_list[] = $res['name'];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->res_list;\n\t}", "public function list_types()\n\t{\n\t\t// Get all types that the user has permission to view.\n\t\t$types = $this->types->find_authed('queue_discussion');\n\n\t\tif (empty($types))\n\t\t{\n\t\t\treturn $this->helper->needs_auth();\n\t\t}\n\n\t\t// Redirect to specific type if user only has access to one.\n\t\tif (sizeof($types) == 1)\n\t\t{\n\t\t\tredirect($this->get_type_url($this->get_type_from_id($types[0])));\n\t\t}\n\n\t\t$counts = $this->get_type_topic_counts($types);\n\n\t\tforeach ($types as $id)\n\t\t{\n\t\t\t$type = $this->get_type_from_id($id);\n\t\t\t$this->template->assign_block_vars('categories', array(\n\t\t\t\t'U_VIEW_CATEGORY'\t=> $this->get_type_url($type),\n\t\t\t\t'CATEGORY_NAME'\t\t=> $type->lang['langs'],\n\t\t\t\t'CATEGORY_CONTRIBS' => $counts[$id],\n\t\t\t));\n\t\t}\n\n\t\t$this->display->assign_global_vars();\n\t\t$this->generate_navigation('queue_discussion');\n\t\t$this->template->assign_vars(array(\n\t\t\t'S_QUEUE_LIST'\t=> true,\n\t\t));\n\n\t\treturn $this->helper->render('manage/queue.html', 'QUEUE_DISCUSSION');\n\t}", "public function getTypes(): array;", "public function getTypes(): array;", "function return_topic_list_data( $view_as_guest=0 )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$topics = array();\n\t\t\n\t\t$this->ipsclass->init_load_cache( array( 'attachtypes' ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Set up\n\t\t//-----------------------------------------\n\n\t\t$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'started' ) ? 'start_date' : $this->topic_list_config['order_field'];\n\t\t$this->topic_list_config['order_field'] = ( $this->topic_list_config['order_field'] == 'lastpost' ) ? 'last_post' : $this->topic_list_config['order_field'];\n\t\t$this->topic_list_config['forums'] = ( is_array( $this->topic_list_config['forums'] ) ) ? implode( \",\", $this->topic_list_config['forums'] ) : $this->topic_list_config['forums'];\n\t\t\n\t\t//-----------------------------------------\n\t\t// Fix up allowed forums\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->topic_list_config['forums'] )\n\t\t{\n\t\t\t# Init forums...\n\t\t\tif ( $view_as_guest )\n\t\t\t{\n\t\t\t\t$this->ipsclass->perm_id_array = explode( ',', $this->ipsclass->create_perms_from_group( $this->ipsclass->vars['guest_group'] ) );\n\t\t\t\t$this->ipsclass->forums->strip_invisible = 1;\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->forums->forums_init();\n\t\t\t\n\t\t\t# Reset topics...\n\t\t\tif ( $this->topic_list_config['forums'] == '*' )\n\t\t\t{\n\t\t\t\t$_tmp_array \t\t\t\t\t = array();\n\t\t\t\t$this->topic_list_config['forums'] = '';\n\t\t\t\t\n\t\t\t\tforeach( $this->ipsclass->forums->forum_by_id as $id => $data )\n\t\t\t\t{\n\t\t\t\t\t$_tmp_forums[] = $id;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_tmp_forums = explode( ',', $this->topic_list_config['forums'] );\n\t\t\t\t$_tmp_array \t\t\t\t\t = array();\n\t\t\t\t$this->topic_list_config['forums'] = '';\n\t\t\t}\n\t\t\t\n\t\t\tforeach( $_tmp_forums as $_id )\n\t\t\t{\n\t\t\t\tif ( $view_as_guest )\n\t\t\t\t{\n\t\t\t\t\tif ( ! $this->ipsclass->forums->forums_quick_check_access( $_id ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_tmp_array[] = $_id;\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$_tmp_array[] = $_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->topic_list_config['forums'] = implode( ',', $_tmp_array );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->build_query( array( 'select' => 't.*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'topics' => 't' ),\n\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 't.approved=1 AND t.forum_id IN (0,'.$this->topic_list_config['forums'].')',\n\t\t\t\t\t\t\t\t\t\t\t 'order' => $this->topic_list_config['order_field'].' '.$this->topic_list_config['order_by'],\n\t\t\t\t\t\t\t\t\t\t\t\t 'limit' => array( $this->topic_list_config['offset'], $this->topic_list_config['limit'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t 'add_join' => array( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0 => array( 'select' => 'p.*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => array( 'posts' => 'p' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => 't.topic_firstpost=p.pid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 1 => array( 'select' => 'm.id as member_id, m.members_display_name as member_name, m.mgroup, m.email',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 'from' => array( 'members' => 'm' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"m.id=p.author_id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'select' => 'f.id as forum_id, f.name as forum_name, f.use_html',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t 'from' => array( 'forums' => 'f' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"t.forum_id=f.id\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'type' => 'left' ) )\n\t\t\t\t\t\t\t\t\t\t) );\n\t\t\n\t\t$this->ipsclass->DB->exec_query();\n\t\t\n\t\twhile( $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\tif( $row['topic_hasattach'] )\n\t\t\t{\n\t\t\t\t$this->attach_pids[] = $row['pid'];\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Guest name?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$row['member_name'] = $row['member_name'] ? $row['member_name'] : $row['author_name'];\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Topic link\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$row['link-topic'] = $this->ipsclass->base_url.'showtopic='.$row['tid'];\n\t\t\t$row['link-forum'] = $this->ipsclass->base_url.'showforum='.$row['forum_id'];\n\t\t\t\n\t\t\t$topics[] = $row;\n\t\t}\n\t\t\n\t\tif( count( $this->attach_pids ) )\n\t\t{\n\t\t\t$final_attachments = array();\n\t\t\t\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'attachments',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"attach_rel_module='post' AND attach_rel_id IN (\".implode(\",\", $this->attach_pids).\")\"\n\t\t\t\t\t\t\t\t\t\t\t\t ) );\n\n\t\t\t$this->ipsclass->DB->simple_exec();\n\t\t\t\n\t\t\twhile ( $a = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$final_attachments[ $a[ 'attach_pid' ] ][ $a['attach_id'] ] = $a;\n\t\t\t}\n\t\t\t\n\t\t\t$final_topics = array();\n\t\t\t\n\t\t\tforeach( $topics as $mytopic )\n\t\t\t{\n\t\t\t\t$this_topic_attachments = array();\n\t\t\t\t\n\t\t\t\tforeach ( $final_attachments as $pid => $data )\n\t\t\t\t{\n\t\t\t\t\tif( $pid <> $mytopic['pid'] )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$temp_out = \"\";\n\t\t\t\t\t$temp_hold = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach( $final_attachments[$pid] as $aid => $row )\n\t\t\t\t\t{\n\t\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t// Is it an image, and are we viewing the image in the post?\n\t\t\t\t\t\t//-----------------------------------------\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->ipsclass->vars['show_img_upload'] and $row['attach_is_image'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ( $this->ipsclass->vars['siu_thumb'] AND $row['attach_thumb_location'] AND $row['attach_thumb_width'] )\n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t$this_topic_attachments[] = array( 'size' \t\t=> $this->ipsclass->size_format( $row['attach_filesize'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'method' \t=> 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t=> $row['attach_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'file'\t\t=> $row['attach_file'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hits'\t\t=> $row['attach_hits'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_location'\t=> $row['attach_thumb_location'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'thumb',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_x'\t=> $row['attach_thumb_width'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_y'\t=> $row['attach_thumb_height'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ext'\t\t=> $row['attach_ext'],\n\t\t\t\t\t\t\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\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this_topic_attachments[] = array( 'size' \t\t=> $this->ipsclass->size_format( $row['attach_filesize'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'method' \t=> 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t=> $row['attach_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'file'\t\t=> $row['attach_file'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hits'\t\t=> $row['attach_hits'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_location'\t=> $row['attach_thumb_location'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'image',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_x'\t=> $row['attach_thumb_width'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_y'\t=> $row['attach_thumb_height'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ext'\t\t=> $row['attach_ext'],\n\t\t\t\t\t\t\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}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this_topic_attachments[] = array( 'size' \t\t=> $this->ipsclass->size_format( $row['attach_filesize'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'method' \t=> 'post',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t\t=> $row['attach_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'file'\t\t=> $row['attach_file'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'hits'\t\t=> $row['attach_hits'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_location'\t=> $row['attach_thumb_location'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'type'\t\t=> 'reg',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_x'\t=> $row['attach_thumb_width'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'thumb_y'\t=> $row['attach_thumb_height'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ext'\t\t=> $row['attach_ext'],\n\t\t\t\t\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}\n\t\t\t\t}\n\n\t\t\t\tif( count( $this_topic_attachments ) )\n\t\t\t\t{\n\t\t\t\t\t$mytopic['attachment_data'] = $this_topic_attachments;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$final_topics[] = $mytopic;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Return...\n\t\t//-----------------------------------------\n\t\t\t\t\n\t\tif( count( $final_topics ) )\n\t\t{\n\t\t\treturn $final_topics;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $topics;\n\t\t}\t\t\t\n\t}", "public function get_desired_types();", "public function getTopics($type = null, $param = null, $page = 1, $limit = RESULTS_LIMIT) {\n $cond = array('Topic.group_id' => 0);\n $order = null;\n $limit = Configure::read('Topic.topic_item_per_pages');\n \n if ($type == 'group')\n $this->unbindModel(array('belongsTo' => array('Category')));\n else\n $this->unbindModel(array('belongsTo' => array('Group')));\n\n switch ($type) {\n case 'category':\n if (!empty($param)) {\n $cond = array('Topic.category_id' => $param, 'Category.type' => 'Topic');\n $order = 'Topic.pinned desc, Topic.last_post desc';\n }\n\n break;\n\n case 'friends':\n if ($param) {\n App::import('Model', 'Friend');\n $friend = new Friend();\n $friends = $friend->getFriends($param);\n $cond = array('Topic.user_id' => $friends, 'Topic.group_id' => 0);\n }\n break;\n\n case 'home':\n case 'my':\n if (!empty($param))\n $cond = array('Topic.user_id' => $param, 'Topic.group_id' => 0);\n\n break;\n\n case 'user':\n if ($param)\n $cond = array('Topic.user_id' => $param, 'Topic.group_id' => 0);\n\n break;\n\n case 'search':\n if ($param)\n $cond = array('Topic.group_id' => 0, 'MATCH(Topic.title, Topic.body) AGAINST(? IN BOOLEAN MODE)' => urldecode($param));\n\n break;\n\n case 'group':\n if (!empty($param)) {\n $cond = array('Topic.group_id' => $param);\n $order = 'Topic.pinned desc, Topic.last_post desc';\n }\n\n break;\n default:\n $order = 'Topic.pinned desc, Topic.last_post desc';\n }\n\n //only get topics of active user\n $cond['User.active'] = 1;\n $cond = $this->addBlockCondition($cond);\n $topics = $this->find('all', array('conditions' => $cond, 'order' => $order, 'limit' => $limit, 'page' => $page));\n $uid = CakeSession::read('uid');\n App::import('Model', 'NotificationStop');\n $notificationStop = new NotificationStop();\n foreach ($topics as $key => $topic){\n $notification_stop = $notificationStop->find('count', array('conditions' => array('item_type' => APP_TOPIC,\n 'item_id' => $topic['Topic']['id'],\n 'user_id' => $uid)\n ));\n $topics[$key]['Topic']['notification_stop'] = $notification_stop;\n }\n \n return $topics;\n }", "public function getAllTopic()\n {\n return $this->dal->getTopic(null,false);\n }", "public function topicLists()\n {\n $this->adapter = $this->serviceLocator->get('Zend\\Db\\Adapter\\Adapter');\n $sql = \"select * from topics\";\n $statement = $this->adapter->query($sql);\n $result = $statement->execute();\n\n return $result;\n }", "public function getTodoTypeListAction(){\n /** @var Object_Todo $todo */\n $this->getDeviceSession()->getUserId();\n $todo = new Object_Todo();\n $this->_helper->json($todo->getClass()->getFieldDefinition('Todo_type'));\n }", "public function get_subtypes()\n {\n }", "public function list_of($type)\n {\n }", "function getWordTypes(){\n\treturn $this->db->get_where('word_types', array('is_active' => 1 ))->result_array();\n }", "public function getSubscriptionTypes();", "function getTopics()\n {\n\n $topics = \"SELECT * from topics\";\n $topicsresult = $this->ds->select($topics); \n //print_r($topicsresult);\n return $topicsresult;\n }", "public function getTypeList()\n {\n $this->db->select(\"tt_code, tt_code ||' - '|| tt_desc as tt_code_desc\");\n $this->db->from(\"ims_hris.training_type\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function get_section_post_types(){\n $id = vezba_get_option( 'ddlSections' );\n\n $section = wp_remote_get( 'http://www.iwa-network.org/wp-json/wp/v2/sections/'. $id );\n $body = wp_remote_retrieve_body( $section );\n $data = json_decode( $body, true );\n\n // Get all section post types\n foreach( $data as $key => $value ) {\n if( is_array( $value ) ) {\n $counter = 0;\n foreach( $value as $item ) {\n $links = $value['wp:post_type']; \n }\n }\n } \n return $links;\n}", "function document_types () {\n $type_array = array ();\n $documents_query_raw = \"\n select \n document_types_id,\n type_description\n from \n \" . TABLE_DOCUMENT_TYPES . \"\n where\n type_visible = 'True'\n order by \n sort_order\n \";\n\n $documents_query = tep_db_query ($documents_query_raw);\n while ($documents = tep_db_fetch_array ($documents_query) ) {\n $type_array[] = array ('id' => $documents['document_types_id'],\n 'text' => $documents['type_description']\n );\n } // while ($documents\n\n return $type_array;\n}", "public function getPageTypes() {}", "public static function getTypesList()\n {\n return ArrayHelper::map(Yii::$app->get('cms')->getPageTypes(), 'type', 'name');\n }", "public function topic($flag = NULL) {\n $incomingFormData = $this->readHttpRequest();\n $formData = json_decode($incomingFormData);\n $TopicList = $this->Coursematerial_model->getTopicList($formData);\n\n if ($flag == 1) {\n return $TopicList;\n }\n echo json_encode($TopicList);\n }", "function getAvailableTypes() {\n return array('public' => 'public microtext',\n 'private' => 'private microtext',\n 'book' => 'microbuilder book microtext' );\n }", "public function get_types()\n\t{\n\t\treturn array();\n\t}", "public function index()\n {\n return Topic::all();\n }", "public function index()\n {\n return Topic::all();\n }", "public function index()\n {\n return Topic::all();\n }", "function get_by_type($type) {\r\n\t\t\t$output = array();\r\n\t\t\t$posts_array = get_posts( 'post_type=' . $type ); \r\n\t\t\tforeach( $posts_array as $post ) {\r\n\t\t\t\tsetup_postdata($post); \r\n\t\t\t\t$output[$post->ID] = $post->post_title ;\r\n\t\t\t}\r\n\t\t\treturn $output;\r\n\t\t}", "public function get_cahnrs_topics() {\n\n\t\t$topics = array();\n\n\t\t$response = wp_remote_get( 'http://api.wpdev.cahnrs.wsu.edu/?service=topics' );\n\t\tif ( ! is_wp_error( $response ) ) {\n\t\t\t$body = wp_remote_retrieve_body( $response );\n\t\t\tif ( ! is_wp_error( $body ) ) {\n\t\t\t\t$topics = json_decode( $body, true );\n\t\t\t}\n\t\t}\n\n\t\treturn $topics;\n\n\t}", "function getTypes($switch = 'page') {\n\n\t$themePath = path_content('themes') . '/' . \\Setting::get('active_theme');\n\t$list = scandir($themePath);\n\t$types = [];\n\n\tif(!empty($list)) {\n\t\tunset($list[0]);\n\t\tunset($list[1]);\n\n\t\tforeach($list as $name) {\n\n\t\t\tif(\\Raindrop\\Helper\\Common::searchMatchString($name, $switch)) {\n\t\t\t\tlist($switch, $key) = explode('-', $name, 2);\n\n\t\t\t\tif(!empty($key)) {\n\t\t\t\t\tlist($nameType) = explode('.', $key ,2);\n\t\t\t\t\t$types[$nameType] = ucfirst($nameType);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $types;\n}", "public function list() {\n foreach ($this->instance->registered_post_types as $key => $registered_post_type) {\n WP_CLI::line($registered_post_type->get_post_type());\n }\n }", "public function getTopics()\n {\n $headers = $this->getDefaultHeaders();\n\n // Accecpt header is needed to fetch the topics\n $headers[\"Accept\"] = \"application/vnd.github.mercy-preview+json\";\n\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo . \"/topics\",\n array(\n \"headers\" => $headers\n )\n );\n\n if ($response->getStatusCode() == 200) {\n $body = $response->getBody();\n $body = json_decode($body, true);\n return $body[\"names\"];\n }\n\n return array();\n }", "public function get_type_list($survey_type_id=0)\r\n\t{\r\n\t\t$query = \"SELECT k.* FROM GES_M_kuesioner k WHERE k.survey_type_id = $survey_type_id \";\r\n\t\treturn $this->survey->query($query)->result();\r\n\r\n\t}", "function getTypes() {\n\t\treturn $this->types;\n\t}", "function jgantt_dashboard_get_content_types() {\n $types = array();\n $result = db_query('SELECT d.node_type, d.configuration\n FROM {jgantt_dashboard} d WHERE d.status = :status', array(':status' => 1));\n\n foreach ($result as $record) {\n $types[$record->node_type] = $record;\n }\n return $types;\n}", "public function get_types()\n\t{\n\t\treturn $this->driver_query('type_list', FALSE);\n\t}", "function getProductTypes(){\n\t\t$id = $_GET['id'];\n\t\t$elem_id = $_GET['elem_id'];\n\t\t$wc = $this->getWc($id);\n\t\t$types = array();\n\t\tforeach ($wc as $k=>$v){\n\t\t\t$types[$v['ptid']] = true;\n\t\t}\n\t\tif ($elem_id){\n\t\t\t$elem = $this->getWc($id, $elem_id);\n\t\t\tunset($types[$elem['ptid']]);\n\t\t}\n\t\t$sql = \"SELECT id, name FROM product_types WHERE visible > 0 AND id NOT IN ('\".implode(\"', '\", array_keys($types)).\"')\";\n\t\t$rows = sql_getRows($sql, true);\n\t\treturn $rows;\n\t}", "public function get_all_message_type()\n\t{\n\t\t$query = $this->db->get('message_type');\n\t\treturn $query;\n\t}", "public function get_topics()\n {\n return $this->connection->query_select_value('threads', 'COUNT(*)');\n }", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public static function types() : array\n {\n return ['questions', 'pictures', 'video'];\n }", "public static function getTypes($type) {\n switch($type) {\n case \"users\":\n $users_info = array(\"users_login\" => \"login\",\n \"password\" => \"password\",\n \"users_email\" => \"email\",\n \"language\" => \"languages_NAME\",\n \"users_name\" => \"name\",\n \"users_surname\" => \"surname\",\n \"active\" => \"active\",\n \"user_type\" => \"user_type\",\n \"registration_date\" => \"timestamp\");\n return $users_info;\n case \"users_to_courses\":\n return array(\"users_login\" => \"users_login\",\n \"courses_name\" => \"courses.name\",\n \"course_start_date\" => \"users_to_courses.from_timestamp\",\n \"course_user_type\" => \"users_to_courses.user_type\",\n \"course_completed\" => \"users_to_courses.completed\",\n \"course_comments\" => \"users_to_courses.comments\",\n \"course_score\" => \"users_to_courses.score\",\n \"course_active\" => \"users_to_courses.active\",\n \"course_end_date\" => \"users_to_courses.to_timestamp\");\n case \"users_to_groups\":\n return array(\"users_login\" => \"users_login\",\n \"group_name\" => \"groups.name\");\n }\n }", "public static function getTypes($type) {\n switch($type) {\n case \"users\":\n $users_info = array(\"users_login\" => \"login\",\n \"password\" => \"password\",\n \"users_email\" => \"email\",\n \"language\" => \"languages_NAME\",\n \"users_name\" => \"name\",\n \"users_surname\" => \"surname\",\n \"active\" => \"active\",\n \"user_type\" => \"user_type\",\n \"registration_date\" => \"timestamp\");\n return $users_info;\n case \"users_to_courses\":\n return array(\"users_login\" => \"users_login\",\n \"courses_name\" => \"course_name\",\n \"course_start_date\" => \"from_timestamp\",\n \"course_user_type\" => \"user_type\",\n \"course_completed\" => \"completed\",\n \"course_comments\" => \"comments\",\n \"course_score\" => \"score\",\n \"course_active\" => \"active\",\n \"course_end_date\" => \"to_timestamp\");\n case \"users_to_groups\":\n return array(\"users_login\" => \"users_login\",\n \"group_name\" => \"groups.name\");\n }\n }", "function currentTypes($id){\n\t$term_id = get_the_terms($id, 'marcato_type');\n\t$terms = \"\";\n\tforeach($term_id as $genre){\n\t//\tprint_r($genre->name);\n\t\t$terms .= strtolower($genre->name) . \" \";\n\t}\n\n\treturn $terms;\n}", "public static function types()\n\t{\n\t\t$states = array(\n\t\t\t'blog' => __('Blog'),\n\t\t\t'page' => __('Page'),\n\t\t\t'user' => __('User')\n\t\t);\n\n\t\t$values = Module::action('gleez_types', $states);\n\n\t\treturn $values;\n\t}", "function get_type($type,$lang_id = NULL)\n\t{\n\t\t$list = $this->cache_get($type);\n\n\t\t// Loc danh sach cat theo cat hien tai\n\t\tif ($lang_id == NULL)// neu truyen lang\n\t\t{\n\t\t\t$lang_id = lang_get_cur()->id;\n\t\t}\n\t\t//pr($lang_id);\n\t\t//pr($list);\n\t\t// Them ten cua cac the content vao de tien lay thong tin\n\t\tforeach ($list as $row)\n\t\t{\n\t\t\t// lay lang mac dinh\n\t\t\tif(isset($row->_content[$lang_id])) {\n\t\t\t\t$content = (array)$row->_content[$lang_id];\n\t\t\t\tforeach ($content as $k => $v)\n\t\t\t\t\t$row->$k = $v;\n\t\t\t}\n\t\t}\n\t\treturn $list;\n\t}", "function &ListContentTypes()\n\t{\n\t\tglobal $gCms;\n\t\t$contenttypes =& $gCms->contenttypes;\n\t\t\n\t\tif (isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\t$variables =& $gCms->variables;\n\t\t\treturn $variables['contenttypes'];\n\t\t}\n\t\t\n\t\t$result = array();\n\t\t\n\t\treset($contenttypes);\n\t\twhile (list($key) = each($contenttypes))\n\t\t{\n\t\t\t$value =& $contenttypes[$key];\n\t\t\t$result[] = $value->type;\n\t\t}\n\t\t\n\t\t$variables =& $gCms->variables;\n\t\t$variables['contenttypes'] =& $result;\n\n\t\treturn $result;\n\t}", "public function getTopicsSelect(){\n\t\treturn Go_Factory::getDbTable( 'Forum_Model_Post' )->selectTopicsByCategoryId( $this->getId() );\n\t}", "public function getTermTypes()\n {\n $pageIds = $this->database->getPageIdsRecursive(\n $this->controller->configModel->get('storageFolder'),\n $this->controller->configModel->get('recurseDepth')\n );\n if ($pageIds === false) {\n throw new \\tx_nclib_exception('label_error_no_pages_found', $this->controller);\n }\n $fields = 'DISTINCT termtype';\n $startTime = $this->controller->dateFilter['iStartTime'];\n $endTime = $this->controller->dateFilter['iEndTime'];\n $where = array(\n 'termtype != \\'\\'',\n 'hidden=0',\n 'deleted=0',\n 'type=' . $this->getModelType(),\n 'publishdate >= ' . $startTime,\n 'publishdate <= ' . $endTime,\n sprintf('%s.pid in (%s)', $this->getTableName(), implode(',', $pageIds)),\n );\n $where = $this->database->getWhere($where);\n $orderBy = 'termtype';\n $groupBy = '';\n\n $this->database->clear();\n\n $records = $this->database->getQueryRecords($this->getTableName(), $fields, $where, $groupBy, $orderBy);\n if (!$records || !\\tx_nclib::isLoopable($records)) {\n return false;\n }\n $result = array();\n foreach ($records as $record) {\n $result[] = $record['termtype'];\n }\n return $result;\n }", "function getTopics($topic) {\n if (empty($this->topics[$topic])) {\n throw new Exception('topic \"' + $topic + '\" is not published.');\n }\n return $this->topics[$topic];\n }", "function getMediaTypes ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/mediaTypes.json\");\n return $this->createResponse($result,'get All MediaTypes');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "protected function get_applicable_types()\n\t{\n\t\t$types = array();\n\n\t\tforeach ($this->types->get_all() as $id => $class)\n\t\t{\n\t\t\tif ($class->forum_robot && $class->forum_database)\n\t\t\t{\n\t\t\t\t$types[] = $id;\n\t\t\t}\n\t\t}\n\t\treturn $types;\n\t}", "function getTagTypes ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/tagTypes.json\");\n return $this->createResponse($result,'get All Tag Types');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function typesProvider()\n {\n return [\n '1 Type' => ['Type1'],\n '2 Type' => [['Type1', 'Type2']],\n ];\n }", "function monitor_list_activity_types() {\n $query = \"select distinct(`wf_type`) from `\".GALAXIA_TABLE_PREFIX.\"activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_type'];\n }\n return $ret; \n }", "public function fetchMPTypes() {\n\t\t\n\t\t$this->_productTypes = array();\n\t\t$sql = \"SELECT * FROM product_types WHERE parent_ptype_id IS NULL\"; \n\t\t$dbh = $this->_conn->query( $sql);\n\t\n\t\twhile ( $row = $dbh->fetch() )\t{\n\t\t\t\t$this->_productTypes[] = new ProductTypes( $row[\"ptype_id\"], $row[\"parent_ptype_id\"], $row[\"type_name\"] );\n\t\t }\t\n\t\t \n\t\treturn $this->_productTypes;\n\t}", "function ctools_term_list_ctools_content_types() {\n return array(\n 'single' => TRUE,\n 'title' => t('List of related terms'),\n 'icon' => 'icon_term.png',\n 'description' => t('Terms related to an existing term; may be child, siblings or top level.'),\n 'required context' => new ctools_context_required(t('Term'), 'term'),\n 'category' => t('Taxonomy term'),\n 'defaults' => array('title' => '', 'type' => 'child', 'list_type' => 'ul'),\n );\n}", "public function index()\n {\n return PostsTopics::get();\n }", "public function list_($topic = null)\n {\n //getAuthentication()->requireAuthentication();\n $webhooks = $this->webhook->getAll($topic);\n if($webhooks)\n return $this->success(\"Successfully retrieved webhooks\", $webhooks);\n else\n return $this->error(\"Error getting webhooks\", false);\n }", "public function getTypes()\n {\n return $this->getData(self::TYPES);\n }", "public function getTopics() {\n $names = [];\n foreach ($this->topics as $topic) {\n $names[] = $topic->entity->topic->entity->name->value;\n }\n sort($names);\n return $names;\n }", "function trieCategorietype()\n\t{\n\t\t$sql=\"SElECT * From categorie ORDER BY type\";\n\t\t$db = config::getConnexion();\n\t\ttry\n\t\t{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e)\n {\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function getForumTopicList($debug_to_pass = '') {\n\n $this->db->select('ft.topic_id,ft.topic_title,ft.category_id,ft.topic_short_description,ft.topic_content,ft.posted_by,ft.posted_on,ft.status as ft_status,fc.category_id,fc.category_name,fc.page_description,u.user_name,u.user_id');\n $this->db->from('mst_forum_topics as ft');\n $this->db->join('mst_forum_categories as fc', 'ft.category_id = fc.category_id', 'inner');\n $this->db->join('mst_users as u', 'ft.posted_by=u.user_id', 'inner');\n// $this->db->join('trans_forum_comments as tfc', 'tfc.topic_id=ft.topic_id', 'inner');\n $this->db->where('ft.status', '1');\n// $this->db->where('tfc.status','1');\n $this->db->order_by('ft.topic_id desc');\n $query = $this->db->get();\n if ($debug_to_pass)\n echo $this->db->last_query();\n return $query->result_array();\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public static function get_possible_types()\n {\n }", "public function getTopic() {}", "public function get_post_types(){ return $this->post_types; }", "public function getVocabList($type_id) {\n \t//returns json object: {{word: word, prompts: [], alternates: []}, {}, etc}\n $type = Type::find($type_id);\n \t$vocabList = $type->words;\n \treturn $vocabList;\n }", "public function getFeedbackTypes()\n {\n $query = \"SELECT ft.id, ft.type\n FROM feedback_types ft\n ORDER BY ft.id;\";\n\n $results = DB::select(DB::raw($query));\n\n return $results;\n }", "public function fetchGroupTypes(): array;", "public function getAvailableSeedTypes(){\n\t\t$sql = \n\t\t\t\"SELECT DISTINCT type.type_name \n\t\t\tFROM type\n\t\t\tWHERE type.type_name != '000'\n\t\t\tORDER BY type.type_name\";\n\t\t$stmt = $this->databaseConnection->dbConnection->prepare($sql);\n\t\t$stmt->execute();\n\t\t$arrayThing = [];\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\tarray_push($arrayThing, $row['type_name']);\n\t\t}\n\t\t$myJSON = json_encode($arrayThing);\n\t\techo $myJSON;\n\t}", "function list_topics($atts) {\n\t$src = 'empty';\n\t\n\tif (isset($_GET['src']))\n\t\t$src = $_GET['src'];\n\t\n\t$a = shortcode_atts( array(\n 'target' => 'empty',\n\t\t'src' => $src,\n\t\t'collapse' => false,\n\t\t'taxonomy' => 'asn_topic_index'\n ), $atts );\n\twp_localize_script( 'sr-functions', 'target_div', $a );\n\t\n\t$taxonomy = 'asn_topic_index';\n\t$orderby = 'slug';\n\t$show_count = 1;\n\t$pad_counts = 1;\n\t$hierarchical = 1;\n\t$title = '';\n\t$empty = 0;\n\t\n\t$args = array(\n\t 'taxonomy' => $taxonomy,\n\t 'orderby' => $orderby,\n\t 'show_count' => $show_count,\n\t 'pad_counts' => $pad_counts,\n\t 'hierarchical' => $hierarchical,\n\t 'title_li' => $title,\n\t 'hide_empty' => $empty,\n\t 'echo' => 0\n\t);\n\t\n\treturn '<div id=\"topic-list\">'.wp_list_categories( $args ).'</div>';\n}", "public function getUserTypes()\n {\n $main_actions = [\n 'type' => \\adminer\\lang('Create type'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n ];\n\n // From db.inc.php\n $userTypes = \\adminer\\support(\"type\") ? \\adminer\\types() : [];\n $details = [];\n foreach($userTypes as $userType)\n {\n $details[] = [\n 'name' => \\adminer\\h($userType),\n ];\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "public function allTopics(){\r\n\r\n $manTopic = new SujetManager();\r\n $topics = $manTopic->findAll();\r\n //Session::addValueTo('ok', 'ok');\r\n \r\n return [\r\n \"view\" => \"forum/listTopics.php\", \r\n \"data\" => [\r\n \"topics\" => $topics\r\n ],\r\n \"titrePage\" => \"FORUM | Sujets\"\r\n ];\r\n }", "public function getTopic();", "public function getTopic();", "public function getNodeTypes() {}", "public function getTissueTypesList() {\n return $this->_get(12);\n }", "public function show_topTopics($type = 'replies', $num_topics = 10, $output_method = 'echo')\n {\n return $this->call_method(\"show/topTopics\",\n array('type' => $type,\n 'num_topics' => $num_topics,\n 'output_method' => $output_method,\n )\n );\n }", "public function getList()\n\t{\n\t\tif(!isset($this->_list))\n\t\t{\n\t\t\tparent::getList();\n\t\t\t\n\t\t\t$table = $this->getTable();\n\t\t\t$types = array(\n\t\t\t\t'forum' => $table->getTypeIdFromName('forum'),\n\t\t\t\t'topic' => $table->getTypeIdFromName('topic'),\n\t\t\t\t'person' => $table->getTypeIdFromName('person')\n\t\t\t);\n\n\t\t\t//@TODO optimize this to 3 queries in total, instead of multiple\n\t\t\tforeach($this->_list as $item)\n\t\t\t{\n\t\t\t\t//@TODO speed this up by adding it as a db column\n\t\t\t\t$item->modified_by = false;\n\t\t\t\t$item->modified_name = JText::_('COM_NINJABOARD_NA');\n\t\t\t\t\n\t\t\t\tif($item->subscription_type == $types['forum'])\n\t\t\t\t{\n\t\t\t\t\t$item->type = 'forum';\n\t\t\t\t\t$item->title = $this->getService('com://admin/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($item->subscription_type_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->title;\n\t\t\t\t\t\n\t\t\t\t\t$icon = '/forums/default.png';\n\t\t\t\t\t$link = '&view=forum&id='.$item->subscription_type_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($item->subscription_type == $types['topic'])\n\t\t\t\t{\n\t\t\t\t\t$item->type = 'topic';\n\t\t\t\t\t$topic = $this->getService('com://admin/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($item->subscription_type_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t\t\t$item->title = $topic->subject;\n\t\t\t\t\t\n\t\t\t\t\t$icon = '/topic/32__default.png';\n\t\t\t\t\t$link = '&view=topic&id='.$item->subscription_type_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($item->subscription_type == $types['person'])\n\t\t\t\t{\n\t\t\t\t\t$item->type = 'person';\n\t\t\t\t\t$item->title = $this->getService('com://admin/ninjaboard.model.people')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($item->subscription_type_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->display_name;\n\t\t\t\t\t$icon = '/16/users.png';\n\t\t\t\t\t$link = '&view=person&id='.$item->subscription_type_id;\n\t\t\t\t}\n\n\t\t\t\t$item->link = JRoute::_('index.php?option=com_ninjaboard'.$link);\n\t\t\t\t$item->icon = $this->getService('ninja:template.helper.document')->img($icon);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_list;\n\t}", "public function onGetTypes($type = null)\n\t{\n\t\t// The name of the hubtype\n\t\t$hubtype = 'ticket';\n\n\t\tif (isset($type) && $type == $hubtype)\n\t\t{\n\t\t\treturn $hubtype;\n\t\t}\n\t\telseif (!isset($type))\n\t\t{\n\t\t\treturn $hubtype;\n\t\t}\n\t}", "function getDatatypes() {\n return ['Protein', 'Phenotype', 'Gene Expression', 'Nucleotide Sequence','Clinical Trials','Imaging Data','Morphology','Proteomics Data','Physiological Signals','Epigenetic Data','Data from Papers',\n 'Omics Data','Survey Data','Cell Signaling','Unspecified',];\n}", "private function getTopicMap () {\n\t\t$config = Zend_Registry::getInstance()->config;\n\t\t$entries = $config->catalog->topic_map;\n\t\t$topicMap = array();\n\t\tif ($entries && count($entries)) {\n\t\t\tforeach ($entries as $key => $entry) {\n\t\t\t\tif (!isset($entry->id) || !$entry->id)\n\t\t\t\t\tthrow new Exception('Each topic_map entry must have an id, \"'.$key.'\" does not.');\n\t\t\t\tif (!isset($entry->url) || !$entry->url)\n\t\t\t\t\tthrow new Exception('Each topic_map entry must have an url, \"'.$key.'\" does not.');\n\t\t\t\t$topicMap[$entry->id] = $entry->url;\n\t\t\t}\n\t\t}\n\t\treturn $topicMap;\n\t}", "public function getTypes()\n {\n return $this->types;\n }", "public function getTypes()\n {\n return $this->types;\n }", "function getSubTopics($topicId, $language) {\n\t $subtopics = $this->db->getAll(\"SELECT sotf_topics.topic_id AS id, sotf_topics.topic_name AS name, number, total FROM sotf_topic_tree_defs LEFT JOIN sotf_topics ON sotf_topics.topic_id = sotf_topic_tree_defs.id LEFT JOIN sotf_topics_counter ON sotf_topics_counter.topic_id = sotf_topic_tree_defs.id WHERE sotf_topics.language='$language' AND sotf_topic_tree_defs.supertopic='$topicId' ORDER BY sotf_topics.topic_name\");\n\t return $subtopics;\n }" ]
[ "0.7036913", "0.67919445", "0.676287", "0.6650992", "0.6572898", "0.6553992", "0.6553992", "0.6553992", "0.6553992", "0.6462565", "0.6457779", "0.6387437", "0.6376169", "0.6251349", "0.6215229", "0.6157128", "0.61462116", "0.61462116", "0.61454624", "0.61360216", "0.6119202", "0.6090871", "0.6079299", "0.6068812", "0.59670144", "0.59656274", "0.59430707", "0.59256977", "0.59081733", "0.58938503", "0.58722156", "0.5870859", "0.58694696", "0.5867665", "0.58636415", "0.58404934", "0.5812576", "0.5793629", "0.5793629", "0.5793629", "0.5785706", "0.5784889", "0.57784617", "0.57743055", "0.57741576", "0.57580453", "0.5752286", "0.57501566", "0.57500744", "0.5747092", "0.5745711", "0.5745326", "0.57344484", "0.57139087", "0.5712604", "0.5693499", "0.56906193", "0.5688984", "0.56803095", "0.5678153", "0.56737894", "0.56722754", "0.56718886", "0.56502056", "0.56434464", "0.5643151", "0.56375545", "0.56359774", "0.56299067", "0.56225234", "0.56196916", "0.56168413", "0.561304", "0.5604233", "0.5596391", "0.5594592", "0.5594498", "0.5594498", "0.5594498", "0.559217", "0.5590586", "0.5589845", "0.5589735", "0.5589374", "0.5588362", "0.5580086", "0.5574874", "0.55745625", "0.55593646", "0.55593646", "0.5557458", "0.5553474", "0.55522317", "0.5545263", "0.55448884", "0.5525177", "0.55229884", "0.5522303", "0.5522303", "0.5514867" ]
0.73622173
0
this method gets agenda alarm list
public function getAgendaAlarmListAction(){ /** @var Object_Agenda $agenda */ $this->getDeviceSession()->getUserId(); $agenda = new Object_Agenda(); $this->_helper->json($agenda->getClass()->getFieldDefinition('Alarm')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_agenda() {\n\t\t$items = $this->agenda_items->get_items();\n\t\t$participants = $this->participants->get_participants();\n\n\t\t// Create agenda\n\t\tforeach ($items as $item) {\n\t\t\tif ($item->is_all_participants) {\n\t\t\t\tforeach ($participants as $participant) {\n\t\t\t\t\t$json_return['items'][] = $this->create_agenda_row($item, $participant);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$json_return['items'][] = $this->create_agenda_row($item, NULL);\n\t\t\t}\n\t\t}\n\n\t\t// Get participants\n\t\tforeach ($participants as $participant) {\n\t\t\t$json_return['participants'][$participant->id] = $participant;\n\t\t}\n\n\t\t$json_return['success'] = TRUE;\n\t\techo json_encode($json_return);\n\t}", "public function getEvents()\n {\n $main_actions = [\n 'event' => \\adminer\\lang('Create event'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n \\adminer\\lang('Schedule'),\n \\adminer\\lang('Start'),\n // \\adminer\\lang('End'),\n ];\n\n // From db.inc.php\n $events = \\adminer\\support(\"event\") ? \\adminer\\get_rows(\"SHOW EVENTS\") : [];\n $details = [];\n foreach($events as $event)\n {\n $detail = [\n 'name' => \\adminer\\h($event[\"Name\"]),\n ];\n if(($event[\"Execute at\"]))\n {\n $detail['schedule'] = \\adminer\\lang('At given time');\n $detail['start'] = $event[\"Execute at\"];\n // $detail['end'] = '';\n }\n else\n {\n $detail['schedule'] = \\adminer\\lang('Every') . \" \" .\n $event[\"Interval value\"] . \" \" . $event[\"Interval field\"];\n $detail['start'] = $event[\"Starts\"];\n // $detail['end'] = '';\n }\n $details[] = $detail;\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function get800xaAlarms() {\n\t\tinclude_once('C:\\wamp64\\www\\events\\wp-includes\\wp-db.php');\n\t\tinclude_once('C:\\wamp64\\www\\events\\wp-config.php');\n\t\t\n global $wpdb;\n $return_array = array();\n\n $result_array = $wpdb->get_results(\"SELECT * FROM `\" . $wpdb->prefix . \"dnwg_alarms` WHERE `alarm_state` = '0' AND `alarm_origin` = '800xA' ORDER BY `alarm_creation` DESC \", ARRAY_A);\n\n // For all database results:\n foreach ($result_array as $idx => $array) {\n // New object\n $cat = new AlarmEvents();\n // Set all info\n $cat->setId($array['alarm_id']);\n $cat->setDate($array['alarm_creation']);\n $cat->setSeverity($array['alarm_severity']);\n $cat->setState($array['alarm_state']);\n $cat->setObject($array['alarm_object']);\n $cat->setMessage($array['alarm_message']);\n $cat->setAlarmPushed($array['alarm_pushed']);\n $cat->setAlarmNoticed($array['alarm_noticed']);\n\t\t\t$cat->setAlarmOrigin($array['alarm_origin']);\n\n // Add new object to return array.\n $return_array[] = $cat;\n }\n return $return_array;\n }", "public function getUserAgendasAction()\n {\n $agenda = new Workapp_Agenda();\n $this->_helper->json($agenda->getAgendaList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "public function getTimeEventsList(){\n return $this->_get(8);\n }", "public function getAllApp()\n {\n $sql = \"SELECT * FROM appointment\";\n $values=array();\n \n $ap=$this->getInfo($sql,$values);\n\n return $ap;\n }", "Public function getEvents()\n\t{\n\t\t$result=$this->M_calendar->getEvents();\n\t\techo json_encode($result);\n\t}", "public function get_all_events()\n {\n // get today date for check past events or not\n $todayData = date(\"m/d/Y\");\n // get option from database\n $past_events_option = get_option('past_events');\n // preparing sql query\n $sql = \"SELECT * FROM $this->tableName \";\n if ($past_events_option != 'yes') {\n $sql .= \"WHERE `date` >= \" . $todayData;\n }\n global $wpdb;\n $allevents = $wpdb->get_results($sql);\n return $allevents;\n }", "private function requestAnimeList () {\n\t\t$curl = curl_init ();\n\t\t\n\t\tcurl_setopt ($curl, CURLOPT_URL, $this->api_url);\n\t\tcurl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t\n\t\t$response = curl_exec ($curl);\n\t\t\n\t\tcurl_close($curl);\n\t\t\n\t\treturn ($response);\n\t}", "public function getEventsByDay( $day ) {\n\n\t\t$rangestart = strtotime($day) * 1000; // zimbra always works with milliseconds in timestamps\n\t\t$rangeend = $rangestart + (24 * 60 * 60 * 1000);\n\n\t\t/**\n\t\t* build full call url\n\t\t*/\n\t\t$calendar = $this->getFromZimbra(\"/calendar?start=\" . $rangestart . \"&end=\" . $rangeend);\n\n\t\t$events = array();\n\t\tif( !property_exists($calendar, \"appt\") ) return $events;\n\n\t\tforeach ($calendar->appt as $meetingSeries) {\n\n\t\t\t/**\n\t\t\t* collect values for the current appointment\n\t\t\t*/\n\t\t\t$finalstartdate = null;\n\t\t\t$finalenddate = null;\n\t\t\t$finalname = null;\n\t\t\t$finallocation = null;\n\n\t\t\t/**\n\t\t\t* iterate over all sub events in order to find the right one\n\t\t\t* single events just have one item = easy, we just take this one\n\t\t\t* series of events contain the original item plus all execptions, more difficult to handle\n\t\t\t*/\n\t\t\tforeach ($meetingSeries->inv as $meeting) {\n\n\t\t\t\t$startdate = isset($meeting->comp[0]->s[0]->u) ? $meeting->comp[0]->s[0]->u : \"\";\n\t\t\t\t$enddate = isset($meeting->comp[0]->e[0]->u) ? $meeting->comp[0]->e[0]->u: \"\";\n\t\t\t\t$name = $meeting->comp[0]->name;\n\t\t\t\t$location = $meeting->comp[0]->loc;\n\n\t\t\t\t/**\n\t\t\t\t* we take the original, if nothing is set yet\n\t\t\t\t* the original events hold the time from the original day only, so we need to recalculate\n\t\t\t\t* since we are only getting the data from one day, we can kill the day information on extract the hours only\n\t\t\t\t*/\n\t\t\t\tif( $finalstartdate == null && !property_exists($meeting->comp[0], \"recurId\")) {\n\t\t\t\t\t$finalstartdate = date(\"Y-m-d\", $rangestart/1000) . \" \" . date(\"H:i\", $startdate / 1000);\n\t\t\t\t\t$finalenddate = date(\"Y-m-d\", $rangestart/1000) . \" \" . date(\"H:i\", $enddate / 1000);\n\t\t\t\t\t$finalname = $name;\n\t\t\t\t\t$finallocation = $location;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t* overwrite if got an exception of the series taking place on the current day\n\t\t\t\t*/\n\t\t\t\tif( property_exists($meeting, \"recurId\") &&\n\t\t\t\t\t($startdate <= $rangeend && $enddate >= $rangestart)) {\n\t\t\t\t\t$finalstartdate = date(\"Y-m-d H:i\", $startdate / 1000);\n\t\t\t\t\t$finalenddate = date(\"Y-m-d H:i\", $enddate / 1000);\n\t\t\t\t\t$finalname = $name;\n\t\t\t\t\t$finallocation = $location; \n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$events[]= array(\n\t\t\t\t\"name\" => $finalname,\n\t\t\t\t\"location\" => $finallocation,\n\t\t\t\t\"startdate\" => $finalstartdate, // timestamp has milli seconds as well\n\t\t\t\t\"enddate\" => $finalenddate\n\t\t\t);\n\t\t}\n\n\t\tusort($events, array(\"self\", \"cmp\"));\n\t\treturn $events;\n\t}", "public function getNetxmsAlarms() {\n\t\tinclude_once('C:\\wamp64\\www\\events\\wp-includes\\wp-db.php');\n\t\tinclude_once('C:\\wamp64\\www\\events\\wp-config.php');\n\t\t\n global $wpdb;\n $return_array = array();\n\n $result_array = $wpdb->get_results(\"SELECT * FROM `\" . $wpdb->prefix . \"dnwg_alarms` WHERE `alarm_state` = '0' AND `alarm_origin` = 'Netxms' ORDER BY `alarm_creation` DESC \", ARRAY_A);\n\n // For all database results:\n foreach ($result_array as $idx => $array) {\n // New object\n $cat = new AlarmEvents();\n // Set all info\n $cat->setId($array['alarm_id']);\n $cat->setDate($array['alarm_creation']);\n $cat->setSeverity($array['alarm_severity']);\n $cat->setState($array['alarm_state']);\n $cat->setObject($array['alarm_object']);\n $cat->setMessage($array['alarm_message']);\n $cat->setAlarmPushed($array['alarm_pushed']);\n $cat->setAlarmNoticed($array['alarm_noticed']);\n\t\t\t$cat->setAlarmOrigin($array['alarm_origin']);\n\n // Add new object to return array.\n $return_array[] = $cat;\n }\n return $return_array;\n }", "public function getEvents();", "public function getEvents();", "public function getEventList() {\n $response = $this->client->get(\n $this->apiUrl . \"events\");\n return $response->json();\n }", "public function playlists()\n\t{\n\t\treturn $this->CLI->arrayQuery(\"alarm playlists\");\n\t}", "function get_all_events(){\n global $database_ged;\n $events = array();\n $sql = \"SELECT id FROM nagios_queue_active\";\n $result = sql($database_ged, $sql);\n foreach($result as $row){\n array_push($events,$row[\"id\"].\":nagios\");\n }\n $result = null;\n $sql = \"SELECT id FROM snmptrap_queue_active\";\n $result = sql($database_ged, $sql);\n foreach($result as $row){\n array_push($events,$row[\"id\"].\":snmptrap\");\n }\n\n return $events;\n}", "public function getAgenda(ServiceBase $api, array $args)\n {\n $end_time = new SugarDateTime(\"+14 days\");\n $start_time = new SugarDateTime(\"-1 hour\");\n\n\n $meeting = BeanFactory::newBean('Meetings');\n $meetingList = $meeting->get_list('date_start', \"date_start > \" . $GLOBALS['db']->convert($GLOBALS['db']->quoted($start_time->asDb()), 'datetime') . \" AND date_start < \" . $GLOBALS['db']->convert($GLOBALS['db']->quoted($end_time->asDb()), 'datetime'));\n\n // Setup the breaks for the various time periods\n $datetime = new SugarDateTime();\n $today_stamp = $datetime->get_day_end()->getTimestamp();\n $tomorrow_stamp = $datetime->setDate($datetime->year,$datetime->month,$datetime->day+1)->get_day_end()->getTimestamp();\n\n\n $timeDate = TimeDate::getInstance();\n\n $returnedMeetings = array('today'=>array(),'tomorrow'=>array(),'upcoming'=>array());\n foreach ( $meetingList['list'] as $meetingBean ) {\n $meetingStamp = $timeDate->fromDb($meetingBean->date_start)->getTimestamp();\n $meetingData = $this->formatBean($api,$args,$meetingBean);\n\n if ( $meetingStamp < $today_stamp ) {\n $returnedMeetings['today'][] = $meetingData;\n } else if ( $meetingStamp < $tomorrow_stamp ) {\n $returnedMeetings['tomorrow'][] = $meetingData;\n } else {\n $returnedMeetings['upcoming'][] = $meetingData;\n }\n }\n\n return $returnedMeetings;\n }", "public function getAppointmentsList() {\nglobal $_LW;\ninclude $_LW->INCLUDES_DIR_PATH.'/core/modules/core/includes/class.livewhale_manager.php'; // include manager class\n$_LW->module='appointments';\n$GLOBALS['manager_appointments']=$_LW->showManager('<ul id=\"manager_appointments\" class=\"manager simple list-group\"/>', '<li id=\"item{id}\" class=\"{class} list-group-item\">\n\t{checkbox}\n\t<h5>{title}</h5>\n\t{appointments}\n</li>', 'managerQuery', 'formatManager');\nreturn $_LW->xphp->parseString('<xphp var=\"manager_appointments\"/>');\n}", "protected function getMasterAppointments($args) {\n\n if ($args['ent_appnt_dt'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $dates = explode('-', $args['ent_appnt_dt']);\n\n if (count($dates) == 3) {\n $endDate = date('Y-m-d', strtotime('+7 day', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" DATE(a.appointment_dt) between '\" . $args['ent_appnt_dt'] . \"' and '\" . $endDate . \"'\";\n } else {\n $args['ent_appnt_dt'] = $args['ent_appnt_dt'] . '-01';\n $endDate = date('Y-m-d', strtotime('+1 month', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" YEAR(a.appointment_dt) = '\" . (int) $dates[0] . \"' and MONTH(a.appointment_dt) = '\" . (int) $dates[1] . \"'\";\n }\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appointment_id,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.drop_addr1,a.drop_addr2,a.drop_lat,a.drop_long,a.complete_dt,a.start_dt,a.arrive_dt,a.status,a.payment_status,a.amount,a.distance_in_mts,(select count(appointment_id) from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"') as pen_count from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.mas_id = '\" . $this->User['entityId'] . \"' and \" . $selectStr . \" and a.status NOT IN (1,3,4,5,10) order by a.appointment_id DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"' a.status NOT in (1,3,4,7) and\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0) {\n\n $selectPenCountQry = \"select count(*) as count from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"'\";\n $countArr = mysql_fetch_assoc(mysql_query($selectPenCountQry, $this->db->conn));\n $errMsgArr = $this->_getStatusMessage(30, 2);\n\n $date = $args['ent_appnt_dt'];\n\n while ($date <= $endDate) {\n\n $sortedApnts[] = array('date' => $date, 'appt' => array());\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $countArr['count'], 'refIndex' => array(), 'appointments' => $sortedApnts, 't' => $selectAppntsQry);\n }\n\n $appointments = $daysArr = array();\n\n $pendingCount = 0;\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pendingCount = $appnt['pen_count'];\n\n $aptdate = date('Y-m-d', strtotime($appnt['appointment_dt']));\n\n $durationSec = (abs(strtotime($appnt['complete_dt']) - strtotime($appnt['start_dt'])) / 60);\n\n $durationMin = round($durationSec, 2);\n\n// if ($appnt['status'] == '1')\n// $status = 'Booking requested';\n// else if ($appnt['status'] == '2')\n// $status = 'Driver accepted.';\n// else if ($appnt['status'] == '3')\n// $status = 'Driver rejected.';\n// else if ($appnt['status'] == '4')\n// $status = 'You have cancelled.';\n// else if ($appnt['status'] == '5')\n// $status = 'Driver have cancelled.';\n// else\n if ($appnt['status'] == '6')\n $status = 'Driver is on the way.';\n else if ($appnt['status'] == '7')\n $status = 'Driver arrived.';\n else if ($appnt['status'] == '8')\n $status = 'Booking started.';\n else if ($appnt['status'] == '9')\n $status = 'Booking completed.';\n// else if ($appnt['status'] == '10')\n// $status = 'Booking expired.';\n else\n $status = 'Status unavailable.';\n\n $appointments[$aptdate][] = array('pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'statCode' => $appnt['status'], 'status' => $status,\n 'fname' => $appnt['first_name'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])), 'bid' => $appnt['appointment_id'], 'apptDt' => $appnt['appointment_dt'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'payStatus' => ($appnt['payment_status'] == '') ? 0 : $appnt['payment_status'],\n 'dropLine1' => urldecode($appnt['drop_addr1']), 'duration' => round($durationMin, 2), 'distance' => round($appnt['distance_in_mts'] / $this->distanceMetersByUnits, 2), 'amount' => $appnt['amount']);\n\n\n// $appointments[$aptdate][] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'status' => $appnt['status'], 'pickupDt' => $appnt['arrive_dt'], 'dropDt' => $appnt['complete_dt'],\n// 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])),\n// 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n// 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'],\n// 'dropLine1' => urldecode($appnt['drop_addr1']), 'dropLine2' => urldecode($appnt['drop_addr2']), 'dropLat' => (double) $appnt['drop_lat'], 'dropLong' => (double) $appnt['drop_long'], 'duration' => $durationMin, 'distanceMts' => $appnt['distance_in_mts'], 'amount' => $appnt['amount']);\n }\n $refIndexes = $sortedApnts = array();\n $date = date('Y-m-d', strtotime($args['ent_appnt_dt']));\n\n while ($date < $endDate) {\n\n $empty_arr = array();\n\n if (is_array($appointments[$date])) {\n $sortedApnts[] = array('date' => $date, 'appt' => $appointments[$date]);\n $num = date('j', strtotime($date));\n $refIndexes[] = $num;\n } else {\n $sortedApnts[] = array('date' => $date, 'appt' => $empty_arr);\n }\n\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n//print_r($sortedApnts);\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $pendingCount, 'refIndex' => $refIndexes, 'appointments' => $sortedApnts); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "function get_all_agendas()\n {\n $this->db->order_by('idagenda', 'desc');\n return $this->db->get('agenda')->result_array();\n }", "public function getAll(){\n $query = $this->fpdo->from('view_history_attend')->orderBy('id_demand DESC')->execute();\n $result = null;\n /* 2. encriptar IDs */\n if($query->rowCount()!=0){\n $result = $query->fetchAll(PDO::FETCH_OBJ);\n $status = true;\n $msg = \"Lista atenciones realizadas\";\n }\n else{\n $result = array();\n $status = false;\n $msg = \"No existen registros\";\n }\n /* 3. retornar valores en un array Response */\n return $this->response->send(\n $result,\n $status,\n $msg,\n []\n );\n }", "public function actionIndex()\n {\n if(\\Yii::$app->user->can('verMarcacaoConsulta')) {\n $tempVariable = Medicos::dataByUser(Yii::$app->user->id);\n $times = MarcacaoConsulta::dataByUserBack($tempVariable['id']);\n\n $events = [];\n foreach ($times as $time) {\n\n $temp = Especialidade::dataByEspecialidade($time['id_especialidade']);\n\n\n $Event = new Event();\n $Event->id = $time['id'];\n $Event->backgroundColor = $this->chooseColor($time['status']);\n $Event->title = $temp['tipo'];\n $Event->start = date(($time['date']));\n $Event->url = 'index.php?r=marcacao-consulta/view&id=' . $time['id'];\n $events[] = $Event;\n\n }\n\n return $this->render('index', [\n 'events' => $events,\n ]);\n }\n }", "public function getEvents()\n {\n if ($this->input->get('start') === null || $this->input->get('end') === null) {\n $response = array(\"status\" => false, \"message\" => 'Please provide necessary data.');\n\n $this->send(400, $response);\n }\n\n $reqData = array('start' => $this->input->get('start'), 'end' => $this->input->get('end'));\n\n $events = $this->model->getEvents($reqData);\n\n $this->send(200, $events);\n }", "function agenda_get_item_list($course_id, $user_id, $user_group_list, $order='DESC')\n\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n\t$sql = \"SELECT event.id \t\t\t\t\t\tAS id,\n\t\t\t\t event.title \t\t\t\t\t\tAS title,\n\t\t\t\t event.description \t\t\t\tAS description,\n\t\t\t\t event.start_date \t\t\t\tAS start_date,\n\t\t\t\t event.end_date \t\t\t\t\tAS end_date,\n\t\t\t\t event.author_id \t\t\t\t\tAS author_id,\n\t\t\t\t event.master_event_id\t\t\tAS master_event_id,\n\t\t\t\t rel_event_recipient.user_id\t \tAS user_id,\n\t\t\t\t rel_event_recipient.group_id \tAS group_id,\n\t\t\t\t rel_event_recipient.visibility \tAS visibility\n\t\tFROM \" . $tbl . \"\n\t\tWHERE \t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id = \" . (int) $user_id .\")\n\t\t\tOR\n\t\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\t\tAND rel_event_recipient.group_id is NULL)\";\n\t\tforeach($user_group_list as $this_group)\n\t\t{\n\t\t\t$sql .=\" OR\n\t\t\t(rel_event_recipient.course_id = '\" . $course_id .\"'\n\t\t\tAND rel_event_recipient.user_id is NULL\n\t\t\tAND rel_event_recipient.group_id = \". (int) $this_group .\")\";\n\t\t}\n\n\n\t\t$sql .=\"ORDER BY event.start_date \" . ('DESC' == $order?'DESC':'ASC');\n\n\treturn claro_sql_query_fetch_all($sql);\n}", "protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "function get_agenda($idagenda)\n {\n return $this->db->get_where('agenda',array('idagenda'=>$idagenda))->row_array();\n }", "public function calendar_get_list($ews,$startdate, $enddate){\n\t\t// Set init class\n\t\t$request = new EWSType_FindItemType();\n\t\t// Use this to search only the items in the parent directory in question or use ::SOFT_DELETED\n\t\t// to identify \"soft deleted\" items, i.e. not visible and not in the trash can.\n\t\t$request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;\n\t\t// This identifies the set of properties to return in an item or folder response\n\t\t$request->ItemShape = new EWSType_ItemResponseShapeType();\n\t\t$request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;//Returns ID_ONLY - DEFAULT_PROPERTIES - ALL_PROPERTIES\n\t\t\n\t\t// Define the timeframe to load calendar items\n\t\t$request->CalendarView = new EWSType_CalendarViewType();\n\t\t$request->CalendarView->StartDate = $startdate; // an ISO8601 date e.g. 2012-06-12T15:18:34+03:00\n\t\t$request->CalendarView->EndDate = $enddate; // an ISO8601 date later than the above\n\t\t\n\t\t// Only look in the \"calendars folder\"\n\t\t$request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();\n\t\t$request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;\n\t\t\n\t\t// Send request\n\t\t$response = $ews->FindItem($request);\n\t\t\n\t\t// Add events to array if event(s) were found in the timeframe specified\n\t\tif ($response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView > 0){\n\t\t $events = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem;\t\n\t\t}\n\t\telse{\n\t\t\tif(empty($events)){\n\t\t\t\t$events = \"No Events Found\"; \t\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $events; //remember to use the php function urlencode on the id and changekey else it will not work when sent to other EWS functions\n\t }", "public function listEvents()\n\t{\n\n\t\t$table=CaseItemModel::getInstance()->getTable();\n $pTable=ProcessModel::getInstance()->getTable();\n $piTable=ProcessItemModel::getInstance()->getTable();\n \n\t\t$status =\"status not in ('Complete','Terminated') \";\n \n\t\t$sql=\"select 'Case Item' as source,id,null as processName, processNodeId,caseId,type,subType,label,timer,timerDue,message,signalName \"\n . \" from $table \"\n . \" where $status\"\n .\" and subType in('timer','message','signal')\";\n\t\t$arr1= $this->db->select($sql);\n\n\t\t$sql=\"select 'Process Item' as source ,p.processName as processName, pi.id as id,pi.processNodeId,null as caseId,pi.type,subType,label,timer,timerDue,message,signalName \"\n . \" from $piTable pi\n join $pTable p on p.processId=pi.processId\n where subType in('timer','message','signal')\";\n \n \n\t\t$arr2= $this->db->select($sql);\n\t\t$results= array_merge($arr1,$arr2);\n\n\t\treturn $results;\n\t}", "public function dayList()\n\t{\n\t\techo json_encode($this->sched_day->fetchData());\n\t}", "public function listAlarms($date, $fullevent = false)\n {\n throw new Kronolith_Exception($this->_errormsg);\n }", "public static function icalendar() {\r\n $ical = \"BEGIN:VCALENDAR\".PHP_EOL;\r\n $ical .= \"VERSION:2.0\".PHP_EOL;\r\n\r\n $show_personal_bak = Calendar_Events::$calsettings->show_personal;\r\n $show_course_bak = Calendar_Events::$calsettings->show_course;\r\n $show_deadline_bak = Calendar_Events::$calsettings->show_deadline;\r\n $show_admin_bak = Calendar_Events::$calsettings->show_admin;\r\n Calendar_Events::set_calendar_settings(1,1,1,1);\r\n Calendar_Events::get_calendar_settings();\r\n $eventlist = Calendar_Events::get_calendar_events();\r\n Calendar_Events::set_calendar_settings($show_personal_bak,$show_course_bak,$show_deadline_bak,$show_admin_bak);\r\n Calendar_Events::get_calendar_settings();\r\n\r\n $events = array();\r\n foreach ($eventlist as $event) {\r\n $ical .= \"BEGIN:VEVENT\".PHP_EOL;\r\n $startdatetime = new DateTime($event->start);\r\n $ical .= \"DTSTART:\".$startdatetime->format(\"Ymd\\THis\").PHP_EOL;\r\n $duration = new DateTime($event->duration);\r\n $ical .= \"DURATION:\".$duration->format(\"\\P\\TH\\Hi\\Ms\\S\").PHP_EOL;\r\n $ical .= \"SUMMARY:[\".strtoupper($event->event_group).\"] \".$event->title.PHP_EOL;\r\n $ical .= \"DESCRIPTION:\".canonicalize_whitespace(strip_tags($event->content)).PHP_EOL;\r\n if ($event->event_group == 'deadline')\r\n {\r\n $ical .= \"BEGIN:VALARM\".PHP_EOL;\r\n $ical .= \"TRIGGER:-PT24H\".PHP_EOL;\r\n $ical .= \"DURATION:PT10H\".PHP_EOL;\r\n $ical .= \"ACTION:DISPLAY\".PHP_EOL;\r\n $ical .= \"DESCRIPTION:DEADLINE REMINDER for \".canonicalize_whitespace(strip_tags($event->title)).PHP_EOL;\r\n $ical .= \"END:VALARM\".PHP_EOL;\r\n }\r\n $ical .= \"END:VEVENT\".PHP_EOL;\r\n }\r\n $ical .= \"END:VCALENDAR\".PHP_EOL;\r\n return $ical;\r\n }", "public function listar(){\n $eventos = \n DB::table('agendas')->where('id_usuario', auth()->user()->id )->orwhere('cliente', auth()->user()->id )->get();\n\n // $eventos = Agenda::all();\n // dd($eventos);\n $eve=[];\n\n foreach($eventos as $evento){\n\n\n $eve[] = [\n\n \"id\"=>$evento->id,\n \"start\"=>$evento->fecha . \" \" . $evento->hora_inicio,\n \"end\"=>$evento->fecha . \" \". $evento->hora_final,\n \"title\"=>$evento->titulo,\n \"backgroundColor\"=>$evento->estado == 1 ? \"#7ACF2A\" : \"#CF2A2A\",\n \"textColor\"=>\"#fff\",\n \"extendedProps\"=>[\n \"id_usuario\"=>$evento->id_usuario,\n \"precio\"=>$evento->precio,\n\n\n ]\n\n ]; \n\n\n }\n\n return response()->json($eve);\n\n}", "public function recuperarTodos() {\n $query = \"select * from tb_atividade where id_evento = :id\";\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id', $_GET['id']);\n // $stmt->bindValue(':id', 8);\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function onGetEvents()\n {\n $start = input('start');\n $end = input('end');\n // dd($start, $end);\n // trace_log($start, $end);\n $systemTZ = config(\"app.timezone\");\n $isConvertToFrontEndTimeZone = config(\"yfktn.eventgubernur::convertToFrontEndTimeZone\");\n // karena di tanggal yang diberikan waktu fullcalendar melakukan permintaan\n // events, pada string yang diberikan sudah ada informasi timezone nya\n // sehingga kita tidak perlu lagi melakukan proses setting manual timezone\n $startTZ = Carbon::parse($start);\n $endTZ = Carbon::parse($end);\n $frontEndTimeZone = $startTZ->timezone;\n // trace_log($startTZ, $endTZ);\n // trace_sql();\n // dapatkan dari db\n $events = EventsModel::whereBetween('tgl_mulai', [\n $startTZ->copy()->timezone($systemTZ), \n $endTZ->copy()->timezone($systemTZ)])\n ->get();\n trace_log($events->toArray(), ($isConvertToFrontEndTimeZone? \"TRUE\":\"FALSE\"));\n // loop untuk melakukan render ke JSON nya\n $data = [];\n $i = 0;\n foreach ($events as $e) {\n $satuHari = false;\n $data[$i]['id'] = $e->id;\n $data[$i]['title'] = $e->judul;\n $data[$i]['slug'] = $e->slug;\n $theStart = Carbon::parse(\"{$e->tgl_mulai} {$e->jam_mulai}\");\n if ($e->tgl_selesai == null) {\n // satu hari\n if ($e->jam_selesai == null) {\n // satu hari?\n $theEnd = $theStart->copy();\n $satuHari = true;\n } else {\n $theEnd = $theStart->copy()->setTimeFromTimeString($e->jam_selesai);\n }\n } else {\n if ($e->jam_selesai == null) {\n $theEnd = Carbon::parse(\"{$e->tgl_selesai}\");\n } else {\n $theEnd = Carbon::parse(\"{$e->tgl_selesai} {$e->jam_selesai}\", $systemTZ);\n }\n }\n trace_log($theStart->format(\"Y-m-d H:i\"), $theEnd->format(\"Y-m-d H:i\"));\n // kalau di set satu hari, maka set pada waktu time telah dirubah timezone nya!\n if($satuHari) {\n // $theEnd->setTime(\n // 23, 59, 59\n // );\n $data[$i]['start'] = $isConvertToFrontEndTimeZone ? \n $theStart->timezone($frontEndTimeZone)->format(\"Y-m-d\") :\n $theStart->shiftTimezone($frontEndTimeZone)->format(\"Y-m-d\");\n // untuk satu hari nilai end tidak perlu ditambahkan!\n // $data[$i]['end'] = null;\n } else {\n // dapatkan, convert ke timezone si front end dan set formatnya\n $data[$i]['start'] = $isConvertToFrontEndTimeZone?\n $theStart->timezone($frontEndTimeZone)->toIso8601String():\n $theStart->shiftTimezone($frontEndTimeZone)->toIso8601String();\n if($isConvertToFrontEndTimeZone) {\n $theEnd->timezone($frontEndTimeZone);\n } else {\n $theEnd->shiftTimezone($frontEndTimeZone);\n }\n if($e->jam_selesai == null) {\n // set di sini supaya menunjukkan sampai akhir hari itu / full satu hari!\n $theEnd->endOfDay();\n }\n $data[$i]['end'] = $theEnd->toIso8601String();\n }\n trace_log($data[$i]);\n $i = $i + 1;\n }\n return $data;\n }", "public function getEvents(){\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/event\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\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 reponse of the API\n\t\t$events = json_decode($output, true);\n\n\t\t// format the date\n\t\tforeach ($events as $key => $event) {\n\t\t\t$events[$key]['date'] = explode('T', $event['date'])[0];\n\t\t}\n\n\t\t// if the user is not connected or if he is a student, remove events which are not public\n\t\tif (!isset($_SESSION['status']) || $_SESSION['status'] == 'student'){\n\t\t\t$publicEvents = [];\n\t\t\t$eventNumber = sizeof($events);\n\t\t\tfor($i=0 ; $i < $eventNumber; $i++){\n\t\t\t\t$event = array_shift($events);\n\t\t\t\tif($event['is_public'] == 1){\n\t\t\t\t\tarray_push($publicEvents, $event);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $publicEvents;\n\t\t}\n\n\t\t// return all events\n\t\treturn $events;\n\t}", "public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}", "function getEventAttendeeList($id){\r\n $response = array('ok' => false, 'msg' => \"Undefined error\");\r\n\r\n $sqlCon = openDatabase();\r\n $query = \"SELECT eventcheckin.checkin_time, eventcheckin.checked_in, \" .\r\n \"attendees.user_id, attendees.firstname, attendees.lastname, attendees.email \" .\r\n \"FROM \".DB_SCHEMA.\".eventcheckin \" .\r\n \"JOIN \".DB_SCHEMA.\".attendees ON \" .\r\n \"eventcheckin.attendee_id = attendees.user_id \" .\r\n \"WHERE eventcheckin.event_id=\" . SQLE($id) . \r\n \" ORDER BY attendees.lastname ASC;\";\r\n\r\n $list = array();\r\n $result = mysql_query($query);\r\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {\r\n $list[] = $row;\r\n }\r\n $response = array('ok' => true, 'msg' => \"OK\", 'list' => $list);\r\n\r\n closeDatabase();\r\n return $response;\r\n}", "public function eventfeedAction()\n {\n $this->disableView();\n $this->setCustomHeader('json');\n //get params\n $startTime = $this->_getParam('start');\n $endTime = $this->_getParam('end');\n $idJabatan = $this->_getParam('id_jabatan');\n $idSkenario = $this->_getParam('id_skenario');\n //get list of events\n $listEvent = $this->getEventFeed($startTime, $endTime, $idJabatan, $idJabatan);\n //initialize empty array\n $arrayEvent = array();\n //loop through the list of the events\n if(count($listEvent))\n {\n foreach($listEvent as $event)\n {\n //converting date time format\n $asumsiDayStart = date('d', strtotime($event['asumsi_start']));\n $asumsiDayEnd = date('d', strtotime($event['asumsi_end']));\n $asumsiDateStart = date('d/F/Y', strtotime($event['asumsi_start']));\n $asumsiDateEnd = date('d/F/Y', strtotime($event['asumsi_end']));\n $asumsiTimeStart = date('H:i:s', strtotime($event['asumsi_start']));\n $asumsiTimeEnd = date('H:i:s', strtotime($event['asumsi_end']));\n //if a one day events only\n if( $asumsiDayStart == $asumsiDayEnd )\n {\n //print the date only once\n $title = $event['nama_kegiatan'] . ' waktu asumsi ' . $asumsiDateStart . ', ';\n }else{\n //print only the start and end date\n $title = $event['nama_kegiatan'] . ' waktu asumsi ' . $asumsiDateStart . ' - ' . $asumsiDateEnd . ', ';\n }\n //print the timeline\n $title .= $asumsiTimeStart . ' - ' . $asumsiTimeEnd;\n //print assumption time\n $title .= ' Perbandingan Sebenarnya : Asumsi = ' . $event['asumsi_perbandingan'];\n //add edit links only if user can access the edit forms: latihan-rol-edit\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $identity = Zend_Auth::getInstance()->getStorage()->read();\n $tablePrivileges = new Latihan_Model_DbTable_Privileges();\n if($tablePrivileges->checkRolesPrivileges('latihan', 'rol', 'edit', $identity->role_id) >= 1)\n {\n $tempArray = array(\n 'id' => $event['id_rol'],\n 'start' => $event['realtime_start'],\n 'end' => $event['realtime_end'],\n 'url' => $this->view->baseUrl('latihan/rol/edit/id/') . $event['id_rol'] ,\n 'title' => $title,\n 'allDay' => false\n );\n }else{\n $tempArray = array(\n 'id' => $event['id_rol'],\n 'start' => $event['realtime_start'],\n 'end' => $event['realtime_end'],\n 'title' => $title,\n 'allDay' => false\n );\n }\n }\n //form into fullcalendar json object format\n array_push($arrayEvent, $tempArray);\n }\n echo json_encode($arrayEvent);\n }\n }", "public function showAll() {\n return response()->json(Appointment::all());\n }", "public function getAllEvents(){\n\t\t//$events = EventPage::get()->sort('Date', 'DESC')->limit(5);\n\t\t$limit = 10;\n\n\t\t$items = DataObject::get(\"EventPage\", \"Date > NOW()\", \"Date\", null, $limit);\n\t\treturn $items;\n\n\t}", "public function getAppointmentsListJSON() {\nglobal $_LW;\n$output=[];\nforeach($_LW->dbo->query('select', 'id, title', 'livewhale_appointments', false, 'title ASC')->run() as $res2) { // loop through and add appointments\n\t$output[]=['id'=>$res2['id'], 'title'=>$res2['title']];\n};\nreturn json_encode($output);\n}", "function getEvents() {\n return [];\n }", "public function getAllEvents() {\n\n $stmt = $this->conn->prepare(\"SELECT * FROM events\");\n\n\n\n if ($stmt->execute()) {\n $events = $stmt->get_result();\n $stmt->close();\n return $events;\n } else {\n return NULL;\n }\n }", "Public function getEvents($id_cliente=1){\n\t\t// Imposto l'azienda di riferimento\n\t\t$id_azienda=$this->session->id_azienda;\n\t\t// Inizio a creare la query\n\t $sql = \"SELECT * FROM eventi\"; // WHERE eventi.inizio\";\n\t\t// Aggiungo il limite per l'azienda\n\t\t$sql.=\" WHERE eventi.id_azienda=$id_azienda \";\n\t\t// Aggiungo l'eventuale limite per il cliente selezionato\n\t\t$sql.=\" AND eventi.id_cliente=$id_cliente \";\n\t\t$sql.=\"AND eventi.inizio BETWEEN ? AND ? ORDER BY eventi.inizio ASC\";\n \treturn $this->db->query($sql, array($_GET['start'], $_GET['end']))->result();\n\t}", "public function get_alertable_events($min = 5, $allusers = false, $onlyexternal = false)\n {\n // $date = date('Y-m-d');\n $return = array();\n $userfilter = ($allusers != false) ? '' : ' AND ('.$this->getGroupAndShareFilter().')';\n $alertfilter = ($onlyexternal) ? ' AND (rm.`mailto` != \"\" OR rm.`smsto` != \"\")' : '';\n\n $query = 'SELECT\n DISTINCT e.`id`, e.`uuid`, rm.`id` `reminder_id`, rm.`text` `reminder`, rm.mailto, rm.smsto, e.uid, e.title, e.description, e.location\n ,IF (rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.starts, \"%T\")) ), UNIX_TIMESTAMP(e.starts) ) `start`\n ,IF (rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.ends, \"%T\")) ), UNIX_TIMESTAMP(e.ends) ) `end`\n ,IF\n (UNIX_TIMESTAMP(rm.snooze) != 0\n ,UNIX_TIMESTAMP(rm.snooze)\n ,IF\n (rm.mode = \"s\"\n ,UNIX_TIMESTAMP(DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.starts, \"%T\")), INTERVAL rm.`time` SECOND))\n ,UNIX_TIMESTAMP(DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \", DATE_FORMAT(e.ends, \"%T\")), INTERVAL rm.`time` SECOND))\n )\n ) `warntime`\nFROM\n '.$this->Tbl['cal_event'].' e\n ,'.$this->Tbl['cal_reminder'].' rm\n ,'.$this->Tbl['cal_repetition'].' rp\nWHERE e.`archived`=\"0\" AND e.`id` = rm.`eid` AND rm.`ref` = \"evt\" AND e.id = rp.eid AND rp.`ref` = \"evt\" AND rm.mode != \"-\"'.$userfilter.$alertfilter.'\n /* Dont alert cancelled events */\n AND `e`.`status` != 3\n /* Nonrepeated events get selected when they were not alerted yet or their warn_snooze is later than now */\n AND IF (rp.`type` = \"-\" AND rm.lastinfo != 0 AND rm.`snooze` < NOW(), 0, 1)\n AND IF (rp.`type` != \"-\" AND rp.`until` IS NOT NULL AND rp.`until` != \"0-0-0 0:0:0\", rp.`until` > NOW(), 1)\n AND\n (\n /* A rescheduled alert */\n IF (UNIX_TIMESTAMP(rm.`snooze`) > 0 AND UNIX_TIMESTAMP(rm.`snooze`)-'.($min * 60).' < UNIX_TIMESTAMP(NOW()), 1, 0)\n OR\n (\n rp.`type` = \"-\"\n AND\n IF\n (rm.`mode` = \"s\"\n , e.starts > NOW() AND rm.lastinfo != e.starts AND DATE_SUB(e.starts, INTERVAL rm.`time` + '.($min * 60).' SECOND) < NOW()\n , e.ends > NOW() AND rm.lastinfo != e.ends AND DATE_SUB(e.ends, INTERVAL rm.`time` + '.($min * 60).' SECOND) < NOW()\n )\n )\n OR\n /* Yearly event */\n (\n rp.`type` = \"year\"\n AND\n DATE_FORMAT(rm.`lastinfo`, \"%Y\") != DATE_FORMAT(NOW(), \"%Y\")\n AND\n IF\n (rm.`mode` = \"s\"\n ,CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`starts`, \"%m-%d %T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`starts`, \"%m-%d %T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n ,CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`ends`, \"%m-%d %T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y\"), \"-\", DATE_FORMAT(e.`ends`, \"%m-%d %T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n )\n )\n OR\n /* Monthly event */\n (\n rp.`type` = \"month\"\n AND\n DATE_FORMAT(rm.`lastinfo`, \"%Y%m\") != DATE_FORMAT(NOW(), \"%Y%m\")\n AND\n (\n rp.`extra` = \"\"\n OR\n FIND_IN_SET(DATE_FORMAT(NOW(), \"%c\"), rp.`extra`) > 0\n )\n AND\n IF\n (rm.`mode` = \"s\"\n ,CONCAT(DATE_FORMAT(NOW(),\"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`starts`, \"%T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`starts`, \"%T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n ,CONCAT(DATE_FORMAT(NOW(),\"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`ends`, \"%T\")) > NOW()\n AND DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m\"), \"-\", rp.`repeat`, \" \", DATE_FORMAT(e.`ends`, \"%T\")), INTERVAL (rm.`time` + '.($min * 60).') SECOND) < NOW()\n )\n )\n OR\n /* Monthly event on e.g. the 31st of month with months shorter than 31 days, will only work with alerts set for the same day */\n (\n LAST_DAY(NOW()) = CURDATE()\n AND\n rp.`type` = \"month\"\n AND\n rp.`repeat` = 31\n AND\n DATE_FORMAT(rm.`lastinfo`, \"%Y%m\") != DATE_FORMAT(NOW(), \"%Y%m\")\n AND\n (\n rp.`extra` = \"\"\n OR\n FIND_IN_SET(DATE_FORMAT(NOW(), \"%c\"), rp.`extra`) > 0\n )\n AND\n IF\n (rm.`mode` = \"s\"\n ,DATE_FORMAT(e.`starts`, \"%d%H%i%s\") > DATE_FORMAT(LAST_DAY(NOW()), \"%d%H%i%s\")\n AND DATE_FORMAT(UNIX_TIMESTAMP(e.`starts`) - (rm.`time` + '.($min * 60).'), \"%H%i%s\") < DATE_FORMAT(NOW(), \"%H%i%s\")\n ,DATE_FORMAT(e.`ends`, \"%d%H%i%s\") > DATE_FORMAT(LAST_DAY(NOW()), \"%d%H%i%s\")\n AND DATE_FORMAT(UNIX_TIMESTAMP(e.`ends`) - (rm.`time` + '.($min * 60).'), \"%H%i%s\") < DATE_FORMAT(NOW(), \"%H%i%s\")\n )\n )\n OR\n /* Weekly event */\n (\n rp.`type` = \"week\"\n AND\n (UNIX_TIMESTAMP(rm.lastinfo) = 0 OR DATE_FORMAT(rm.`lastinfo`, \"%Y%m%d\") != DATE_FORMAT(NOW(), \"%Y%m%d\"))\n AND\n IF\n (rm.`mode`=\"s\"\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w%H%i\") >= DATE_FORMAT(e.`starts`, \"%w%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%w%H%i\") <= DATE_FORMAT(e.`starts`, \"%w%H%i\")\n AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`starts`, NOW()) / 7, rp.`extra`)) = 0)\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w%H%i\") >= DATE_FORMAT(e.`ends`, \"%w%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%w%H%i\") <= DATE_FORMAT(e.`ends`, \"%w%H%i\")\n AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`ends`, NOW()) / 7, rp.`extra`)) = 0)\n )\n )\n OR\n /* \"Daily\" event, where the bit pattern should match today\\'s weekday */\n (\n rp.`type` = \"day\"\n AND\n (UNIX_TIMESTAMP(rm.lastinfo) = 0 OR DATE_FORMAT(rm.`lastinfo`, \"%Y%m%d\") != DATE_FORMAT(NOW(), \"%Y%m%d\"))\n AND\n (rp.`repeat`=\"0\"\n OR\n SUBSTRING(LPAD(BIN(rp.`repeat`), 8, 0), IF(DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w\") = 0, 8, DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%w\")), 1) = 1\n )\n AND\n IF\n (rm.`mode`=\"s\"\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%H%i\") >= DATE_FORMAT(e.`starts`, \"%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%H%i\") <= DATE_FORMAT(e.`starts`, \"%H%i\")\n ,DATE_FORMAT(CAST(NOW() + INTERVAL (rm.`time` + '.($min * 60).') SECOND AS DATETIME), \"%H%i\") >= DATE_FORMAT(e.`ends`, \"%H%i\")\n AND DATE_FORMAT(CAST(NOW() + INTERVAL rm.`time` SECOND AS DATETIME), \"%H%i\") <= DATE_FORMAT(e.`ends`, \"%H%i\")\n )\n )\n )\nORDER BY `warntime` ASC';\n\n // echo $query.LF;\n\n $qid = $this->query($query);\n if (false === $qid) {\n $error = $this->error();\n if ($error && function_exists('vecho')) {\n error_log($error);\n vecho($error);\n\n }\n return array();\n }\n while ($line = $this->assoc($qid)) {\n $return[$line['id']] = array\n ('warn_time' => $line['warntime'], 'mailto' => $line['mailto']\n ,'smsto' => $line['smsto'], 'uid' => $line['uid']\n ,'title' => $line['title'], 'description' => $line['description']\n ,'location' => $line['location'], 'starts' => $line['start'], 'ends' => $line['end']\n ,'reminder' => $line['reminder'], 'reminder_id' => $line['reminder_id']\n );\n }\n // print_r($return);\n return $return;\n }", "function drush_acapi_ac_task_list() {\n $api_args = acapi_get_site_args();\n $format = acapi_get_option('format');\n $state = drush_get_option('state', NULL);\n $days = drush_get_option('days', NULL);\n $limit = drush_get_option('limit', NULL);\n $params = array();\n if (isset($state)) {\n $params['state'] = $state;\n }\n if (isset($days)) {\n $params['days'] = $days;\n }\n if (isset($limit)) {\n $params['limit'] = $limit;\n }\n\n list($status, $result) = acapi_call(\n 'GET',\n '/sites/:realm::site/tasks',\n $api_args,\n $params,\n array(),\n array('display' => !empty($format))\n );\n\n $simulate = drush_get_option('simulate', FALSE);\n if ($simulate) {\n return;\n }\n\n if (empty($format)) {\n $display = array();\n foreach ($result as $id => $task) {\n $display[$task->id] = $task->description;\n }\n drush_print_table(drush_key_value_to_array_table($display));\n }\n}", "function rec_empresa_list(){\n\t\t}", "public function agenda() {\r\n // $arrayHorario = $horario->fetchAll();\r\n\r\n $id_medico = $_GET['id_medico'];\r\n\r\n $medico = new MedicoModel();\r\n $loadMedico = $medico->fetchById($id_medico);\r\n $loadHorario = $medico->fecthMedicoHorario();\r\n\r\n //echo \"<pre>\"; print_r($loadHorario); echo \"</pre>\"; die;\r\n\r\n ob_start();\r\n include('view/horario/agenda.php');\r\n $content = ob_get_clean();\r\n return $content;\r\n }", "public function get_event_list()\n\t{\n\treturn $this->cal['VEVENT'];\n\t}", "public function listar(){\n\t\t$eve = $this->db->get('eventos'); \n\t\treturn $eve->result(); \n\t}", "function GetAllSchedules() {\n\tglobal $server;\n\tglobal $user;\n\t$url = \"http://\".$server.\"/api/\".$user.\"/schedules\";\n\t$array = LaunchCurl($url);\n\treturn $array;\n}", "public function getPendingEvents(): array;", "function obtenerSesion_agendar(){\n\t\t\n\t\t$query1 = ('select sesion.id, sesion.checkin, sesion.pagada, sesion.id_servicio, sesion.id_usuario, sesion.id_agenda, sesion.ejecutada, usuario.nombre,\n\t\t\t\t\tusuario.apellido, servicio.descripcion , cliente.nombre as nombre_cliente , cliente.apellido as apellido_cliente from sesion \n\t\t\t\t\tInner JOIN usuario\n\t\t\t\t\ton sesion.id_usuario = usuario.id\n\t\t\t\t\tInner Join servicio\n\t\t\t\t\ton sesion.id_servicio = servicio.id\n\t\t\t\t\tInner Join cliente\n\t\t\t\t\ton sesion.id_cliente = cliente.id\n\t\t\t\t\twhere sesion.id_agenda is NULL'); //QUERY PARA OBTENER TODO DE UNA VEZ.\n\t\t$query = $this->db->query($query1);\n\t\t\n\t\t\n\t //$query = $this->db->get('sesion');\n\t if($query-> num_rows() > 0) return $query->result_array();\n\t else return false ;\n\t \n\t \n\t}", "function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }", "function get_patient_queue()\n {\n return Appointments::whereStatus(2)->get();\n }", "public function getEvents()\n {\n if (isset($this->list)) {\n return $this->list;\n } else {\n return false;\n }\n }", "public function get_test_scheduled_events()\n {\n }", "protected function getPendingAppts($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.appointment_id,a.drop_addr2,a.drop_addr1,a.extra_notes,a.address_line1,a.address_line2,a.status,a.appt_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 2 and a.appt_type = 2 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[date('Y-m-d', strtotime($appnt['appointment_dt']))][] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'bid' => $appnt['appointment_id'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])), 'dropLine1' => urldecode($appnt['drop_addr1']), 'dropLine2' => urldecode($appnt['drop_addr2']),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n $finalArr = array();\n\n foreach ($pending_appt as $date => $penAppt) {\n $finalArr[] = array('date' => $date, 'appt' => $penAppt);\n }\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $finalArr); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }", "function getAttendanceList($act_id){\n $data = array(\n 'act_id' => $act_id,\n 'dept_id' => $this->activity_model->fetchDeptID($act_id)->act_department,\n 'att_list' => $this->activity_model->fetchAttendance($act_id)->result()\n );\n return $this->load->view('activitymonitoring/att_list', $data);\n }", "public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }", "public function getEvents()\n {\n //\n\n return Event::all();\n }", "public function getAimeos()\n\t{\n\t\treturn $this->client->getAimeos();\n\t}", "public function getEventsAction() {\n\t\tdate_default_timezone_set ( 'UTC' );\n\t\t\n\t\t// Short-circuit if the client did not give us a date range.\n\t\tif (! isset ( $_GET ['start'] ) || ! isset ( $_GET ['end'] )) {\n\t\t\tdie ( \"Please provide a date range.\" );\n\t\t}\n\t\t\n\t\t// Parse the start/end parameters.\n\t\t// These are assumed to be ISO8601 strings with no time nor timezone, like \"2013-12-29\".\n\t\t// Since no timezone will be present, they will parsed as UTC.\n\t\t$range_start = Object\\Shift::parseDateTime ( $_GET ['start'] );\n\t\t$range_end = Object\\Shift::parseDateTime ( $_GET ['end'] );\n\t\t$data [] = $range_start->toString ( \\Zend_Date::ISO_8601 );\n\t\t$data [] = $range_end->toString ( \\Zend_Date::ISO_8601 );\n\t\t// Parse the timezone parameter if it is present.\n\t\t$timezone = null;\n\t\tif (isset ( $_GET ['timezone'] )) {\n\t\t\t$timezone = new DateTimeZone ( $_GET ['timezone'] );\n\t\t}\n\t\t\n\t\t// Read and parse our events JSON file into an array of event data arrays.\n\t\t$json = file_get_contents ( PIMCORE_LAYOUTS_DIRECTORY . '/assets/json/events.json' );\n\t\t$input_arrays = new Object\\Shift\\Listing (); // json_decode($json, true);\n\t\t \n\t\t// Accumulate an output array of event data arrays.\n\t\t$output_arrays = array ();\n\t\tforeach ( $input_arrays as $event ) {\n\t\t\t\n\t\t\t// Convert the input array into a useful Event object\n\t\t\t// $event2 = Object\\Shift::create($event->toArray());\n\t\t\t// $event2->setKey(Pimcore_File::getValidFilename('New Name 10'));\n\t\t\t// $event2->setParentId(53);\n\t\t\t// $event2->save();\n\t\t\t// $output_arrays['new'] = $event2 ;\n\t\t\t\n\t\t\t// $data[]= $event->getEnd()->toString(\\Zend_Date::ISO_8601);\n\t\t\t// If the event is in-bounds, add it to the output\n\t\t\tif ($event->isWithinDayRange ( $range_start, $range_end )) {\n\t\t\t\t$output_arrays [] = $event->toCalendar ();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Send JSON to the client.\n\t\t$reponse = new Reponse ();\n\t\t\n\t\t$reponse->data = $output_arrays; // $input_arrays;\n\t\t$reponse->message = \"TXT_SHIFTS_SENT\";\n\t\t$reponse->success = true;\n\t\t\n\t\t$this->render ( $reponse );\n\t\t// echo json_encode($output_arrays);\n\t}", "function listAlarms($user = null, $time = null, $load = false,\n $preload = true)\n {\n if (empty($time)) {\n $time = new Horde_Date(time());\n }\n if ($load) {\n $this->load($user, $preload);\n }\n\n $alarms = $this->_list($user, $time);\n if (is_a($alarms, 'PEAR_Error')) {\n return $alarms;\n }\n\n foreach (array_keys($alarms) as $alarm) {\n if (isset($alarms[$alarm]['mail']['body'])) {\n $alarms[$alarm]['mail']['body'] = $this->_fromDriver($alarms[$alarm]['mail']['body']);\n }\n }\n return $alarms;\n }", "public function index()\n {\n if(Auth::user()->mecano) {\n $calenderoffers = [];\n $events = [];\n\n $offres = DB::table('offreapplications')->where([['user_id', '=', Auth::user()->id], ['accepted', '=', 1]])->get();\n foreach ($offres as $offre) {\n $calenderoffer = DB::table('offres')->where('id', '=', $offre->offre_id)->first();\n if(!$calenderoffer->completed)\n array_push($calenderoffers, $calenderoffer);\n }\n\n foreach ($calenderoffers as $calenderofferfinal) {\n $event = \\Calendar::event(\n $calenderofferfinal->title, //event title\n false, //full day event?\n $calenderofferfinal->wanteddate, //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)\n $calenderofferfinal->wanteddate, //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),\n 1, //optional event ID\n [\n 'url' => 'http://laravel.dev/home'\n ]\n );\n\n array_push($events, $event);\n }\n\n $eloquentEvent = EventModel::first(); //EventModel implements MaddHatter\\LaravelFullcalendar\\Event\n\n $calendar = \\Calendar::addEvents($events); \n $calendar->setOptions([\n 'buttonText' => [ 'today' => 'Today', 'month' => 'Month', 'week' => 'Week', 'day' => 'Day', 'list' => 'List'],\n ]);\n\n return view('calender', compact('calendar'));\n\n } else {\n $calenderoffers = [];\n $events = [];\n\n $offres = DB::table('offres')->where('user_id', '=', Auth::user()->id)->get();\n foreach ($offres as $offre) {\n if(!$offre->completed) {\n $calenderoffer = DB::table('offreapplications')->where([['offre_id', '=', $offre->id], ['accepted', '=', 1]])->get();\n foreach ($calenderoffer as $calenders) {\n if($calenders->offre_id == $offre->id) {\n array_push($calenderoffers, $offre); \n }\n }\n }\n \n }\n\n foreach ($calenderoffers as $calenderofferfinal) {\n $event = \\Calendar::event(\n $calenderofferfinal->title, //event title\n false, //full day event?\n $calenderofferfinal->wanteddate, //start time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg)\n $calenderofferfinal->wanteddate, //end time, must be a DateTime object or valid DateTime format (http://bit.ly/1z7QWbg),\n 1, //optional event ID\n [\n 'url' => 'http://laravel.dev/myoffers'\n ]\n );\n\n array_push($events, $event);\n }\n\n $eloquentEvent = EventModel::first(); //EventModel implements MaddHatter\\LaravelFullcalendar\\Event\n\n $calendar = \\Calendar::addEvents($events);\n $calendar->setOptions([\n 'buttonText' => [ 'today' => 'Today', 'month' => 'Month', 'week' => 'Week', 'day' => 'Day', 'list' => 'List'],\n ]);\n\n return view('calender', compact('calendar'));\n }\n }", "private function getEventsOnADate($date)\n {\n # Load EventLinks\n $eventlinks = $this->eventlinks;\n\n # Convert Date to currently displayed month\n $dayDate = $this->getDayDate($date);\n\n # get all events on a day\n $events = array_first($eventlinks, function ($eventDate, $url) use ($dayDate) {\n return $eventDate == $dayDate;\n }, false);\n\n return $events ;\n }", "function agenda_liste_avertir($id_agenda, $annee_choisie, $mois_choisi) {\n\n\t$message = NULL;\n\n\t$contexte_aff = agenda_definir_contexte(0);\n\t$debut_saison = $contexte_aff['debut_saison'];\n\t$type_saison = $contexte_aff['type_saison'];\t\t\n\n\tif (intval($debut_saison) != 1) \n\t\t$annee_choisie = (intval($mois_choisi) < intval($debut_saison)) ? $annee_choisie : strval(intval($annee_choisie)+1);\n\n\t$count_evt = count(agenda_recenser_evenement(0));\n\t$count_evt_filtre = agenda_liste_afficher(0);\n\n\tif ($count_evt == 0)\n\t\t$message = _T('sarkaspip:msg_0_evt_agenda');\n\telse\n\t\tif ($count_evt_filtre == 0)\n\t\t\tif (intval($debut_saison) == 1)\n\t\t\t\t$message = _T('sarkaspip:msg_0_evt_annee').'&nbsp;'.$annee_choisie;\n\t\t\telse\n\t\t\t\tif ($type_saison == 'annee')\n\t\t\t\t\t$message = _T('sarkaspip:msg_0_evt_saison').'&nbsp;'.$annee_choisie;\n\t\t\t\telseif ($type_saison == 'periode')\n\t\t\t\t\t$message = _T('sarkaspip:msg_0_evt_saison').'&nbsp;'.strval(intval($annee_choisie)-1).'-'.$annee_choisie;\n\t\t\t\telse // $type_saison == 'periode_abregee'\n\t\t\t\t\t$message = _T('sarkaspip:msg_0_evt_saison').'&nbsp;'.substr(strval(intval($annee_choisie)-1),2,2).'-'.substr($annee_choisie,2,2);\n\n\treturn $message;\n}", "function getUpcomingEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE starttime > CURRENT_DATE && archive != 1 ORDER BY starttime\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function indexAction()\n {\n\t\t$this->verifySessionRights();\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$employee=$this->getConnectedEmployee();\n\t\t$this->setActivity($employee->getName().\" \".$employee->getFirstname().\"'s Agenda is consulted by this user\");\n\t\t$aTimes = $this->getAgendaTime();\n\t\t$aDates = $this->getDatesOfWeek();\t\n\t\t$aDkey = array_keys($aDates);\n\t\t$aAgenda = $this->generateAgenda($employee,$aTimes,$aDates);\n\t\t$aFormatdate = $this->formatDate($aDates);\n//print_r($aAgenda);\n/*\necho $aAgenda[4]['endpm'];\necho \"<br>\".$this->getCreatingTsHour();\nif(isset($aAgenda[4]['endpm']) and $this->getCreatingTsHour()>0 and $this->getCreatingTsHour()<$aAgenda[4]['endpm']) \n\techo \"yes\";\nelse \n\techo \"No\";\nexit(0);\n*/\n \treturn $this->render('BoHomeBundle:Agenda:index.html.twig', array(\n \t\t'employee' => $employee,\n\t\t\t'agenda'=>$aAgenda,\n\t\t\t'datekeys'=>$aDkey,\n\t\t\t'dates'=>$aDates,\n\t\t\t'cth'=>$this->getCreatingTsHour(),//cth is the time when the teacher can do the timesheet \n\t\t\t'higham'=>$this->getHighEndAm($aAgenda),\n\t\t\t'formatdates'=>$aFormatdate,\n\t\t\t'ttkeys'=>array_keys($aTimes),\n\t\t\t'today'=> new \\DateTime(date(\"d-m-Y\")),\n\t\t\t'times'=>$aTimes,\n\t\t\t'pm'=>\"tabeau-bord\",\n\t\t\t'sm'=>\"agenda\",\n \t));\n }", "public function findAlarms($Filter=[]) { \n $q = $this->createQueryBuilder('a')\n ->select('a.eoid,a.joid,a.alarm,a.alarmTime,a.state,a.stateTime,a.response,a.theUser,a.eventComment,'\n . 'j.jobName,j.description,j.status,'\n . 'e.runNum,e.ntry,e.machName')\n ->leftjoin('AriiATSBundle:UjoJobst','j',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,'a.joid = j.joid')\n ->leftjoin('AriiATSBundle:UjoProcEvent','e',\\Doctrine\\ORM\\Query\\Expr\\Join::WITH,'a.eoid = e.eoid');\n if (isset($Filter['jobName'])) {\n $q->andWhere('j.jobName = :jobName')\n ->setParameter('jobName',$Filter['jobName']);\n } \n // A la minute\n if (isset($Filter['alarmTime'])) {\n $q->andWhere('a.alarmTime >= :alarmTime')\n ->andWhere('a.alarmTime <= :alarmTime2') \n ->setParameter('alarmTime',$Filter['alarmTime']-> format('U'))\n ->setParameter('alarmTime2',$Filter['alarmTime']-> format('U')+60);\n } \n if (isset($Filter['state']) and ($Filter['state']>0)) {\n $q->andWhere('a.state = :state')\n ->setParameter('state',$Filter['state']);\n } \n return $q->orderBy('a.eoid','desc')\n ->setMaxResults(1000)\n ->getQuery()\n ->getResult();\n }", "public function listarUsuariosActivos()\r\n\t{\r\n\t\t$eventos=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador WHERE admin_status LIKE 'Activo'\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_pregunta_secreta']=$row['ADMIN_FK_ID_PRE'];\r\n\t\t\t$fila['admin_respuesta_secreta']=$row['ADMIN_RESP_SECRETA'];\r\n\t\t\t$fila['admin_contrasena']=$row['ADMIN_CONTRASENA'];\r\n\t\t\t$eventos[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $eventos;\t\t\r\n\t}", "function getArrEvents(){\n $conn = $this->conectarBD(); \n $i=0;\n $arrEvents = null; \n $sql = \"SELECT * FROM eventos WHERE id_evento IN\n\t\t\t\t\t\t(SELECT id_evento FROM usuarios_eventos \n\t\t\t\t\t\t\tWHERE id_usuario= \".$this->id_user.\" and fecha >= CURDATE());\";\n\t\t$result = mysqli_query($conn, $sql);\n\t\twhile($row=mysqli_fetch_array($result, MYSQL_ASSOC)){ \n\t\t\t$arrEvents [$i]= array('id' => $row['id_evento'], 'description' => $row['descripcion'], 'date' => $row['fecha']);\n\t\t\t$i++;\n }\n\n $this->desconectarBD($conn);\n return $arrEvents;\n }", "function agenda_get_item($event_id)\n{\n\t$tbl = get_conf('mainTblPrefix') . 'event AS event INNER JOIN ' \n\t\t. get_conf('mainTblPrefix') . 'rel_event_recipient AS rel_event_recipient' \n\t\t. ' ON event.id = rel_event_recipient.event_id';\n\n $sql = \"SELECT \tevent.id \t\t\t\t\t\tAS id,\n\t\t\t\t\tevent.title \t\t\t\t\tAS title,\n\t\t\t\t\tevent.description \t\t\t\tAS description,\n\t\t\t\t\tevent.start_date \t\t\t\tAS old_start_date,\n\t\t\t\t\tevent.end_date \t\t\t\t\tAS old_end_date,\n\t\t\t\t\tevent.author_id \t\t\t\tAS author_id,\n\t\t\t\t\trel_event_recipient.visibility \tAS visibility,\n\t\t\t\t\tevent.master_event_id\t\t \tAS master_event_id,\n\t\t\t\t\trel_event_recipient.user_id\t\tAS user_id,\n\t\t\t\t\trel_event_recipient.group_id\tAS group_id\n FROM \" . $tbl . \"\n\n WHERE event.id = \" . (int) $event_id ;\n\n $event = claro_sql_query_get_single_row($sql);\n\n if ($event) return $event;\n else return claro_failure::set_failure('EVENT_ENTRY_UNKNOW');\n\n}", "public function getEventsAction($start, $repeatingEnd)\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('HospiceSiteBundle:Event')->findAllBetweenStartAndRepeatingEndDate($start, $repeatingEnd);\n \t$response = new JsonResponse();\n \n \t$jsonArray = array();\n \n \tforeach ($events as $event) {\n $dateDiff = null;\n $r = $event->getRecurOptions();\n if ($r != null) {\n $firstEventStart;\n $dateStart = new \\DateTime($start);\n $dateEnd = new \\DateTime($repeatingEnd);\n $dateStep = new \\DateInterval(\"P0D\");\n $dateDiff = date_diff($event->getStart(), $dateStart);\n\n $name = $r->getFrequency()->getName();\n if ($name === 'PER_DAY') {\n if ($r->getInterval() > 0) {\n $e = $this->getEventsSeriesStart($dateStart, $event);\n $dateStep->d = $r->getInterval();\n while ($e->getStart() < $dateEnd) {\n \t array_push($jsonArray, $e->toJSON());\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n }\n } elseif ($name === 'PER_WEEK') {\n if ($r->getInterval() > 0) {\n $firstEventInWeek = $this->getEventsSeriesStart($dateStart, $event);\n\n $eventInWeek = array();\n $flags = intval($r->getIntervalFlags());\n if ($flags != 0) {\n $opts_arr = $this->getPerDayOptions($r->getFrequency());\n $dateStep->d = intval($firstEventInWeek->getStart()->format(\"N\")) - self::DAY_MONDAY;\n $firstEventInWeek->getStart()->sub($dateStep);\n $firstEventInWeek->getEnd()->sub($dateStep);\n if ($flags & $opts_arr[\"ON_MONDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 0);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_TUSEDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 1);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_WEDNESDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 2);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_THURSDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 3);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_FRIDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 4);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_SATURDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 5);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_SUNDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 6);\n array_push($eventInWeek, $e);\n }\n } else {\n $e = /* clone */ $firstEventInWeek;\n array_push($eventInWeek, $e);\n }\n\n $dateStep->d = $r->getInterval() * 7;\n\n $contFlag = true;\n while ($contFlag) {\n \t foreach ($eventInWeek as $e) {\n if ($e->getStart() > $dateEnd) {\n $contFlag = false;\n break;\n }\n if ($e->getEnd() >= $dateStart) {\n array_push($jsonArray, $e->toJSON());\n }\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n }\n }\n } elseif ($name === 'PER_MONTH') {\n $e = $this->getEventsSeriesStart($dateStart, $event);\n $dateStep->m = $r->getInterval();\n while ($e->getStart() < $dateEnd) {\n array_push($jsonArray, $e->toJSON());\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n } elseif ($name === 'PER_YEAR') {\n $e = $this->getEventsSeriesStart($dateStart, $event);\n $dateStep->y = $r->getInterval();\n while ($e->getStart() < $dateEnd) {\n array_push($jsonArray, $e->toJSON());\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n }\n } else {\n \t array_push($jsonArray, $event->toJSON());\n }\n \t}\n \t$response->setData($jsonArray);\n \t$response->setStatusCode(Response::HTTP_OK);\n \treturn $response;\n\n }", "public function alarms($start = 0, $itemsPerResponse = 5, $dow = \"\", $filter = \"enabled\")\n\t{\n\t\t$filter = strtolower($filter);\n\t\tif (!empty($filter))\n\t\t{\n\t\t\tif (!in_array($filter,array(\"all\",\"enabled\")))\n\t\t\t{\n\t\t\t\t$filter = \"\";\n\t\t\t}\n\t\t}\n\t\t$fnArgs = func_get_args();\n\t\treturn $this->CLI->arrayQuery(\"alarms \".((string) $start).\" \".((string) $itemsPerResponse).\" \".$this->CLI->argsToTaggedParams(array(2=>\"dow\",3=>\"filter\"),$fnArgs));\n\t}", "public function getEvents()\n {\n return json_decode((string) $this->response->getBody())->events;\n }", "public function fullCaAction(){\n \t$logger = new Frogg_Log('/home2/bleachse/public_html/seriando/log/calendar_CA.log');\n \t$xml = new XMLReader();\n \tif(!$xml->open('http://services.tvrage.com/feeds/fullschedule.php?country=CA')){\n \t\t$logger->err('Failed to open input file');\n \t\t$logger->close();\n \t\tdie;\n \t}\n \t$logger->info('Starting to index full schedule');\n \t$series = new Application_Model_Series();\n \twhile ($xml->read()){\n \t\twhile($xml->read() && $xml->name != 'DAY');//Goes to next <DAY>\n \t\t$timestamp = new Frogg_Time_Time($xml->getAttribute('attr'));\n \t\t$timestamp = $timestamp->getUnixTstamp();\n \t\twhile($xml->read()){ //Daily shows reading\n \t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'show'){ //Found new show\n \t\t\t\t$episode_name = $xml->getAttribute('name');\n \t\t\t\t$show_id = '';\n \t\t\t\twhile($xml->read() && $xml->name != 'sid'); //Found show id\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'sid'){\n \t\t\t\t\t$show_id = $xml->readString();\n \t\t\t\t}\n \t\t\t\twhile($xml->read() && $xml->name != 'ep'); //Found episode air order\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'ep'){\n \t\t\t\t\t$episode_num = $xml->readString();\n \t\t\t\t\t$scheduled = new Application_Model_Scheduled($show_id,'http://services.tvrage.com/tools/quickinfo.php?show='.urlencode($episode_name).'&ep='.$episode_num,Application_Model_Scheduled::UNREAD,$timestamp);\n \t\t\t\t\t$scheduled->save();\n \t\t\t\t\t$logger->ok('Saved : '.$scheduled->link);\n \t\t\t\t}\n \t\t\t$xml->next('show');\n \t\t\t} else if($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'DAY'){ //Found </DAY>\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}//END - Daily shows reading\n \t}\n \t$logger->close();\n \tdie;\n }", "function getEvents()\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT * FROM bdd_satisfevent.events ORDER BY Date Desc');\n $request->execute(array());\n $result = $request->fetchAll();\n return $result;\n}", "function get_my_events($rama) {\r\n\t\tglobal $post;\r\n\t\t$events = new WP_Query();\r\n\t\t$events->query('post_type=Rama&showposts=5&order=desc' . $rama);\r\n\t\tif($events->found_posts>0) {\r\n\t\t\techo '<ul class=\"rama_widget\">';\r\n\t\t\t\twhile($events->have_posts()) {\r\n\t\t\t\t\t$events->the_post();\r\n\t\t\t\t\t$image = (has_post_thumbnail($post->ID)) ? get_the_post_thumbnail($post->ID) : '<div class=\"missingthumbnail\"></div>';\r\n\t\t\t\t\t$eventItem = '<li>' . $image;\r\n\t\t\t\t\t$eventItem .= '<a href=\"' . get_permalink() . '\">';\r\n\t\t\t\t\t$eventItem .= get_the_title() . '</a>';\r\n\t\t\t\t\t$eventItem .= '<span>' . get_the_excerpt() . '';\r\n\t\t\t\t\t$eventItem .= '<a class=\"widgetmore\" href=\"' . get_permalink() . '\">';\r\n\t\t\t\t\t$eventItem .= '<p>Read More... </p>' . '</a></span></li>';\r\n\t\t\t\t\techo $eventItem;\r\n\t\t\t\t}\r\n\t\t\techo '</ul>';\r\n\t\t\twp_reset_postdata();\r\n\t\t}\r\n\t}", "public function events()\n {\n if (!Sentry::check()) {\n // User is not logged in, or is not activated\n return Redirect::route('landing');\n } else {\n // Gets all appointments from the school\n $user = Sentry::getUser();\n\n // Check if user is superAdmin\n if ($user->hasAccess('school')) {\n $appointments = Appointment::get()->load('group.school')->toArray();\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(\n Input::get('callback')\n ); //return View::make('calendar.events');\n\n } else {\n // If user is not superAdmin, show groups based on the school of the logged in user\n $user->load('school.groups.appointments.group.school');\n $appointments = [];\n\n // Loop through groups to get all appointments\n foreach ($user->school->groups as $group) {\n foreach ($group->appointments as $appointment) {\n array_push($appointments, $appointment);\n }\n }\n // Returns JSON response of the user\n return Response::json($appointments)->setCallback(Input::get('callback'));\n }\n }\n }", "public static function initialize_calendar(){\n \n $event_array[] = array();\n $schedules = \\App\\Event::get();\n if(!empty($schedules)){\n foreach($schedules as $schedule){\n $event_array[] = array(\n 'id' => uniqid(),\n 'title' => $schedule->description,\n 'start' => date('Y-m-d', strtotime($schedule->event_date)),\n 'end' => date('Y-m-d', strtotime($schedule->event_date)),\n 'color' => \"lightblue\",\n \"textEscape\"=> 'false' ,\n 'textColor' => 'black',\n );\n }\n return $get_schedule = json_encode($event_array);\n }\n }", "function event_list(){\n\tglobal $DB;\n\t$currenttime = time();\n\t$query = \"SELECT * FROM {event} WHERE eventtype='site' ORDER By id DESC\";\n $result = $DB->get_records_sql($query);\n\treturn $result;\n}", "public function show()\n {\n\n\n\n\n $myMeetings = MeetingAttendee::where('phonebook','=',0)\n ->where('attendee','=',\\Auth::user()->id)\n ->select('meeting')\n ->get();\n\n $myMeetingIds = array();\n\n foreach ($myMeetings as $myMeeting) {\n\n $myMeetingIds[] = $myMeeting->meeting;\n\n }\n\n $calendarMeetingsEvents = \\DB::table('calendar_events')\n ->join('calendar_events_type', 'calendar_events.event_type_id', '=', 'calendar_events_type.id')\n ->select(\n \\DB::raw(\"\n calendar_events.id,\n calendar_events.name,\n calendar_events.start_date,\n calendar_events.start_time,\n calendar_events.end_date,\n calendar_events.end_time,\n calendar_events_type.name as event_type\n \"\n\n )\n )\n ->where('calendar_events.event_type_id','=',1)\n ->whereIn('meeting_id',$myMeetingIds)\n ->groupBy('calendar_events.id')\n ->get();\n\n\n\n $calendarEventArray = array();\n $response = array();\n\n foreach ($calendarMeetingsEvents as $calendarMeetingEvent) {\n\n $calendarEventArray['title'] = $calendarMeetingEvent->start_time.'-'.$calendarMeetingEvent->name;\n $calendarEventArray['start'] = $calendarMeetingEvent->start_date.' '.$calendarMeetingEvent->start_time;\n $calendarEventArray['end'] = $calendarMeetingEvent->end_date.' '.$calendarMeetingEvent->end_time;\n $response[] = $calendarEventArray;\n\n\n }\n\n return \\Response::json($response);\n\n }", "function findAppointmentsDue(){\n\t$db = dbConnect();\n\n\t$sql = \"SELECT id FROM Appointment WHERE start_date > date_add(NOW(),INTERVAL 15 MINUTE) AND start_date <= date_add(NOW(),INTERVAL 30 MINUTE) AND status = 2 AND (type = 0 OR type = 1)\";\n\n\t$results = $db->query($sql);\n\n\treturn $results;\n}", "public function date_get_eventlist($date, $gid = 0)\n {\n if (is_array($date)) {\n $from = $this->esc($date[0]);\n $to = $this->esc($date[1]);\n } else {\n $date = $from = $to = $this->esc($date);\n }\n // Support for filtering out events from groups not included in result set according to query type\n $eventListFilter = $this->getQueryTypeFilter($gid);\n $gidFilter = $this->getGroupAndShareFilter($gid);\n\n $return = array();\n $query = 'SELECT DISTINCT e.`id` '\n .', IF(rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"), \" \",DATE_FORMAT(e.`starts`, \"%T\")) ), UNIX_TIMESTAMP(e.`starts`) ) as start'\n .', IF(rp.`type`!=\"-\", UNIX_TIMESTAMP(CONCAT(DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"), \" \",DATE_FORMAT(e.`ends`, \"%T\")) ), UNIX_TIMESTAMP(e.`ends`) ) as end'\n .',e.`starts`, e.`ends`, e.`location`, e.`title`, e.`description`, e.`type`, e.`status`, e.`opaque`, rp.`type` `repeat_type`, rp.`until` `repeat_until`'\n .',IF(fs.`val` IS NULL, \"\", fs.`val`) `colour`'\n .', (SELECT `mode` FROM '.$this->Tbl['cal_reminder'].' WHERE `uid`='.$this->uid.' AND `eid`=e.`id` AND `ref`=\"evt\" LIMIT 1) `warn_mode`'\n .' FROM '.$this->Tbl['cal_repetition'].' rp, '.$this->Tbl['cal_event'].' e'\n .' LEFT JOIN '.$this->Tbl['cal_group'].' eg ON eg.`gid`=e.`gid`'\n .' LEFT JOIN '.$this->Tbl['user_foldersettings'].' fs ON fs.`fid`=e.`gid` AND fs.`handler`=\"calendar\" AND fs.`key`=\"foldercolour\" AND fs.uid='.$this->uid\n .$eventListFilter[0]\n .' WHERE rp.`eid`=e.`id` AND rp.`ref`=\"evt\" AND ('.$gidFilter.')'.$eventListFilter[1]\n .' AND IF (rp.`type`!=\"-\", DATE_FORMAT(e.`starts`, \"%Y%m%d\") <= DATE_FORMAT(\"'.$from.'\", \"%Y%m%d\"), 1)'\n .' AND IF (rp.`type`!=\"-\" AND rp.`until` IS NOT NULL AND rp.`until` != \"0-0-0 0:0:0\", rp.`until`>\"'.$to.'\",1) AND ('\n // Begins or ends today\n .'DATE_FORMAT(e.`starts`, \"%Y%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR DATE_FORMAT(e.`ends`, \"%Y%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") OR '\n // Begins in the past AND ends in the future\n .'( DATE_FORMAT(e.`starts`, \"%Y%m%d\")<=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") AND DATE_FORMAT(e.`ends`, \"%Y%m%d\")>=DATE_FORMAT(\"'.$date.'\", \"%Y%m%d\") ) OR '\n // Is an event occuring yearly. Todays date matches the repetition date\n .'(rp.`type`=\"year\" AND (DATE_FORMAT(e.`starts`,\"%m%d\")=DATE_FORMAT(\"'.$date.'\", \"%m%d\") OR DATE_FORMAT(e.`ends`,\"%m%d\")=DATE_FORMAT(\"'.$date.'\",\"%m%d\"))) OR '\n // A monthly event, repetition day is today, repetition month is empty or matches\n .'(rp.`type`=\"month\" AND rp.`repeat`=DATE_FORMAT(\"'.$date.'\", \"%e\") AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) ) OR '\n // Monthly event on e.g. the 31st of month with months shorter than 31 days, this is only supported from MySQL 4.1.1 onward\n .'(rp.`type`=\"month\" AND rp.`repeat`=31 AND (rp.`extra`=\"\" OR FIND_IN_SET(DATE_FORMAT(\"'.$date.'\", \"%c\"), rp.`extra`)>0) AND LAST_DAY(\"'.$date.'\")=DATE_FORMAT(\"'.$date.'\", \"%Y-%m-%d\"))'\n // A weekly event, repetition weekday is today\n .' OR (rp.`type`=\"week\" AND rp.`repeat`=DATE_FORMAT(\"'.$date.'\", \"%w\") AND IF(rp.`extra` IN(\"\", \"1\"), 1, ABS(MOD(DATEDIFF(e.`starts`, \"'.$date.'\")/7, rp.`extra`))=0) ) OR '\n // A \"daily\" event, where the bit pattern should match today's weekday\n .'(rp.`type`=\"day\" AND (rp.`repeat`=\"0\" OR SUBSTRING(LPAD(BIN(rp.`repeat`), 8, 0), IF(DATE_FORMAT(\"'.$date.'\", \"%w\")=0, 8, DATE_FORMAT(\"'.$date.'\", \"%w\")+1), 1) = 1 ) )'\n .') ORDER BY `start` ASC';\n $qh = $this->query($query);\n while ($line = $this->assoc($qh)) {\n if ($line['warn_mode'] == '?') {\n $qid2 = $this->query('SELECT `mode` FROM '.$this->Tbl['cal_reminder']\n .' WHERE `uid`='.$this->uid.' AND `eid`='.$line['id'].' AND `ref`=\"evt\" AND `mode` != \"-\" LIMIT 1');\n list ($rem) = $this->fetchrow($qid2);\n $line['warn_mode'] = $rem ? $rem : '-';\n } elseif ($line['warn_mode'] == '' || is_null($line['warn_mode'])) {\n $line['warn_mode'] = '-';\n }\n $return[] = $line;\n }\n return $return;\n }", "public function hasAlarmList()\n {\n return $this->alarm !== null;\n }", "public function get_calendar() {\n $start = date('Y-m-d H:i:s', strtotime($this->input->post('start_date')));\n $end = date('Y-m-d H:i:s', strtotime($this->input->post('end_date')));\n $filter = $this->input->post('filter');\n if ($start && $end) {\n if (isset($filter) && !empty($filter) && !in_array($filter, config_item('event_types'))) {\n return $this->send_error('INVALID_FILTER');\n }\n $this->load->model('events_model');\n $where = array('start_date >=' => $start, 'end_date <=' => $end);\n if (isset($filter) && !empty($filter)) {\n $where['type'] = $filter;\n }\n if ($events = $this->events_model->get_all($where)) {\n setlocale(LC_TIME, 'nl_NL.UTF-8');\n foreach ($events as &$event) {\n $event['readable_start_date'] = strftime('%A %d %B %G', strtotime($event['start_date']));\n $event['readable_end_date'] = strftime('%A %d %B %G', strtotime($event['end_date']));\n }\n $this->event_log();\n return $this->send_response($events);\n }\n return $this->send_error('NO_RESULTS');\n } else {\n return $this->send_error('ERROR');\n }\n }", "function listEventInfo() {\n\t\t$query = \"SELECT e_description, c_name, tag_name, start_datetime, end_datetime, capacity, v.name AS vname, address,o.name AS oname, v.address, v.city, v.state, v.postal_code \n\t\tFROM yam14.F_event e, yam14.F_venue v, yam14.F_category c, yam14.F_topic t, yam14.F_organizer o\n\t\tWHERE e.venue_id = v.v_id \n\t\tAND c.c_id = e.c_id \n\t\tAND t.tag_id = e.tag_id \n\t\tAND o.o_id = e.organizer_id\n\t\tAND e.e_id = $this->eid ;\";\n\t\t\n\t\t$result = mysql_query($query);\n\t\tif (!$result) {\n\t\t\t$message='Invalid Query' .mysql_errno().\" \\n\";\n\t\t $message .= 'Whole Query' . $query;\n\t\t die($message);\n\t\t}//end if\n\t\t\n\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t$this->category = $row['c_name'];\n\t\t\t$this->tag = $row['tag_name'];\n\t\t\t$this->description = $row['e_description'];\n\t\t\t$this->startdate = date('l, M d, Y',strtotime($row['start_datetime']));\n\t\t\t$this->starttime = date('H:i A',strtotime($row['start_datetime']));\n\t\t\t$this->enddate = date('l, M d, Y',strtotime($row['end_datetime']));\n\t\t\t$this->endtime =date('H:i A',strtotime($row['end_datetime']));\n\t\t\t$this->capacity = $row['capacity'];\n\t\t\t$this->venue = $row['vname'];\n\t\t\t$this->address = $row['address'] . \", \" . $row['city'] . \", \" . $row['state'] . \" \" . $row['postal_code'];\n\t\t\t$this->organizer = $row['oname'];\n\t\t\techo \"<hr />\";\n\t\t\techo \"<div class=\\\"panel panel-default\\\">\";\n\t\t\techo \t\"<div class=\\\"panel-heading\\\">\";\n\t\t\techo \t\"<h3 class=\\\"panel-title\\\">Event Information</h3>\";\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"<div class=\\\"panel-body\\\">\";\n\t\t\techo \"<p><b>Description: </b>$this->description</p>\";\n\t\t\techo \t\"<p><b>Category: </b>$this->category</p>\";\n\t\t\techo \t\"<p><b>Topic: </b>$this->tag</p>\";\n\t\t\techo \t\"<p><b>Start Date: </b>$this->startdate</p>\";\n\t\t\techo \t\"<p><b>Start Time: </b>$this->starttime</p>\";\n\t\t\techo \t\"<p><b>End Date: </b>$this->enddate</p>\";\n\t\t\techo \t\"<p><b>End Time: </b>$this->endtime</p>\";\n\t\t\techo \t\"<p><b>Capacity: </b>$this->capacity</p>\";\n\t\t\techo \t\"<p><b>Organizer: </b>$this->organizer</p>\";\n\t\t\techo \t\"<p><b>Location: </b>$this->venue</p>\";\n\t\t\techo \t\"<p><b>Address: </b>$this->address</p>\";\n\t\t\t\n\t\t\techo \t\"</div>\";\n\t\t\techo \t\"</div>\";\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t}\t\n\t\t\n\t\tmysql_free_result($result);\n\t}", "public function lista(): array\n {\n return $this->eventos;\n }", "function getEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "function getAllNews(){\n $response=getAllNews();\n $all_awp_news = awp_convertObjToArray($response->return->newsList);\n $allnews=array();\n $currentdate = gmdate(DATE_ATOM,mktime());\n if( count($all_awp_news)>0){\n\t foreach($all_awp_news as $news)\n\t {\n\t\t if(strtotime($news->startDate)<=strtotime($currentdate) && strtotime($news->endDate)>=strtotime($currentdate)){\n\t\t array_push($allnews,$news);\n\t\t }\n\t }\n }\n return $allnews;\n }", "public function index()\n {\n $doorAlarms = DoorAlarm::all()->where('is_deleted', 0);\n return $this->responseFormat(200, 'Success', $doorAlarms);\n }", "public function index()\n {\n /*\n if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {\n $this->client->setAccessToken($_SESSION['access_token']);\n $service = new Google_Service_Calendar($this->client);\n\n $calendarId = 'primary';\n\n\n $results = $service->events->listEvents($calendarId);\n return $results->getItems();\n\n } else {\n return redirect()->route('oauthCallback');\n }\n */\n\n if (Session::has('access_token')) {\n $this->client->setAccessToken(Session::get('access_token'));\n $service = new Google_Service_Calendar($this->client);\n\n $calendarId = 'primary';\n\n\n $results = $service->events->listEvents($calendarId);\n\n foreach ($results as $key => $value) {\n\n //$res = Meeting::where('title', $meetings[0]['title'][2])->where('name', $meetings[0]['name'][2])->where('start_time', $meetings[0]['start_time'][2])->where('end_time', $meetings[0]['end_time'][2])->first();\n\n \n $m = new Meeting;\n //$m->title = $results->getItems()[0]->description;\n $m->description = $results->getItems()[0]->description;\n $m->name = $results->getItems()[0]->organizer->displayName;\n $m->start_time = trim(preg_replace('/[a-zA-Z]/',' ',$results->getItems()[0]->start->dateTime));\n $m->end_time = trim(preg_replace('/[a-zA-Z]/',' ',$results->getItems()[0]->end->dateTime));\n //$m->end_time = $results->getItems()[0]->end->dateTime;\n $m->save();\n \n \n }\n\n return dd($results->getItems());\n\n //return dd($results->getItems()[0]->description);\n //return $results->getItems();\n\n } else {\n return redirect()->route('oauth2Callback');\n }\n\n }", "function get_new_events( $options=array() ){\n\t\t\n\t\tglobal $gamo, $dbh;\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'start' => 0,\n\t\t\t\t'number' => 1\n\t\t\t),\n\t\t$options);\n\t\t\n\t\t$sql = \"SELECT id FROM \" . CORE_DB . \".\" . self::$table_name.\n\t\t\" WHERE active = 1 and hide = 0 ORDER BY date_time ASC LIMIT \".$options['start'].\",\".$options['number'];\n\n\t\t$sth = $dbh->prepare($sql);\n\n\t\t$vevents = array();\n\t\t$sth->execute();\n\n\t\twhile($row = $sth->fetch()) {\n\n\t\t\t$row = Core::r('virtual_events')->get_event(array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'public_has' => 1,\n\t\t\t\t\t'show_private_has' => 0\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tarray_push($vevents, $row);\n\n\t\t}\n\n\t\treturn $vevents;\n\t\t\n\t}", "public function listAll( Request $request ) \n { \n $draw = $request->get('draw');\n $maxResult = $request->get('length'); \n $firstResult = $request->get('start');\n $buscar = $request->get('search')['value'];\n\n $fechaInicio = $request->get('fechaInicio'); \n $fechaFin = $request->get('fechaFin');\n \n\n $alertas = $this->alertaDao->listAll( $fechaInicio , $fechaFin, $draw, $maxResult , $firstResult , $buscar );\n \n $arregloAlertas = array();\n foreach( $alertas['data'] as $indice => $alerta ){\n\n $cadenasArreglo = array();\n foreach( $alerta->getNegocio()->getCadenas() as $indice => $cadena ){\n $arreglo = array(\n \"id\" => $cadena->getId(),\n \"etiqueta\" => $cadena->getEtiqueta(),\n \"fechaAlta\" => $cadena->getFechaAlta(), \n \"status\" => $cadena->getStatus() ? \"Activo\" : \"No activo\" \n ); \n $cadenasArreglo[] = $arreglo;\n } \n\n $zonasArreglo = array();\n if( $alerta->getSector() != null ){\n foreach( $alerta->getSector()->getZonas() as $indice => $zona ){ \n $arreglo = array(\n \"id\" => $zona->getId(),\n \"etiqueta\" => $zona->getEtiqueta()\n ); \n $zonasArreglo[] = $arreglo;\n } \n }\n\n $direccionArreglo = array(\n \"colonia\" => $alerta->getNegocio()->getDireccion()->getColonia()->getEtiqueta(),\n \"delegacion\" => $alerta->getNegocio()->getDireccion()->getColonia()->getDelegacion()->getEtiqueta(),\n \"callePrincipal\" => $alerta->getNegocio()->getDireccion()->getCallePrincipal(),\n \"calle1\" => $alerta->getNegocio()->getDireccion()->getCalle1(),\n \"calle2\" => $alerta->getNegocio()->getDireccion()->getCalle2(),\n \"numeroInterior\" => $alerta->getNegocio()->getDireccion()->getNumeroInterior(),\n \"numeroExterior\" => $alerta->getNegocio()->getDireccion()->getNumeroExterior(),\n \"edificio\" => $alerta->getNegocio()->getDireccion()->getEdificio(),\n \"codigoPostal\" => $alerta->getNegocio()->getDireccion()->getCodigoPostal()\n ); \n \n \n $arreglo = array( \n \"id\" => $alerta->getId(), \n \"cadenas\" => $cadenasArreglo, \n \"idNegocio\" => $alerta->getNegocio()->getId(),\n\n \"latitud\" => $alerta->getNegocio()->getLatitud(), \n \"longitud\" => $alerta->getNegocio()->getLongitud(),\n \n \"idNegocio\" => $alerta->getNegocio()->getId(),\n \"fechaAltaNegocio\" => $alerta->getNegocio()->getFechaAlta(), \n \"direccionNegocio\" => $direccionArreglo,\n \"negocio\" => $alerta->getNegocio()->getNombre(),\n \n \"referenciaNegocio\" => $alerta->getNegocio()->getReferencia(),\n \"giroNegocio\" => $alerta->getNegocio()->getGirONegocioGeneral()->getEtiqueta(),\n\n \n \"fechaAlta\" => $alerta->getFechaAlta(), \n \"tipoAlarma\" => $alerta->getTipoAlarma() != null ? $alerta->getTipoAlarma()->getEtiqueta() : \"No asignado\",\n \"tipoStatus\" => $alerta->getTipoStatus()->getEtiqueta(), \n \"zonas\" => $zonasArreglo, \n \"sector\" => $alerta->getSector() != null ? $alerta->getSector()->getEtiqueta() : \"Ninguno\",\n \"motivoAlarma\" => $alerta->getMotivoAlarma() != null ? $alerta->getMotivoAlarma()->getEtiqueta(): \"No asignado\",\n \"dispositivo\" => $alerta->getDispositivo()->getTipoDispositivo()->getEtiqueta(),\n );\n $arregloAlertas[] = $arreglo;\n } \n $alertas['data'] = $arregloAlertas;\n return response( $alertas , 200)->header('Content-Type', 'application/json'); \n }", "function get_events($start, $event_limit, $cond=array())\r\n\t{\r\n\t\t$c_filter = '';\r\n\t\tif (is_domain_user() == true) {\r\n\t\t\t$c_filter .= ' AND TL.domain_origin = '.get_domain_auth_id();\r\n\t\t}\r\n\t\tif (valid_array($cond)) {\r\n\t\t\t$c_filter .= $this->CI->custom_db->get_custom_condition($cond);\r\n\t\t}\r\n\t\tif (is_app_user()) {\r\n\t\t\t$c_filter .= ' AND TL.created_by_id = '.intval($this->CI->entity_user_id);\r\n\t\t}\r\n\t\t$query = 'select TL.*, TLE.event_title, TLE.event_icon \r\n\t\t\t\tfrom timeline TL \r\n\t\t\t\tJOIN timeline_master_event TLE \r\n\t\t\t\twhere TL.event_origin=TLE.origin '.$c_filter.' order by TL.origin desc limit '.$start.','.$event_limit;\r\n\t\treturn $this->CI->db->query($query)->result_array();\r\n\t}", "private function getUpcomingMeetingList($id) {\n $currentDate = new \\DateTime();\n\n $em = $this->getDoctrine()->getManager();\n\n $q = $em->createQuery(\"SELECT e \"\n . \"FROM \\Acme\\bsceneBundle\\Entity\\Meeting e \"\n . \"WHERE e.account = :id AND e.date >= :date \"\n . \"ORDER BY e.date ASC\")->setParameters(array('date' => $currentDate, 'id' => $id));\n $eventList = $q->getArrayResult();\n\n return $eventList;\n }", "public function listarAerolineas() {\n//Se obtiene la conexion\n $conn = Conexion::singleton()->obtenerConexion();\n try {\n //Consulta para listar las aerolinas registradas\n $query = $conn->prepare(\"SELECT * FROM tbl_aerolinea\");\n $query->execute();\n return $query->fetchAll();\n }\n catch (Exception $ex) {\n\n echo 'ERROR' . $ex->getMessage();\n }\n\n $conn = null;\n }", "function getCurrentEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE starttime < CURRENT_DATE && event_complete != 1 ORDER BY starttime\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }" ]
[ "0.65576774", "0.64311796", "0.63000643", "0.6299815", "0.62756264", "0.6257771", "0.6201781", "0.6197145", "0.61781037", "0.61694765", "0.61662114", "0.6095432", "0.6092611", "0.6092611", "0.6057798", "0.60091203", "0.60051733", "0.6003813", "0.6002366", "0.59902656", "0.59822", "0.5957333", "0.5950767", "0.5937082", "0.5935271", "0.5926857", "0.5913229", "0.589417", "0.5873766", "0.5872978", "0.5871916", "0.58673936", "0.580713", "0.5777501", "0.5776338", "0.577442", "0.5768028", "0.5766981", "0.5762989", "0.5731227", "0.57258034", "0.5723404", "0.5721856", "0.57186675", "0.5717813", "0.57157755", "0.571289", "0.57118094", "0.5711751", "0.5702067", "0.5685477", "0.56840295", "0.5673206", "0.5671206", "0.5665503", "0.56490993", "0.5645316", "0.5640537", "0.56401443", "0.56392896", "0.5632096", "0.5630281", "0.56289804", "0.5625564", "0.55982584", "0.55927795", "0.5583205", "0.5582614", "0.5572286", "0.5572262", "0.5567398", "0.5561043", "0.55503947", "0.5547041", "0.55446386", "0.55364156", "0.5523016", "0.55226535", "0.5517354", "0.5511777", "0.55101883", "0.5507847", "0.55049354", "0.55015707", "0.5500103", "0.54979914", "0.54954547", "0.54918337", "0.5487907", "0.54851717", "0.5483996", "0.5483024", "0.5478591", "0.5469514", "0.54642093", "0.5456406", "0.54555124", "0.5450235", "0.5449504", "0.5442407" ]
0.8293316
0
get list of user peoples
public function getUserPeoplesAction() { $people = new Workapp_People(); $this->_helper->json($people->getPeopleList(array('user_id' => $this->getDeviceSession()->getUserId()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public static function getPersonsUsers(){\n return self::getPersonsByRole();\n }", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "public function listUsers(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=3\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }", "function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}", "public function findUsers(): iterable;", "function list_users(){\r\n\t\t$query = $this->db->query(\"SELECT userid, concat(fname, ' ', lname, ' (', username, ')') as name FROM nf_users\");\r\n\t\t$return = array();\r\n\t\tforeach($query->result() as $row){\r\n\t\t\t$return[$row->userid] = $row->name;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "public function getUsersList()\n {\n }", "public function getList($user);", "private function getUsers()\n {\n $url = $this->base_uri.'user/assignable/multiProjectSearch?projectKeys='.$this->project;\n $users = $this->request($url);\n if (!$this->infos['errorBoolean']) {\n return json_decode($users);\n }\n }", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function findUsers();", "public function findUsers();", "public static function listUsers()\n {\n //Init curl\n $curl = new curl\\Curl();\n\n // GET request to api\n $response = $curl->get(Yii::$app->params['listUsers']);\n\n $records = json_decode($response, true);\n\n foreach($records as $users){\n foreach($users as $user){\n $list[$user['id']] = $user['name'] . ' ' . $user['last_name'];\n }\n }\n\n return $list;\n }", "public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\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//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}", "function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "public function getUserList($data)\n {\n $return = [];\n foreach(UserModel::where(\"first_name\",\"like\", \"%{$data->value}%\")->get() as $q)\n {\n $return[][\"username\"] = $q->first_name;\n }\n if(!empty($return))\n {\n return $return;\n }\n return false;\n }", "public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public function getLTIUsers();", "function get_users()\n {\n //Unimplemented\n }", "public static function getUserList() {\n $db = DB::getInstance();\n $resp = \"\";\n try {\n $query = $db->query(\"SELECT id, first_name, last_name, username, lump, admin FROM `users` ORDER BY last_name ASC\", PDO::FETCH_ASSOC);\n $rows = $query->fetchAll();\n $resp = json_encode($rows);\n }\n catch (Exception $e) {\n $db->rollBack();\n $resp = $e->getMessage();\n }\n return $resp;\n }", "public function listUsersAdmin(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=1\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "function getUserSelectList() {\r\n\t\t$return = array();\r\n\t\t$query = \"select ID, CONCAT(LastName, ', ', FirstName, ' ', MiddleIn, ' (', ID, ')') as Label\r\n\t\t\t from users order by LastName\";\r\n\t\t$result = mysql_query($query);\r\n\t\twhile( $row = mysql_fetch_assoc($result) ) {\r\n\t\t\tarray_push( $return, $row );\r\n\t\t}\r\n\t\treturn $return;\r\n\t\t\r\n\t}", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "public function getUsers()\n {\n $request = \"SELECT user.*, rank.name as rank_name FROM `user` join rank on user.rank = rank.id order by rank.id\";\n $request = $this->connexion->query($request);\n $newsList = $request->fetchAll(PDO::FETCH_ASSOC);\n // var_dump($newsList);\n return $newsList;\n }", "public function getResearcherList() {\n return CHtml::listData(User::model()->findAll(array('order' => 'short_name')), 'uniquename', 'short_name');\n }", "public function getUsers() {\n $user= \\DB::table('users')\n ->pluck('name', 'id');\n return $user;\n \n \n }", "public function likedBy()\n {\n return $this->likes()\n ->join('users', 'likes.user_id', '=', 'users.id')\n ->get(['users.name', 'users.username']);\n }", "public function getUserList() {\n return $this->users;\n }", "private function getUsersMailist() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $users = $this->mailist->gets($param);\n\n return $users;\n }", "public function getPeopleList()\n {\n //db object\n $db = JFactory::getDBO();\n //gen query\n $query = $db->getQuery(true);\n $query->select(\"DISTINCT(p.id),p.first_name,p.last_name\");\n $query->from(\"#__people AS p\");\n $query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $query->leftJoin(\"#__people_cf AS dcf ON dcf.person_id = p.id AND dcf.association_type='deal'\");\n\n //filter based on member access roles\n $user_id = UsersHelper::getUserId();\n $member_role = UsersHelper::getRole();\n $team_id = UsersHelper::getTeamId();\n\n if ($member_role != 'exec') {\n\n if ($member_role == 'manager') {\n $query->where(\"u.team_id=$team_id\");\n } else {\n $query->where(\"(p.owner_id=$user_id OR p.assignee_id=$user_id )\");\n }\n\n }\n\n $query->where(\"p.published=\".$this->published);\n\n $associationType = $this->app->input->get('association');\n $associationId = $this->app->input->get('association_id');\n\n if ($associationType == \"company\") {\n $query->where(\"p.company_id=\".$associationId);\n }\n if ($associationType == \"deal\") {\n $query->where(\"dcf.association_id=\".$associationId.\" AND dcf.association_type='deal'\");\n }\n\n //set query\n $db->setQuery($query);\n\n //load list\n $row = $db->loadAssocList();\n $blank = array(array('first_name'=>TextHelper::_('COBALT_NONE'),'last_name'=>'','id'=>0));\n $return = array_merge($blank,$row);\n\n //return results\n return $return;\n\n }", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "public function getPersonsList($hint, $uacc_uid=''){\r\n\t\t//format datetime into \"time ago\"\r\n\t\t$list = array();\r\n\r\n\t\tif($uacc_uid != '')\r\n\t\t\t$query = $this->db->select('people_id,first_name,last_name,company_id')->like(\"first_name\", $hint)->or_like(\"last_name\", $hint)->where(array(\"created_by\"=>$uacc_uid,\"deleted\"=>0))->order_by(\"company_id\", \"desc\")->get(\"sc_people\");\r\n\t\telse\r\n\t\t\t$query = $this->db->select(\"people_id,first_name,last_name,company_id\")->like(\"first_name\", $hint)->or_like(\"last_name\", $hint)->where(\"deleted\",0)->order_by(\"company_id\", \"desc\")->get(\"sc_people\");\r\n\r\n\t\t$this->load->model(\"general\");\r\n\r\n\r\n\t if ($query->num_rows() > 0){\r\n\t\t\tforeach($query->result() as $row){\r\n\t\t\t\t$company_name = $this->general->getAccountName($row->company_id);\r\n\t\t\t\tif($company_name != \"\" && $company_name != \" - \")\r\n\t\t\t\t\t$list[] = array(\"name\"=>$row->first_name . \" \" . $row->last_name . \" (\" . $company_name . \")\", \"label\"=>$row->first_name . \" \" . $row->last_name . \" (\" . $company_name . \")\", \"id\"=>$row->people_id);\r\n\t\t\t\telse\r\n\t\t\t\t\t$list[] = array(\"name\"=>$row->first_name . \" \" . $row->last_name, \"label\"=>$row->first_name . \" \" . $row->last_name, \"id\"=>$row->people_id);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $list;\r\n\t}", "public function getPresidentUsers($filter = array())\n {\n //$vp_ops_dept = 54;\n $vp_ops_dept = $this->em->getRepository(\"HrisAdminBundle:JobTitle\")->findBy(array('name'=> 'President/CEO'));\n \n $query = 'select d from HrisWorkforceBundle:Employee d where d.job_title = :code';\n $opts = $this->em ->createQuery($query)\n ->setParameter('code', $vp_ops_dept) \n ->getResult();\n\n $list_opts = array();\n foreach ($opts as $item)\n $list_opts[$item->getID()] = $item->getFirstName().' '.$item->getLastName();\n\n return $list_opts;\n }", "function getUsers(){\n\t\t$this->users = $this->fileHandler->parseRows($this->userFile, '^', '|');\n\t\t$this->logMsg(SUCCESS, 'users generated');\n\t}", "public function getList() {\n //Retourne la liste de tous les users\n $users = [];\n $requsers = $this->db->query('SELECT * FROM user');\n\n while ($data = $requsers->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new user($data);\n }\n\n return $users;\n }", "public function getMembers()\n {\n \t$companyId = session('company_id');\n \t$userRepo = $this->em->getRepository('App\\Entity\\Management\\User');\n \t$users = $userRepo->getUsersByCompany($companyId);\n\n echo json_encode($users);\n\n }", "public function getUsersList($employer_id)\n {\n $em = $this->getEntityManager();\n\n\t\t$recs = $em->createQuery(\"SELECT DISTINCT ec.userId, CONCAT(u.firstname,' ',u.surname) AS username\n\t\t\tFROM AppBundle:ExtraChecks ec \n\t\t\tLEFT JOIN AppBundle:Users u WITH ec.userId = u.id\n\t\t\tWHERE ec.employerId = :eid AND ec.checkType NOT LIKE 'DBS%'\n\t\t\tORDER BY u.firstname,u.surname\")\n\t\t\t->setParameters(array(\"eid\"=>$employer_id))\n\t\t\t->getResult();\n\t\t$output = array('0'=>array('userId'=>0, 'username'=>'All'));\n\t\t$output = array_merge($output,$recs);\n\t\t//print \"<pre>\"; var_dump($output); die;\n\t\treturn $output;\n\t}", "public function getUserListAttribute()\n {\n return $this->users->pluck('id')->all();\n }", "private function getUserBatch() {\n\t\t// Include also hidden (disabled) users to the export\n\t\t$hidden_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\n\t\t// Ignore access settings to get all users\n\t\telgg_set_ignore_access(true);\n\n\t\t$users = elgg_get_entities(array(\n\t\t\t'type' => 'user',\n\t\t\t'limit' => $this->limit,\n\t\t\t'offset' => $this->offset,\n\t\t));\n\n\t\t// Set access level to normal\n\t\telgg_set_ignore_access(false);\n\n\t\t// Set hidden status to normal\n\t\taccess_show_hidden_entities($hidden_status);\n\n\t\treturn $users;\n\t}", "public function getUserList()\n {\n $responseMap = $this->_postCommand(static::$COMMAND_GET_USER_LIST);\n \n // From the response, filter out only the users that matched this environment Prefix\n $userIdList = [];\n foreach ($responseMap['ids'] as $userId) {\n $unprefixedUserId = PrefixHelper::unprefix($userId);\n \n if ($unprefixedUserId !== false) {\n $userIdList[] = $unprefixedUserId;\n }\n }\n \n return $userIdList;\n }", "public function getUsersListAttribute()\n {\n return User::orderBy('name')->get();\n }", "public function get_users_list() {\n\n\t\t\t$users = get_users();\n\n\t\t\t$result = array( '0' => esc_html__( 'Select a user', 'cherry' ) );\n\n\t\t\tif ( empty( $users ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\tforeach ( $users as $user ) {\n\t\t\t\t$result[ $user->data->ID ] = $user->data->user_nicename;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "public function index()\n {\n $users = UserMetal::all(); \n $usersMetal = [];\n \n foreach ($users as $user) {\n $perfil = $user->perfil()->where('id', $user->perfil_id)->first();\n \n $tempUser = $user;\n $tempUser['perfil_name'] = $perfil->name;\n \n $usersMetal[] = $tempUser;\n }\n \n return $usersMetal;\n }", "public function getMembers() {\r\n\r\n //statement of resources\r\n $user = array();\r\n\r\n //sql connection\r\n $connect = connection::getInstance();\r\n\r\n //user sql request\r\n $sql = \"SELECT* FROM users\";\r\n //sending request\r\n\r\n\r\n\r\n $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());\r\n\r\n while ($data = mysql_fetch_assoc($req)) {\r\n //scenario creation\r\n $data['nameU'] = Users::secure($data['nameU']);\r\n $data['IDU'] = Users::secure($data['IDU']);\r\n $data['typeU'] = Users::secure($data['typeU']);\r\n $data['admin'] = Users::secure($data['admin']);\r\n $data['password'] = Users::secure($data['password']);\r\n\r\n $users[] = new User($data['nameU'], $data['IDU'], $data['typeU'], $data['admin'], $data['password']);\r\n }\r\n\r\n return $users;\r\n }", "public function get_users() {\n // Return key => value pair array\n $query = $this->db->query(\"SELECT $this->_table_name.*, fname, lname, t2.title FROM $this->_table_name\n LEFT JOIN kompetenzm.job_title as t2 on t2.id = $this->_table_name.job_title_id\");\n $users = $query->result_object();\n $array = array('0' => 'Select');\n if (count($users)) {\n foreach ($users as $user) {\n $array[$user->TITLE][$user->ID] = $user->FNAME . \" \" . $user->LNAME;\n }\n }\n\n return $array;\n }", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function getUserNames()\n {\n $result = $this->getUsers()->all();\n if( is_null( $result ) ) return [];\n return array_map( function($o) {return $o->namedId;}, $result );\n }", "public function getUserList()\n {\n $this->db->select('nama,nip');\n $this->db->from('user');\n\n $query = $this->db->get();\n return $query->result_array();\n }", "public function getAllUser(){\n return $this->users;\n }", "public function getUserList() {\n $users = DB::select(\"select * from users\");\n $count = DB::table(\"users\") -> count();\n $data = [];\n foreach ($users as $user) {\n array_push($data, array(\n \"id\" => $user -> id,\n \"role\" => ($user -> role == 0)?\"Inactive\":($user -> role == 1?\"Active\":'[ Admin ]'),\n \"fname\" => $user -> fname,\n \"lname\" => $user -> lname,\n \"affiliation\" => $user -> affiliation,\n \"email\" => $user -> email,\n \"created_at\" => $user -> created_at,));\n };\n return array(\"code\" => 0, \"msg\" => \"\", \"count\" => $count, \"data\" => $data);\n }", "function extract_all_users() {\n\t\t$db = connect_to_db();\n\n\t\t$select_statement = \n\t\t\t\"select users.id, users.username from users\";\n\t\t;\n\n\t\t$stmt = $db->prepare($select_statement);\n\n\t\tif ( !($stmt->execute()) ) {\n\t\t\techo \"Error: Could not get users.\";\n\t\t\t$db->close();\n\t\t\texit;\n\t\t}\n\n\t\t$json = \"[\";\n\n\t\t$stmt->bind_result($id, $username);\n\n\t\twhile ( $stmt->fetch() ) {\n\t\t\t$info = array('id' => $id, 'username' => $username);\n\t\t\t$json = $json . json_encode($info) . \",\";\n\t\t}\n\n\t\techo substr_replace($json, \"]\", -1);\n\n\t\t$db->close();\n\t}", "public function getUsers()\n {\n $users = [];\n $request = $this->_db->query('SELECT * FROM user');\n while ($data = $request->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new User($data);\n }\n return $users;\n }", "function listUsers() {\n return $this->users;\n }", "function getFriends()\n\t{\n\t\t//init variable\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser($this->plugin->get('user')->id);\n\t\t$userid = $app->input->get('target_user',$this->plugin->get('user')->id,'INT');\n\t\t\n\t\t$search = $app->input->get('search','','STRING');\n\t\t\n\t\t$mapp = new EasySocialApiMappingHelper();\n\t\t\n\t\tif($userid == 0)\n\t\t$userid = $user->id;\n\t\t\n\t\t$frnd_mod = new EasySocialModelFriends();\n\t\t\n\t\t// if search word present then search user as per term and given id\n\t\tif(empty($search))\n\t\t{\n\t\t\t$ttl_list = $frnd_mod->getFriends($userid); \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ttl_list = $frnd_mod->search($userid,$search,'username');\n\t\t}\n\n\t\t$frnd_list = $mapp->mapItem( $ttl_list,'user',$userid);\n\n\t //get other data\n\t foreach($frnd_list as $ky=>$lval)\n\t {\t\t\t\n\t\t\t$lval->mutual = $frnd_mod->getMutualFriendCount($user->id,$lval->id);\n\t\t\t$lval->isFriend = $frnd_mod->isFriends($user->id,$lval->id);\n\t\t}\n\t\treturn( $frnd_list );\n\t}", "public function getList(): Collection\n {\n return User::with(['match1', 'match2'])->get();\n }", "public function getCompanyWithUsers();", "public static function listUser()\n {\n $self = new self();\n\n $where = '';\n $limit = self::LIMIT;\n\n\n $search = isset($_GET['search']) ? $_GET['search'] : '';\n\n $page = (isset($_GET['page']) && $_GET['page'] >= 0) ?\n (int)$_GET['page'] : 1;\n\n if ($search != '')\n $where .= \" WHERE name LIKE '%$search%' \";\n\n $from = ($page == 1) ? 1 : ($page - 1) * $limit;\n\n $sql = \"SELECT * FROM user \" . $where . \" ORDER BY id DESC LIMIT $from, $limit\";\n\n $result = $self->db->query($sql);\n $result = $result->fetchAll();\n\n $countSql = \"SELECT count(*) FROM user \" . $where;\n\n $resultCount = $self->db->query($countSql);\n $resultCount = $resultCount->count();\n\n return [\n 'items' => $result,\n 'current_page' => $page,\n 'limit' => $limit,\n 'total' => $resultCount,\n 'keysearch' => $search,\n 'from' => $from\n ];\n }", "function getUsers() {\r\n\t\t\t$sql = \"SELECT users.user_id, users.email, users.student_id, 'Click to change password', users.active, societies.society_name FROM `users`, `societies` WHERE societies.society_id=users.society_id\";\r\n\t\t\t$result = $this->query($sql);\r\n\t\t\tif (mysql_num_rows($result) == 0) return false;\r\n\t\t\twhile ($row = mysql_fetch_object($result)) $rows[] = array($row->user_id, $row->email, $row->student_id, \"Click to change\", str_replace(array(1, 0), array(\"Yes\", \"No\"), $row->active), $row->society_name);\r\n\t\t\treturn $rows;\r\n\t\t}", "public function songsLikedByUser()\n {\n $likes = \\App\\SongLike::where('user_id', \\Auth::user()->id)->with('song')->get()->pluck('song');\n return $likes;\n }", "public function userList() \n { \n $user = User::get(); \n return response([ 'data' => ToArray::collection($user), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "function getUserTags(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$tags = $this->askFlickr('tags.getListUserPopular','user_id='.$this->user);\n\n\t\t/* Return Tags */\n\t\treturn $tags;\n\t}", "public function getPeoples(){\n $result = $this->mysqli->query('SELECT * FROM alumno');\n $peoples = $result->fetch_all(MYSQLI_ASSOC);\n $result->close();\n return $peoples;\n }", "public function getPeople()\n\t{\n\t\treturn $this->people;\n\t}", "function wfSpecialListusers( $par = null ) {\n\tglobal $wgRequest;\n\n\tlist( $limit, $offset ) = wfCheckLimits();\n\n\n\t$slu = new ListUsersPage();\n\t\n\t/**\n\t * Get some parameters\n\t */\n\t$groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' );\n\t$slu->requestedGroup = $groupTarget;\n\t$slu->requestedUser = $wgRequest->getVal('username');\n\n\treturn $slu->doQuery( $offset, $limit );\n}", "public function getAllUsers(){\n\t\treturn $this->user;\n\t}", "public function getPeople() {\n $peopleNames = array();\n\n foreach ($this->tblPeople as $model_person) {\n $peopleNames[] = $model_person->name;\n }\n\n // return concatenated list of people names\n return implode(', ', $peopleNames);\n }", "function getUserList(){\n try{\n $query = \"Select id, fname, lname, email, phone, created_at FROM users ORDER BY id DESC\";\n $stmt = $this -> getConnection($query);\n $stmt ->execute();\n $stmt ->bind_result($id, $fname, $lname, $email, $phone, $since);\n $result = array();\n while ($stmt -> fetch()) {\n $result[] = array(\n 'id' => $id,\n 'fname'=>$fname,\n 'lname'=>$lname,\n 'email' => $email,\n 'phone' => $phone,\n 'since' => $since\n );\n }\n $stmt->close();\n \n return $result;\n }catch (exception $e){\n die('Error - cannot retrieve user list: ' . $e -> getMessage());\n }\n }", "public function memberList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function user_lists(){\n return get_instance()->ecl('Instance')->mod('lists', 'user_lists', [get_instance()->ecl('Instance')->user(),'email']);\n }", "function get_userlist() {\r\n \r\n $this->db->order_by('id', 'desc');\r\n $query = $this->db->get('users');\r\n return $query->result_array();\r\n }", "public static function getAllUsersNames()\n {\n $sql = \"SELECT idUser, CONCAT(FirstName,' ',LastName) AS Name FROM users ORDER BY LastName, FirstName\";\n $req = DbConnection::getInstance()->prepare($sql);\n //$req->setFetchMode(PDO::FETCH_OBJ);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_KEY_PAIR);\n }", "public function getUsersPairs()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'));\n\t\treturn $db->fetchPairs($select);\n\t}", "public function get_users()\n\t{\n\t\t$sql=\"SELECT * FROM waf_users WHERE 1=1\";\n\t\t$result=$this->db->LIST_Q($sql);\n\t\treturn $result;\n\t}", "public static function getUsersToImpersonate()\n {\n $userProfileTable = UserProfile::tableName();\n $userTable = User::tableName();\n $query = new Query();\n $query->select([\"CONCAT(\" . $userProfileTable . \".nome, ' ', \" . $userProfileTable . \".cognome, ' - userId: ', \" . $userProfileTable . \".user_id, ' - userProfileId: ', \" . $userProfileTable . \".id) AS userNameSurname\"]);\n $query->from($userTable);\n $query->innerJoin($userProfileTable, $userProfileTable . '.user_id = ' . $userTable . '.id');\n $query->andWhere([$userTable . '.deleted_at' => null]);\n $query->andWhere([$userProfileTable . '.deleted_at' => null]);\n $query->andWhere([$userTable . '.status' => User::STATUS_ACTIVE]);\n $query->andWhere([$userProfileTable . '.attivo' => UserProfile::STATUS_ACTIVE]);\n $query->andWhere(['not like', 'email', '#deleted_']);\n $query->andWhere(['<>', $userTable . '.id', \\Yii::$app->user->id]);\n $query->indexBy('id');\n $usersToImpersonate = $query->column();\n return $usersToImpersonate;\n }", "public function creer_definition_user_get_ws() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$filter = array (\n\t\t\t\t\"alias\" => $this->getAlias () \n\t\t);\n\t\tif ($this->getName () != \"\") {\n\t\t\t$filter [\"name\"] = $this->getName ();\n\t\t}\n\t\t\n\t\treturn array (\n\t\t\t\t\"output\" => \"userid\",\n\t\t\t\t\"filter\" => $filter \n\t\t);\n\t}", "public static function getSeniorStaff(){\n $senior = YumUser::model()->findAll('id IN (1,8,11)');\n return CHtml::listData($senior, 'id', 'username');\n }", "public function getuseritems()\n {\n $user_name = $this->session->userdata('name');\n $query = \"SELECT `user`.`id`\n FROM `user` JOIN `items` \n ON `user`.`id` = `items`.`user_id`\n WHERE `items`.`user_name` = $user_name\n ORDER BY `items`.`user_id` ASC\n \";\n\n return $this->db->query($query)->result_array();\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function getAllUsers()\n {\n return \"users from mongo\";\n }", "public function getMyNoticesUsers()\n {\n\t\t// Get my related departments\n\t\t$related_departments = [];\n\n $c_related = $this->getRelatedDepartments();\n\n if (!$c_related) return [];\n\n foreach ($c_related as $rel){\n\t\t\t$related_departments [] = $rel->id;\n\t\t}\n\n\n\t\t/*\n\t\t *\tGet related Departamental users from my related departments\n\t\t *\n\t\t * Conditions:\n\t\t * - agent ticketit_department in related_departments\n\t\t * - agent person in related_departments\n\t\t*/\n\t\t$related_users = \\PanicHDMember::where('id','!=',$this->id)\n\t\t\t->whereIn('ticketit_department', $related_departments);\n\n\t\t// Get users that are visible by all departments\n\t\t$all_dept_users = \\PanicHDMember::where('ticketit_department','0');\n\n\t\tif (version_compare(app()->version(), '5.3.0', '>=')) {\n\t\t\t$related_users = $related_users->pluck('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->pluck('id')->toArray()));\n\t\t}else{\n\t\t\t$related_users = $related_users->lists('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->lists('id')->toArray()));\n\t\t}\n\n\t\treturn $related_users;\n\t}", "public function getUserList(){\n\t\t$this->load->database();\n\t\t$eventlist = $this->db->query(\"SELECT * FROM user \");\n\t\treturn $eventlist;\n\t}", "function getUsers() {\n $users = $this->users;\n if (is_string($users)) {\n $users = explode(',', $users);\n }\n return $users;\n }", "function get_author_user_ids()\n {\n }", "public function mentionedUsers()\n {\n\n preg_match_all('/\\@([\\w\\-]+)/', $this->body, $matches);\n\n // return the mentioned users\n\n return $matches[1];\n\n }", "public function getUsers()\n {\n $stmt = $this->DB->prepare(\"select user, hash from users\");\n $stmt->execute();\n // fetchall returns all records in the set as an array\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function getUsernames(){\n $arr = array();\n for($x=0;$x<count($this->names);$x++){\n array_push($arr,$this->names[$x]);\n }\n return $arr;\n }", "public function meList( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminListByUser($userId);\n\t}", "public function getAll()\n {\n return $this->appUser->orderBy('first_name')->get()->toArray();\n }" ]
[ "0.69041556", "0.68857783", "0.68857783", "0.68857783", "0.68162924", "0.6807705", "0.6805229", "0.6796118", "0.6765865", "0.67559737", "0.67380023", "0.6734546", "0.6729329", "0.66896474", "0.66079575", "0.66023964", "0.65949625", "0.6588191", "0.6555696", "0.6555696", "0.6542292", "0.6542292", "0.6538494", "0.6523928", "0.65138376", "0.6502137", "0.6496048", "0.6470742", "0.646835", "0.6457545", "0.6446227", "0.6441745", "0.6428682", "0.6427398", "0.64104444", "0.6403601", "0.6397695", "0.6393237", "0.6391246", "0.63850033", "0.6375866", "0.6347495", "0.63337123", "0.63279015", "0.6319954", "0.63190496", "0.63124806", "0.6308893", "0.62964547", "0.62939733", "0.6280529", "0.626017", "0.6257612", "0.6256794", "0.6252396", "0.6239199", "0.6234534", "0.62247145", "0.6221524", "0.62204117", "0.621848", "0.6215945", "0.62090045", "0.620705", "0.62035793", "0.62035036", "0.6202416", "0.6201026", "0.6192771", "0.61921686", "0.6181241", "0.61806667", "0.618031", "0.61789703", "0.6175116", "0.61730164", "0.6163307", "0.61596775", "0.6157544", "0.61522543", "0.6147932", "0.6144929", "0.6137544", "0.6136419", "0.6130196", "0.6127659", "0.6126314", "0.6119352", "0.61131704", "0.6110263", "0.61068106", "0.61065763", "0.6100759", "0.60968983", "0.6093337", "0.609226", "0.6090355", "0.6085408", "0.60851026", "0.60846317" ]
0.77734315
0
returns user people by people_id people_id mandatory field
public function getUserPeopleByIdAction() { /** @var Object_People $people */ $data = $this->getRequestData(); if (isset($data['people_id'])) { $people = Object_People::getById($data['people_id']); if (!$people) { $this->setErrorResponse('no People with this people_id!'); } elseif ($this->getDeviceSession()->getUserId() != $people->getCreator()->getId()) { $this->setErrorResponse('no People for this user with current people_id!'); } } $this->_helper->json($people); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPerson($id=null)\n {\n $app = \\Cobalt\\Container::get('app');\n $id = $id ? $id : $app->input->get('id');\n\n if ($id > 0) {\n\n $db = JFactory::getDBO();\n //generate query\n //\n $query = $db->getQuery(true);\n $query->select('p.*,c.name as company_name,stat.name as status_name,\n source.name as source_name, owner.name as owner_name, crmery_user.first_name AS owner_first_name, crmery_user.last_name AS owner_last_name');\n $query->from('#__people AS p');\n $query->leftJoin('#__companies AS c ON c.id = p.company_id AND c.published>0');\n $query->leftJoin('#__people_status AS stat ON stat.id = p.status_id');\n $query->leftJoin('#__sources AS source ON source.id = p.source_id');\n $query->leftJoin('#__users AS owner ON p.owner_id = owner.id');\n $query->leftJoin(\"#__users AS crmery_user ON crmery_user.id = p.owner_id\");\n\n //searching for specific person\n $query->where(\"p.published=\".$this->published);\n $query->where(\"p.id='\".$id.\"'\");\n\n //run query and grab results\n $db->setQuery($query);\n $person = $db->loadAssoc();\n\n /* Deals */\n $dealModel = new CobaltModelDeal();\n $dealModel->set('person_id',$person['id']);\n $person['deals'] = $dealModel->getDeals();;\n\n /* Notes */\n $notesModel = new CobaltModelNote();\n $person['notes'] = $notesModel->getNotes($person['id'],'person');\n\n /* Docs */\n $docsModel = new CobaltModelDocument();\n $docsModel->set('person_id',$person['id']);\n $person['documents'] = $docsModel->getDocuments();\n\n /* Tweets */\n if ($person['twitter_user']!=\"\" && $person['twitter_user']!=\" \") {\n $person['tweets'] = TweetsHelper::getTweets($person['twitter_user']);\n }\n\n $this->person = $person;\n\n } else {\n\n //TODO update things to OBJECTS\n $person = (array) new PeopleTable;\n $this->person = $person;\n\n }\n\n $app->triggerEvent('onPersonLoad', array(&$person));\n\n return $person;\n }", "public function getPeopleList()\n {\n //db object\n $db = JFactory::getDBO();\n //gen query\n $query = $db->getQuery(true);\n $query->select(\"DISTINCT(p.id),p.first_name,p.last_name\");\n $query->from(\"#__people AS p\");\n $query->leftJoin(\"#__users AS u ON u.id = p.owner_id\");\n $query->leftJoin(\"#__people_cf AS dcf ON dcf.person_id = p.id AND dcf.association_type='deal'\");\n\n //filter based on member access roles\n $user_id = UsersHelper::getUserId();\n $member_role = UsersHelper::getRole();\n $team_id = UsersHelper::getTeamId();\n\n if ($member_role != 'exec') {\n\n if ($member_role == 'manager') {\n $query->where(\"u.team_id=$team_id\");\n } else {\n $query->where(\"(p.owner_id=$user_id OR p.assignee_id=$user_id )\");\n }\n\n }\n\n $query->where(\"p.published=\".$this->published);\n\n $associationType = $this->app->input->get('association');\n $associationId = $this->app->input->get('association_id');\n\n if ($associationType == \"company\") {\n $query->where(\"p.company_id=\".$associationId);\n }\n if ($associationType == \"deal\") {\n $query->where(\"dcf.association_id=\".$associationId.\" AND dcf.association_type='deal'\");\n }\n\n //set query\n $db->setQuery($query);\n\n //load list\n $row = $db->loadAssocList();\n $blank = array(array('first_name'=>TextHelper::_('COBALT_NONE'),'last_name'=>'','id'=>0));\n $return = array_merge($blank,$row);\n\n //return results\n return $return;\n\n }", "function get_person($person_id)\n {\n return $this->db->get_where('person',array('person_id'=>$person_id))->row_array();\n }", "public function people(){\n\t\treturn Person::left_join('profiles', 'profiles.id', '=', 'people.profile_id')\n\t\t\t\t\t ->select('people.*')->where('profiles.event_id', '=', $this->id);\n\t}", "public function listUsers(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=3\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "function people_getInfo ($user_id) {\n $response = $this->execute(array('method' => 'flickr.people.getInfo', 'user_id' => $user_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function select_people($conn, $id) {\n\t$name = \"\";\n\t$sql = \"SELECT * FROM People WHERE People_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding person\n\tif (mysqli_num_rows($result)== 1){\n\t\t$row = mysqli_fetch_assoc($result);\n\t\t$name = $row[\"People_Name\"];\n\t}\n\treturn $name;\n}", "public function getPeople($id=0){\n $stmt = $this->mysqli->prepare(\"SELECT * FROM alumno WHERE no_ctrl = ?;\");\n $stmt->bind_param('i', $id);\n $stmt->execute();\n $result = $stmt->get_result(); \n $people = $result->fetch_all(MYSQLI_ASSOC);\n $stmt->close();\n return $people;\n }", "public function getPeople()\n {\n //Get query\n $db = JFactory::getDBO();\n $query = $this->_buildQuery();\n\n $view = $this->app->input->get('view');\n $layout = $this->app->input->get('layout');\n\n /** ------------------------------------------\n * Set query limits/ordering and load results\n */\n $limit = $this->getState($this->_view.'_limit');\n $limitStart = $this->getState($this->_view.'_limitstart');\n if (!$this->_id && $limit != 0) {\n $query->order($this->getState('People.filter_order') . ' ' . $this->getState('People.filter_order_Dir'));\n if ( $limitStart >= $this->getTotal() ) {\n $limitStart = 0;\n $limit = 10;\n $limitStart = ($limit != 0) ? (floor($limitStart / $limit) * $limit) : 0;\n $this->state->set($this->_view.'_limit', $limit);\n $this->state->set($this->_view.'_limitstart', $limitStart);\n }\n $query .= \" LIMIT \".($limit).\" OFFSET \".($limitStart);\n }\n $db->setQuery($query);\n $people = $db->loadAssocList();\n\n //generate query to join deals\n if ( count($people) > 0 ) {\n\n $export = $this->app->input->get('export');\n\n if (!$export) {\n\n //generate query to join notes\n foreach ($people as $key => $person) {\n\n /* Deals */\n $dealModel = new Deal;\n $dealModel->set('person_id',$person['id']);\n $people[$key]['deals'] = $dealModel->getDeals();;\n\n /* Notes */\n $notesModel = new Note;\n $people[$key]['notes'] = $notesModel->getNotes($person['id'],'people');\n\n /* Docs */\n $docsModel = new Document;\n $docsModel->set('person_id',$person['id']);\n $people[$key]['documents'] = $docsModel->getDocuments();\n\n /* Tweets */\n if ($person['twitter_user']!=\"\" && $person['twitter_user']!=\" \") {\n $people[$key]['tweets'] = TweetsHelper::getTweets($person['twitter_user']);\n }\n\n }\n\n }\n }\n\n $this->app->triggerEvent('onPersonLoad', array(&$people));\n\n //return results\n return $people;\n\n }", "public function findUserById($id,$deletePersonalInfo = true)\r\n {\r\n $user = $this->DB->fetchAssoc('select * from user where _id = ?',array($id));\r\n $contacts = $this->DB->fetchAll('select contact_user_id from user_contact where user_id = ?',array($id));\r\n $groups = $this->DB->fetchAll('select group_id from user_group where user_id = ?',array($id));\r\n \r\n $contactIds = array(); \r\n if(is_array($contacts)){\r\n foreach($contacts as $row){\r\n $contactIds[] = $row['contact_user_id'];\r\n }\r\n }\r\n \r\n $groupIds = array(); \r\n if(is_array($groups)){\r\n foreach($groups as $row){\r\n $groupIds[] = $row['group_id'];\r\n }\r\n }\r\n \r\n $user['contacts'] = $contactIds;\r\n $user['favorite_groups'] = $groupIds;\r\n \r\n $user = $this->reformatUserData($user,$deletePersonalInfo);\r\n \r\n return $user;\r\n \r\n }", "function get_persona_perfil($id)\n {\n return $this->db->get_where('persona_perfil',array('id'=>$id))->row_array();\n }", "public function people($params)\r\n {\r\n \t$_query = array('page' => isset($params['page']) ? $params['page'] : 1);\r\n\r\n return $this->curl_execute($method = 'people', $_query);\r\n }", "public function getUserPeoplesAction()\n {\n $people = new Workapp_People();\n $this->_helper->json($people->getPeopleList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "public function getPeopleSearch($peopleId = \"\"){\n \n $this->pitchbook_api_url.\"/people/search\";\n $response = $this->http->get($this->pitchbook_api_url.\"/people/search?personId=\".$peopleId, [], [\n 'type' => 'json',\n 'headers' => ['authorization' => \"PB-Token \".$this->pitchbook_api_key]\n ]); \n return $response;\n }", "function get_person($id)\n {\n\t$this->db->where('id',$id);\n\t$query = $this->db->get('person');\n\t$row = $query->row();\n\treturn $row;\n\t}", "public static function getPerson($id) {\n\t\t$person = self::with('whimseys', 'socials')->find($id);\n\t\treturn $person;\n\t}", "function get_people($selected_country)\n \n {\n\t\n\t//$query = $this->db->query(\"SELECT*FROM person WHERE countryid =$selected_country\" );\n\t\n\t$data = array();\n\t\n\t$query = $this->db->get_where('person', array('countryid' => $selected_country));\n\t\n\tforeach($query-> result_array() as $row)\n\t\n\t {\n\t $data[] = $row;\n\t /*\n\t echo $row->name.'<br>';\n\t echo $row->description .'<br>';\n\t echo $row->wlink .'<br>';\n\t */\n\t }\n\t\n\treturn $data;\n\t\n\t}", "public function deleteUserPeopleAction()\n {\n /** @var Object_People $people */\n $data = $this->getRequestData();\n if ($data['people_id']) {\n $people = Object_People::getById($data['people_id']);\n if (!$people) {\n $this->setErrorResponse('no People with this people_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $people->getCreator()->getId()) {\n $people->setPublished(false);\n if (!$people->save()) {\n $this->setErrorResponse('cannot delete People object!');\n }\n } else {\n $this->setErrorResponse('no People for this user with current people_id!');\n }\n } else {\n $this->setErrorResponse('people_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "function person_list($person_id=-1) {\n\tglobal $_DB, $_STATE;\n\n\t//get each person in this org, then get their rate records; if no rate, return NULLs\n\t$sql = \"SELECT c00.person_id, c00.lastname, c00.firstname,\n\t\t\t\t\t\tc02.rate_id, c02.rate, c02.effective_asof, c02.expire_after,\n\t\t\t\t\t\tc00.inactive_asof\n\t\t\tFROM (\n\t\t\t\tSELECT c00.person_id, c00.lastname, c00.firstname, c10.inactive_asof\n\t\t\t\tFROM \".$_DB->prefix.\"c00_person AS c00\n\t\t\t\tINNER JOIN \".$_DB->prefix.\"c10_person_organization AS c10\n\t\t\t\tON c10.person_idref = c00.person_id\n\t\t\t\tWHERE c10.organization_idref = \".$_SESSION[\"organization_id\"].\"\n\t\t\t\t) AS c00\n\t\t\t\tLEFT OUTER JOIN (\n\t\t\t\tSELECT rate_id, person_idref, rate, effective_asof, expire_after\n\t\t\t\tFROM \".$_DB->prefix.\"c02_rate\n\t\t\t\tWHERE project_idref = \".$_STATE->project_id.\"\n\t\t\t\t) AS c02\n\t\t\t\tON c00.person_id = c02.person_idref\";\n\tif ($person_id > 0) $sql .= \"\n\t\t\tWHERE c00.person_id = \".$person_id;\n\t$sql .= \"\n\t\t\tORDER BY c00.lastname, c00.person_id, c02.effective_asof DESC;\";\n\t$stmt = $_DB->query($sql);\n\t$_STATE->records = array();\n\t$rates = array();\n\t$EOF = -1;\n\twhile ($EOF < 1) {\n\t\tif (!$row = $stmt->fetchObject()) { //EOF\n\t\t\tif ($EOF == -1) break; //no people!!??\n\t\t\t$EOF = 1;\n\t\t} else {\n\t\t\tif ($EOF == -1) $row_sav = $row; //first record\n\t\t\t$EOF = 0;\n\t\t}\n\t\tif (($EOF == 1) || ($row_sav->person_id != $row->person_id)) {\n\t\t\t$record = array(\n\t\t\t\t\"ID\" => $row_sav->person_id,\n\t\t\t\t\"name\" => $row_sav->lastname.\", \".$row_sav->firstname,\n\t\t\t\t\"inactive_asof\"=>new DATE_FIELD($row_sav->inactive_asof), //provides formatting only\n\t\t\t\t\"rates\" => $rates,\n\t\t\t\t);\n\t\t\t$_STATE->records[strval($row_sav->person_id)] = $record;\n\t\t\tif ($EOF == 1) break; //all done\n\t\t\t$rates = array();\n\t\t\t$row_sav = $row;\n\t\t}\n\t\t$rates[] = array(\n\t\t\t\"ID\" => $row->rate_id,\n\t\t\t\"update\" => false,\n\t\t\t\"rate\" => $row->rate,\n\t\t\t\t\t\t\t//pagename,DBname,load from DB?,write to DB?,required?,maxlength,disabled,value\n\t\t\t\"eff\"=>new DATE_FIELD(\"txtEff\",\"effective_asof\",FALSE,FALSE,FALSE,0,FALSE,$row->effective_asof),\n\t\t\t\"exp\"=>new DATE_FIELD(\"txtExp\",\"expire_after\",FALSE,FALSE,FALSE,0,FALSE,$row->expire_after),\n\t\t\t);\n\t}\n\t$stmt->closeCursor();\n}", "static function get_nfp($id_people) {\n global $wpdb;\n $ret = $wpdb->get_row(\n $wpdb->prepare('\n SELECT a.*, b.icon_medium, b.icon_large, b.name AS country_name, LOWER(b.code) AS country_code\n FROM ai_people a\n LEFT JOIN ai_country b ON a.id_country = b.id\n WHERE a.id = %d\n ', $id_people)\n );\n if(!empty($ret)) {\n $ret->treaties = $wpdb->get_results(\n $wpdb->prepare('\n SELECT a.* FROM ai_treaty a\n INNER JOIN ai_people_treaty b ON a.id = b.id_treaty\n WHERE b.id_people = %d\n ', $id_people)\n );\n }\n return $ret;\n }", "function lightboxgallery_get_participants($galleryid) {\n global $DB, $CFG;\n\n return $DB->get_records_sql(\"SELECT DISTINCT u.id, u.id\n FROM {$CFG->prefix}user u,\n {$CFG->prefix}lightboxgallery_comments c\n WHERE c.gallery = $galleryid AND u.id = c.userid\");\n}", "function researcher_projects_get_persons_json_callback($projectId){\n //TODO check access, if current user has the permission to get person info\n drupal_set_header('Content-Type: text/plain; charset: utf-8');\n $sql = \"SELECT pc.idperson id, u.mail name FROM {project_code} AS pc \"\n .\"LEFT JOIN {users} AS u ON u.uid=pc.idperson \"\n .\"WHERE pc.idproject=%d\";\n $res = db_query($sql,$projectId);\n $persons = array();\n while($person=db_fetch_array($res)){\n $persons[] = $person;\n }\n print(json_encode($persons));\n}", "function salespeople_select_all()\n{\n $conn = db_connect();\n\n // Prepared statement for selecting all salespeople from the database\n $salespeople_select_stmt = pg_prepare($conn, \"salespeople_select_stmt\", \"SELECT salespeople.*, users.id AS user_id, users.enabled FROM salespeople JOIN users ON salespeople.email_address = users.email_address\");\n $result = pg_execute($conn, \"salespeople_select_stmt\", array());\n\n $rows = pg_fetch_all($result);\n\n // Check for a result after querying database and if one exists, save it as an array to return user data\n if ($rows) {\n return $rows;\n }\n\n return false;\n}", "public static function getValidRecordsOfPerson($person_id) {\n return self::getRepository()->findBy(['person' => $person_id, 'is_hidden' => 0]);\n }", "public function getPersonsList($hint, $uacc_uid=''){\r\n\t\t//format datetime into \"time ago\"\r\n\t\t$list = array();\r\n\r\n\t\tif($uacc_uid != '')\r\n\t\t\t$query = $this->db->select('people_id,first_name,last_name,company_id')->like(\"first_name\", $hint)->or_like(\"last_name\", $hint)->where(array(\"created_by\"=>$uacc_uid,\"deleted\"=>0))->order_by(\"company_id\", \"desc\")->get(\"sc_people\");\r\n\t\telse\r\n\t\t\t$query = $this->db->select(\"people_id,first_name,last_name,company_id\")->like(\"first_name\", $hint)->or_like(\"last_name\", $hint)->where(\"deleted\",0)->order_by(\"company_id\", \"desc\")->get(\"sc_people\");\r\n\r\n\t\t$this->load->model(\"general\");\r\n\r\n\r\n\t if ($query->num_rows() > 0){\r\n\t\t\tforeach($query->result() as $row){\r\n\t\t\t\t$company_name = $this->general->getAccountName($row->company_id);\r\n\t\t\t\tif($company_name != \"\" && $company_name != \" - \")\r\n\t\t\t\t\t$list[] = array(\"name\"=>$row->first_name . \" \" . $row->last_name . \" (\" . $company_name . \")\", \"label\"=>$row->first_name . \" \" . $row->last_name . \" (\" . $company_name . \")\", \"id\"=>$row->people_id);\r\n\t\t\t\telse\r\n\t\t\t\t\t$list[] = array(\"name\"=>$row->first_name . \" \" . $row->last_name, \"label\"=>$row->first_name . \" \" . $row->last_name, \"id\"=>$row->people_id);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $list;\r\n\t}", "public function show($id)\n {\n $people = $this->personRepository\n ->makeModel()\n ->qPeople(Auth::id(), $id);\n\n if ($people > 0){\n $person = $this->personRepository->find($id);\n $person->load('features');\n\n $communities = CommunityPeople::join('communities','community_people.community_id', '=', 'communities.id')\n ->where('community_people.person_id', $id)\n ->select('communities.*')\n ->distinct()\n ->get();\n\n $community_people = CommunityPeople::where('community_people.person_id', $id)\n ->whereNotNull('community_people.group_id')\n ->distinct()\n ->paginate(config('global.per_page'));\n\n if($person->status == 0) {\n $group_meetings = GroupMeetings::join('meetings', 'group_meetings.meeting_id', '=', 'meetings.id')\n ->join('assistants', 'meetings.id', '=', 'assistants.meeting_id')\n ->join('groups', 'group_meetings.group_id', '=', 'groups.id')\n ->where('assistants.person_id', '=', $id)\n ->select('groups.*')\n ->distinct()\n ->first();\n }else{\n $group_meetings = null;\n }\n }else{\n abort(401);\n }\n \n if (empty($person)) {\n Flash::error(trans('flash.error', ['model' => trans_choice('functionalities.people', 1)]));\n\n return redirect(route('people.index'));\n }\n\n return view('people.show', compact('person','communities', 'community_people', 'group_meetings'));\n }", "function personne($id){\r\n\t\treturn mysql_fetch_assoc(mysql_query(\"SELECT * FROM personnes WHERE id='$id'\"));\r\n\t}", "abstract public function getByGooglePersonId($googlePersonId);", "public function getPeople()\n\t{\n\t\treturn $this->people;\n\t}", "function specialty_person($specialty_id, $connection, $start = 0)\n{\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\t$sql = \"select person.person_id, person.first_name , person.last_name from person where person_id in (select person_specialty.person_id from person_specialty where specialty_id ={$specialty_id}) and remove_approved = 0\";\n\t$sql = $sql.\" limit {$start},\".LIMIT;\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}", "public static function KeyPeopleById($people) {\n\t\t\tif (empty($people)) {\n\t\t\t\treturn $people;\n\t\t\t}\n\t\t\tforeach ($people as $person) {\n\t\t\t\t$aOut[$person->intId] = $person;\n\t\t\t}\n\t\t\treturn $aOut;\n\t\t}", "public function get_people_profile($user_id, $query_parameters = null) {\n $resource = sprintf(\"/people/%s/%s\", $user_id, SelectorType::$SELF);\n $result = $this->do_get($resource, null, $query_parameters);\n return $result;\n }", "public function getPerson()\n {\n return $this->hasOne(Person::className(), ['id' => 'person_id']);\n }", "public function show(People $people)\n {\n return $people;\n }", "public static function getPersonsUsers(){\n return self::getPersonsByRole();\n }", "static function get_list_of_users_who_have_added_user($id) {\n global $con;\n $sql = \"\n\t\tSELECT `user`.`id`, `user`.`firstname`, `user`.`lastname`, `user`.`email`\n\t\tFROM `user`, `relationship`\n\t\tWHERE `user`.`id` = `relationship`.`user1` AND `relationship`.`user2` = \".$id.\" AND `relationship`.`type` = 1\n ORDER BY `user`.`firstname`, `user`.`lastname`;\";\n $query = mysqli_query($con, $sql);\n $result = array();\n while ($row = mysqli_fetch_assoc($query)) {\n $user = new SimpleUser($row['id'], $row['firstname'], $row['lastname'], $row['email']);\n $user->bidirectional = self::users_have_added_them_both($id, $row['id']);\n array_push($result, $user);\n }\n return $result;\n }", "public function getPersonByID($id) {\n\t\tglobal $db;\n\n\t\t$person = $db->query(\"SELECT * FROM person WHERE id=$id\");\n\t\treturn $person[0];\n\t}", "public function getPersonById(int $id): ?Person;", "function getAllFriends() {\n $query = \"SELECT id, concat(t1.first_name,' ' , t1.last_name) as name, t1.email\n FROM users as t1\n LEFT JOIN friends as t2\n on t1.id = t2.friend_id\n WHERE t2.user_id =\".$this->data['id'];\n $people = $this->connection->fetch_all($query);\n return array_map(function($data) { return new Person($data); }, $people);\n }", "public function getPeoples()\n {\n return $this->hasOne(Peoples::class, ['id' => 'people_id']);\n }", "public function people (){\n\n \treturn $this->belongsTo(People::class);\n }", "function getUsers ($walkId, $userId)\n {\n $getUsersQuery = $this->db->query(\"SELECT id,nickName,profilePicture, \n (select id from walkparticipants w \n WHERE w.walkId = '\".$walkId.\"' and \n w.participantId = u.id ) isInvited, \n (select status from walkparticipants w \n WHERE w.walkId = '\".$walkId.\"' and \n w.participantId = u.id ) status\n FROM user u where id != '\".$userId.\"'\");\n\n return $getUsersQuery->result();\n }", "public function listAllbyUser($id){\n try{\n $sql = 'select * from user u inner join person p on u.id_person = p.id_person where id_user = ?';\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n $result = $stm->fetch();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "function getPersons(){\n\t\t \n\t\t $linksObj = new dbXML_dbLinks;\n\t\t $creatorRels = $linksObj->relToCreator;\n\t\t $contribRels = $linksObj->relToContributor;\n\t\t \n\t\t $db = $this->startDB();\n\t\t $result = false;\n\t\t \n\t\t $sql = \"SELECT actTab.uuid, links.targ_uuid, links.link_type,\n\t\t persons.combined_name, persons.last_name, persons.first_name, persons.mid_init\n\t\t FROM \".$this->penelopeTabID.\" AS actTab\n\t\t JOIN links ON actTab.uuid = links.origin_uuid\n\t\t JOIN persons ON persons.uuid = links.targ_uuid\n\t\t WHERE links.targ_type LIKE '%person%' ;\n\t\t \";\n\t\t \n\t\t $resultA = $db->fetchAll($sql);\n\t\t \n\t\t $sql =\t\"\t\n\t\t\t\tSELECT actTab.uuid, links.targ_uuid, links.link_type, \n\t\t\t\tusers.combined_name, users.last_name, users.first_name, users.mid_init\n\t\t\t\tFROM \".$this->penelopeTabID.\" AS actTab\n\t\t\t\tJOIN links ON actTab.uuid = links.origin_uuid\n\t\t\t\tJOIN users ON users.uuid = links.targ_uuid\n\t\t\t\tWHERE links.targ_type LIKE '%person%'\n\t\t\t\t \n\t\t\t\t\";\n\t\t \n\t\t $resultB = $db->fetchAll($sql);\n\t\t if($resultA && $resultB){\n\t\t\t\t$result = array();\n\t\t\t\tforeach($resultA as $row){\n\t\t\t\t\t $ukey = md5($row[\"uuid\"].$row[\"targ_uuid\"].$row[\"link_type\"]);\n\t\t\t\t\t $result[$ukey] = $row;\n\t\t\t\t}\n\t\t\t\tforeach($resultB as $row){\n\t\t\t\t\t $ukey = md5($row[\"uuid\"].$row[\"targ_uuid\"].$row[\"link_type\"]);\n\t\t\t\t\t if(!array_key_exists($ukey, $result)){\n\t\t\t\t\t\t $result[$ukey] = $row;\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t elseif($resultB && !$resultA){\n\t\t\t\t$result = $resultB;\n\t\t }\n\t\t elseif(!$resultB && $resultA){\n\t\t\t\t$result = $resultA;\n\t\t }\n\t\t \n\t\t if($result){\n\t\t\t\t\n\t\t\t\t$rawCreators = array();\n\t\t\t\t$rawContributors = array();\n\t\t\t\t$persons = array();\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t $uuid = $row[\"targ_uuid\"];\n\t\t\t\t\t $uri = self::personBaseURI.$uuid;\n\t\t\t\t\t $name = $row[\"combined_name\"];\n\t\t\t\t\t $linkType = $row[\"link_type\"];\n\t\t\t\t\t if(in_array($linkType, $creatorRels)){\n\t\t\t\t\t\t if(!array_key_exists($uri, $rawCreators)){\n\t\t\t\t\t\t\t\t$rawCreators[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t\t\t$rawCreators[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t$rawCreators[$uri][\"count\"] ++ ; \n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t elseif(in_array($linkType, $contribRels)){\n\t\t\t\t\t\t if(!array_key_exists($uri, $rawContributors)){\n\t\t\t\t\t\t\t\t$rawContributors[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t\t\t$rawContributors[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else{\n\t\t\t\t\t\t\t\t$rawContributors[$uri][\"count\"] = $rawContributors[$uri][\"count\"] + 1; \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 if(!array_key_exists($uri, $persons)){\n\t\t\t\t\t\t $persons[$uri] = array(\"name\" => $name, \"count\" => 1);\n\t\t\t\t\t\t $persons[$uri][\"rel\"] = $this->getLinkedPerson($uuid);\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t $persons[$uri][\"count\"] ++ ; \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\t\n\t\t\t\t\n\t\t\t\t//combine URIs for the same person, choose the URI with the most associated items\n\t\t\t\t$rawCreators = $this->consolidateRelatedURIs($rawCreators);\n\t\t\t\t$rawContributors = $this->consolidateRelatedURIs($rawContributors);\n\t\t\t\t$persons = $this->consolidateRelatedURIs($persons);\n\t\t\t\t\n\t\t\t\t//sort the array by count, from high to low\n\t\t\t\t$rawCreators = $this->orderURIs($rawCreators);\n\t\t\t\t$rawContributors = $this->orderURIs($rawContributors);\n\t\t\t\t$persons = $this->orderURIs($persons);\n\t\t\t\t\n\t\t\t\t$this->rawCreators = $rawCreators;\n\t\t\t\t$this->rawContributors = $rawContributors;\n\t\t\t\t$this->rawLinkedPersons = $persons;\n\t\t\t\t\n\t\t }\n\t }", "public function get_personnel($personnel_id)\n\t{\n\t\t//retrieve all users\n\t\t$this->db->from('personnel');\n\t\t$this->db->select('*');\n\t\t$this->db->where('personnel_id = '.$personnel_id);\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "function getEverybody() {\n $query =\n \"SELECT\n id,\n concat(first_name,' ' , last_name) AS name,\n email,\n (select count(*) from friends where user_id = id and friend_id = \".$this->id.\") AS is_friend\n FROM users WHERE NOT id = \".$this->id;\n $people = $this->connection->fetch_all($query);\n return array_map(function($data) { return new Person($data); }, $people);\n }", "public function getUserId($name){\n $names = explode(\",\", $name);\n // Search each Name Field for any specified Name\n return User::where(function ($query) use ($names) {\n $query->whereIn('first_name', $names);\n\n $query->orWhere(function ($query) use ($names) {\n $query->whereIn('middle_name', $names);\n });\n $query->orWhere(function ($query) use ($names) {\n $query->whereIn('last_name', $names);\n });\n })->get();\n }", "public function get_user_by_id($user_id, $organization_id);", "function get_user_by_id( $user_id, $fields = null, $result_type = 'result_array' ) {\n // $this->db->where( 'id', $id ) ;\n // return $this->db->get( $this->_tuser )->{$result_type}( ) ;\n\t\t\n\t\tif ($fields != null) {\n\t\t\t$this->db->select($fields);\n\t\t}\n\t\telse {\n\t\t\t$q=\"users.id, users.username, users.hash_id, users.email,\n\t\t\t\tuser_profile.company AS up_company, user_profile.location AS ulocation, user_profile.gender AS up_gender, \n\t\t\t\tuser_profile.fullname AS up_fullname, user_profile.specialties AS uspecialties, user_profile.aboutme AS up_aboutme, \n\t\t\t\tuser_profile.email AS up_email, user_profile.job_objective AS up_job_objective, user_profile.interests AS up_interests, \n\t\t\t\tuser_profile.location AS up_location, user_profile.city AS up_city, user_profile.city AS up_state, user_profile.birthday AS up_birthday,\n\t\t\t\tuser_profile.postalcode AS up_postalcode, user_profile.specialties AS up_specialties, user_profile.website AS up_website, \n\t\t\t\tuser_profile.contactno AS up_contactno, user_profile.profile_pic AS up_profile_pic,\n\t\t\t\t\";\n\t\t\t$this->db->select($q);\t\t\n\t\t}\n\n\t\t$this->db->where(array('users.id' => $user_id));\n\t\t$this->db->join('user_profile', 'user_profile.user_id = users.id', 'left');\n\t\t$res = $this->db->get($this->_tuser);\n\t\tif ( $res->num_rows( ) > 0 )\n\t\t\treturn $res->$result_type() ; \n\t\treturn FALSE ;\t\t\n }", "public function getUsersList($employer_id)\n {\n $em = $this->getEntityManager();\n\n\t\t$recs = $em->createQuery(\"SELECT DISTINCT ec.userId, CONCAT(u.firstname,' ',u.surname) AS username\n\t\t\tFROM AppBundle:ExtraChecks ec \n\t\t\tLEFT JOIN AppBundle:Users u WITH ec.userId = u.id\n\t\t\tWHERE ec.employerId = :eid AND ec.checkType NOT LIKE 'DBS%'\n\t\t\tORDER BY u.firstname,u.surname\")\n\t\t\t->setParameters(array(\"eid\"=>$employer_id))\n\t\t\t->getResult();\n\t\t$output = array('0'=>array('userId'=>0, 'username'=>'All'));\n\t\t$output = array_merge($output,$recs);\n\t\t//print \"<pre>\"; var_dump($output); die;\n\t\treturn $output;\n\t}", "public function listUsersAdmin(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=1\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "public function createUserPeopleAction()\n {\n $data = $this->getRequestData();\n if (isset($data['name'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Object_Folder::getByPath('/peoples/' . $user->getKey() . \"-people\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-people\");\n $folder->setParentId(52);\n $folder->save();\n }\n $people = new Object_People();\n $people->setCreator($user);\n $people->setName($data['name']);\n $people->setCompany(isset($data['company']) ? $data['company'] : \"\");\n $people->setPhone(isset($data['phone']) ? $data['phone'] : \"\");\n $people->setEmail(isset($data['email']) ? $data['email'] : \"\");\n $people->setImage(isset($data['image']) ? Asset_Image::getById($data['image']) : \"\");\n $people->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['name'] . \"-\" . time()));\n $people->setPublished(true);\n $people->setParentId($folder->getId());\n if (!$people->save()) {\n $this->setErrorResponse('cannot save People object');\n }\n } else {\n $this->setErrorResponse('name is mandatory field for this request!');\n }\n\n $this->_helper->json($people);\n }", "public function getIdSexoPeople( ){\n\t\treturn $this->idSexoPeople;\n\t}", "public function getIdByUser($usersid);", "function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}", "public function getPresidentUsers($filter = array())\n {\n //$vp_ops_dept = 54;\n $vp_ops_dept = $this->em->getRepository(\"HrisAdminBundle:JobTitle\")->findBy(array('name'=> 'President/CEO'));\n \n $query = 'select d from HrisWorkforceBundle:Employee d where d.job_title = :code';\n $opts = $this->em ->createQuery($query)\n ->setParameter('code', $vp_ops_dept) \n ->getResult();\n\n $list_opts = array();\n foreach ($opts as $item)\n $list_opts[$item->getID()] = $item->getFirstName().' '.$item->getLastName();\n\n return $list_opts;\n }", "public static function getByID($id) { \n $str = \"\n SELECT id, firstName, lastName, email, password\n FROM indPrj_persons\n WHERE id = \" . $id;\n \n return mysql_fetch_array(Database::query($str));\n }", "public function get_users($organization_id, $user_type);", "public function getFindPerson()\n\t{\n\t\t$this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_FINDPERSON);\n\t\treturn $this->_result;\n\t}", "function findForCoPerson($coPersonId, $limit=null, $offset=null, $order=null, $owner=true) {\n $args = array();\n $args['joins'][0]['table'] = 'co_group_members';\n $args['joins'][0]['alias'] = 'CoGroupMember';\n $args['joins'][0]['type'] = 'INNER';\n $args['joins'][0]['conditions'][0] = 'CoGroup.id=CoGroupMember.co_group_id';\n $args['conditions']['CoGroup.status'] = StatusEnum::Active;\n $args['conditions']['CoGroupMember.co_person_id'] = $coPersonId;\n if($owner) {\n $args['conditions']['OR']['CoGroupMember.member'] = 1;\n $args['conditions']['OR']['CoGroupMember.owner'] = 1;\n } else {\n $args['conditions']['CoGroupMember.member'] = true;\n }\n // Only pull currently valid group memberships\n $args['conditions']['AND'][] = array(\n 'OR' => array(\n 'CoGroupMember.valid_from IS NULL',\n 'CoGroupMember.valid_from < ' => date('Y-m-d H:i:s', time())\n )\n );\n $args['conditions']['AND'][] = array(\n 'OR' => array(\n 'CoGroupMember.valid_through IS NULL',\n 'CoGroupMember.valid_through > ' => date('Y-m-d H:i:s', time())\n )\n );\n $args['contain'] = false;\n \n if($limit) {\n $args['limit'] = $limit;\n }\n \n if($offset) {\n $args['offset'] = $offset;\n }\n \n if($order) {\n $args['order'] = $order;\n }\n \n return $this->find('all', $args);\n }", "public function people()\n\t{\treturn $this->hasMany('App\\Person');\n\t}", "public function listPersons()\n {\n $pgw = $this->di['personGateway'];\n return $pgw->fetchAll();\n }", "public static function get_party_user($party_id){\n $user_data = array();\n $party_data = EntityAPI::get_by_id('party', $party_id); \n \n if(isset($party_data['id'])){ \n $user = get_user_by('login', $party_data['user_name']); \n if($user){\n $user_data['id'] = $user->ID;\n $user_data['user_pass'] = $user->user_pass;\n $user_data['last_name'] = $user->last_name;\n $user_data['first_name'] = $user->first_name;\n $user_data['user_name'] = $user->user_login;\n $user_data['user_login'] = $user->user_login;\n }\n }\n return $user_data;\n }", "function _get_user_info_simple($user_id = array(), $fields = \"full\", $params = array(), $return_sql = false) {\n\t\t$sql = \"\";\n\t\t// Dynamic fields group not availiable here\n\t\tif ($fields == \"dynamic\") {\n\t\t\t$fields = \"full\";\n\t\t}\n\t\t// Fields is just simple array\n\t\tif (is_array($fields)) {\n\t\t\t$sql = \"SELECT id,\".implode(\",\", $fields).\" FROM \".db('user').\" WHERE id IN(\".implode(\",\", $user_id).\")\";\n\t\t// Fields is a group name\n\t\t} elseif (is_string($fields)) {\n\t\t\t// We do not need to enumerate fields in \"full\" mode, we could just pass * here\n\t\t\tif ($fields == \"full\") {\n\t\t\t\t$sql = \"SELECT * FROM \".db('user').\" WHERE id IN(\".implode(\",\", $user_id).\")\";\n\t\t\t} else {\n\t\t\t\t$_fields = $this->_fields_groups[$fields];\n\t\t\t\t$sql = \"SELECT id\".($_fields ? \", \".implode(\",\", $_fields).\"\" : \"\").\" FROM \".db('user').\" WHERE id IN(\".implode(\",\", $user_id).\")\";\n\t\t\t}\n\t\t}\n\t\t// Create additional SQL from \"params\" array\n\t\tif (strlen($sql)) {\n\t\t\t$sql .= $this->_create_add_sql($params);\n\t\t}\n\t\t$result = false;\n\t\tif ($return_sql) {\n\t\t\t$result = $sql;\n\t\t} elseif (strlen($sql)) {\n\t\t\t$result = $this->_get_result($sql);\n\t\t}\n\t\treturn $result;\n\t}", "public function findByPersonId($personId)\n {\n return $this->createStandardQueryBuilder()\n ->field('people.people._id')->equals(new \\MongoId($personId))->getQuery()\n ->execute();\n }", "public function updateUserPeopleAction()\n {\n /** @var Object_People $people */\n $data = $this->getRequestData();\n if (isset($data['people_id'])) {\n $people = Object_People::getById($data['people_id']);\n if (!$people) {\n $this->setErrorResponse('no People with this people_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $people->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this People!');\n } else {\n if (isset($data['name'])) {\n $people->setName($data['name']);\n }\n if (isset($data['company'])) {\n $people->setCompany($data['company']);\n }\n if (isset($data['phone'])) {\n $people->setPhone($data['phone']);\n }\n if (isset($data['email'])) {\n $people->setEmail($data['email']);\n }\n if (isset($data['image'])) {\n $people->setImage(Asset_Image::getById($data['image']));\n }\n if (!$people->save()) {\n $this->setErrorResponse('cannot update People object');\n }\n }\n } else {\n $this->setErrorResponse('people_id is mandatory field for this request!');\n }\n\n $this->_helper->json($people);\n }", "public function getUser($id);", "function get_user($id = NULL)\n{\n $select_query = 'SELECT user_id, username, email\n FROM ' . TBL_USERS;\n\n if ($id !== NULL)\n {\n $select_query .= ' WHERE `user_id`=' . (int)$id;\n }\n\n $select_query .= ' ORDER BY `user_id` ASC';\n\n $result = mysql_query($select_query);\n\n $users = array();\n while ($row = mysql_fetch_assoc($result))\n {\n $users[] = $row;\n }\n\n return $users;\n}", "function get_people_manage_table_data_rows($people,$controller)\n{\n\t$CI =& get_instance();\n\t$table_data_rows='';\n\n\tforeach($people->result() as $person)\n\t{\n\t\t$table_data_rows.=get_person_data_row($person,$controller);\n\t}\n\n\tif($people->num_rows()==0)\n\t{\n\t\t$table_data_rows.='<tr><td colspan=\"6\"><div class=\"warning_message\" style=\"padding:7px;\">'.$CI->lang->line('common_no_persons_to_display').'</div></tr></tr>';\n\t}\n\n\treturn $table_data_rows;\n}", "public function person() {\n $personId = $_REQUEST['id'];\n $person = $this->tmdb->getPerson($personId);\n $imageUrl = $this->tmdb->getImageUrl($person['profile_path'], TMDb::IMAGE_PROFILE, 'w185');\n //$images = $this->tmdb->getPersonImages($personId);\n $credits = $this->tmdb->getPersonCredits($personId);\n $map = array('person' => $person, 'imageUrl' => $imageUrl, 'credits' => $credits);\n $this->reply($map);\n }", "function getUserById($userId, $users)\n {\n foreach ($users as $user)\n {\n if ($user['id'] == $userId)\n {\n return $user;\n }\n }\n return NULL;\n }", "public function getUser($id) {\n $sql = \"select * from infos_contributeur where id_user = $id\";\n $result = $this->db->fetchAll($sql);\n\n return $result;\n }", "function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}", "function get_personas($accid)\r\n{\r\n\t$ret[] = array(-1,\"--account--\");\r\n\t$query = \"SELECT * from personas where '$accid'= accid \";\r\n\r\n\t$result = mysql_query ($query) or die(\"can not query table personas - \".mysql_error());\r\n\t$rowcount = mysql_num_rows($result);\r\n\t$odd = false; $first = true;\r\n\tif ($rowcount != 0) {\r\n\t\twhile (true) {\r\n\t\t\t$a = mysql_fetch_object($result);\r\n\t\t\tif ($a===false) break;\r\n\t\t\t$ret[] = array($a->persona,$a->persona);\r\n\t\t}\r\n\t}\r\n\treturn $ret;\r\n}", "public function selectPersons($request) {\n\n // domain, app always present\n\n //\n $conditions = \"\";\n $domain = $request['domain'];\n $prefix = prefixed($domain);\n\n //\n if(isset($request['id'])){$id=clean($request['id']);$conditions.=\"AND \".substr($domain,0,-1).\"_id LIKE '%\".$id.\"%' \";}else{$conditions.=\"\";}\n\n $columns = \"\n\n person_id,\n person_attributes,\n person_first_name,\n person_last_name,\n person_email,\n person_phone,\n person_entitlements\n\n \";\n\n $table = $domain;\n\n //\n $start = 0;\n\n //\n if(isset($request['page'])) {\n\n //\n $start = ($request['page'] - 1) * $request['per'];\n \n }\n\n //\n if(!empty($request['id'])) {\n\n $conditions = \" WHERE\";\n $conditions.= \" \" . $prefix . \"_id = :id \";\n $conditions.= \" AND active = 1 \";\n $conditions.= \" ORDER BY time_finished DESC \";\n \n $subset = \" LIMIT 1\";\n\n $sql = \"SELECT \";\n $sql.= $columns;\n $sql.= \" FROM \" . $table;\n $sql.= $conditions;\n $sql.= $subset;\n \n //echo $sql; exit;\n\n //\n $statement = $this->pdo->prepare($sql);\n\n // bind value to the :id parameter\n $statement->bindValue(':id', $request['id']);\n\n //echo $sql; exit;\n\n } else {\n\n $conditions = \" WHERE \";\n $conditions.= \" active = 1 \";\n $conditions.= \" ORDER BY time_finished DESC \";\n $subset = \" OFFSET {$start}\" . \" LIMIT {$request['per']}\";\n\n $sql = \"SELECT \";\n $sql.= $columns;\n $sql.= \"FROM \" . $table;\n $sql.= $conditions;\n $sql.= $subset;\n \n //\n $statement = $this->pdo->prepare($sql);\n\n }\n \n // execute the statement\n $statement->execute();\n\n //\n $results = [];\n $total = $statement->rowCount();\n $pages = ceil($total/$request['per']); //\n //$current = 1; // current page\n //$limit = $result['limit'];\n //$max = $result['max'];\n\n //\n if($statement->rowCount() > 0) {\n\n //\n $data = [];\n \n //\n while($row = $statement->fetch(\\PDO::FETCH_ASSOC)) {\n \n //\n $data[] = [\n\n 'id' => $row['person_id'],\n 'attributes' => $row['person_attributes'],\n 'first_name' => $row['person_first_name'],\n 'last_name' => $row['person_last_name'],\n 'email' => $row['person_email'],\n 'phone' => $row['person_phone'],\n 'entitlements' => $row['person_entitlements']\n ];\n\n }\n\n } else {\n\n //\n echo 'No data in your DATABASE...';\n\n }\n\n $results[] = [\n 'status' => 200,\n 'message' => 'Successful',\n 'metadata' => [\n 'page' => $request['page'],\n 'pages' => $pages,\n 'total' => $total\n ],\n 'data' => $data,\n 'log' => [\n 'event' => substr(md5(uniqid(microtime(true),true)),0,13),\n 'process' => substr(md5(uniqid(microtime(true),true)),0,13)\n ],\n ];\n\n //echo \" results \";\n //echo json_encode($results);\n\n //\n return $results;\n\n }", "function flashcard_get_participants($flashcardid) {\n global $DB;\n\n $sql = \"\n SELECT DISTINCT\n userid,\n userid\n FROM\n {flashcard_card}\n WHERE\n flashcardid = ?\n \";\n $userids = $DB->get_records_sql_menu($sql, array('flashcardid' => $flashcardid));\n if ($userids) {\n $users = $DB->get_records_list('user', 'id', array_keys($userids));\n }\n\n if (!empty($users)) {\n return $users;\n }\n\n return false;\n}", "function getProfessors() {\n// \"email\" => null, \"firstname\" => null, \"lastname\" => null, \"path\" => null,\n// \"user_id\" => null ];\n if ($result = $this->dbCnx->query(\n \"SELECT firstname, lastname, username, email, profileimg\n FROM users\n WHERE users.usertype = 'PROFESSOR'\")) {\n\n $i = 0;\n while ($row = $result->fetch_assoc()) {\n $res[$i]['email']= $row['email'];\n $res[$i]['username']= $row['username'];\n $res[$i]['profileimg']= $row['profileimg'];\n $res[$i]['lastname']= $row['lastname'];\n $res[$i]['firstname']= $row['firstname'];\n $i++;\n }\n $result->close();\n// $res['errMsg']=\"Tehre was an error.\";\n// return $res;\n }\n// $res['errMsg'] = $result;\n return $res;\n }", "protected function getOwnedPersons() {\n // Get owner.\n $uid = $this->order->getCustomerId();\n if (!$uid) {\n // Do not select existing persons for anonymous customers.\n return [];\n }\n\n // Get identity entity type.\n $event = $this->registrantFormHelper->getEvent($this->registrant);\n list($person_entity_type_id, $person_bundle) = $this->registrantFormHelper->getIdentityType($event);\n\n // Find existing identities.\n $storage = $this->entityTypeManager->getStorage($person_entity_type_id);\n $ids = $storage->getQuery()\n ->condition('type', $person_bundle)\n ->condition('uid', $uid)\n ->execute();\n\n if (empty($ids)) {\n return [];\n }\n\n // Ensure that the ID's keys and values are equal.\n $ids = array_combine(array_values($ids), array_values($ids));\n\n // Remove any ID's that are already in current registration.\n foreach ($this->registration->getRegistrants() as $registrant) {\n $person = $registrant->getIdentity();\n if ($person) {\n unset($ids[$person->id()]);\n }\n }\n\n if (empty($ids)) {\n return [];\n }\n\n return $storage->loadMultiple($ids);\n }", "public function getPersonas()\n {\n $pivot = $this->Personas_->filter(function ($persona) {\n return $persona->approved;\n })->pluckNamed('User');\n $parents = $this->Parents_->filter(function ($persona) {\n return $persona->approved;\n })->pluckNamed('Parent');\n return $pivot->merge($parents);\n }", "function get_people_manage_table_data_rows($people,$controller)\n{\n\t$CI =& get_instance();\n\t$table_data_rows='';\n\t\n\tforeach($people->result() as $person)\n\t{\n\t\t$table_data_rows.=get_person_data_row($person,$controller);\n\t}\n\t\n\tif($people->num_rows()==0)\n\t{\n\t\t$table_data_rows.=\"<tr><td colspan='6'><div class='warning_message' style='padding:7px;'>\".$CI->lang->line('common_no_persons_to_display').\"</div></tr></tr>\";\n\t}\n\t\n\treturn $table_data_rows;\n}", "function get_user_details_byid($user_id) {\n\n $ci = & get_instance();\n $qur = $ci->db->query(\"SELECT * FROM `users` u INNER JOIN `users_profiles` up ON u.id = up.user_id WHERE u.id=\".$user_id);\n if($qur->num_rows() > 0) {\n $row = $qur->result_array();\n $email = $row[0]['email'];\n $f_name = $row[0]['f_name'];\n return ['email'=>$email,'f_name'=>$f_name];\n }else{\n return [];\n }\n}", "public function getUserWithId($id){\r\n\r\n\t\t$sql = \"Select * from users where id = ?\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$id]);\r\n\r\n\t\t$postOwner = $query->fetch(PDO::FETCH_OBJ);\r\n\t\treturn $postOwner;\r\n\t}", "function search_people($target) { \n //retrive a specific thinktank, either by id or name\n if (is_numeric($target)) { \n $query = \"SELECT * FROM people WHERE person_id= '$target'\"; \n }\n else { \n $target= mysql_real_escape_string($target); \n $query = \"SELECT * FROM people WHERE name_primary = '$target'\";\n }\n \n $results = $this->fetch($query);\n $output = array();\n foreach($results as $result) { \n $jobs = $this->search_jobs($result[\"name_primary\"], '', '', false, false);\n $temp_output['person'] = $result;\n $temp_output['jobs'] = $jobs;\n $output[] = $temp_output;\n }\n \n return $output;\n }", "public function getUser(?string $id): Users\n {\n foreach ($this->users as $user) {\n if ($user->id == $id) {\n sendlog(\"User \". $user->id, \"common.log\");\n return $user;\n }\n }\n return $this->users[0];\n }", "public function persons($params = null) {\n $this->checkPage($params);\n\n $response = $this->sendRequest(\n 'GET', $this->addParams('/api/v1/persons', $params)\n );\n\n return $this->validate($response);\n }", "function getPersonID()\n {\n return $this->getValueByFieldName('person_id');\n }", "public function getuserbyID( $id )\n\t{\n\t\t$users = array();\n\n\t\tif( is_array( $id ) )\n\t\t{\n\t\t\t$result = $this->db->query( \" SELECT userid, username, first_name, last_name FROM \" . $this->db_prefix . \"_users WHERE userid IN(\" . implode( \",\", $id ) . \")\" );\n\n\t\t\twhile( $row = $result->fetch() )\n\t\t\t{\n\t\t\t\t$row['full_name'] = nv_show_name_user( $row['first_name'], $row['last_name'], $row['username']);\n\t\t\t\t$users[$row['userid']] = $row;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->db->query( \" SELECT userid, username, full_name FROM \" . $this->db_prefix . \"_users WHERE userid=\" . $id );\n\t\t\t$users = $result->fetch();\n\t\t\t$users['full_name'] = $users['full_name'] == '' ? $users['username'] : $users['full_name'];\n\t\t}\n\n\t\treturn $users;\n\t}", "public function getPersonalIds()\n {\n if ($this->isHeadPreceptor())\n {\n $c = new Criteria();\n $c->add(PersonPeer::USER_ID, $this->getGuardUser()->getId());\n $c->addJoin(PersonPeer::ID, PersonalPeer::PERSON_ID);\n $c->addJoin(HeadPersonalPersonalPeer::HEAD_PERSONAL_ID, PersonalPeer::ID);\n $head_personal = PersonalPeer::doSelectOne($c);\n\n $personal_in =array();\n\n if (!is_null($head_personal))\n {\n foreach($head_personal->getHeadPersonalPersonals() as $head_personal_personal)\n {\n $personal_in[] = $head_personal_personal->getPersonalId();\n }\n }\n\n return $personal_in;\n }\n }", "public function get_personal_data($will_id){\n $this->db->select('*');\n $this->db->from('tbl_personal_info');\n $this->db->where('will_id',$will_id);\n $query = $this->db->get();\n $result = $query->result();\n return $result;\n }", "function show_person($user_id, $args) {\n\tif( $ar = get_user_meta($user_id) ){\n\t\t$meta = array_map( function( $a ){ \n\t\t\treturn $a[0];\n\t\t}, $ar);\n\t}\n\n\t$defaults = array(\"avatar_size\" => 96);\n\t$args = wp_parse_args($args, $defaults);\n\n\t# $id must me present for use in _members.php\n\t$id = $user_id;\n\n\tob_start();\n\tinclude THEME_ABSPATH.\"partials/_member.php\";\n\techo ob_get_clean();\n}", "function calls_select_all($salesperson_id)\n{\n $conn = db_connect();\n\n // Prepared statement for selecting a user from the database\n $calls_select_stmt = pg_prepare($conn, \"calls_select_stmt\", \"\n SELECT calls.id, calls.client_id, clients.first_name, clients.last_name, calls.date, calls.reason, clients.salesperson_id \n FROM calls \n INNER JOIN clients \n ON calls.client_id = clients.id\n WHERE clients.salesperson_id = $salesperson_id\");\n $result = pg_execute($conn, \"calls_select_stmt\", array());\n $rows = pg_fetch_all($result);\n\n // Check for a result after querying database and if one exists, return call data\n if ($rows) {\n return $rows;\n }\n\n return false;\n}", "public function personelData($id) {\n $personel = Personels::find($id);\n $companies = Companies::all();\n return $personel;\n }", "public function loadOfficialsForPerson($projectId,$personId)\n {\n $qbPersonPersons = $this->qbPersonPersons($projectId,$personId);\n \n // Build query\n $em = $this->getEntityManager();\n $qb = $em->createQueryBuilder();\n\n $qb->addSelect('person');\n $qb->addSelect('personRegistered');\n \n //$qb->addSelect('projectPerson');\n\n $qb->from('ZaysoCoreBundle:Person', 'person');\n $qb->leftJoin('person.personPersons', 'personPerson');\n $qb->leftJoin('person.registeredPersons', 'personRegistered'); // Limit to ayso\n \n //$qb->leftJoin('person.projectPersons', 'projectPerson');\n\n $qb->andWhere($qb->expr()->in('person.id',$qbPersonPersons->getDQL()));\n \n $qb->addOrderBy('person.nickName');\n $qb->addOrderBy('person.firstName');\n $qb->addOrderBy('person.lastName');\n\n $items = $qb->getQuery()->getResult();\n \n return $items;\n }", "public function get_competitors(){\n $sql = \"SELECT DISTINCT * from members WHERE members.id IN \"\n .\"(SELECT competitorID FROM tournamentCompetitors WHERE tournamentID=$this->id)\";\n return Member::find_by_sql($sql);\n }", "public static function getRecord($id) {\r\n $connection = Database::getConnection();\r\n // Set up the query\r\n $query = 'SELECT `id`,`first_name`,`last_name`,`gender`,`avatar`,`bloodgroup`, `email`, `phone`,\r\n `user_name`, `access`\r\n FROM `persons` WHERE id=\"'. (int) $id.'\"';\r\n // Run the MySQL command \r\n $result_obj = ''; \r\n try {\r\n $result_obj = $connection->query($query);\r\n if (!$result_obj) {\r\n throw new Exception($connection->error);\r\n } else {\r\n $item = $result_obj->fetch_object('Person');\r\n if (!$item) {\r\n throw new Exception($connection->error);\r\n } else {\r\n // pass back the results\r\n return($item);\r\n }\r\n }\r\n }\r\n catch(Exception $e) {\r\n echo $e->getMessage();\r\n }\r\n }", "function paces_get_users_all_details( $user_id ){\n return get_metadata( 'user', $user_id );\n}", "public function get_individual_dependants($individual_id)\n\t{\n\t\t//retrieve all users\n\t\t$this->db->from('individual_dependant');\n\t\t$this->db->select('*');\n\t\t$this->db->where(array('individual_dependant.individual_id' => $individual_id, 'individual_dependant.relationship_id' => 'relationship.relationship_id'));\n\t\t$this->db->order_by('individual_dependant_fname');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "function users_by_hobby_id($hobby_id,$total=5,$exclude=array()){\r\n\r\n//get subscribers\r\n$users=$this->get_subscribers($hobby_id,$total,$exclude);\r\n\r\n//final arrary to be returned\r\n$return=array();\r\n\r\nif(!count($users))return $return;\r\n\r\n//form SQL query\r\n$sql=\"select id,first,last,country from userdata where \". SQL_valid_users(false). \" && \".SQL_not_in($this->get_uids($users),\"id\",false).\" order by RAND()\";\r\n\r\n$mysqli =new mysqli($GLOBALS['host'],$GLOBALS['db_user'],$GLOBALS['db_passwd'],$GLOBALS['selected_db']);\r\n\r\nif($result=$mysqli->query($sql))\r\n{\r\nif($result->num_rows>0)\r\n{\r\nwhile($row=$result->fetch_array())\r\n{\r\n$return[]=$row;\r\n}\r\n}\r\n}\r\n\r\nreturn $return;\r\n\r\n}", "function getProjectUsers($db, $user_id, $project_id) {\n $query = \"SELECT DISTINCT u.user_id, u.username, u.first_name, u.last_name \".\n \"FROM Users u INNER JOIN Users_Projects up ON u.user_id = up.user_id \".\n \"WHERE up.proj_id = ? AND (\".\n \"EXISTS (SELECT * FROM Users WHERE user_id = $user_id AND admin = 1) \".\n \"OR up.proj_id IN (SELECT proj_id FROM Users_Projects WHERE user_id = $user_id)\".\n \") ORDER BY u.username\";\n $stmt = prepareQuery($db, $query);\n bindParam($stmt, \"i\", $project_id);\n executeStatement($stmt);\n $results = $stmt->get_result();\n $users = array();\n while ($row = $results->fetch_assoc()) {\n $users[] = $row;\n }\n return $users;\n}", "function get_all_person()\n {\n $this->db->order_by('person_id', 'desc');\n return $this->db->get('person')->result_array();\n }" ]
[ "0.6533435", "0.6500275", "0.642814", "0.63904023", "0.6110907", "0.6066991", "0.6025295", "0.59378195", "0.5912326", "0.58952177", "0.5868457", "0.5839717", "0.58203757", "0.5801222", "0.5788947", "0.57336336", "0.56931573", "0.5688893", "0.5674435", "0.5665378", "0.565958", "0.5654622", "0.56303537", "0.56274873", "0.5626325", "0.5616181", "0.5609504", "0.5606684", "0.5600667", "0.5596994", "0.5568507", "0.5563709", "0.55353326", "0.5533367", "0.55227166", "0.55000335", "0.5497895", "0.549683", "0.54920983", "0.5476754", "0.5469307", "0.54641825", "0.54505575", "0.54497164", "0.5447978", "0.5429871", "0.5422664", "0.5417703", "0.54069006", "0.5405699", "0.5399422", "0.5395287", "0.53917164", "0.53878355", "0.53853667", "0.53766805", "0.537358", "0.53708184", "0.5356635", "0.5356593", "0.5324787", "0.5318986", "0.5314525", "0.53045064", "0.5301597", "0.52944386", "0.5286441", "0.5268891", "0.52668446", "0.5263073", "0.5262168", "0.5255948", "0.52547824", "0.5243731", "0.5243099", "0.5237905", "0.5228456", "0.5223587", "0.5217269", "0.52171075", "0.5215106", "0.5208846", "0.5206298", "0.5198716", "0.5196527", "0.5196201", "0.51918036", "0.51863486", "0.51849127", "0.5183494", "0.5179298", "0.51740724", "0.5172076", "0.51607716", "0.51599383", "0.5155934", "0.51464254", "0.5142074", "0.5140618", "0.5136303" ]
0.7297928
0
delete user people by people_id people_id mandatory field
public function deleteUserPeopleAction() { /** @var Object_People $people */ $data = $this->getRequestData(); if ($data['people_id']) { $people = Object_People::getById($data['people_id']); if (!$people) { $this->setErrorResponse('no People with this people_id!'); } elseif ($this->getDeviceSession()->getUserId() == $people->getCreator()->getId()) { $people->setPublished(false); if (!$people->save()) { $this->setErrorResponse('cannot delete People object!'); } } else { $this->setErrorResponse('no People for this user with current people_id!'); } } else { $this->setErrorResponse('people_id is mandatory field for this request!'); } $this->_helper->json(array('deleted' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove($people_id) {\n\t}", "public function delete($idPersonas);", "function delete_person($person_id)\n {\n return $this->db->delete('person',array('person_id'=>$person_id));\n }", "public function deletePeople ($id){ \n $sql = \"DELETE FROM alumnos WHERE no_ctrl=?\";\n $dPerson = $this->mysqli->prepare($sql);\n $dPerson->bind_param(\"i\", $id);\n $nPerson->execute();\n $nPerson->close;\n }", "public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }", "function delete($id) {\n // Pull the CO Person ID, we'll need it for the redirect\n $model = $this->modelClass;\n $coPersonId = $this->$model->field('co_person_id', array($this->modelClass.'.id' => $id));\n \n $this->setViewVars(null, $coPersonId);\n \n parent::delete($id);\n }", "public function deletePersons()\n {\n $conn = $this->_em->getConnection();\n $conn->executeUpdate('DELETE FROM person_person;');\n $conn->executeUpdate('DELETE FROM person_league;');\n $conn->executeUpdate('DELETE FROM person_cert;');\n $conn->executeUpdate('DELETE FROM person;');\n \n $conn->executeUpdate('ALTER TABLE person_person AUTO_INCREMENT = 1;');\n $conn->executeUpdate('ALTER TABLE person_league AUTO_INCREMENT = 1;');\n $conn->executeUpdate('ALTER TABLE person_cert AUTO_INCREMENT = 1;');\n }", "public function test_delete( $people )\n\t{\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\t\t\n\t\t$handler->run( 'delete from people where id = ?', array( 1 ) );\n\t\t\n\t\t// check the count\n\t\t$this->assertEquals( count( $people ) -1, count( $handler->fetch( 'select * from people', array() ) ) );\n\t}", "public function destroy(People $people)\n {\n //\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_person_detail\n\t\t\t\tWHERE psd_ps_id=?\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id));\n\t}", "public function action_personDelete() {\r\n if ($this->validateEdit()) {\r\n\r\n try {\r\n // 2. usunięcie rekordu\r\n App::getDB()->delete(\"person\", [\r\n \"id\" => $this->form->id\r\n ]);\r\n Utils::addInfoMessage('Pomyślnie usunięto rekord');\r\n } catch (\\PDOException $e) {\r\n Utils::addErrorMessage('Wystąpił błąd podczas usuwania rekordu');\r\n if (App::getConf()->debug)\r\n Utils::addErrorMessage($e->getMessage());\r\n }\r\n }\r\n\r\n // 3. Przekierowanie na stronę listy osób\r\n App::getRouter()->forwardTo('personList');\r\n }", "function removeUserFromPersonID($personID, $conn) {\n\t\t\t// check if person has any user accounts associated with it\n\t\t\t$sql = 'SELECT * FROM users WHERE person_id='.$personID.'';\n\t\t\t// echo $sql.'<br>';\n\t\t\t//Prepare sql using conn and returns the statement identifier\n\t\t\t$stid = oci_parse($conn, $sql);\n\t\t\t//Execute a statement returned from oci_parse()\n\t\t\t$res=oci_execute($stid);\n\t\t\t//if error, retrieve the error using the oci_error() function & output an error message\n\t\t\tif (!$res) {\n\t\t\t\t$err = oci_error($stid); \n\t\t\t\techo htmlentities($err['message']);\n\t\t\t}\n\n\t\t\t// remove the user accounts if necessary\n\t\t\t$results = oci_fetch_array($stid, OCI_ASSOC);\n\t\t\tif (!empty($results)) {\n\t\t\t\t$sql = 'DELETE FROM users WHERE ( person_id = '.(int)$personID.')';\n\t\t\t\t// echo $sql.'<br>';\n\t\t\t\t//Prepare sql using conn and returns the statement identifier\n\t\t\t\t$stid = oci_parse($conn, $sql);\n\t\t\t\t//Execute a statement returned from oci_parse()\n\t\t\t\t$res=oci_execute($stid);\n\t\t\t\t//if error, retrieve the error using the oci_error() function & output an error message\n\t\t\t\tif (!$res) {\n\t\t\t\t\t$err = oci_error($stid); \n\t\t\t\t\techo htmlentities($err['message']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Free the statement identifier when closing the connection\n\t\t\toci_free_statement($stid);\n\t\t}", "public function delete_user($user);", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function destroy($id)\n {\n $people = $this->personRepository\n ->makeModel()\n ->qPeople(Auth::id(), $id);\n\n if ($people > 0){\n $person = $this->personRepository->find($id); \n $person->features()->detach();\n $person->groups()->detach(); \n }else{\n abort(401);\n }\n\n if (empty($person)) {\n Flash::error(trans('flash.error', ['model' => trans_choice('functionalities.people', 1)]));\n\n return redirect(route('people.index'));\n }\n\n $this->personRepository->delete($id);\n\n Flash::success(trans('flash.destroy', ['model' => trans_choice('functionalities.people', 1)]));\n\n return redirect(route('people.index'));\n }", "public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non pu&ograve; essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "function delete_persona_perfil($id)\n {\n return $this->db->delete('persona_perfil',array('id'=>$id));\n }", "function deleteById($personId, $objectId = null) {\n\t\t$params = array((int) $personId);\n\t\tif ($objectId) $params[] = (int) $objectId;\n\t\t$returner = $this->update(\n\t\t\t'DELETE FROM object_for_review_persons WHERE person_id = ?' . ($objectId ? ' AND object_id = ?' : ''),\n\t\t\t$params\n\t\t);\n\t}", "function deleteUser($params = null)\n {\n $key = $params[\":ID\"];\n $this->modelUser->deleteUser($key);\n $this->view->ShowUsersLocation();\n }", "function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}", "public static function delete($id) {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"DELETE indPrj_persons FROM indPrj_persons WHERE id = ?\");\n \n $stmt->bind_param('i', $id);\n \n $stmt->execute();\n $stmt->close();\n $mysqli->close();\n }", "function delete_user_pdo()\r\n{\r\n global $surname, $firstname;\r\n\r\n $surname = $_POST[\"surname\"];\r\n $firstname = $_POST[\"firstname\"];\r\n\r\n $pdo = connect_DB_pdo();\r\n\r\n $sql = 'SELECT id FROM benutzer WHERE name = ? && vorname = ?';\r\n $stmt = $pdo->prepare($sql);\r\n $stmt->execute([$surname, $firstname]);\r\n $userID = $stmt->fetch(PDO::FETCH_OBJ);\r\n\r\n $sql = 'DELETE from rel_benutzer_gruppe Where id_benutzer = ?';\r\n $stmt = $pdo->prepare($sql);\r\n $stmt->execute([$userID->id]);\r\n\r\n $sql = 'DELETE from benutzer Where id = ?';\r\n $stmt = $pdo->prepare($sql);\r\n $stmt->execute([$userID->id]);\r\n\r\n $pdo = null;\r\n}", "public function destroy($id)\n {\n $person = Person::findOrfail($id);\n// unlink(public_path().$user->photo->file);\n if (isset($person->photo->file)) {\n if (is_readable(public_path() . $person->photo->file)) {\n unlink(public_path() . $person->photo->file);\n }\n }\n $person->delete();\n\n Session::flash('deleted_user', 'همکار مورد نظر با موفقیت پاک شد');\n return redirect('/admin/persons');\n\n }", "function removePerson($personID, $conn) {\n\t\t\t$sql = 'DELETE FROM persons WHERE ( person_id = '.(int)$personID.')';\n\t\t\t// echo $sql.'<br>';\n\t\t\t//Prepare sql using conn and returns the statement identifier\n\t\t\t$stid = oci_parse($conn, $sql);\n\t\t\t//Execute a statement returned from oci_parse()\n\t\t\t$res=oci_execute($stid);\n\t\t\t//if error, retrieve the error using the oci_error() function & output an error message\n\t\t\tif (!$res) {\n\t\t\t\t$err = oci_error($stid); \n\t\t\t\techo htmlentities($err['message']);\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo '<ul class=\"list-group\">\n\t\t\t\t\t\t<li class=\"list-group-item list-group-item-success\">Person ID : '.(int)$personID.' deleted.</li>\n\t\t\t\t\t </ul>';\n\t\t\t}\n\t\t\t// Free the statement identifier when closing the connection\n\t\t\toci_free_statement($stid);\n\t\t}", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function destroy($id)\n {\n $person = People::find($id);\n if (empty($person)) return json_encode(['error' => \"Invalid user\"]);\n $person->delete();\n return redirect()->route('users.index')->with('success', \"User deleted\");\n }", "function removePerson(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $changesMade = false;\n\t\t $requestParams = $this->requestParams;\n\t\t if(isset($requestParams[\"uri\"]) && isset($requestParams[\"role\"])){\n\t\t\t\t\n\t\t\t\t$personURI = $requestParams[\"uri\"];\n\t\t\t\tif($requestParams[\"role\"] == \"creator\"){\n\t\t\t\t\t $persons = $this->rawCreators;\n\t\t\t\t\t unset($persons[$personURI]);\n\t\t\t\t\t $this->rawCreators = $persons;\n\t\t\t\t\t $changesMade = true;\n\t\t\t\t}\n\t\t\t\telseif($requestParams[\"role\"] == \"contributor\"){\n\t\t\t\t\t $persons = $this->rawContributors;\n\t\t\t\t\t unset($persons[$personURI]);\n\t\t\t\t\t $this->rawContributors = $persons;\n\t\t\t\t\t $changesMade = true;\n\t\t\t\t}\n\t\t\t\telseif($requestParams[\"role\"] == \"person\"){\n\t\t\t\t\t $persons = $this->rawLinkedPersons;\n\t\t\t\t\t unset($persons[$personURI]);\n\t\t\t\t\t $this->rawLinkedPersons = $persons;\n\t\t\t\t\t $changesMade = true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if($changesMade){\n\t\t\t\t$this->saveMetadata(); //save the results\n\t\t }\n\t\t return $changesMade;\n\t }", "public function invited_task_remove_people_post()\n {\n $id = $this->post('task_id');\n $user_id = $this->post('user_id');\n \n $array = array(\n 'is_removed' => 1\n );\n $this->db->where('taskId',$id);\n $this->db->where('user_id',$user_id);\n $this->db->update('invite_people',$array);\n \n $response = array('success'=>true,'message'=>'People Removed Successfully');\n echo json_encode($response);\n }", "public function delete($id) {\n\t \tDB::table('employer_personal_details as e')\n ->where('id', $id)\n ->update(['e.deleted' => 'Y']);\n // $del = Fdw::find($id);\n //$del->delete();\n\t\t\\Session::flash('success', 'Employer profile has been deleted.');\n\t\treturn redirect('employer');\n\t}", "public function remove(Request $request){\n //DB::delete('delete from people where id = :id', $param);\n DB::table('people') -> where('id',$request -> id) -> delete();\n return redirect('/hello');\n }", "public function delete($photoId, User $user, \\PDO $db){\n $stmt = $db->prepare(\"DELETE FROM `photos` WHERE `user_id` = ? AND id = ?\"); \n $stmt->bindParam(1, $user->id);\n $stmt->bindParam(2, $photoId);\n return $stmt->execute(); \n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function deleted(PersonaParcela $personaParcela)\n {\n //\n }", "public function destroy($id)\n {\n $user = new persona();\n $user =$user::find($id);\n $user->delete(); \n return redirect('mostrar_usuarios');\n }", "public function actionDelete($id) {\n $persona = Persona::model()->with(array('titularidad', 'cotitularidad'))->findByPk($id);\n if (is_null($persona->titularidad) && is_null($persona->cotitularidad)) {\n $persona->delete();\n } else {\n http_response_code(400);\n header('Content-type: application/json');\n echo CJSON::encode(array('error'=>\"No se puede eliminar la persona $persona->nombre $persona->apellido por estar vinculada a solicitudes.\"));\n Yii::app()->end();\n }\n\t}", "public function delete(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::delete(): Attempt to delete a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\t//Delete the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t\t$st = $conn->prepare ( \"DELETE FROM \".TABLENAME_GROUPS.\" WHERE id = :id LIMIT 1\" );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\t$st->execute();\r\n\t\t\t$conn = null;\t\t\r\n\t\t}", "function wp_delete_signup_on_user_delete($id, $reassign, $user)\n {\n }", "function userDelete(PDO $db,$id)\n{\n $sql = \"DELETE FROM users WHERE id = :id\";\n \n $stmt = $db->prepare($sql);\n \n $stmt->bindParam(':id', $id, PDO::PARAM_INT); \n\n $stmt->execute();\n}", "public function delete()\n { if (is_null($this->id))\n trigger_error(\"User::delete(): Attempt to delete a User object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM users WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT); \n $st->execute();\n \n $conn = null;\n }", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function delete($user){\n }", "public function delete(User $user, MuzaiEducation $muzaiEducation)\n {\n //\n }", "public function deleteAction($id){\n\t\t$persona = $this->getDoctrine()->getRepository('AppBundle:Person')->find($id);\n\t\tif (!$persona) {\n\t\t\tthrow $this->createNotFoundException('Ninguna persona tiene esa id '.$id);\n\t\t}else{\n\t\t\t// ... Una vez tengo el obj $persona, puedo hacer cosas con él, en este caso borrarlo\n\t\t\t$em = $this->getDoctrine()->getManager();\n\t\t\t$em->remove($persona); // primero lo elimino de la memoria\n\t\t\t$em->flush(); // ... el flush actua haciendo el commit del DELETE\n\t\t\treturn new Response('Persona eliminada');\n\t\t}\n\t}", "function delete($user_id) {\n $oldName = get_user_by_id($user_id['id']);\n $oldImage = 'img/demo/avatars/' . $oldName['image'];\n if(!empty($oldName['image'])) {\n if(file_exists($oldImage)) {\n unlink($oldImage);\n }\n }\n\n $db = new PDO(\"mysql:host=localhost; dbname=registration\", \"root\", \"root\");\n $sql = \"DELETE FROM users WHERE id=:id\";\n $statement = $db->prepare($sql);\n $statement->execute([\n 'id' => $user_id['id'],\n ]);\n\n}", "public function eliminar ($idpersona)\n\t{\n\t\t$sql=\"DELETE FROM persona WHERE idpersona='$idpersona';\";\n/*echo \"<pre><br>Elin¡minas:<br>\";\nprint_r($sql);\necho \"</pre>\";\ndie();*/\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function deleteUser($id){\n$sql = \"DELETE FROM utilisateurs WHERE id = :id\";\n $stmt= $this->pdo->prepare($sql);\n $stmt->execute([\n 'id' => $id\n ]);\n}", "public function destroy($id)\n {\n Creation::where('users_id', $id)->delete();\n Preferencias::where('users_email', Auth::user()->email)->delete();\n User::destroy($id); \n\n\n return Redirect::to('/');\n\n \n }", "public function delIdentity()\n\t{\n\t\t// Verifier l'adhesion\n\t\t$q = new Bn_query('u2a', '_asso');\n\t\t$q->setFields('u2a_adherentid');\n\t\t$q->addWhere('u2a_userid='. $this->getVal('id', -1));\n\t\t$adheId = $q->getOne();\n\t\t$q->deleteRow();\n\t\t$q->setTables('adherents');\n\t\t$q->deleteRow('adhe_id=' . $adheId);\n\t}", "public function deleteUser()\n {\n $this->delete();\n }", "public function softdelete()\n {\n\n $user = User::findOrFail(request()->id);\n\n $user->first_name = NULL;\n $user->middle_name = NULL;\n $user->last_name = NULL;\n $user->email = NULL;\n $user->address = NULL;\n $user->postal = NULL;\n $user->city = NULL;\n $user->phone = NULL;\n\n $user->save();\n $user->delete();\n // Session::flash('success', 'Gebruiker verwijderd');\n return redirect('/users');\n\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "public function deleteUser($id_users) {\n\t\t$users = new Model_Users();\n\t\t$deleteArticle = $users->deleteUser($id_users);\n\t\theader('Location: /ecommerce/admin/users/list');\n\t}", "Public Function PermanentDelete()\n\t{\n\t\t$this->_db->delete('bevomedia_user', 'ID = ' . $this->id);\n\t\t$this->_db->delete('bevomedia_user_info', 'ID = ' . $this->id);\n\t}", "public function destroy($id)\n {\n //\n $personas = Persona::find($id);\n $personas->delete();\n }", "public function delete()\n{\n $query = \"DELETE FROM \" . $this->table_name . \" WHERE `user_id`=:user_id\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n // unique ID of record to be edited\n $this->user_id=htmlspecialchars(strip_tags($this->user_id));\n $stmt->bindParam(':user_id', $this->user_id);\n\n \n if($stmt->execute()){\n return true;\n }\n \n // return false if email does not exist in the database\n $this->errmsg=implode(\",\",$stmt->errorInfo());\n return false;\n}", "function deleteUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$this->db->delete('usuarios');\n\t}", "public function delete(User $user, AcademicYear $academicYear)\n {\n //\n }", "public function destroy($id)\n {\n Person::where('id',$id)->delete();\n return redirect('/people');\n }", "function heateor_ss_delete_social_profile(){\r\n\tif(isset($_GET['user_id'])){\r\n\t\t$userId = intval(trim($_GET['user_id']));\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->query($wpdb->prepare('DELETE FROM '.$wpdb->prefix.'usermeta WHERE user_id = %d and meta_key LIKE \"thechamp%\"', $userId));\r\n\t\tdie('done');\r\n\t}\r\n\tdie;\r\n}", "public function delete(User $user, Profil $profil)\n {\n //\n }", "function delete() {\n db_begin_work();\n \n $delete = parent::delete();\n if($delete && !is_error($delete)) {\n cache_remove('companies_id_name'); // remove ID - name map from cache\n \n $users = $this->getUsers();\n if(is_foreachable($users)) {\n foreach($users as $user) {\n $user->delete();\n } // foreach\n } // if\n \n Projects::resetByCompany($this);\n \n db_commit();\n } else {\n db_rollback();\n } // if\n return $delete;\n }", "public function delete($id) {\n // Delete the user\n $this->getDb()->delete('user', array('user_email' => $id));\n }", "public function destroy(UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function eraseUserAndPhotos($user_id){\n // Below deletes user when they have posts and comments \n $this->db->query('DELETE users, photos\n FROM users \n INNER JOIN photos \n ON photos.user_id = users.user_id\n WHERE users.user_id = :user_id');\n \n $this->db->bind(':user_id', $user_id); \n\n if($this->db->execute()){\n return true;\n } else {\n return false;\n } \n }", "function eliminarDiaryUser($id) {\n $sql = \"DELETE FROM diario WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }", "public function delete($user)\n {\n\n }", "public function deletePeople()\n {\n\n $parseCloud = new parseCloud('deletePeople');\n $parseCloud->objectId = $this->objectId;\n\n try {\n $results = $parseCloud->run();\n\n return $results;\n } catch (Exception $e) {\n print_r($e);\n die();\n }\n\n }", "function delete() {\n\t\t$personSectionObject = DB_DataObject::factory('person_section');\n\t\t$personSectionObject->person_id = $this->person_id;\n\t\t$personSectionObject->find();\n\t\t//echo '<PRE> Found Person Section Objects'; print_r($personSectionObject); echo '<PRE>';\n\n\t\twhile ($personSectionObject->fetch()) {\n\t\t\t$deleteObject = DB_DataObject::factory('person_section');\n\t\t\t$deleteObject->id = $personSectionObject->id;\n\t\t\t$deleteObject->section_id = $personSectionObject->section_id;\n\t\t\t$deleteObject->person_id = $this->id;\n\t\t\t$deleteObject->delete();\n\t\t}\n\n\t\treturn DB_DataObject::delete(); //Call the parent method\n\t}", "public function deleteRecord($id) {\r\n $this->db->delete(USERS, array('id' => $id));\r\n }", "function deleteUser(int $id) : void\n{\n $db = new Database;\n $db = $db->dbConnect();\n\n $sql = \"DELETE FROM user WHERE id = :id \";\n $deleteUser = $db->prepare($sql);\n $deleteUser->execute([':id' => $id]);\n}", "protected function _delete($id) {\n $this->wpdb->delete($this->table_relationships, array('person2_id' => $id), array('%d'));\n $this->wpdb->delete($this->table_relationships, array('person1_id' => $id), array('%d'));\n $this->wpdb->delete($this->table_name, array('id' => $id), array('%d'));\n }", "public function delete_user($id)\n\t{\n\t\t$termination_date = date(\"Y-m-d H:i\");\n\t\t$dbres = $this->db->query(\"update user SET delete_status='1',termination_date='$termination_date' where id = $id \");\n\t\tredirect(site_url() . 'sys/get_employees?msg_del=success');\n\t}", "public function destroy($id)\n {\n $personalDelete = User::findOrFail($id);\n $personalDelete->delete();\n\n Alert::success('Operación realizada con éxito','¡Personal eliminado!');\n \n return redirect()->route('personal.index');\n }", "public function destroy($id)\n {\n // delete user\n }", "public function delete($id)\n {\n $result = new \\stdClass();\n\n // First we need to verify that we don't try to delete ourselve.\n if (Auth::user()->id == $id) {\n $result->result = 'error';\n $result->msg = 'User '.Auth::user()->name.' cannot delete himself';\n\n return json_encode($result);\n }\n\n $user = User::find($id);\n\n if (count($user->employees)) {\n $result->result = 'error';\n $result->msg = 'Record cannot be deleted because some employees are associated to it.';\n\n return json_encode($result);\n }\n\n if (count($user->activities)) {\n $result->result = 'error';\n $result->msg = 'Record cannot be deleted because some activities are associated to it.';\n\n return json_encode($result);\n }\n\n $projects = $user->projects;\n if (count($projects)) {\n foreach ($projects as $project) {\n $project->created_by_user_id = 1;\n $project->save();\n }\n }\n\n $user->managers()->detach();\n $user->clusters()->delete();\n\n User::destroy($id);\n\n $result->result = 'success';\n $result->msg = 'Record deleted successfully';\n\n return json_encode($result);\n }", "public function destroy($id)\n {\n $personID = request()->input('personID');\n $this->currentPerson = Person::find(auth()->user()->id);\n\n $phone = Phone::find($id);\n $phone->updaterID = $this->currentPerson->personID;\n $phone->save();\n $phone->delete();\n\n if (request()->input('personID') == $this->currentPerson->personID) {\n return redirect('/profile/my');\n } else {\n return redirect('/profile/'.$personID);\n }\n }", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "public function destroy($id)\n {\n $person = Person::with('personalData')->findOrFail($id);\n\n $data = $person->personalData;\n $data->delete();\n $person->delete();\n }", "public function dokan_remove_bookable_person() {\n $post_data = wp_unslash( $_POST ); // phpcs:ignore\n\n // @codingStandardsIgnoreLine\n if ( ! isset( $post_data['action'] ) && $post_data['action'] != 'woocommerce_remove_bookable_person' ) {\n return;\n }\n if ( ! wp_verify_nonce( $post_data['security'], 'delete-bookable-person' ) ) {\n return;\n }\n\n wp_delete_post( intval( $post_data['person_id'] ) );\n exit;\n }", "public function deleteData()\n {\t\t\n \t$arrayId = $this->getAllUserId($this->readFromLocalFile());\n \tforeach($arrayId as $id)\n \t{\n \t\t$user = User::find()->where(['id' => $id])->one();\n \t\tif($user)\n \t\t{\n \t\t\t$user->delete();\n \t\t}\n \t}\n \t$this->deleteSelectedLocalItems('user');\n }", "public function deleted_user_action($id) {\r\n $this->db->delete_by_user_id($id);\r\n }", "public function delete($id) {\n // On supprime l'utilisateur\n $this->getDb()->delete('utilisateurs', array('user_id' => $id));\n }", "public function deleteAction() {\n\t\t $userId = $this->_request->getParam('userId');\n\t\t if($userId){\n\t\t $model_lucky = new Model_Lucky();\n\t\t $model_lucky->delete_where(array('user_id' => $userId));\n\t\t \n\t\t$this->_helper->json(1);\n\t\t}\n\t \n }", "function delete_user($user_id) {\r\n\t\t$owned_groups = $this->group_model->get_groups($user_id, 'owner');\r\n\t\t$owned_events = $this->event_model->get_events_by_user_id($user_id, 'owned');\r\n\t\t\r\n\t\tfor ($x = 0; $x < sizeof($owned_groups); $x++) {\r\n\t\t\t$this->group_model->delete_group($owned_groups[$x]->org_id);\r\n\t\t}\r\n\t\t\r\n\t\tfor ($x = 0; $x < sizeof($owned_events); $x++) {\r\n\t\t\t$this->group_model->delete_event($owned_events[$x]->event_id);\r\n\t\t}\r\n\t\t\r\n\t\t$this->db->delete('user', array('user_id'=> $user_id));\r\n\t\t$this->db->delete('attendee', array('user_id' => $user_id));\r\n\t\t$this->db->delete('bulletin', array('bulletin_user_id' => $user_id));\r\n\t\t$this->db->delete('member', array('user_id' => $user_id));\r\n\t\t$this->db->delete('owner', array('user_id' => $user_id));\r\n\t}", "public function userDeleted();", "function delContact ($p) {\r\n\r\n\t// pre checks\r\n\tif (!isAdmin()) return false;\r\n\tif (!isset($p['user'])) return false;\r\n\tif (empty($p['user'])) return false;\r\n\r\n\t// security\r\n\t$userPrep = prepareDBValue($p['user']);\r\n\r\n\t// get contact id\r\n\t$dbResult = queryDB('select id from contacts where username=\\'' . $userPrep . '\\'');\r\n\tif (!isset($dbResult[0]['id'])) return false;\r\n\t$userID = $dbResult[0]['id'];\r\n\r\n\t// delete all notifications assigned to the posted contact\r\n\tqueryDB('delete from notifications_to_contacts where contact_id=\\'' . $userID . '\\'');\r\n\r\n\t// disable all notifications and change usernames of all notifications owned by this user\r\n\tqueryDB('update notifications set active=\\'0\\', username=\\'' . prepareDBValue('[' . $p['user'] . ']') . '\\' where username=\\'' . $userPrep . '\\'');\r\n\r\n\t// finally, delete the user\r\n\tqueryDB('delete from contacts where id=\\'' . $userID . '\\'');\r\n\r\n\treturn true;\r\n\r\n}", "public function destroy(Person $person)\n {\n $person->delete();\n\n return redirect('/users/' . $person->user_id)->with('success','Los datos personales de este usuario se ha eliminado correctamente');\n }", "public function deleteUser($userId);", "public function user_delete_post()\n { \n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n \n $id = $data['id'];\n $where = array(\n 'id' => $id\n );\n $this->model->delete('users', $where);\n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\n }", "public function deleteAction()\n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('backend-evenements-personnage-list');\n }\n $oTable = $this->getTable();\n $oEntite = $oTable->findRow($id);\n $oTable->delete($oEntite);\n $this->flashMessenger()->addMessage($this->_getServTranslator()->translate(\"La evenements-personnage a été supprimé avec succès.\"), 'success');\n return $this->redirect()->toRoute('backend-evenements-personnage-list');\n }", "public function delete(User $user, InterventionRequest $interventionRequest)\n {\n //\n }", "public static function deleteRecord($id) {\r\n $connection = Database::getConnection(); \r\n // Set up query\r\n $query = 'DELETE FROM `persons` WHERE id=\"'. (int) $id.'\"';\r\n // Run the query\r\n if ($result = $connection->query($query)) { \r\n $return = array('', 'Your account successfully deleted.', '');\r\n return $return;\r\n } else {\r\n $return = array('accountdelete', 'Unable to delete your account.', (int) $id);\r\n return $return;\r\n }\r\n }", "function delete(){\n $user_id = $this->uri->rsegment('3');\n $this->_del($user_id);\n redirect(admin_url('user'));\n\n }", "function deleteUser($user_id) {\n global $pdo;\n $statement = $pdo->prepare('DELETE FROM `user` WHERE `id` = :id');\n $statement->bindParam(\":id\", $user_id);\n return $statement->execute();\n}", "function delete($id){\n\t\tglobal $conn;\n\t\t$sqlCmd = \"DELETE FROM user WHERE id=:id\";\n\t\t$stmt = $conn->prepare($sqlCmd);\n\t\t$stmt->bindParam(':id',$id);\n\t\t$stmt->execute();\n\t}", "function deleteUser(){\n $bdd = bdd();\n $bdd->prepare(\"DELETE from postSujet where propri=?\")->execute(array($_GET['del']));\n $bdd->prepare(\"DELETE from membres where id=?\")->execute(array($_GET['del']));\n}", "public function destroy($id)\n {\n $persona=Persona::findOrFail($id);\n $persona->estado='0';\n $persona->update();\n Session::flash('message','Persona eliminada correctamente');\n return Redirect::to('runner/personas');\n }", "public function delete(User $user, Meeting $meeting)\n {\n //\n }", "function delete() {\n db_begin_work();\n $delete = parent::delete();\n if($delete && !is_error($delete)) {\n unlink($this->getAvatarPath());\n \tunlink($this->getAvatarPath(true));\n\n ProjectUsers::deleteByUser($this);\n Assignments::deleteByUser($this);\n Subscriptions::deleteByUser($this);\n StarredObjects::deleteByUser($this);\n PinnedProjects::deleteByUser($this);\n UserConfigOptions::deleteByUser($this);\n Reminders::deleteByUser($this);\n\n search_index_remove($this->getId(), 'User');\n\n $cleanup = array();\n event_trigger('on_user_cleanup', array(&$cleanup));\n\n if(is_foreachable($cleanup)) {\n foreach($cleanup as $table_name => $fields) {\n foreach($fields as $field) {\n $condition = '';\n if(is_array($field)) {\n $id_field = array_var($field, 'id');\n $name_field = array_var($field, 'name');\n $email_field = array_var($field, 'email');\n $condition = array_var($field, 'condition');\n } else {\n $id_field = $field . '_id';\n $name_field = $field . '_name';\n $email_field = $field . '_email';\n } // if\n\n if($condition) {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ? AND $condition\", $this->getName(), $this->getEmail(), $this->getId());\n } else {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ?\", $this->getName(), $this->getEmail(), $this->getId());\n } // if\n } // foreach\n } // foreach\n } // if\n\n db_commit();\n return true;\n } else {\n db_rollback();\n return $delete;\n } // if\n }" ]
[ "0.7302314", "0.72567225", "0.6956891", "0.68961036", "0.6885045", "0.6799213", "0.6767392", "0.67370325", "0.66720814", "0.66690004", "0.65847206", "0.65029365", "0.6479975", "0.64767504", "0.64483064", "0.64251924", "0.63749295", "0.63408357", "0.63379157", "0.6318331", "0.63155055", "0.62705207", "0.62120646", "0.6204526", "0.61833215", "0.6180669", "0.6166739", "0.61584413", "0.6158322", "0.61573505", "0.61395425", "0.61374134", "0.6128317", "0.6122326", "0.61221415", "0.61083376", "0.61046344", "0.60884845", "0.6088179", "0.60833514", "0.60832286", "0.6082329", "0.6065266", "0.6064663", "0.6056452", "0.6053145", "0.6051864", "0.6042965", "0.6041311", "0.6025802", "0.60214627", "0.60180783", "0.6014924", "0.60128224", "0.5992292", "0.59877175", "0.59821606", "0.5974877", "0.59736145", "0.59694433", "0.5961019", "0.5956527", "0.59427935", "0.594086", "0.593968", "0.5928209", "0.5924112", "0.59235275", "0.59193", "0.5914248", "0.590656", "0.5903128", "0.5901198", "0.59002507", "0.58977777", "0.5896387", "0.58957314", "0.58949345", "0.58865374", "0.58854926", "0.5881231", "0.5880759", "0.58772653", "0.58770263", "0.58688456", "0.58688235", "0.5867493", "0.5867383", "0.5866148", "0.5853459", "0.5851184", "0.58460015", "0.5845556", "0.58440053", "0.58429897", "0.58396393", "0.5838963", "0.58387023", "0.5836968", "0.5835287" ]
0.7848862
0
this action creates user people name is mandatory field company, phone, email, image is optional field
public function createUserPeopleAction() { $data = $this->getRequestData(); if (isset($data['name'])) { $user = Object_User::getById($this->getDeviceSession()->getUserId()); $folder = Object_Folder::getByPath('/peoples/' . $user->getKey() . "-people"); if (!$folder) { $folder = new Object_Folder(); $folder->setKey($user->getKey() . "-people"); $folder->setParentId(52); $folder->save(); } $people = new Object_People(); $people->setCreator($user); $people->setName($data['name']); $people->setCompany(isset($data['company']) ? $data['company'] : ""); $people->setPhone(isset($data['phone']) ? $data['phone'] : ""); $people->setEmail(isset($data['email']) ? $data['email'] : ""); $people->setImage(isset($data['image']) ? Asset_Image::getById($data['image']) : ""); $people->setKey(Pimcore_File::getValidFilename($user->getKey() . "-" . $data['name'] . "-" . time())); $people->setPublished(true); $people->setParentId($folder->getId()); if (!$people->save()) { $this->setErrorResponse('cannot save People object'); } } else { $this->setErrorResponse('name is mandatory field for this request!'); } $this->_helper->json($people); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function doCreate() {\n if(\n isset($_POST['email']) &&\n isset($_POST['password']) &&\n isset($_POST['lastName']) &&\n isset($_POST['firstName']) &&\n isset($_POST['address']) &&\n isset($_POST['postalCode']) &&\n isset($_POST['city'])\n ) {\n $alreadyExist = $this->userManager->findByEmail($_POST['email']);\n\n if(!$alreadyExist) {\n $newUser = new User($_POST);\n $this->userManager->create($newUser);\n $page = 'login';\n }\n else {\n $error = \"ERROR : This email (\".$_POST['email'].\") is used by another user\";\n $page = 'create';\n }\n }\n\n require('./View/default.php');\n }", "public function formUserCreate(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primary_group = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Get the default groups\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n \n // Set default groups, including default primary group\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($default_groups[$group_id]) || $group_id == $primary_group->id)\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n $data['primary_group_id'] = $primary_group->id;\n // Set default title for new users\n $data['title'] = $primary_group->new_user_title;\n // Set default locale\n $data['locale'] = $this->_app->site->default_locale;\n \n // Create a dummy user to prepopulate fields\n $target_user = new User($data); \n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields for those that have default values. Don't hide any fields\n $fields = ['title', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else\n $disabled_fields[] = $field;\n } \n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Create User\",\n \"submit_button\" => \"Create user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }", "public function createAction()\n {\n if(isset($_FILES['user_avatar']) && $_FILES['user_avatar']['size']!=0)\n $avatar = $_FILES['user_avatar'];\n else\n $avatar = null;\n\n $user = new User($_POST);\n if($user->save($avatar)){\n if(($avatar && user::uploadAvatar($user->email,$avatar)) || !$avatar){\n Flash::addMessage('Registered Successfully, Please login!');\n }else{\n Flash::addMessage('Registered Successfully, Please login! Uploaded Avatar file not allowed. Please try uploading Avatar later through Profile page');\n }\n\n if(isset($_SESSION['admin']) && $_SESSION['admin'])\n $this->redirect('/museum/gamify/admin');\n else\n $this->redirect('/museum/gamify');\n\n }else{\n if(isset($_SESSION['admin']) && $_SESSION['admin'])\n View::renderTemplate('Admin/index.html', array(\n 'user' => $user));\n else\n View::renderTemplate('Home/index.html', array(\n 'user' => $user));\n //var_dump($user->errors);\n } \n }", "public function create_user()\n\t{\n\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\t// redirect them to the login page\n\t\t\tredirect('/admin/login', 'refresh');\n\t\t}\n\t\t$this->data['title'] = $this->lang->line('create_user_heading');\n\n\t\t//See the ion_auth config to check if allow_user_registration is TRUE\n\t\tif( ! $this->config->item('allow_user_registration', 'ion_auth')){\n\n\t\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t\t{\n\t\t\t\tredirect('/admin', 'refresh');\n\t\t\t}\n\n\t\t}\n\n\n\t\t$tables = $this->config->item('tables', 'ion_auth');\n\t\t$identity_column = $this->config->item('identity', 'ion_auth');\n\t\t$this->data['identity_column'] = $identity_column;\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'trim|required');\n\t\t$this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'trim|required');\n\t\tif ($identity_column !== 'email')\n\t\t{\n\t\t\t$this->form_validation->set_rules('identity', $this->lang->line('create_user_validation_identity_label'), 'trim|required|is_unique[' . $tables['users'] . '.' . $identity_column . ']');\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email|is_unique[' . $tables['users'] . '.email]');\n\t\t}\n\t\t$this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\n\t\t$this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\n\t\t$this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n\t\tif ($this->form_validation->run() === TRUE)\n\t\t{\n\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t$identity = ($identity_column === 'email') ? $email : $this->input->post('identity');\n\t\t\t$password = $this->input->post('password');\n\n\t\t\t$additional_data = array(\n\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t'company' => $this->input->post('company'),\n\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t);\n\t\t}\n\t\tif ($this->form_validation->run() === TRUE && $this->ion_auth->register($identity, $password, $email, $additional_data))\n\t\t{\n\t\t\t// check to see if we are creating the user\n\t\t\t// redirect them back to the admin page\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\tredirect(\"auth\", 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create user form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['first_name'] = array(\n\t\t\t\t'name' => 'first_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'first_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t);\n\t\t\t$this->data['last_name'] = array(\n\t\t\t\t'name' => 'last_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'last_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t);\n\t\t\t$this->data['identity'] = array(\n\t\t\t\t'name' => 'identity',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'identity',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('identity'),\n\t\t\t);\n\t\t\t$this->data['email'] = array(\n\t\t\t\t'name' => 'email',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'email',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t);\n\t\t\t$this->data['company'] = array(\n\t\t\t\t'name' => 'company',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'company',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t);\n\t\t\t$this->data['phone'] = array(\n\t\t\t\t'name' => 'phone',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'phone',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t);\n\t\t\t$this->data['password'] = array(\n\t\t\t\t'name' => 'password',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t);\n\t\t\t$this->data['password_confirm'] = array(\n\t\t\t\t'name' => 'password_confirm',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password_confirm',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t);\n\n\n\t\t\t$this->load->view('templates/header',$this->data);\n\t\t\t$this->load->view('/admin/create_user');\n\t\t\t$this->load->view('templates/footer');\n\t\t}\n\t}", "public function createuser(){\n\t\t Input::replace($this->arrayStripTags(Input::all()));\n\t\t\tif(Input::isMethod('post')){\n\t\t\t\t$rules = array(\n\t\t\t\t'first_name' \t=> 'required',\n\t\t\t\t'last_name' \t\t=> 'required',\n\t\t\t\t'username' \t=> 'required',\n\t\t\t\t'email' \t\t=> 'required|email|unique:users,email',\n\t\t\t\t'password' \t\t=> 'required',\n\t\t\t\t'confirm_password' => 'required|same:password',\n\t\t\t\t'phone' \t\t\t=> 'required',\n\t\t\t\t);\n\t\t\t$validator = Validator::make(Input::all(),$rules);\n\t\t\t\tif ($validator->fails()){\n\t\t\t\t\t$messages = $validator->messages();\n\t\t\t\t\t return Redirect::back()->withErrors($validator)->withInput();\n\t\t\t\t}else{\n\t\t\t\t\t\t$first_name \t\t\t= \tInput::get('first_name');\n\t\t\t\t\t\t$last_name \t\t\t\t= \tInput::get('last_name');\n\t\t\t\t\t\t$email \t\t\t\t\t\t= \tInput::get('email');\n\t\t\t\t\t\t$image\t\t\t\t\t\t=\t\tInput::file('image');\n\t\t\t\t\t\t$verify_string \t\t= \t$this->generate_random_string(20); // generate random string\n\t\t\t\t\t\tif($image){\n\t\t\t\t\t\t\t /* image uploading process start */\n\t\t\t\t\t\t\t$filename \t= \ttime() . '_'.$image->getClientOriginalName();\n\t\t\t\t\t\t\t$path \t\t\t= \tpublic_path('uploads/users/' . $filename);\n\t\t\t\t\t\t\t$path2 \t\t\t= \tpublic_path('uploads/users/50x50/' . $filename);\n\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize(50,50)->save($path2);\n\t\t\t\t\t\t\tImage::make($image->getRealPath())->save($path);\n\t\t\t\t\t\t\t\t$x \t\t= \t100;\n\t\t\t\t\t\t\t\t$y \t\t= \t100;\n\t\t\t\t\t\t\tfor($i=1;$i<6;$i++){\n\t\t\t\t\t\t\t\t$path \t=\tpublic_path('uploads/users/'.$x.'x'.$y.'/'. $filename);\n\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize($x,$y)->save($path);\n\t\t\t\t\t\t\t\t$x = $x+100;\n\t\t\t\t\t\t\t\t$y = $y+100;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t /* image uploading process end */\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$user \t\t= \tnew AdminUser;\n\t\t\t\t\t\t$saveuser \t= \t$user->SaveUser($filename,$verify_string); //calls function for create user.\n\t\t\t\t\t\tif($saveuser){\n\t\t\t\t\t\t\t/* Email sending process starts */\n\t\t\t\t\t\t\t$loginurl\t\t\t\t\t=\t\turl('/login');\n\t\t\t\t\t\t\t$full_name\t\t\t\t= \t$first_name.' '.$last_name;\n\t\t\t\t\t\t\t$validateurl = \tURL('/login/'.$verify_string);\n\t\t\t\t\t\t\t$route_url\t\t\t\t=\t\tURL::to('/login/'.$verify_string);\n\t\t\t\t\t\t\t$replace_array \t\t= \tarray($full_name,$validateurl,$route_url);\n\t\t\t\t\t\t\t/* call email sending function */\t$this->mail_send($action='account_verification',$email,$full_name,$replace_array);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tSession::flash('flash_error', trans(\"Technical error please try again later.\"));\n\t\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tSession::flash('flash_success', trans(\"User is successfully registered & email has been sent to user with verification link.\"));\n\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t}\n\t\t}else{\n\t\t\t\treturn View::make('admin.pages.users.add');\n\t\t\t }\n\t }", "public function createUserDetail($userName,$password,$email,$about,$onlineStatus,$maxContacts,$maxFavorites,$birthday,$gender,$avatarFile,$thumbFile,$go_id,$reg_status,$invite_user_id,$create_id,$desired_team_title='',$signup_team_id=null)\r\n {\r\n \r\n $now = time();\r\n \r\n $valueArray = array();\r\n $valueArray['name'] = $userName;\r\n $valueArray['email'] = $email;\r\n $valueArray['password'] = $password;\r\n $valueArray['about'] = $about;\r\n $valueArray['online_status'] =$onlineStatus;\r\n $valueArray['max_contact_count'] = $maxContacts;\r\n $valueArray['max_favorite_count'] = $maxFavorites;\r\n $valueArray['birthday'] = $birthday;\r\n $valueArray['gender'] = $gender;\r\n $valueArray['avatar_file_id'] = $avatarFile;\r\n $valueArray['avatar_thumb_file_id'] = $thumbFile;\r\n $valueArray['created'] = $now;\r\n $valueArray['modified'] = $now;\r\n $valueArray['go_id'] = $go_id; \r\n $valueArray['reg_status'] = $reg_status; \r\n $valueArray['invite_user_id'] = $invite_user_id; \r\n $valueArray['create_id'] = $create_id; \r\n $valueArray['desired_team_title'] = $desired_team_title; \r\n $valueArray['signup_team_id'] = $signup_team_id;\r\n if($this->DB->insert('user',$valueArray)){\r\n return $this->DB->lastInsertId(\"_id\");\r\n }else{\r\n return null;\r\n }\r\n \r\n }", "function createUsers(){\n\n\t\t\n\t\t\n\t\t$this->copyFrom('POST');\n\t\t$this->save(); // execute\n\t}", "public function createUser(){\n $post = $this->_app->request->post();\n \n // Load the request schema\n $requestSchema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n \n // Get the alert message stream\n $ms = $this->_app->alerts; \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $ms->addMessageTranslated(\"danger\", \"ACCESS_DENIED\");\n $this->_app->halt(403);\n }\n\n // Set up Fortress to process the request\n $rf = new \\Fortress\\HTTPRequestFortress($ms, $requestSchema, $post); \n \n // Sanitize data\n $rf->sanitize();\n \n // Validate, and halt on validation errors.\n $error = !$rf->validate(true);\n \n // Get the filtered data\n $data = $rf->data(); \n \n // Remove csrf_token, password confirmation from object data\n $rf->removeFields(['csrf_token, passwordc']);\n \n // Perform desired data transformations on required fields. Is this a feature we could add to Fortress?\n $data['user_name'] = strtolower(trim($data['user_name']));\n $data['display_name'] = trim($data['display_name']);\n $data['email'] = strtolower(trim($data['email']));\n $data['active'] = 1;\n \n // Check if username or email already exists\n if (UserLoader::exists($data['user_name'], 'user_name')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_USERNAME_IN_USE\", $data);\n $error = true;\n }\n\n if (UserLoader::exists($data['email'], 'email')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_EMAIL_IN_USE\", $data);\n $error = true;\n }\n \n // Halt on any validation errors\n if ($error) {\n $this->_app->halt(400);\n }\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primaryGroup = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Set default values if not specified or not authorized\n if (!isset($data['locale']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"locale\"]))\n $data['locale'] = $this->_app->site->default_locale;\n \n if (!isset($data['title']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"title\"])) {\n // Set default title for new users\n $data['title'] = $primaryGroup->new_user_title;\n }\n \n if (!isset($data['primary_group_id']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"primary_group_id\"])) {\n $data['primary_group_id'] = $primaryGroup->id;\n }\n \n // Set groups to default groups if not specified or not authorized to set groups\n if (!isset($data['groups']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"groups\"])) {\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n $data['groups'] = [];\n foreach ($default_groups as $group_id => $group){\n $data['groups'][$group_id] = \"1\";\n }\n }\n \n // Hash password\n $data['password'] = Authentication::hashPassword($data['password']);\n \n // Create the user\n $user = new User($data);\n\n // Add user to groups, including selected primary group\n $user->addGroup($data['primary_group_id']);\n foreach ($data['groups'] as $group_id => $is_member) {\n if ($is_member == \"1\"){ \n $user->addGroup($group_id); \n }\n }\n \n // Store new user to database\n $user->store(); \n \n // Success message\n $ms->addMessageTranslated(\"success\", \"ACCOUNT_CREATION_COMPLETE\", $data);\n }", "function autoregister_create_new_user($itemId)\n {\n $item = Item::newInstance()->findByPrimaryKey($itemId['pk_i_id']);\n // if not exist user\n if( $item['fk_i_user_id'] == NULL ) {\n // create new user + send email\n $name = $item['s_contact_name'];\n $email = $item['s_contact_email'];\n // prepare data for register user\n $aux_password = osc_genRandomPassword();\n // clear params ....\n $input = array();\n $input['s_name'] = Params::getParam('s_name') ;\n Params::setParam('s_name', $name ); // from inserted item\n $input['s_email'] = Params::getParam('s_email') ;\n Params::setParam('s_email', $email ); // from inserted item\n $input['s_password'] = Params::getParam('s_password') ;\n Params::setParam('s_password', $aux_password ); // generated\n $input['s_password2'] = Params::getParam('s_password2') ;\n Params::setParam('s_password2', $aux_password ); // generated\n $input['s_website'] = Params::getParam('s_website') ;\n Params::setParam('s_website', '');\n $input['s_phone_land'] = Params::getParam('s_phone_land') ;\n Params::setParam('s_phone_land', '');\n $input['s_phone_mobile'] = Params::getParam('s_phone_mobile') ;\n Params::setParam('s_phone_mobile', '');\n $input['countryId'] = Params::getParam('countryId');\n Params::setParam('countryId', '');\n $input['regionId'] = Params::getParam('regionId');\n Params::setParam('regionId', '');\n $input['cityId'] = Params::getParam('cityId');\n Params::setParam('cityId', '');\n $input['cityArea'] = Params::getParam('cityArea') ;\n Params::setParam('cityArea', '');\n $input['address'] = Params::getParam('address') ;\n Params::setParam('address', '');\n $input['b_company'] = (Params::getParam('b_company') != '' && Params::getParam('b_company') != 0) ? 1 : 0 ;\n Params::setParam('b_company', '0');\n\n require_once LIB_PATH . 'osclass/UserActions.php' ;\n $userActions = new UserActions(false) ;\n $success = $userActions->add() ;\n\n switch($success) {\n case 1: osc_add_flash_ok_message( _m('The user has been created. An activation email has been sent')) ;\n $success = true;\n break;\n case 2: osc_add_flash_ok_message( _m('Your account has been created successfully')) ;\n $success = true;\n break;\n case 3: osc_add_flash_warning_message( _m('The specified e-mail is already in use')) ;\n $success = false;\n break;\n case 4: osc_add_flash_error_message( _m('The reCAPTCHA was not entered correctly')) ;\n $success = false;\n break;\n case 5: osc_add_flash_warning_message( _m('The email is not valid')) ;\n $success = false;\n break;\n case 6: osc_add_flash_warning_message( _m('The password cannot be empty')) ;\n $success = false;\n break;\n case 7: osc_add_flash_warning_message( _m(\"Passwords don't match\")) ;\n $success = false;\n break;\n }\n\n if($success) {\n Log::newInstance()->insertLog('plugin_autoregister', 'autoregister', '', $email.' '.$_SERVER['REMOTE_ADDR'], 'autoregister', osc_logged_admin_id()) ;\n // update user of item\n $user = User::newInstance()->findByEmail($email);\n Item::newInstance()->update(array('fk_i_user_id' => $user['pk_i_id'] ), array('pk_i_id' => $itemId ) );\n $item = Item::newInstance()->findByPrimaryKey($itemId);\n\n autoregister_sendMail($email, $user, $aux_password);\n\n // not activated\n if( $item['b_active'] != 1 ) {\n osc_run_hook('hook_email_item_validation', $item);\n }\n }\n\n // set params again\n Params::setParam('s_name', $input['s_name']);\n Params::setParam('s_email', $input['s_email']);\n Params::getParam('s_password', $input['s_password']) ;\n Params::getParam('s_password2', $input['s_password2']) ;\n Params::setParam('s_website', $input['s_website']);\n Params::setParam('s_phone_land', $input['s_phone_land']);\n Params::setParam('s_phone_mobile', $input['s_phone_mobile']);\n Params::setParam('countryId', $input['countryId']);\n Params::setParam('regionId', $input['regionId']);\n Params::setParam('cityId', $input['cityId']);\n Params::setParam('cityArea', $input['cityArea'] );\n Params::setParam('address', $input['address']);\n Params::setParam('b_company', $input['b_company']);\n // end\n }\n }", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createUser(){\n \n $password = DbrLib::rand_string(8);\n \n /**\n * create username \n */\n $firstName = strtolower(self::translitStringToAscii($this->pprs_first_name));\n $secondName = strtolower(self::translitStringToAscii($this->pprs_second_name));\n $username = $firstName . substr($secondName, 0, 1);\n $i = 1;\n while(User::model()->findByAttributes(['username'=>$username])){\n $i ++;\n if($i> strlen($secondName)){\n $username = $firstName . DbrLib::rand_string(2);\n }\n $username = $firstName . substr($secondName, 0, $i); \n }\n \n /**\n * get email from person contacts\n */\n $contacts = $this->ppcnPersonContacts;\n $email = '';\n foreach($contacts as $contact){\n if($contact->ppcn_pcnt_type == PcntContactType::TYPE_EMAIL ){\n $email = trim($contact->ppcn_value);\n }\n }\n \n /**\n * create user record\n */\n $user = new User();\n $user->username = $username;\n $user->password = $password;\n $user->email = $email;\n $user->status = User::STATUS_ACTIVE;\n \n if(!$user->validate()){\n return CHtml::errorSummary($user);\n }\n \n $user->save();\n \n /**\n * create profile record\n */\n $profile=new Profile;\n $profile->user_id=$user->id;\n $profile->first_name = $this->pprs_first_name;\n $profile->last_name = $this->pprs_second_name;\n $profile->sys_ccmp_id = Yii::app()->sysCompany->getActiveCompany();\n $profile->person_id=$this->primaryKey;\n\t\t$profile->save(); \n \n return true;\n \n \n }", "public function actionCreate()\n {\n $model = new User;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // получаем изображение для последующего сохранения\n $file = UploadedFile::getInstance($model, 'image');\n if ($file && $file->tempName) {\n $fileName = self::_saveFile($model, $file);\n if ($fileName) {\n $model->image = $fileName;\n } else {\n // уведомить пользователя, админа о невозможности сохранить файл\n }\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n MainFunctions::register('Добавлен пользователь ' . $model->name);\n return $this->redirect(['view', 'id' => $model->_id]);\n } else {\n return $this->render('create', ['model' => $model]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create_user()\n {\n $this->data['title'] = $this->lang->line('create_user_heading');\n\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n {\n redirect('auth', 'refresh');\n }\n\n $tables = $this->config->item('tables','ion_auth');\n $identity_column = $this->config->item('identity','ion_auth');\n $this->data['identity_column'] = $identity_column;\n\n // validate form input\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\n if($identity_column!=='email')\n {\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\n }\n else\n {\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\n }\n $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\n $this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n if ($this->form_validation->run() == true)\n {\n $email = strtolower($this->input->post('email'));\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\n $password = $this->input->post('password');\n\n $additional_data = array(\n 'first_name' => $this->input->post('first_name'),\n 'last_name' => $this->input->post('last_name'),\n 'company' => $this->input->post('company'),\n 'phone' => $this->input->post('phone'),\n );\n }\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\n {\n // check to see if we are creating the user\n $this->emailNotification($identity, $email, $password);\n // redirect them back to the admin page\n $this->session->set_flashdata('message', $this->ion_auth->messages());\n redirect(\"auth\", 'refresh');\n }\n else\n {\n\t\t\t\n\t\t\t//var_dump($ss);exit;\n // display the create user form\n // set the flash data error message if there is one\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n $this->data['first_name'] = array(\n 'name' => 'first_name',\n 'id' => 'first_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('first_name'),\n );\n $this->data['last_name'] = array(\n 'name' => 'last_name',\n 'id' => 'last_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('last_name'),\n );\n $this->data['identity'] = array(\n 'name' => 'identity',\n 'id' => 'identity',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('identity'),\n );\n $this->data['email'] = array(\n 'name' => 'email',\n 'id' => 'email',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('email'),\n );\n $this->data['organisation'] = array(\n 'name' => 'company',\n 'id' => 'organisation',\n 'type' => 'select',\n 'options' => $this->get_options(),\n );\n $this->data['company'] = array(\n 'name' => 'company',\n 'id' => 'company',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('company'),\n );\n $this->data['phone'] = array(\n 'name' => 'phone',\n 'id' => 'phone',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('phone'),\n );\n $this->data['password'] = array(\n 'name' => 'password',\n 'id' => 'password',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password'),\n );\n $this->data['password_confirm'] = array(\n 'name' => 'password_confirm',\n 'id' => 'password_confirm',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password_confirm'),\n );\n\n $this->_render_page('auth/create_user', $this->data);\n }\n }", "public function create()\n {\n $this->resetFields();\n //DAN MEMBUKA AREA\n $this->openUser();\n }", "public function crea_user(){\n\t\tif ($this->input->post('tipo_persona')==\"Natural\") {\n\t\t\t$nombres = 'Nombres del titular';\n\t\t\t$apellid = 'Apellidos del titular';\n\t\t\t$cedulas = 'Cédula de identidad';\n\t\t\t$numerif = 'RIF del titular';\n\t\t} else {\n\t\t\t$nombres = 'Razón social';\n\t\t\t$apellid = 'Representante legal';\n\t\t\t$cedulas = 'C.I. Representante legal';\n\t\t\t$numerif = 'RIF de la empresa';\n\t\t}\n\t\tif ($this->input->post('nacionalidad')==\"Local\") {\n\t\t\t$condced = 'required|min_length[6]|max_length[8]|callback_validanumero';\n\t\t\t$condrif = 'required|min_length[9]|max_length[10]|callback_validarif';\n\t\t} else {\n\t\t\t$condced = 'required|min_length[6]|max_length[9]|callback_validanumero';\n\t\t\t$condrif = 'required|min_length[9]|max_length[11]|callback_validarif';\n\t\t}\n\t\t$this->form_validation->set_rules('tit_nombres', $nombres, 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tit_apellidos', $apellid, 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tit_cedula', $cedulas, $condced);\n\t\t$this->form_validation->set_rules('tit_rif', $numerif, $condrif);\n\t\tif ($this->input->post('tipo_persona')==\"Natural\") {\n\t\t\t$this->form_validation->set_rules('tit_fecha_nac', 'Fecha de nacimiento', 'required');\n\t\t\t$this->form_validation->set_rules('tit_edo_civil', 'Estado Civil', 'required');\n\t\t\t$this->form_validation->set_rules('tit_sexo', 'Sexo', 'required');\n\t\t\t$this->form_validation->set_rules('tit_profesion', 'Profesión', 'required|max_length[150]');\n\n\t\t\t$this->form_validation->set_rules('cot_nombres', 'Nombres del cotitular', 'max_length[150]');\n\t\t\t$this->form_validation->set_rules('cot_apellidos', 'Apellidos del cotitular', 'max_length[150]');\n\t\t\t$this->form_validation->set_rules('cot_cedula', 'Cédula de identidad', 'min_length[6]|max_length[9]|callback_validanumero');\n\t\t\t$this->form_validation->set_rules('cot_rif', 'RIF del cotitular', 'min_length[8]|max_length[11]|callback_validarif');\n\t\t}\n\t\t$this->form_validation->set_rules('calle', 'Calle/Avenida/Vereda', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('cruce', 'Cruce con/Entre calles', 'max_length[150]');\n\t\t$this->form_validation->set_rules('casa', 'Casa/Edificio', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('sector', 'Urbanización/Sector', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('piso', 'Piso Nro.', 'max_length[50]');\n\t\t$this->form_validation->set_rules('apto', 'Apto.', 'max_length[50]');\n\t\t$this->form_validation->set_rules('referencia', 'Punto de referencia', 'max_length[150]');\n\t\t$this->form_validation->set_rules('ciudad', 'Ciudad', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('municipio', 'Municipio', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('estado', 'Estado', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('parroquia', 'Parroquia', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('cod_postal', 'Código Postal', 'required|max_length[10]');\n\t\t$this->form_validation->set_rules('pais', 'País', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('tel_local', 'Teléfono Local', 'required|min_length[11]|max_length[50]|callback_validanumero');\n\t\t$this->form_validation->set_rules('tel_celular', 'Teléfono Celular', 'required|min_length[11]|max_length[50]|callback_validanumero');\n\t\t$this->form_validation->set_rules('email', 'Dirección de Correo Electrónico', 'required|max_length[150]|valid_email');\n/*\n\t\t$this->form_validation->set_rules('enrol_codigo', 'Código del enrolador', 'required|exact_length[5]|callback_validacodigo|callback_existecodigo');\n\t\t$this->form_validation->set_rules('enrol_nombre_completo', 'Nombres y Apellidos del enrolador', 'required|max_length[200]');\n\n\t\t$this->form_validation->set_rules('patroc_codigo', 'Código del patrocinador', 'required|exact_length[5]|callback_validacodigo|callback_existecodigo');\n\t\t$this->form_validation->set_rules('patroc_nombre_completo', 'Nombres y Apellidos del patrocinador', 'required|max_length[200]');\n*/\n\t\t$this->form_validation->set_rules('banco_nombre_cta', 'Nombre del titula de la cuenta', 'required|max_length[200]');\n\t\t$this->form_validation->set_rules('banco_numero_cta', 'Número de cuenta bancaria', 'required|min_length[13]|max_length[20]|callback_validanumero');\n\t\t$this->form_validation->set_rules('banco_nombre_bco', 'Nombre del Banco', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_sucursal', 'Sucursal bancaria', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_estado', 'Estado de ubicación del banco', 'required|max_length[150]');\n\t\t$this->form_validation->set_rules('banco_tipo_cta', 'Tipo de cuenta', 'required');\n\n\t\t$this->form_validation->set_message('required', 'El campo {field} es obligatorio, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('valid_email', 'Debe incluir un correo electrónico válido, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('max_length', 'El campo {field} no debe exceder de {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('min_length', 'El campo {field} debe tener al menos {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('exact_length', 'El campo {field} debe tener {param} caracteres, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('validanumero', 'El campo {field} sólo debe contener números, pulse atrás para corregir');\n\t\t$this->form_validation->set_message('validarif', 'El campo {field} debe contener el formato válido para RIF (1 letra: V, J ó E) y hasta 10 números sin guiones ni puntos, pulse atrás para corregir');\n\n\t\tif ($this->form_validation->run() == FALSE){\n $this->registro();\n } else {\n\t\t\t$data = new stdClass();\n\t\t\t$data->title = \"MANNA - La Provisión que cambiará tu vida\";\n\t\t\t$data->contenido = \"apl/auth/contrato\"; //aqui es la dirección física del controlador\n\t\t\t$data->panel_title = \"Afiliación de aliados comerciales - Página 3 de 3\";\n\n\t\t\t$data->tit_nombres = $this->input->post('tit_nombres');\n \t$data->tit_apellidos = $this->input->post('tit_apellidos');\n \t$data->tit_cedula = $this->input->post('tit_cedula');\n \t$data->tit_rif = $this->input->post('tit_rif');\n \t$data->tit_fecha_nac = $this->input->post('tit_fecha_nac');\n \t$data->tit_edo_civil = $this->input->post('tit_edo_civil');\n \t$data->tit_sexo = $this->input->post('tit_sexo');\n \t$data->tit_profesion = $this->input->post('tit_profesion');\n \t$data->cot_nombres = $this->input->post('cot_nombres');\n \t$data->cot_apellidos = $this->input->post('cot_apellidos');\n \t$data->cot_cedula = $this->input->post('cot_cedula');\n \t$data->cot_rif = $this->input->post('cot_rif');\n \t$data->cot_fecha_nac = $this->input->post('cot_fecha_nac');\n \t$data->cot_edo_civil = $this->input->post('cot_edo_civil');\n \t$data->cot_sexo = $this->input->post('cot_sexo');\n \t$data->calle = $this->input->post('calle');\n \t$data->cruce = $this->input->post('cruce');\n \t$data->casa = $this->input->post('casa');\n \t$data->sector = $this->input->post('sector');\n \t$data->piso = $this->input->post('piso');\n \t$data->apto = $this->input->post('apto');\n \t$data->referencia = $this->input->post('referencia');\n \t$data->ciudad = $this->input->post('ciudad');\n \t$data->municipio = $this->input->post('municipio');\n \t$data->estado = $this->input->post('estado');\n \t$data->parroquia = $this->input->post('parroquia');\n \t$data->cod_postal = $this->input->post('cod_postal');\n \t$data->pais = $this->input->post('pais');\n \t$data->tel_local = $this->input->post('tel_local');\n \t$data->tel_celular = $this->input->post('tel_celular');\n \t$data->email = $this->input->post('email');\n \t$data->enrol_codigo = $this->input->post('enrol_codigo');\n \t$data->enrol_nombre_completo = $this->input->post('enrol_nombre_completo');\n \t$data->patroc_codigo = $this->input->post('patroc_codigo');\n \t$data->patroc_nombre_completo = $this->input->post('patroc_nombre_completo');\n \t$data->banco_nombre_cta = $this->input->post('banco_nombre_cta');\n \t$data->banco_numero_cta = $this->input->post('banco_numero_cta');\n \t$data->banco_nombre_bco = $this->input->post('banco_nombre_bco');\n \t$data->banco_sucursal = $this->input->post('banco_sucursal');\n \t$data->banco_estado = $this->input->post('banco_estado');\n \t$data->banco_tipo_cta = $this->input->post('banco_tipo_cta');\n \t$data->tipo_persona = $this->input->post('tipo_persona');\n \t$data->nacionalidad = $this->input->post('nacionalidad');\n \t$data->tipo_afiliado = $this->input->post('tipo_afiliado');\n \t$data->tipo_kit = $this->input->post('tipo_kit');\n \t$data->fechapago = $this->input->post('fechapago');\n// \t$data->fechapago = substr($this->input->post('fechapago'),6,4).\"-\".substr($this->input->post('fechapago'),3,2).\"-\".substr($this->input->post('fechapago'),0,2);\n \t$data->numcomprobante = $this->input->post('numcomprobante');\n \t$data->bancoorigen = $this->input->post('bancoorigen');\n \t$data->envio = $this->input->post('envio'); \t\n \t$data->direccion_envio = $this->input->post('direccion_envio');\n\n\t\t\t$data->active = \"registro\";\n\t\t\t$this->load->view('menu',$data);\n\t\t}\n\t}", "function create_user()\n\t{\n\t\t$this->data['title'] = \"Create User\";\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t$tables = $this->config->item('tables','ion_auth');\n\n\t\t//validate form input\n\t\t$this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique['.$tables['users'].'.email]');\n\t\t$this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'required|xss_clean');\n\t\t$this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n\t\tif ($this->form_validation->run() == true)\n\t\t{\n\t\t\t$username = strtolower($this->input->post('first_name')) . ' ' . strtolower($this->input->post('last_name'));\n\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t$password = $this->input->post('password');\n\n\t\t\t$additional_data = array(\n\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t'company' => $this->input->post('company'),\n\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t);\n\t\t}\n\t\tif ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data))\n\t\t{\n\t\t\t//check to see if we are creating the user\n\t\t\t//redirect them back to the admin page\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\tredirect(\"auth\", 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//display the create user form\n\t\t\t//set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['first_name'] = array(\n\t\t\t\t'name' => 'first_name',\n\t\t\t\t'id' => 'first_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t);\n\t\t\t$this->data['last_name'] = array(\n\t\t\t\t'name' => 'last_name',\n\t\t\t\t'id' => 'last_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t);\n\t\t\t$this->data['email'] = array(\n\t\t\t\t'name' => 'email',\n\t\t\t\t'id' => 'email',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t);\n\t\t\t$this->data['company'] = array(\n\t\t\t\t'name' => 'company',\n\t\t\t\t'id' => 'company',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t);\n\t\t\t$this->data['phone'] = array(\n\t\t\t\t'name' => 'phone',\n\t\t\t\t'id' => 'phone',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t);\n\t\t\t$this->data['password'] = array(\n\t\t\t\t'name' => 'password',\n\t\t\t\t'id' => 'password',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t);\n\t\t\t$this->data['password_confirm'] = array(\n\t\t\t\t'name' => 'password_confirm',\n\t\t\t\t'id' => 'password_confirm',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_user', $this->data);\n\t\t}\n\t}", "function create_user ( $ID, $first_name, $last_name, $email ) {\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$pass=md5(uniqid($first_name.$last_name, true));\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json\";\n\tsystem(\"curl $url -F 'user[name]=$first_name $last_name' -F 'user[short_name]=$first_name' -F 'pseudonym[unique_id]=$email' -F 'pseudonym[password]=$pass' -F 'pseudonym[sis_user_id]=$ID' -H 'Authorization: Bearer $access_token'\");\n\t\n}", "public function createUser(){\n //richiamo le classi di cui avrò bisogno\n require_once \"./application/models/input_manager.php\";\n require_once \"./application/models/mail_manager.php\";\n\n $errors = array();\n\n //verifico il metodo di richiesta\n if($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n //verifico che i campi siano impostati e che non siano stringhe vuote\n if (isset($_POST['firstname']) && !empty($_POST['firstname']) && isset($_POST['lastname']) && !empty($_POST['lastname'])\n && isset($_POST['username']) && !empty($_POST['username']) &&\n isset($_POST['email']) && !empty($_POST['email'])) {\n\n //genero un nuovo input_manager e testo gli inserimenti\n $exists = false;\n $im = new input_manager();\n $firstname = filter_var($im->checkInputSpace($_POST['firstname']), FILTER_SANITIZE_STRING);\n $lastname = filter_var($im->checkInputSpace($_POST['lastname']), FILTER_SANITIZE_STRING);\n $username = filter_var($im->checkInput($_POST['username']), FILTER_SANITIZE_STRING);\n $email = filter_var($im->checkInput($_POST['email']), FILTER_SANITIZE_EMAIL);\n\n //verifico che la lunghezza dei campi corrisponda con quella consentita\n if(!(strlen($firstname) > 0 && strlen($firstname) <= 50) || !preg_match('/^[\\p{L}a-zA-Z\\' ]+$/', $firstname)){\n array_push($errors, \"Il nome deve essere lungo tra gli 1 e 50 caratteri\");\n }\n if(!(strlen($lastname) > 0 && strlen($lastname) <= 50) || !preg_match('/^[\\p{L}a-zA-Z\\' ]+$/', $lastname)){\n array_push($errors, \"Il cognome deve essere lungo tra gli 1 e 50 caratteri\");\n }\n if(!(strlen($username) > 0 && strlen($username) <= 50) || !preg_match('/^[\\p{L}a-zA-Z0-9\\d._\\- ]+$/', $username)){\n array_push($errors, \"Lo username deve essere lungo tra gli 1 e 50 caratteri\");\n }\n if(!(strlen($email) > 0 && strlen($email) <= 50) || !filter_var($email, FILTER_VALIDATE_EMAIL)){\n array_push($errors, \"L'email deve essere formattata nel seguente modo: [email protected]\");\n }\n\n //se sono di lunghezze sbagliate ritorno l'errore\n if(count($errors) != 0){\n $_SESSION['errors'] = $errors;\n $data = array(\n 'firstname' => $firstname,\n 'lastname' => $lastname,\n 'username' => $username,\n 'email' => $email\n );\n $_SESSION['data'] = $data;\n header('Location: ' . URL . 'newUser');\n exit();\n }\n\n //verifico che la password sia la stessa in entrambi i campi\n\n $users = (new utente_model)->getUsers();\n //verifico che l'email non sia già in uso\n foreach ($users as $row) {\n if ($row['email'] == $email) {\n array_push($errors, \"L'email è già in uso\");\n $exists = true;\n }\n }\n //se non esiste inserisco il nuovo utente nel db\n if(!$exists) {\n try {\n $password = bin2hex(random_bytes(4));\n (new utente_model)->addUser($firstname, $lastname, $username, $email, $password, true);\n unset($_POST);\n $mm = new mail_manager();\n $body = \"<h3>Un admin di Grotti Ticinesi ha creato un account con la tua email</h3>La password per accedervi è la seguente: <br><b>\" . $password . \"</b><br><br>Accedi dal seguente link: <a href='\" . URL . \"login'>Grotti ticino</a>\";\n $mm->sendMail($email, $body, \"Grotti Ticinesi - Benvenuto\");\n header('Location: ' . URL . 'admin');\n exit();\n }catch(Exception $e){\n $_SESSION['warning'] = $e->getCode() . \" - \" . $e->getMessage();\n header('Location: ' . URL . 'warning');\n exit();\n }\n }else{\n //se è già in uso ritorno l'errore\n $_SESSION['errors'] = $errors;\n $data = array(\n 'firstname' => $firstname,\n 'lastname' => $lastname,\n 'username' => $username,\n 'email' => $email\n );\n $_SESSION['data'] = $data;\n header('Location: ' . URL . 'newUser');\n exit();\n }\n //se le password non sono uguali ritorno l'errore\n }else{\n //se non sono stati inseriti tutti i dati ritorno l'errore\n array_push($errors, \"Inserire tutti i dati\");\n $_SESSION['errors'] = $errors;\n header('Location: ' . URL . 'newUser');\n exit();\n }\n }\n }", "public function initializeCreateAction() {\n\t\t$fieldConfigurationWithValues = $this->fieldConfiguration;\n\t\tif ($this->request->hasArgument('frontendUser')) {\n\t\t\t$frontendUserData = $this->request->getArgument('frontendUser');\n\t\t\t$errors = 0;\n\t\t\tforeach ($frontendUserData as $fieldName => $value) {\n\t\t\t\t// XSS sanitation\n\t\t\t\t$value = htmlspecialchars(strip_tags(trim($value)));\n\t\t\t\tif (array_key_exists($fieldName, $this->fieldConfiguration)) {\n\t\t\t\t\t// the field is allowed\n\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['value'] = $value;\n\t\t\t\t\tif ($this->fieldConfiguration[$fieldName]['mandatory']) {\n\t\t\t\t\t\t// the field is mandatory, thus it must not be empty\n\t\t\t\t\t\tif (empty($value)) {\n\t\t\t\t\t\t\t// Error: Empty mandatory field\n\t\t\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['cssClasses'] = 'has-error';\n\t\t\t\t\t\t\t$errors++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Validate e-mail address\n\t\t\t\t\t\t\tif ($fieldName === 'email' && GeneralUtility::validEmail($value) === FALSE) {\n\t\t\t\t\t\t\t\t// Error: Invalid e-mail address\n\t\t\t\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['cssClasses'] = 'has-error';\n\t\t\t\t\t\t\t\t$errors++;\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} else {\n\t\t\t\t\t// Unset fields that are not allowed for security reasons\n\t\t\t\t\tunset($frontendUserData[$fieldName]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($errors > 0) {\n\t\t\t\t$this->forward('new', NULL, NULL, array('fieldConfiguration' => $fieldConfigurationWithValues));\n\t\t\t} else {\n\t\t\t\t$this->forward('addAccountAndLogin', NULL, NULL, array('frontendUserData' => $frontendUserData));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->forward('new');\n\t\t}\n\n\t}", "public function create_user()\r\n {\r\n $this->data['title'] = $this->lang->line('create_user_heading');\r\n\r\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\r\n {\r\n //redirect('auth', 'refresh');\r\n }\r\n\r\n $tables = $this->config->item('tables','ion_auth');\r\n $identity_column = $this->config->item('identity','ion_auth');\r\n $this->data['identity_column'] = $identity_column;\r\n\r\n // validate form input\r\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\r\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\r\n if($identity_column!=='email')\r\n {\r\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\r\n }\r\n else\r\n {\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\r\n }\r\n $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\r\n $this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\r\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\r\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\r\n\r\n if ($this->form_validation->run() == true)\r\n {\r\n $email = strtolower($this->input->post('email'));\r\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\r\n $password = $this->input->post('password');\r\n\r\n $additional_data = array(\r\n 'first_name' => $this->input->post('first_name'),\r\n 'last_name' => $this->input->post('last_name'),\r\n 'company' => $this->input->post('company'),\r\n 'phone' => $this->input->post('phone'),\r\n );\r\n }\r\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\r\n {\r\n // check to see if we are creating the user\r\n // redirect them back to the admin page\r\n $this->session->set_flashdata('message', $this->ion_auth->messages());\r\n redirect(\"auth\", 'refresh');\r\n }\r\n else\r\n {\r\n // display the create user form\r\n // set the flash data error message if there is one\r\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\r\n\r\n $this->data['first_name'] = array(\r\n 'name' => 'first_name',\r\n 'id' => 'first_name',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('first_name'),\r\n );\r\n $this->data['last_name'] = array(\r\n 'name' => 'last_name',\r\n 'id' => 'last_name',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('last_name'),\r\n );\r\n $this->data['identity'] = array(\r\n 'name' => 'identity',\r\n 'id' => 'identity',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('identity'),\r\n );\r\n $this->data['email'] = array(\r\n 'name' => 'email',\r\n 'id' => 'email',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('email'),\r\n );\r\n $this->data['company'] = array(\r\n 'name' => 'company',\r\n 'id' => 'company',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('company'),\r\n );\r\n $this->data['phone'] = array(\r\n 'name' => 'phone',\r\n 'id' => 'phone',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('phone'),\r\n );\r\n $this->data['password'] = array(\r\n 'name' => 'password',\r\n 'id' => 'password',\r\n 'type' => 'password',\r\n 'value' => $this->form_validation->set_value('password'),\r\n );\r\n $this->data['password_confirm'] = array(\r\n 'name' => 'password_confirm',\r\n 'id' => 'password_confirm',\r\n 'type' => 'password',\r\n 'value' => $this->form_validation->set_value('password_confirm'),\r\n );\r\n\t\t\t\r\n\t\t\t$this->_render_page('auth/create_user', $this->data);\r\n }\r\n }", "public function createAction()\n {\n echo (new View('userCreate'))->render();\n }", "function actionAddUser($templateVars) {\n\n\t$property = propertiesNewModel();\n\n\tif(!empty($_POST) && isset($_POST['newPropertyForm'])) {\n\n\t\t$validForm = true;\n\n\t\t$property['name'] = $_POST['name'];\n\t\tif(empty($property['name'])) {\n\t\t\t$templateVars['nameError'] = 'Please enter a name for this property';\n\t\t\t$validForm = false;\n\t\t}\n\n\t\tif(empty($_FILES['logo']['name'])) {\n\t\t\t$templateVars['logoError'] = 'Please include a logo for for this property';\n\t\t\t$validForm = false;\n\t\t}\n\t\telse {\n\t\t\t$newLogo = $_FILES['logo']['name'];\n\t\t\t$newLogoTemp = $_FILES['logo']['tmp_name'];\n\t\t\t$newLogoType = $_FILES['logo']['type'];\n\t\t\tif(!in_array($newLogoType, $siteConfig['validLogoTypes'])) {\n\t\t\t\t$templateVars['logoError'] = 'Supported logo types are JPEG, GIF or PNG';\n\t\t\t\t$validForm = false;\n\t\t\t}\n\t\t}\n\n\t\tif($validForm == true) {\n\t\t\tpropertiesAddRecord($property);\n\t\t\t$property['id'] = dbLastId();\n\t\t\t$property['logo'] = generateLogoFilename($property['id'], $newLogo);\n\t\t\t//move_uploaded_file($newLogoTemp, APPLICATION_DIR.'/images/logos/'.$property['logo']);\n\t\t\tpropertiesUpdateRecord($property);\n\t\t\tredirectToPage('settings/properties/listing');\n\t\t}\n\n\t}\n\n\t$templateVars['property'] = $property;\n\n\treturn $templateVars;\n}", "public function createCompanyProfile($input);", "public function actionCreate()\n {\n $model = new UserProfile();\n\n $model->user_id = Yii::$app->user->identity->id;\n\n\n $POST_VARIABLE = Yii::$app->request->post('Place');\n echo $POST_VARIABLE['first_name'];\n\n if ($already_exists = RecordHelpers::userHas('user_profile')) {\n return $this->render('view', [\n\n 'model' => $this->findModel($already_exists),\n ]);\n\n } elseif ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash(\"success\", Yii::t('app', 'Profile successfully created!'));\n return $this->redirect(['view']);\n\n } else {\n// echo $model->user_id;\n return $this->render('create', [\n\n 'model' => $model,\n\n ]);\n }\n\n// if ($model->load(Yii::$app->request->post()) && $model->save()) {\n//\n// return $this->redirect(['view', 'id' => $model->id]);\n// } else {\n// return $this->render('create', [\n// 'model' => $model,\n// ]);\n// }\n }", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "function _create_user($user_data){\n \n $person_id=$this->model->insert($user_data);\n return $person_id;\n \n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function action_createblank(){\n\t\t\n\t\t\t$userinfo = array();\n\t\t\t\n\t\t\t$userinfo['mis'] = '';\n\t\t\t$userinfo['name'] = '';\n\t\t\t$userinfo['username'] = '';\n\t\t\t$userinfo['iohid'] = '';\n\t\t\t$userinfo['password'] = '';\n\t\t\t\n\t\t\t$userinfo['email'] = '';\n\t\t\t$userinfo['mobileno'] = '';\n\t\t\t$userinfo['dob'] = 'DD / MM / YYYY';\n\t\t\t$userinfo['gender'] = '';\n\t\t\t$userinfo['year'] = '';\n\t\t\t$userinfo['stream']= '';\n\t\t\t\n\t\t\t$userinfo['age'] = ''; \n\t\t\t$userinfo['orderid'] = '';\n\t\t\t$year = 'blank';\n\t\t\t$stream = 'blank';\n\t\t\t//$this->placepdfvalue(json_encode($userinfo),str_replace('coep2013_', '', $user->username).'_1', 'studentinfo.php');\n\t\t\t$this->placepdfvalue(json_encode($userinfo),'blank', 'stjohnhealthcard.php',$year,$stream );\n\t\t\tdie;\n\t}", "function create(){\n\t\t\t//getting default circle\n\t\t\t$def_circle = $this->circle_model->get_Circle(\"cursos\");\n\t\t\t$id = new MongoID($def_circle['_id']);\n\t\t\t\n\t\t\t$document = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'password' => $this->input->post('password'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'acl' => array(\n\t\t\t\t//asignamos el circulo cursos por default\n\t\t\t\t0 => array('circle' => $id)\n\t\t\t\t)\n\t\t\t);\t\t\n\t\t\t$this->user_model->add_User($document);\n\t\t}", "public function action_createforstjohn(){\n\t\ttry{\n\t\t$users = ORM::factory('stjohnuser')->where('file','=','false')->order_by('id','asc')->find_all();\n\n\t\t$arr_user = array();\n\t\tforeach($users as $user)\n\t\t{\n\t\t\tarray_push($arr_user,$user->iohid);\n\t\t}\n\t\techo 'before';\n\t\tforeach($arr_user as $user)\n\t\t{\n\t\t\t$userinfo = array();\n\t\t\t$coepuser = ORM::factory('stjohnuser')->where('iohid','=',$user)->find();\n\t\t\t\n\t\t\tif($coepuser->file == 'true'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$userinfo['mis'] = str_replace(\"SJ\",\"\",$coepuser->username);\n\t\t\t$userinfo['name'] = $coepuser->firstname;\n\t\t\t$userinfo['username'] = $coepuser->username;\n\t\t\t$userinfo['iohid'] = $coepuser->iohid;\n\t\t\t$userinfo['password'] = $coepuser->password;\n\t\t\techo ($coepuser->email == 0);\n\t\t\t\n\t\t\t$userinfo['email'] = $coepuser->email;\n\t\t\t$userinfo['mobileno'] = ($coepuser->MobileNumber==0)?'-':$coepuser->MobileNumber;\n\t\t\t$userinfo['dob'] = $coepuser->DOB;\n\t\t\t$userinfo['gender'] = $coepuser->gender;\n\t\t\t$userinfo['year'] = $coepuser->stream;\n\t\t\t$userinfo['stream']= $coepuser->div;\n\t\t\t\n\t\t\t $birthDate =str_replace(\"-\",\"/\",$userinfo['dob']);\n\t\t\t //explode the date to get month, day and year\n\t\t\t $birthDate = explode(\"/\", $birthDate);\n\t\t\t //get age from date or birthdate\n\t\t\t $age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date(\"md\") ? ((date(\"Y\")-$birthDate[2])-1):(date(\"Y\")-$birthDate[2]));\n\t\t\t$userinfo['age'] = $age; \n\t\t\t$userinfo['orderid'] = $coepuser->ordernumber;\n\t\t\t$year = trim($coepuser->year);\n\t\t\t$stream = trim($coepuser->div);\n\t\t\t//$this->placepdfvalue(json_encode($userinfo),str_replace('coep2013_', '', $user->username).'_1', 'studentinfo.php');\n\t\t\t$this->placepdfvalue(json_encode($userinfo),$coepuser->username, 'stjohnhealthcard.php',$year,$stream );\n\t\t\t$coepuser->file = 'true';$coepuser->save();\n\t\t}\n\t\tdie('done');}catch(Exception $e){\n\t\t\tvar_dump($e);die;\n\t\t}\n\t}", "public function CreateUser(string $name, \n string $username, \n string $email, \n string $password, \n string $birthdate)\n {\n\n }", "public function createAction() {\n\n // Verifica a chave de comunicacao da API\n if(!parent::checkApi()) {\n // Retorna erro 400 na requisição se a chave não estiver correta\n return http_response_code(400);\n } else {\n // Descriptografa os dados vindos por POST\n $this->post = parent::checkApi();\n }\n\n // \n if(!isset($this->post->userType) || $this->post->userType != 3) {\n $this->response->errorCode = 1;\n $this->response->errorMessage = 'Tipo de usuário deve ser CLIENTE';\n return $this->return();\n }\n\n // Instancia um novo validator que verifica o email\n $validation = new Validation();\n $validation->add(\n [\n \"user\",\n \"userType\",\n //\"ddd\",\n \"phone\",\n \"street\",\n \"number\",\n // \"state\",\n \"city\",\n ],\n new PresenceOf(\n [\n \"message\" => [\n \"user\" => \"Informe o nome\",\n //\"ddd\" => \"Informe o DDD do telefone\",\n \"phone\" => \"Informe o telefone\",\n \"street\" => \"Informe a rua\",\n \"number\" => \"Informe o número da casa\",\n // \"state\" => \"Informe o estado\",\n \"city\" => \"Informe a cidade\",\n \"userType\" => \"Informe o tipo de usuário\"\n ],\n ]\n )\n );\n\n $validation->add(\n [\n \"user\",\n //\"ddd\",\n \"phone\",\n \"street\",\n \"number\"\n ],\n new StringLength(\n [\n \"max\" => [ \n \"user\" => 30,\n //\"ddd\" => 2,\n \"phone\" => 11,\n \"street\" => 100,\n \"number\" => 10\n ],\n \"min\" => [\n \"user\" => 4,\n //\"ddd\" => 2,\n \"phone\" => 10,\n \"street\" => 1,\n \"number\" => 1 \n ],\n \"messageMaximum\" => [\n \"user\" => \"Nome com máximo 30 caracteres\",\n //\"ddd\" => \"DDD tem que ter 2 dígitos\",\n \"phone\" => \"Telefone máximo 11 dígitos\",\n \"street\" => \"Rua com máximo 100 caracteres\",\n \"number\" => \"Número com máximo 10 caracteres\" \n ],\n \"messageMinimum\" => [\n \"user\" => \"Nome com mínimo 4 caracteres\",\n //\"ddd\" => \"DDD tem que ter 2 dígitos\",\n \"phone\" => \"Telefone mínimo 8 dígitos\",\n \"street\" => \"Rua com no mínimo 1 dígitos\",\n \"number\" => \"Número com mínimo 1 dígito\"\n ] \n ]\n )\n );\n\n $validation->add(\n [\n //\"ddd\",\n \"phone\",\n ],\n new Digit(\n [\n \"message\" => [\n //\"ddd\" => \"DDD somente números\",\n \"phone\" => \"Telefone somente números\"\n ],\n ]\n ) \n );\n\n if(isset($this->post->email)) {\n $validation->add(\n [\n \"email\",\n ],\n new Email(\n [\n \"message\" => [\n \"email\" => \"Email inválido, digite novamente\"\n ],\n ]\n ) \n );\n }\n\n // Caso o email nao seja valido, retorna para Login e imprime a mensagem para o usuario.\n $messages = $validation->validate($this->post);\n\n if (count($messages)) {\n\n foreach ($messages as $message) {\n\n $this->response->errorCode = 1;\n $this->response->errorMessage = $message->getMessage();\n $this->response->errorField = $message->getField();\n\n // Retorno\n return $this->return();\n }\n }\n\n try {\n\n // Verifica se o CPF é válido\n if(isset($this->post->cpf)) {\n\n if(!parent::validateCPF($this->post->cpf)) {\n\n $this->response->errorField = 'cpf';\n \n throw new Exception('CPF inválido');\n }\n }\n\n // Verifica se o CNPJ é válido\n if(isset($this->post->cnpj)) {\n\n if(!parent::validateCNPJ($this->post->cnpj)) {\n\n $this->response->errorField = 'cnpj';\n \n throw new Exception('CNPJ inválido');\n }\n }\n\n // Validação da data\n if(isset($this->post->birthDate) && !empty($this->post->birthDate)) {\n\n $date = explode('/', $this->post->birthDate);\n\n // Invertido a posiçao de comparação do array para dar certo com o formato de data americano\n if(!checkdate($date[1], $date[0], $date[2])) {\n throw new Exception(\"Ano de nascimento inválido\");\n }\n }\n\n // Verifica se já existe um CPF cadastrado com o numero\n $clientCPF = Member::find([ \n 'CPF = :cpf:',\n 'bind' => [\n 'cpf' => $this->post->cpf\n ]\n ]);\n\n if(count($clientCPF) > 0) {\n throw new Exception(\"Já existe um CPF cadastrado com esse número\");\n }\n \n // Verifica se já existe um CNPJ cadastrado com o numero\n $clientCPF = Member::find([ \n 'CNPJ = :cnpj:',\n 'bind' => [\n 'cnpj' => $this->post->cnpj\n ]\n ]);\n\n if(count($clientCPF) > 0) {\n throw new Exception(\"Já existe um CNPJ cadastrado com esse número\");\n }\n\n // $transactionManager = new TransactionManager();\n // $this->transaction = $transactionManager->get();\n \n $member = new Member();\n //$member->setTransaction($this->transaction);\n $member->IDMBT = parent::sanitize($this->post->userType, 'int'); // isset($this->post->nameCompany) ? parent::sanitize($this->post->nameCompany, 'string') : NULL; //parent::sanitize((isset()) ? $this->post->userType $this->post->userType : null) , 'int');\n $member->Name = parent::sanitize($this->post->user, 'string');\n //$member->NameCompany = isset($this->post->nameCompany) ? parent::sanitize($this->post->nameCompany, 'string') : NULL;\n $member->Gender = isset($this->post->gender) ? parent::sanitize($this->post->gender, 'int') : NULL;\n $member->CPF = isset($this->post->cpf) ? parent::sanitize($this->post->cpf, 'int') : NULL;\n $member->CNPJ = isset($this->post->cnpj) ? parent::sanitize($this->post->cnpj, 'int') : NULL;\n $member->Entity = isset($this->post->entity) ? parent::sanitize($this->post->entity, 'int') : 1;\n\n\n // Salva o usuário\n if(!$member->save()) {\n foreach ($member->getMessages() as $message) {\n\n // Grava o erro\n parent::saveError(\n $this->dispatcher->getControllerName(),\n $this->dispatcher->getActionName(),\n $message,\n 'Erro ao salvar usuario novo cliente Member'\n );\n\n if($message->getCode() == 3) {\n throw new Exception($message->getMessage());\n \n } else {\n throw new Exception(parent::internalError()); \n }\n }\n }\n\n // Salva o contato do usuário\n $memberContact = new MemberContact();\n $memberContact->IDMB = $member->IDMB;\n $memberContact->Email = isset($this->post->email) ? $this->post->email : NULL;\n $memberContact->Phone = isset($this->post->phone) ? parent::sanitize($this->post->phone, 'int') : NULL;\n $memberContact->SecondPhone = isset($this->post->secondPhone) ? parent::sanitize($this->post->secondPhone, 'int') : NULL;\n\n // Salva o contato do usuário\n if(!$memberContact->save()) {\n foreach ($memberContact->getMessages() as $message) {\n\n // Grava o erro\n parent::saveError(\n $this->dispatcher->getControllerName(),\n $this->dispatcher->getActionName(),\n $message,\n 'Erro ao salvar o contato do novo cliente'\n );\n\n throw new Exception(parent::internalError()); \n }\n }\n\n // Salva o endereço do usuário\n $memberAddress = new MemberAddress();\n $memberAddress->IDMB = $member->IDMB;\n $memberAddress->IDGC = isset($this->post->city) ? parent::sanitize($this->post->city, 'int') : NULL;\n $memberAddress->IDGS = isset($this->post->state) ? parent::sanitize($this->post->state, 'int') : NULL;\n $memberAddress->Distric = isset($this->post->district) ? parent::sanitize($this->post->district, 'string') : NULL;\n $memberAddress->Street = isset($this->post->street) ? parent::sanitize($this->post->street, 'string') : NULL;\n $memberAddress->Number = isset($this->post->number) ? parent::sanitize($this->post->number, 'string') : NULL;\n $memberAddress->Complement = isset($this->post->complement) ? parent::sanitize($this->post->complement, 'string') : NULL;\n $memberAddress->ZipCode = isset($this->post->zipCode) ? parent::sanitize($this->post->zipCode, 'string') : NULL;\n\n // Salva o endereço do usuário\n if(!$memberAddress->save()) {\n \n //$this->transaction->rollBack();\n\n foreach ($memberAddress->getMessages() as $message) {\n\n parent::saveError(\n // Grava o erro\n $this->dispatcher->getControllerName(),\n $this->dispatcher->getActionName(),\n $message,\n 'Erro ao salvar o endereço do novo cliente'\n );\n \n throw new Exception(parent::internalError());\n \n }\n }\n\n // $this->useDynamicUpdate(true);\n\n // Salva a FK do endereço e do contato\n // $member->IDMBA = $memberAddress->IDMBA;\n // $member->IDMBC = $memberContact->IDMBC;\n\n // $member->update();\n\n // With bound parameters\n $query = $this->modelsManager->createQuery('UPDATE Member set IDMBA = :idmba:, IDMBC = :idmbc: WHERE IDMB = :idmb:');\n $updateMember = $query->execute(\n [\n 'idmb' => $member->IDMB,\n 'idmba' => $memberAddress->IDMBA,\n 'idmbc' => $memberContact->IDMBC\n ]\n );\n\n $this->response->successMessage = 'Cadastrado com sucesso!';\n\n return $this->return();\n\n } catch (Exception $e) {\n \n $this->response->errorCode = 1;\n $this->response->errorMessage = $e->getMessage();\n\n return $this->return();\n }\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "function CreateUser() {\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USER_TYPE] = $this->reseller->getUserType();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USERNAME] = $this->reseller->getUserLoginName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EMAIL_ID] = $this->reseller->getEmailId();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CONTACT_NO] = $this->reseller->getMobileNo();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_FULL_NAME] = $this->reseller->getFullName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ADDRESS] = $this->reseller->getAddress();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CITY] = $this->reseller->getCity();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_REGION] = $this->reseller->getRegion();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_COUNTRY] = $this->reseller->getCountry();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DOMAIN_NAME] = $this->reseller->getDomainName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EXPIRY_DATE] = $this->reseller->getExpiryDate();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ENABLE_CMS] = $this->reseller->getEnableCMS();\n $this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DLT_ENTITY_ID] = $this->reseller->getDltEntityId();\n\t\t\t$response = new sgc_callapi(sgc_constant::SGC_API, sgc_constant::SGC_ENDPOINT_RESELLER_CREATE_USER, $this->data, $this->header, sgc_common_api_params::API_COMMON_METHOD_POST, $this->useRestApi);\n\t\t\treturn $response->getResponse();\n\t\t}", "protected function create(array $data)\n {\n\n if( URL::previous() == \"http://localhost:8000/register/company\"){\n $type=\"company\";\n }\n if(URL::previous() ==\"http://localhost:8000/register/user\"){\n $type=\"user\";\n }\n\n $user=User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'user_type'=> $type,\n 'password' => bcrypt($data['password']),\n ]);\n\n if($type==\"company\"){\n Company::create([\n 'user_id' => $user->id,\n 'slug' => $this->slugCreator($data['name'],'company'),\n 'logo'=>'default.png',\n 'cover_photo'=>'default1.jpg'\n ]);\n }\n\n\n // return redirect('/login')->with('status', 'We sent you an activation code. Check your email.');\n\n return $user;\n }", "public function add_user_get(){\r\n if (!$this->pronet_model->add_user('Fname Lname', '7711223344553', '[email protected]', '31111225', '1990-01-01','134091830-2')) {\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 actionCreate(){ \n // function to create User.\n //redirect a user if not super admin\n\n $site_url = Yii::$app->params['yii_url'];\n $upload_url = \"\";\n if($site_url == \"http://dev.digitalvidya.com/assist\") {\n $upload_url - $site_url.\"/uploads/user_image/\";\n } else {\n $upload_url = $site_url . \"/uploads/\";\n }\n if (!Yii::$app->CustomComponents->check_permission('create_user')) {\n return $this->redirect(['site/index']);\n }\n\n $model = new DvUsers();\n if (!empty($model->course)) {\n $model->course = explode(',', $model->course);\n }\n\n\n if ($model->load(Yii::$app->request->post())) {\n if (!empty($model->course)) {\n $model->course = implode(\",\", $_POST['DvUsers']['course']);\n }\n\n if (isset($_POST['usermeta']['day_avail'])) {\n $day_avail = $_POST['usermeta']['day_avail'];\n }\n\n if (!empty($day_avail)) {\n $day_avail = implode(\",\", $_POST['usermeta']['day_avail']);\n }\n\n $userdata = Yii::$app->request->post();\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($userdata); die;\n\t\t\tif($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n\t\t\t\t$email = $userdata['DvUsers']['email'];\n\t\t\t\t$phone = $userdata['usermeta']['phone'];\n\t\t\t\t$fname = $userdata['DvUsers']['first_name'];\n\t\t\t\t$lname = $userdata['DvUsers']['last_name'];\n\t\t\t\t$fb_link = $userdata['usermeta']['fb_link'];\n\t\t\t\t$linkedin_link = $userdata['usermeta']['linkedin_link'];\n\t\t\t\t$twitter_link = $userdata['usermeta']['twitter_link'];\n\t\t\t\t\n\t\t\t\tif(isset($userdata['usermeta']['description'])){\n\t\t\t\t\t$desc = $userdata['usermeta']['description'];\n\t\t\t\t}else{\n\t\t\t\t\t$desc = \"\";\n\t\t\t\t}\n\n\t\t\t\n\t\t\t \n\t\t\t}\n\t\t\t\n $model->save();\n\n $uid = Yii::$app->db->getLastInsertID();\n\t\t\tif($userdata['usermeta']['role'] == 4){\n\t\t\t\t$usre_role = 1;\n\t\t\t\t$profile_visibility = $userdata['usermeta']['profile_visibility'];\n\t\t\t}else{\n\t\t\t\t$usre_role = 2;\n\t\t\t\t$profile_visibility = 1;\n\t\t\t}\n\n if($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n // ***************** Start of curl ************************\n \n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n CURLOPT_USERAGENT => 'Get course data',\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => [\n \n 'ta_email' => $email,\n 'tm_fname' => $fname,\n 'tm_lname' => $lname,\n 'tm_phone' => $phone,\n 'tm_facebook' => $fb_link,\n 'tm_linkedin' => $linkedin_link,\n 'tm_twitter' => $twitter_link,\n 'tm_description' => $desc,\n 'tm_image_url' => $upload_url.'img_'.$uid.'.jpg',\n 'tm_image_name' => 'img_'.$uid.'.jpg',\n 'profile_visibility' => $profile_visibility,\n\t\t\t\t\t\t'user_role' => $usre_role\n\n ]\n ]);\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n $resulst = json_decode($resp,true);\n curl_close($curl);\n\t\t\t\t//echo \"<pre>\";print_r($resulst);die;\n // ************* End of the curl ************************\n }\n\n $model->picture = UploadedFile::getInstance($model, 'picture');\n if (!empty($model->picture->baseName)) {\n $model->picture->saveAs('uploads/user_image/img_' . $uid . '.' . $model->picture->extension);\n $user_image = 'img_' . $uid . '.' . $model->picture->extension;\n Yii::$app->db->createCommand(\"UPDATE assist_users SET picture = '$user_image' WHERE id = '$uid' AND status = 1 \")->execute();\n }\n\n $usermeta = $_POST['usermeta'];\n unset($usermeta['day_avail']);\n\t\t\tif(isset($resulst['user_id'])){\n\t\t\t\t$usermeta['wp_user_id'] = $resulst['user_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\tif(isset($resulst['post_id'])){\n\t\t\t\t\n\t\t\t\t$usermeta['wp_post_id'] = $resulst['post_id'];\n\t\t\t\t$usermeta['trainer_profile_url'] = $_SERVER['SERVER_NAME'].\"/?p=\".$resulst['post_id'];\n\t\t\t}\n\n\n foreach ($usermeta as $key => $val) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => $key, 'meta_value' => $val])->execute();\n }\n\n if (!empty($day_avail)) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => 'day_avail', 'meta_value' => $day_avail])->execute();\n }\n\n $user_password = $_POST['DvUsers']['password']; \n\n // send email\n if ($usermeta['notify'] == 1) {\n $subject = Yii::$app->params['site_name'].\" New Account Invitation\";\n $body = \" <h3>Welcome to \". Yii::$app->params['site_name'].\"</h3>\n <p>Hi $model->first_name,</p>\n <p>Your login details are:</p>\n <p>Site URL: \". Yii::$app->params['yii_url'].\"</p>\n <p>Username: $model->username</p>\n <p>Password: $user_password</p>\n <br>\n <br>\n <p>Thanks and Regards</p>\n <p>Digital Vidya Team</p>\n \";\n\n $is_sent = Yii::$app->mailer->compose()\n ->setFrom('[email protected]')\n //->setTo('[email protected]')\n ->setTo($model->email)\n ->setBcc ('[email protected]')\n ->setSubject($subject)\n ->setHtmlBody($body)\n ->send();\n \n }\n\n return $this->redirect(['view', 'id' => $uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n\n if(strtolower(Request::method()) == \"post\"){\n $user_m = Model(\"User\");\n\n $data[\"name\"] = trim(Request::input(\"user\"));\n $data[\"password\"] = bcrypt(trim(md5(Request::input(\"password\"))));\n\n if($user_info = $user_m->userInfo(['name' => $data['name'] ])){\n $rsCode = -1001;\n $msg = $this->showMsg($rsCode);\n \n }\n\n\n $rs = $user_m->insert_user($data); \n\n $rsCode = $rs?1001:-1000;\n\n // dump($rs);\n $msg = $this->showMsg($rsCode); \n }\n\n return view('admin.foundation.user.create', ['title'=>\"CoG | Tell your world\"]);\n }", "public function store(UserCreateRequest $request)\n {\n // upload the image\n $image = $request->image->store('users');\n\n $new = auth()->user()->contacts()->create([\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'email' => $request->email,\n 'birthday' => $request->birthday,\n 'password' => Hash::make($request->password),\n 'picture' => $image,\n ]);\n\n return redirect()->route('users.index')->with('success', $new->fullName.' was created');\n }", "protected function create(array $data)\n {\n if($data['user_group'] == 'person'){\n return User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'user_group' => 'person',\n 'country_code' => $data['cou-code'],\n 'phone' => $data['mobile'],\n 'api_token' => str_random(60),\n ]); \n }\n elseif($data['user_group'] == 'company'){\n $company= new Company;\n $company->ar_company= $data['ar_company'];\n $company->en_company= $data['en_company'];\n $company->ar_info= $data['ar_info'];\n $company->en_info= $data['en_info'];\n $company->save();\n return User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'company_id' => $company->id,\n 'user_group' => 'company',\n 'country_code' => $data['cou-code'],\n 'phone' => $data['mobile'],\n 'api_token' => str_random(60),\n ]); \n } \n }", "public function create_user()\n {\n $this->data['title'] = $this->lang->line('create_user_heading');\n\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n {\n redirect('admin', 'refresh');\n }\n\n $tables = $this->config->item('tables','ion_auth');\n $identity_column = $this->config->item('identity','ion_auth');\n $this->data['identity_column'] = $identity_column;\n\n // validate form input\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\n if($identity_column!=='email')\n {\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\n }\n else\n {\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\n }\n\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n if ($this->form_validation->run() == true)\n {\n $email = strtolower($this->input->post('email'));\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\n $password = $this->input->post('password');\n\n $additional_data = array(\n 'first_name' => $this->input->post('first_name'),\n 'last_name' => $this->input->post('last_name'),\n 'company' => $this->input->post('company'),\n 'phone' => $this->input->post('phone'),\n );\n }\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\n {\n // check to see if we are creating the user\n // redirect them back to the admin page\n $this->session->set_flashdata('message', $this->ion_auth->messages());\n redirect(\"/admin/users\", 'refresh');\n }\n else\n {\n // display the create user form\n // set the flash data error message if there is one\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n $this->data['first_name'] = array(\n 'name' => 'first_name',\n 'id' => 'first_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('first_name'),\n );\n $this->data['last_name'] = array(\n 'name' => 'last_name',\n 'id' => 'last_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('last_name'),\n );\n $this->data['identity'] = array(\n 'name' => 'identity',\n 'id' => 'identity',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('identity'),\n );\n $this->data['email'] = array(\n 'name' => 'email',\n 'id' => 'email',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('email'),\n );\n $this->data['company'] = array(\n 'name' => 'company',\n 'id' => 'company',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('company'),\n );\n $this->data['phone'] = array(\n 'name' => 'phone',\n 'id' => 'phone',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('phone'),\n );\n $this->data['password'] = array(\n 'name' => 'password',\n 'id' => 'password',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password'),\n );\n $this->data['password_confirm'] = array(\n 'name' => 'password_confirm',\n 'id' => 'password_confirm',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password_confirm'),\n );\n\n\t\t\t$this->template->set('title', 'Users - Create');\n\t\t\t$this->template->load('admin/default_layout', 'contents' , 'admin/create_user', $this->data);\n }\n }", "public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()))\n {\n if(isset($_FILES['User']['name']['image']) && $_FILES['User']['name']['image'] != null)\n {\n if($model->image_path != '' && $model->image_path != null && file_exists(Yii::getAlias('@webroot').'/'.$model->image_path))\n {\n unlink(Yii::getAlias('@webroot').\"/\".$model->image_path);\n }\n $new_image['name'] = $_FILES['User']['name']['image'];\n $new_image['type'] = $_FILES['User']['type']['image'];\n $new_image['tmp_name'] = $_FILES['User']['tmp_name']['image'];\n $new_image['error'] = $_FILES['User']['error']['image'];\n $new_image['size'] = $_FILES['User']['size']['image'];\n\n $name = Yii::$app->common->normalUpload($new_image, Yii::$app->params['userimage']);\n $model->image_path = $name;\n }\n $model->password =md5($model->password);\n $model->i_by = Yii::$app->user->id;\n $model->i_date = time();\n $model->u_by = Yii::$app->user->id;\n $model->u_date = time();\n\n if($model->save(false))\n {\n $msg=\"User has been successfully added\";\n $flash_msg = \\Yii::$app->params['msg_success'].$msg.\\Yii::$app->params['msg_end'];\n \\Yii::$app->getSession()->setFlash('flash_msg', $flash_msg);\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "protected function create(array $data)\n {\n // if ($request->hasFile('image')) {\n // // your code here\n // }\n \n if(isset($data['image'])){\n if($data['image']->getClientOriginalName()){\n $ext = $data['image']->getClientOriginalExtension();\n $file = date('YmdHis').'_'.rand(1,999).'.'.$ext;\n $data['image']->storeAs('public/profile',$file);\n }else{\n $file = NULL;\n }\n }else{\n $file = NULL; \n }\n \n return User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => Hash::make($data['password']),\n 'lab_id' => NULL,\n 'phone' => $data['phone'],\n 'role' => 1,\n 'power' => 0,\n 'image' => $file,\n 'edu_dept' => $data['edu_dept'],\n 'edu_varsity' => $data['edu_varsity'],\n 'edu_country' => $data['edu_country'],\n 'bkash_trxid' => $data['trxid'],\n\n\n ]);\n }", "public function actionCreate()\n {\n $model = new User();\n\n $profile = new UserProfile();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $userProfile = Yii::$app->request->post('UserProfile');\n $profile->user_id = $model->id;\n $profile->phone = $userProfile['phone'];\n $profile->firstname = $userProfile['firstname'];\n $profile->lastname = $userProfile['lastname'];\n $profile->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'profile' => $profile,\n ]);\n }", "public function new_profile(){\n\n\t\t// -- error checking -- //\n\t\t$errors = array();\n\t\t\t\t\n\n\t\t\t\tif(empty($_POST) === false){\n\t\t\t\t\t$required_fields = array('full_name','location', 'user_bio');\n\n\n\t\t\t\t\tforeach($_POST as $key=>$value) {\n\t\t\t\t\t\tif (empty($value) && in_array($key, $required_fields) === true) {\n\t\t\t\t\t\t\t$errors[] = 'Please fill out all fields';\n\t\t\t\t\t\n\t\t\t\t\t\t\treturn $errors;\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}\n\t\t// if no errors found add user_profile data to the database.\n\t\t\t\tif(empty($_POST) === false && empty($errors) === true){\n\n\t\t\t\t\t$tmp_name = $_FILES['images']['tmp_name'];\n\t\t\t\t\t$uploadfilename = $_FILES['images'][\"name\"];\n\t\t\t\t\t$saveddate=date(\"mdy-Hms\");\n\t\t\t\t\t$newfilename = \"./uploads/user_image/\".basename($saveddate.\"-\".$uploadfilename);\n\t\t\t\t\t$user_file = '';\n\t\t\t\t\t\n\t\t\t\t\tif($_FILES['images']['name']){\n\t\t\t\t\t$user_file = basename($saveddate.\"-\".$uploadfilename);\n\t\t\t\t\t}\n\t\t\t\t\t//move file to storage\n\t\t\t\t\tmove_uploaded_file($tmp_name, $newfilename);\n\t\t\t\t\t\n\t\t\t\t\t//get current user\n\t\t\t\t\t$user_name = $_SESSION['username'];\n\t\t\t\t\t// get user id for the logged in user\n\t\t\t\t\t$user_id = Database::user_id_query($user_name);\n\t\t\t\t\t$full_name = isset($_POST['full_name'])? $_POST['full_name'] : null;\n\t\t\t\t\t$location = isset($_POST['location'])? $_POST['location'] : null;\n\t\t\t\t\t$user_bio = isset($_POST['user_bio'])? $_POST['user_bio'] : null;\n\t\t\t\t\t\n\t\t\t\t\t// put profile data into array \n\t\t\t\t\t$new_user_profile = array(\n\t\t\t\t\t\t'full_name' => $full_name,\n\t\t\t\t\t\t'location' => $location,\n\t\t\t\t\t\t'user_bio' => $user_bio,\n\t\t\t\t\t\t'user_id' => $user_id,\n\t\t\t\t\t\t'join_date' => ''\n\t\t\t\t\t\t);\n\n\t\t\t\t\tif($_FILES['images']['name']){\n\t\t\t\t\t\t$new_user_profile['user_file'] = $user_file;\n\t\t\t\t\t}\n\t\t\t\t\t//call static function to insert profile data array into the database\n\t\t\t\t\tUserProfileHelper::new_profile($new_user_profile);\n\t\t\t\t}\n\t}", "function newuser(){\n\t\t\tif(!empty($_POST['newemail']) && !empty($_POST['newpassword']) && !empty($_POST['newnombre']) && !empty($_POST['newpoblacion']) && !empty($_POST['newrol'])){\n\t\t\t\t$poblacion = filter_input(INPUT_POST,'newpoblacion',FILTER_SANITIZE_STRING);\n\t\t\t\t$nombre = filter_input(INPUT_POST,'newnombre',FILTER_SANITIZE_STRING);\n\t\t\t\t$password = filter_input(INPUT_POST,'newpassword',FILTER_SANITIZE_STRING);\n\t\t\t\t$email = filter_input(INPUT_POST,'newemail',FILTER_SANITIZE_STRING);\n\t\t\t\t$rol = filter_input(INPUT_POST,'newrol',FILTER_SANITIZE_STRING);\n\t\t\t\t$list = $this -> model -> adduser($nombre,$password,$email,$poblacion,$rol);\n \t\t$this -> ajax_set(array('redirect'=>APP_W.'admin'));\n\t\t\t}\n\t\t}", "public function action_create(){\n\t\ttry{\n\t\t$users = ORM::factory('coepuser')->where('file','=','false')->order_by('id','asc')->find_all();\n\n\t\t$arr_user = array();\n\t\tforeach($users as $user)\n\t\t{\n\t\t\tarray_push($arr_user,$user->iohid);\n\t\t}\n\t\techo 'before';\n\t\tforeach($arr_user as $user)\n\t\t{\n\t\t\t$userinfo = array();\n\t\t\t$coepuser = ORM::factory('coepuser')->where('iohid','=',$user)->find();\n\t\t\t\n\t\t\tif($coepuser->file == 'true'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$userinfo['mis'] = str_replace(\"coep\",\"\",$coepuser->username);\n\t\t\t$userinfo['name'] = $coepuser->firstname;\n\t\t\t$userinfo['username'] = $coepuser->username;\n\t\t\t$userinfo['iohid'] = $coepuser->iohid;\n\t\t\t$userinfo['password'] = $coepuser->password;\n\t\t\techo ($coepuser->email == 0);\n\t\t\t\n\t\t\t$userinfo['email'] = $coepuser->email;\n\t\t\t$userinfo['mobileno'] = ($coepuser->MobileNumber==0)?'-':$coepuser->MobileNumber;\n\t\t\t$userinfo['dob'] = $coepuser->DOB;\n\t\t\t$userinfo['gender'] = $coepuser->gender;\n\t\t\t$userinfo['year'] = $coepuser->year;\n\t\t\t$userinfo['stream']= $coepuser->stream;\n\t\t\t\n\t\t\t $birthDate =str_replace(\"-\",\"/\",$userinfo['dob']);\n\t\t\t //explode the date to get month, day and year\n\t\t\t $birthDate = explode(\"/\", $birthDate);\n\t\t\t //get age from date or birthdate\n\t\t\t $age = (date(\"md\", date(\"U\", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date(\"md\") ? ((date(\"Y\")-$birthDate[2])-1):(date(\"Y\")-$birthDate[2]));\n\t\t\t$userinfo['age'] = $age; \n\t\t\t$userinfo['orderid'] = $coepuser->ordernumber;\n\t\t\t$year = trim($coepuser->year);\n\t\t\t$stream = trim($coepuser->div);\n\t\t\t//$this->placepdfvalue(json_encode($userinfo),str_replace('coep2013_', '', $user->username).'_1', 'studentinfo.php');\n\t\t\t$this->placepdfvalue(json_encode($userinfo),$coepuser->username, 'coephealthcard.php',$year,$stream );\n\t\t\t$coepuser->file = 'true';$coepuser->save();\n\t\t}\n\t\tdie('done');}catch(Exception $e){\n\t\t\tvar_dump($e);die;\n\t\t}\n\t}", "function createPartner() {\n $data = array(\n 'partnerName' => $this->input->post('partnerName'),\n 'partnerLink' => $this->input->post('partnerLink'),\n );\n\t\t\tif ($this->input->post('partnerImg') != \"\"){\n\t\t\t\t$data['partnerImg'] = $this->input->post('file_upload');\n\t\t\t} \n $this->db->insert('partner', $data);\n }", "public function actionCreate() {\n $id_user = Yii::app()->user->getId();\n $model = User::model()->findByPk($id_user);\n $tipo = $model->id_tipoUser;\n if ($tipo == \"1\") {\n $model = new Consultor;\n $modelUser = new User;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Consultor'])) {\n $model->attributes = $_POST['Consultor'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n \n \n \n $senha = uniqid(\"\", true);\n $modelUser->password = $senha;\n $modelUser->username = $_POST['username'];\n $modelUser->email = trim($model->email);\n $modelUser->attributes = $modelUser;\n $modelUser->id_tipoUser = 4;\n $modelUser->senha = '0';\n\n if ($modelUser->save()) {\n\n $model->id_user = $modelUser->id;\n if ($model->save()) {\n $this->redirect(array('EnviaEmail', 'nomedestinatario' => $model->nome, \"emaildestinatario\" => $model->email, \"nomedeusuario\" => $modelUser->username, \"senha\" => $modelUser->password));\n }\n }\n \n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n \n }else {\n $this->redirect(array('User/ChecaTipo'));\n }\n }", "public function actionCreate()\n {\n $model = new User();\n $employee=new UserProfile();\n if ($model->load(Yii::$app->request->post()) && $employee->load(Yii::$app->request->post())) {\n $model->password=Yii::$app->getSecurity()->generatePasswordHash($model->password);\n if($model->save()){\n $employee->user_id=$model->id;\n $employee->photo = UploadedFile::getInstance($employee, 'photo');\n if ($employee->photo){ \n $photo_name='profile_'.date('Ymdhis').'.' . $employee->photo->extension; \n $employee->photo->saveAs(\\Yii::$app->basePath.'/web/images/' . $photo_name);\n $employee->photo=$photo_name;\n }\n if($employee->save())\n {\n return $this->redirect(['index']);\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'employee'=>$employee\n ]);\n }", "function createUser()\n {\n $userLogged = Auth::check(['administrateur']);\n \n // user\n $user = new User();\n \n $dateTime = new Datetime();\n $date = $dateTime->format('Y-m-d H:i:s'); \n $user->setValidate($date);\n \n $userManager = new UserManager();\n\n $formUser = new Form($user);\n\n // userType\n $userType = new UserType();\n $formUserType = new Form($userType);\n\n $userTypeManager = new UserTypeManager(); \n $listUserTypes = $userTypeManager->getListUserTypes();\n $listUserTypesSelect = $userTypeManager-> listUserTypesFormSelect($listUserTypes); // to display the content of the select of the usertypes, will be used in \"backView> user> _form.php\" \n\n // media (logo)\n $mediaManager = new MediaManager();\n $mediaUploadLogo = new Media(); //to have in the input field to upload a logo (by default all the variables of this Media entity are \"null\") \n $formMediaUploadLogo = new Form($mediaUploadLogo);\n\n // socialNetwork\n $socialNetwork = new SocialNetwork();\n $socialNetworkManager = new SocialNetworkManager();\n $formSocialNetwork = new Form($socialNetwork);\n\n // server processing and display of feedbacks \n if ($_SERVER['REQUEST_METHOD'] === 'POST') { // if a submission of the form (=> a creation of a user) has been made \n \n //for data validation\n $errors = [];\n \n //validation test of the form fields \n if (empty($_POST['firstName']) OR mb_strlen($_POST['firstName'])<=3) {\n $errors[] = 'Le champ firstName ne peut être vide et doit contenir plus de 3 caracteres';\n }\n if (empty($_POST['lastName']) OR mb_strlen($_POST['lastName'])<=3) {\n $errors[] = 'Le champ lastName ne peut être vide et doit contenir plus de 3 caracteres';\n }\n\n if (empty($_POST['email']) OR strpos($_POST['email'], '@') === false) {\n $errors[] = 'Le champ email ne peut être vide ou l\\'ecriture de votre adresse email est incorrect';\n }\n $idUserIidenticalData1 = $userManager->identicalDataSearch('email', $_POST['email']);\n if (!is_null($idUserIidenticalData1)) {\n $errors[] = 'Votre email a été déjà utilisé, vous devez en indiquer un autre';\n }\n \n if (empty($_POST['login']) OR mb_strlen($_POST['login'])<=3) {\n $errors[] = 'Le champ login ne peut être vide et doit contenir plus de 3 caracteres';\n }\n \n $idUserIidenticalData2 = $userManager->identicalDataSearch('login', $_POST['login']);\n if (!is_null($idUserIidenticalData2)) {\n $errors[] = 'Votre login a été déjà utilisé, vous devez en indiquer un autre';\n }\n\n if (empty($_POST['password']) OR mb_strlen($_POST['password'])<=3) {\n $errors[] = 'Le champ password ne peut être vide et doit contenir plus de 3 caracteres';\n }\n\n if (empty($errors)) {\n\n // we hashed the password\n $hashPsswords = hash('md5', $_POST['password']);\n\n // user database recording \n $user\n ->setFirstName($_POST['firstName'])\n ->setLastName($_POST['lastName'])\n ->setEmail($_POST['email'])\n ->setSlogan($_POST['slogan'])\n ->setLogin($_POST['login'])\n ->setPassword($hashPsswords)\n ->setUserType_id($_POST['userType_id'][0]); //because this data comes from a multiple select \n \n try{\n $lastRecordingUser = $userManager->addUser($user);// add the user to the database and get the last id of the users in the database via the return of the function\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n }\n \n // bdd recording of the media logo and the uploader file on the server in the media folder \n if (isset($_FILES['mediaUploadLogo']) AND $_FILES['mediaUploadLogo']['error']== 0) {\n \n // info variables \n $idMediaType = 2; // logo\n\n $file = $_FILES['mediaUploadLogo']; // file uploader \n $storagePath = searchDatasFile('imageStoragePath')[1]; // storage path of the uploader file (see globalFunctions.php file) \n $name = 'mediaLogo-'.pathinfo($file['name'])['filename'].'-'; \n $newNameUploaderFile = uniqid($name , true); // concatenation \"media-\" + name of the uploader file (without its extension + unique identifier (via uniqid) to have a unique identifier \n\n $extension_upload = pathinfo($file['name'])['extension']; // to retrieve the extension of the uploader file \n $pathFile = $storagePath.basename($newNameUploaderFile.'.'.$extension_upload); // storage path with new name of the media uploader \n\n // LOGO media bdd recording \n $mediaUploadLogo\n ->setPath($pathFile)\n ->setAlt($_POST['altFileMediaLogo'])\n ->setStatutActif(1)\n ->setMediaType_id($idMediaType)\n ->setUser_id($lastRecordingUser)\n ;\n \n try{\n $mediaManager->addMediaImage($mediaUploadLogo, CONFIGFILE, $file); //adding the media to the database and recovery via the id function of the last media in the database\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n }\n }\n \n // socialNetwork bdd recording \n if (!empty($_POST['socialNetwork'])) {\n \n $socialNetwork\n ->setUrl($_POST['socialNetwork'])\n ->setUser_id($lastRecordingUser)\n ;\n try\n {\n $socialNetworkManager->addSocialNetwork($socialNetwork);\n }\n catch (Exception $e)\n {\n $errors[] = $e->getMessage();\n }\n }\n\n setFlashErrors($errors); // to manage flash message errors (see globalFunctions.php file) \n\n header('Location: /backend/editUser/'.$lastRecordingUser.'?created=true');\n return http_response_code(302);\n\n }else{\n \n setFlashErrors($errors); // to manage flash message errors (see globalFunctions.php file) \n \n header('Location: /backend/createUser?created=false');\n return http_response_code(302);\n\n }\n }\n \n require'../app/Views/backViews/user/backCreateUserView.php';\n }", "public function createAction()\n {\n $result = [\n 'type' => 'error',\n 'message' => 'Missing parameters, this functionality expects a POST array called `user` with `email`, `given_name`, and `family_name` keys!'\n ];\n\n if ($this->request->hasPost('user')) {\n $formData = $this->request->getPost('user');\n $userService = new UserService(new Users());\n // validating the data\n if ($userService->validateData($formData, ['email', 'given_name', 'family_name'])) {\n // we have all of the data\n $result = $userService->createUser($formData);\n }\n }\n return $this->response->setJsonContent($result);\n }", "public function createAction()\n {\n var_dump($_POST);\n //exit();\n $user = new User($_POST);\n\n //if($user->save()){\n\n if($user_id=$user->save()){\n\n // Send the activation email\n $user->sendActivationEmail();\n\n // Login the user. Comment out first 2 lines\n /*session_regenerate_id(true);\n $_SESSION['user_id'] = $user_id;*/\n\n //$_SESSION['course_id'] = $user->course_name;\n\n /*$ug = new UserGroup($_SESSION);\n $ug->firstSubscription();*/\n\n // Flash the success message\n /*Flash::addMessage('Account Created Successfully');\n Flash::addMessage('Please check your email to activate your account');*/\n\n// $this->redirect('/payment/new');\n //$this->redirect('/Account/welcome');\n $this->redirect('/register/success');\n\n }else{\n\n foreach($user->errors as $error){\n Flash::addMessage($error,'danger');\n }\n View::renderBlade('register.index2',['arr'=>$_POST]);\n\n }\n\n }", "public function create() {\n //getting the active companies \n $company_name = CompanyInformation::where('status',1)->pluck('company_name','company_id');\n \treturn view('admin.user.create',['company_name'=>$company_name]);\n }", "public function actionCreate()\n {\n if (!Yii::$app->user->isGuest) {\n\n if (Yii::$app->user->can('createUser')) {\n\n $model = new Employees();\n $user = new User();\n\n $model->created_by = Yii::$app->user->identity->getId();\n $model->created_at = date('Y-m-d H:i');\n $model->status = Employees::ACTIVE;\n\n\n if ($model->load(Yii::$app->request->post()) && $user->load(Yii::$app->request->post())) {\n\n if($model->save()){\n\n $model->employee_image = UploadedFile::getInstance($model, 'employee_image');\n\n if ($model->employee_image != null) {\n $model->employee_image->saveAs('uploads/employee/' . $model->employee_image . '.' . $model->employee_image->extension);\n $model->image = $model->employee_image . '.' . $model->employee_image->extension;\n }\n\n $user->employee_id = $model->id;\n $user->\tcreated_at = date('Y-m-d H:i');\n $user->\tupdated_at = date('Y-m-d H:i');\n try {\n\n if ($user->save()) {\n\n Yii::$app->authManager->assign(Yii::$app->authManager->getRole($user->role), $user->id);\n\n Yii::$app->session->setFlash('', [\n 'type' => 'success',\n 'duration' => 5000,\n 'icon' => 'fa fa-check',\n 'title' => 'Notification',\n 'message' => 'Registration successfully registered',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 10000,\n 'icon' => 'fa fa-warning',\n 'title' => 'Notification',\n 'message' => 'User registration not successfully,username have already used',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n\n // Audit::setActivity('Duplicates user ID in User table ' . '(' . $model->id . ')', 'Wafanyakazi', 'Create', '', '');\n Employees::deleteAll(['id' => $model->id]);\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n }\n } catch (\\Exception $e) {\n\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 5000,\n 'icon' => 'fa fa-warning',\n 'message' => 'User registration not successfully',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n // Audit::setActivity('Duplicates user ID in User table ' . '(' . $model->id . ')', 'Wafanyakazi', 'Create', '', '');\n Employees::deleteAll(['id' => $model->id]);\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n\n }\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n }\n\n\n } else {\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 8000,\n 'icon' => 'fa fa-warning',\n 'title' => 'Notification',\n 'message' => 'You dont have a permission',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n return $this->redirect(['index']);\n }\n\n } else {\n $model = new LoginForm();\n return $this->redirect(['site/login',\n 'model' => $model,\n ]);\n }\n\n\n }", "function create_user()\r\n\t{\r\n\t\t$additional_data = array();\r\n\t\tif ($this->form_validation->run() == true)\r\n\t\t{\r\n\t\t\t$nickname \t= $this->input->post('nickname');\r\n\t\t\t$email \t= $this->input->post('email');\r\n\t\t\t$password \t= $this->input->post('password');\r\n\t\t\t$national\t= $this->input->post('national');\r\n\t\t\t$plan \t\t= $this->input->post('plan');\r\n\t\t\t$ed_level\t= $this->input->post('ed_level');\r\n\t\t\t$lang\t\t= $this->input->post('lang');\r\n\t\t\t$gender\t= $this->input->post('gender');\r\n\t\t\t\r\n\t\t\t$additional_data = array(\r\n\t\t\t\t'email'\t\t\t\t=> $email,\r\n\t\t\t\t'pass' \t\t\t=> $password,\r\n\t\t\t\t'nickname' \t\t\t=> $nickname,\r\n\t\t\t\t'last_name' \t\t\t=> '',\r\n\t\t\t\t'middle_name'\t\t\t=> '',\r\n\t\t\t\t'first_name'\t\t\t=> '',\r\n\t\t\t\t'gender'\t\t\t\t=> $gender,\r\n\t\t\t\t'addr1'\t\t\t\t=> '',\r\n\t\t\t\t'addr2'\t\t\t\t=> '',\r\n\t\t\t\t'addr3'\t\t\t\t=> '',\r\n\t\t\t\t'country'\t\t\t\t=> '',\r\n\t\t\t\t'zip_code'\t\t\t\t=> '',\r\n\t\t\t\t'nationality' \t\t=> $national,\r\n\t\t\t\t'ethnicity' \t\t\t=> '',\r\n\t\t\t\t'birthday_day' \t\t=> '',\r\n\t\t\t\t'birthday_month' \t\t=> '',\r\n\t\t\t\t'birthday_year' \t\t=> '',\r\n\t\t\t\t'language' \t\t\t=> $lang,\r\n\t\t\t\t'currently_school' \t=> '',\r\n\t\t\t\t'graduation_year' \t=> '',\r\n\t\t\t\t'area_of_interests' \t=> '',\r\n\t\t\t\t'major' \t\t\t\t=> '',\r\n\t\t\t\t'parents_email' \t\t=> '',\r\n\t\t\t\t'grade' \t\t\t\t=> $ed_level,\r\n\t\t\t\t'activationKey' \t\t=> mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand(),\r\n\t\t\t\t'remember_code'\t\t=> sha1($password)\r\n\t\t\t);\r\n\r\n\t\t}\r\n\r\n\r\n\t\tif ($this->form_validation->run() == true && $this->ion_auth->register($email, $password, $additional_data))\r\n\t\t{\r\n\t\t\t//check to see if we are creating the user\r\n\t\t\t//redirect them back to the admin page\r\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\r\n\t\t\tredirect(\"dashboard\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\r\n\t\t\t\r\n\t\t\t$this->session->set_flashdata('app_error', $this->ion_auth->errors());\r\n\t\t\t\r\n\t\t\t$data['national'] = $this->config->item('national');\r\n\t\t\t\r\n\t\t\t$data['nickname'] = array('name' => 'nickname',\r\n\t\t\t\t'id' => 'nickname',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'value' => $this->form_validation->set_value('nickname'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'NICKNAME *'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['email'] = array('name' => 'email',\r\n\t\t\t\t'id' => 'email',\r\n\t\t\t\t'type' => 'email',\r\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'EMAIL ADDRESS'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['password'] = array('name' => 'password',\r\n\t\t\t\t'id' => 'password',\r\n\t\t\t\t'type' => 'password',\r\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'PASSWORD'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['cpassword'] = array('name' => 'cpassword',\r\n\t\t\t\t'id' => 'cpassword',\r\n\t\t\t\t'type' => 'password',\r\n\t\t\t\t'value' => $this->form_validation->set_value('cpassword'),\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'CONFIRM PASSWORD'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['lang'] = array('name' => 'lang',\r\n\t\t\t\t'id' => 'lang',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'class' => 'form-control input-lg',\r\n\t\t\t\t'placeholder' => 'LANGUAGE SPOKEN'\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$data['show_form'] = \"show\";\r\n\r\n\t\t\t\r\n\t\t\t$this->render_page('signup/index', $data);\r\n\t\t}\r\n\t}", "public function actionCreate() {}", "public function actionCreate() {}", "public function create() \n\t{\n\t\n\t\t$this->form_validation->set_rules('firstname', 'First name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('lastname', 'Last name', 'trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('email', 'Email address', 'trim|required|valid_email|xss_clean');\n\t\t$this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean|min_length[8]|max_length[20]');\n\t\t$this->form_validation->set_rules('group', 'Role', 'trim|required|xss_clean');\n\t\t\n\t\t\n\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\n\t\t\t$this->session->set_flashdata('error_message', $this->lang->line('users_create_error1').validation_errors());\n\t\t\t\n\t\t\tredirect(\"/users/\", \"refresh\");\n\t\t\n\t\t} else {\n\t\t\n\t\t\t$userID = $this->usermodel->newUser($_POST);\n\t\t\t\n\t\t\t$this->session->set_flashdata('success_message', $this->lang->line('users_create_success'));\n\t\t\t\n\t\t\t\n\t\t\t//send email\n\t\t\t$this->load->library('email');\n\t\t\t\n\t\t\t$this->email->from($this->config->item('support_email'), $this->config->item('support_name'));\n\t\t\t$this->email->to($_POST['email']); \n\t\t\t\n\t\t\t$this->email->subject('Your new Databased account');\n\t\t\t$this->email->message( $this->load->view('auth/email/new', array('email'=>$_POST['email'], 'password'=>$_POST['password']), true ) );\t\n\t\t\t\n\t\t\t$this->email->send();\n\t\t\t\n\t\t\t//echo $this->email->print_debugger();\n\t\t\t\n\t\t\tredirect(\"/users/\".$userID, \"refresh\");\n\t\t\n\t\t}\n\t\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Users;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n $path= realpath(Yii::app()->basePath . '/../images/profile/'); \n $thumbpath=realpath(Yii::app()->basePath . '/../images/profile/thumb/');\n\t\tif(isset($_POST['Users'])){\n\t\t\t$model->attributes=$_POST['Users'];\n if ($_FILES[\"Users\"][\"name\"][\"profile_image\"] != \"\"){\n // Upload doctor image\n $uploadedFile=CUploadedFile::getInstance($model,'profile_image');\n $filename=explode(\".\", $uploadedFile);\n $fileext = $filename[count($filename) - 1];\n $newfilename = time() . \".\" . $fileext;\n $model->profile_image = $newfilename;\n $_POST['Users'][\"profile_image\"] = $newfilename;\n if(!empty($uploadedFile)){\n $uploadedFile->saveAs($path.\"/\".$newfilename);\n $image = new EasyImage($path.\"/\".$newfilename);\n $image->resize(100, 100);\n $image->save($thumbpath.\"/\".$newfilename);\n /**\n * @desc : Delete existing images\n */\n if (file_exists($path . $old_image)) {\n @unlink($path . $old_image);\n }\n }\n }\n $model->password = base64_encode($_POST['Users'][\"password\"]);\n if($model->save()){\n $this->redirect(array('view','id'=>$model->user_id));\n }\n\t\t}\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create($data,$user_id,$photo){\n $customer = new Customer();\n $customer->name = strip_tags($data['name']);\n $customer->address = strip_tags($data['address']);\n $customer->fonction = strip_tags($data['fonction']);\n $customer->wilaya = strip_tags($data['wilaya']);\n $customer->commune = strip_tags($data['commune']);\n $customer->type = $data['type'];\n $customer->photo=$photo;\n $customer->id = $user_id;\n $customer->save();\n }", "public function createEnterpriseUser($input);", "public function p_signup() {\n\t\t$email_a = $_POST['email'];\n\n\t\t//check to ensure there is not already a user with that email (a duplicate)\n\t\t$q = \"SELECT users.email\n\t\t\t\tFROM users \n\t \tWHERE users.email = '\".$_POST['email'].\"'\n\t \t\";\n\t\t\t\n\t\t$email_validation = DB::instance(DB_NAME)->select_field($q);\n\n\t\t//validation of empty fields\n\n\t\tif (empty($_POST['first_name'])) {\n\t\t\tRouter::redirect(\"/users/signup/signup_error\");\n\n \t} elseif (empty($_POST['last_name'])) {\n \t\tRouter::redirect(\"/users/signup/signup_error\");\n \t\n \t} elseif (empty($_POST['email'])) {\n \tRouter::redirect(\"/users/signup/signuperror\");\n \t\n \t} elseif (empty($_POST['password'])) {\n \tRouter::redirect(\"/users/signup/signup_error\");\n \n //check for valid email syntax\t\n \t} elseif (!filter_var($email_a, FILTER_VALIDATE_EMAIL)) {\n \t\n\t\t\tRouter::redirect(\"/users/signup_invalid/signup_invalid\");\n\t\t\n \t} \n \t//check duplicate\n \telseif ($email_validation) {\n\t\t\t\t\n\t\t\tRouter::redirect(\"/users/signup_duplicate/signup_duplicate\");\n\t\t\n\t\t//signup the user and send info to DB\t\n\t\t} else {\n\n\t\t\t\t//1. insert the data into the DB\n\n\t\t\t\t$_POST['created'] = Time::now();\n\t\t\t\t$_POST['modified'] = Time::now();\n\t\t\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\t\t\t\t$_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string());\n\n\t\t\t\t$user_id = DB::instance(DB_NAME)->insert('users', $_POST);\n\n\t\t\t\t//2. get the user id in order to upload the default photo for the user\n\t\t\t\t//(Currently this is not working. Please see the open items and review items explanation in github readme).\n\n\t\t\t\t\t$q_userID = \"SELECT users.user_id\n\t\t\t\t\tFROM users \n\t\t \tWHERE users.email = '\".$_POST['email'].\"'\n\t\t \t\";\n\t\t\t\t\n\t\t\t\t\t$user_validation = DB::instance(DB_NAME)->select_field($q_userID);\n\t\t\t\t\n\t\t\t\t//2a. Insert a default pic for user. See error note in item 2 above.\n\t\t\t\t//This uploads a \"broken link. Since INNER JOIN is used on posts, \n\t\t\t\t//a profile picture is needed (even if the link is broken in the view).\n\n\t\t\t\t\t$data = Array('pic_id' => $user_validation,\n\t\t\t\t\t\t\t'user_id' => $user_validation,\n\t\t\t\t\t\t\t'created' => Time::now(),\n\t\t\t\t\t\t\t'picture' => \"/uploads/profiles/blank_profile.jpg\");\n\n\t\t\t\t\t$user_id = DB::instance(DB_NAME)->update_or_insert_row('profilePics', $data);\n\n\t\t\t\t\n\t\t\t\t//3. upon signup, give the user a token to continue directly to their page\n\n\t\t\t\t$q2 = \"SELECT token\n\t\t\t\t\tFROM users \n\t\t \tWHERE email = '\".$_POST['email'].\"'\n\t\t \tAND password = '\".$_POST['password'].\"'\";\n\n\t\t\t\t$token = DB::instance(DB_NAME)->select_field($q2);\n\n\t\t\t\tsetcookie(\"token\", $token, strtotime('+1 year'), '/');\n\n\t\t\t\tRouter::redirect(\"/users/profile\");\n\t\t}\t\t\n\t\n\t}", "function create_user()\n {\n $this->data['title'] = \"Create User\";\n\n if (!$this->ion_auth->in_group('superadmin'))\n {\n redirect('auth', 'refresh');\n }\n\n //validate form input\n $this->form_validation->set_rules('first_name', 'First Name', 'required|xss_clean');\n $this->form_validation->set_rules('last_name', 'Last Name', 'required|xss_clean');\n $this->form_validation->set_rules('email', 'Email Address', 'required|valid_email');\n $this->form_validation->set_rules('phone1', 'Phone No', 'required|xss_clean|min_length[9]|max_length[14]');\n $this->form_validation->set_rules('group', 'Group', 'required|xss_clean');\n $this->form_validation->set_rules('password', 'Password', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n $this->form_validation->set_rules('password_confirm', 'Password Confirmation', 'required');\n\n if ($this->form_validation->run() == true)\n {\n $username = strtolower($this->input->post('first_name')) . ' ' . strtolower($this->input->post('last_name'));\n $email = $this->input->post('email');\n $password = $this->input->post('password');\n\n $additional_data = array(\n 'first_name' => $this->input->post('first_name'),\n 'last_name' => $this->input->post('last_name'),\n //'company' => $this->input->post('company'),\n\t\t\t\t//'password1' =>$this->input->post('password'),\n // 'phone' => $this->input->post('phone1') . '-' . $this->input->post('phone2') . '-' . $this->input->post('phone3'),\n 'phone' => $this->input->post('phone1'),\n );\n }\n if ($this->form_validation->run() == true && $this->ion_auth->register($username, $password, $email, $additional_data,array($this->input->post('group'))))\n { \n //check to see if we are creating the user\n //redirect them back to the admin page\n $this->session->set_flashdata('message', $this->ion_auth->messages());\n redirect(\"auth\", 'refresh');\n }\n else\n { \n //display the create user form\n //set the flash data error message if there is one\n $message = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n flashMsg('error',$message);\n $this->data['first_name'] = array(\n 'name' => 'first_name',\n 'id' => 'first_name',\n 'class'=>'text-input small-input',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('first_name'),\n );\n $this->data['last_name'] = array(\n 'name' => 'last_name',\n 'id' => 'last_name',\n 'class'=>'text-input small-input',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('last_name'),\n );\n \n $this->data['email'] = array(\n 'name' => 'email',\n 'id' => 'email',\n 'class'=>'text-input small-input',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('email'),\n );\n $this->data['phone1'] = array(\n 'name' => 'phone1',\n 'id' => 'phone1',\n 'class'=>'text-input small-input',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('phone1'),\n );\n \n $this->data['password'] = array(\n 'name' => 'password',\n 'id' => 'password',\n 'class'=>'text-input small-input',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password'),\n );\n $this->data['password_confirm'] = array(\n 'name' => 'password_confirm',\n 'id' => 'password_confirm',\n 'class'=>'text-input small-input',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password_confirm'),\n );\n $this->data['group'] = array(\n 'name' => 'group',\n 'id' => 'group',\n 'class'=>'text-input small-input',\n 'type' => 'select',\n 'selected' => $this->form_validation->set_value('group'),\n );\n $groups=$this->ion_auth_model->get_groups();\n $options=array();\n $options[null]='choose group';\n foreach($groups as $group){\n if($this->session->userdata('user_group')=='superadmin'){\n $options[$group->id]=$group->description;\n }\n elseif($this->session->userdata('user_group')=='admin'){\n if($group->name !='superadmin')\n $options[$group->id]=$group->name;\n \n }\n \n }\n $this->data['options']=$options;\n $this->data['module']='auth';\n $this->data['page']='add_user';\n $this->load->view('admin_container',$this->data);\n\n \n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $foto = UploadedFile::getInstance($model,'use_foto');\n\n if ($foto == ''){\n $model->use_foto = 'usuario_anonimo.jpg';\n }else{\n\n $modelFoto = User::find()->count();\n\n $foto->saveAs('img/user/'. $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension);\n $model->use_foto = $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension;\n }\n\n /*\n * 1. usuario Administrador\n * 2. usuario Investigador\n * 3. usuario Registrado\n */\n\n /* if($model->rol_id != 2){\n $model ->use_estado = 1;\n //Aqui va codigo borrar el perfil del investigador\n }*/\n\n $model -> use_estadoAudit = 'N';\n $model -> use_fechaCreacion = date('y-m-d H:i:s');\n $model -> use_fechaAudit = date('y-m-d H:i:s');\n $model -> use_accion = 'N';\n\n\n if($model->signup()){\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Registro agregado!</h4>\n El registro se agregó correctamente.\n </div>\n ');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create_user() {\r\n\r\n $user_id = $this->session->userdata('user_id');\r\n $data['dataHeader'] = $this->users->get_allData($user_id);\r\n $this->data['title'] = $this->lang->line('create_user_heading');\r\n\r\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin()) {\r\n redirect('auth/login#signup', 'refresh');\r\n }\r\n\r\n $tables = $this->config->item('tables', 'ion_auth');\r\n $identity_column = $this->config->item('identity', 'ion_auth');\r\n $this->data['identity_column'] = $identity_column;\r\n\r\n// validate form input\r\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\r\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\r\n if ($identity_column !== 'email') {\r\n $this->form_validation->set_rules('identity', $this->lang->line('create_user_validation_identity_label'), 'required|is_unique[' . $tables['users'] . '.' . $identity_column . ']');\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\r\n } else {\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\r\n }\r\n $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\r\n $this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\r\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\r\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\r\n\r\n if ($this->form_validation->run() == true) {\r\n $email = strtolower($this->input->post('email'));\r\n $identity = ($identity_column === 'email') ? $email : $this->input->post('identity');\r\n $password = $this->input->post('password');\r\n\r\n\r\n\r\n /* Upload profile picture */\r\n if (isset($_FILES['profile_image']['name']) && $_FILES['profile_image']['name'] != '') {\r\n $targetDir = \"uploads/profile/\";\r\n $fileName = $_FILES['profile_image']['name'];\r\n $targetFile = $targetDir . $fileName;\r\n\r\n if (!file_exists($targetPath)) {\r\n mkdir($targetPath, 0777, true);\r\n }\r\n $slug = $this->input->post('name');\r\n\r\n $fileExt = pathinfo($_FILES['profile_image']['name']);\r\n $dataDocumentDetail['type'] = $fileExt['extension'];\r\n\r\n\r\n $uploded_file_path = $this->handleUploadUser($slug);\r\n if ($uploded_file_path != '')\r\n $data['profileimg'] = $targetDir . $uploded_file_path;\r\n }\r\n\r\n $additional_data = array(\r\n 'first_name' => $this->input->post('first_name'),\r\n 'last_name' => $this->input->post('last_name'),\r\n 'company' => $this->input->post('company'),\r\n 'phone' => $this->input->post('phone'),\r\n 'profileimg' => $data['profileimg'] ? $data['profileimg'] : '',\r\n 'birth_date' => date('y-m-d', strtotime($this->input->post('birth_date'))),\r\n );\r\n }\r\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data)) {\r\n// check to see if we are creating the user\r\n// redirect them back to the admin page\r\n $this->session->set_flashdata('message', $this->ion_auth->messages());\r\n redirect(\"auth/login#signup\");\r\n } else {\r\n// display the create user form\r\n// set the flash data error message if there is one\r\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\r\n\r\n $this->data['first_name'] = array(\r\n 'name' => 'first_name',\r\n 'id' => 'first_name',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr1',\r\n 'autofocus' => 'autofocus',\r\n 'required' => 'required',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('first_name'),\r\n );\r\n $this->data['last_name'] = array(\r\n 'name' => 'last_name',\r\n 'id' => 'last_name',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr2',\r\n 'required' => 'required',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('last_name'),\r\n );\r\n $this->data['identity'] = array(\r\n 'name' => 'identity',\r\n 'id' => 'identity',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr3',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('identity'),\r\n );\r\n $this->data['email'] = array(\r\n 'name' => 'email',\r\n 'id' => 'email',\r\n 'type' => 'email',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr4',\r\n 'value' => $this->form_validation->set_value('email'),\r\n );\r\n $this->data['company'] = array(\r\n 'name' => 'company',\r\n 'id' => 'company',\r\n 'type' => 'text',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr5',\r\n 'value' => $this->form_validation->set_value('company'),\r\n );\r\n $this->data['phone'] = array(\r\n 'name' => 'phone',\r\n 'id' => 'phone',\r\n 'required' => 'required',\r\n 'type' => 'text',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr6',\r\n 'value' => $this->form_validation->set_value('phone'),\r\n );\r\n $this->data['password'] = array(\r\n 'name' => 'password',\r\n 'id' => 'password',\r\n 'type' => 'password',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr7',\r\n 'value' => $this->form_validation->set_value('password'),\r\n );\r\n $this->data['password_confirm'] = array(\r\n 'name' => 'password_confirm',\r\n 'id' => 'password_confirm',\r\n 'type' => 'password',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr8',\r\n 'value' => $this->form_validation->set_value('password_confirm'),\r\n );\r\n $this->data['birth_date'] = array(\r\n 'name' => 'birth_date',\r\n 'id' => 'birth_date',\r\n 'type' => 'date',\r\n 'class' => 'form-control has-feedback-left',\r\n 'data-error' => '.regErorr9',\r\n 'value' => $this->form_validation->set_value('birth_date'),\r\n );\r\n $this->data['profile_image'] = array(\r\n 'name' => 'profile_image',\r\n 'id' => 'profile_image',\r\n 'type' => 'file',\r\n 'class' => 'form-control',\r\n 'data-error' => '.regErorr10',\r\n 'value' => $this->form_validation->set_value('profile_image'),\r\n );\r\n\r\n\r\n $this->template->set_master_template('template.php');\r\n $this->template->write_view('header', 'backend/header', (isset($data) ? $data : NULL));\r\n $this->template->write_view('sidebar', 'backend/sidebar', (isset($this->data) ? $this->data : NULL));\r\n $this->template->write_view('content', 'create_user', (isset($this->data) ? $this->data : NULL), TRUE);\r\n $this->template->write_view('footer', 'backend/footer', '', TRUE);\r\n $this->template->render();\r\n }\r\n }", "public function create()\n {\n $data['id'] = $this->db->order_by('id', 'desc')->get($this->User->table)->row()->id + 1;\n \n $this->Helper->view('user/create', $data);\n }", "public function create()\n {\n\t $role = Auth::user()->rols()->first();\n\t $roles = $this->role_repository->allowedCrudRoles($role);\n\t $country = $this->country_repository->findOneBy(old('country_id',null));\n\t $state = $this->state_repository->findOneBy(old('state_id',null));\n\t $city = $this->city_repository->findOneBy(old('city_id',null));\n\t\t$offices = $this->office_repository->offices(Auth::user());\n\n\t $viewData = compact('roles','offices');\n\t if($country){\n\t\t $viewData['country']=$country;\n\t }\n\n\t if($state){\n\t\t $viewData['state']=$state;\n\t }\n\n\t if($city){\n\t\t $viewData['city']=$city;\n\t }\n\n\t return view('web.supplier.user.create')->with($viewData);\n }", "function create_user($email){\r\n\r\n $post_array = $_POST;\r\n $default_usergroup = \"11\";\r\n\r\n $distributor = $this->aauth->get_user();\r\n $distributor_id = $distributor->user_link_id;\r\n\r\n $new_user_id = '';\r\n $this->load->model('user_model');\r\n\r\n $password = $this->generateRandomString(6);\r\n\r\n $new_user_id = $this->aauth->create_user($post_array['email'],$password,$post_array['name'],$post_array['username'],$default_usergroup);\r\n $errors = $this->aauth->get_errors_array();\r\n\r\n if(is_array($errors) && count($errors) >= 1){\r\n $this->event_model->track('user','attempted_add_user', $errors[0]);\r\n $this->form_validation->set_message('create_user', $errors[0]);\r\n return false;\r\n\r\n }else{\r\n\r\n $this->user_model->update_user_cellphone($post_array['email'], array(\r\n \"cellphone\" => $post_array['cellphone'],\r\n \"user_link_id\" => $distributor_id,\r\n \"parent_id\" => $new_user_id\r\n ));\r\n $this->send_welcome($post_array['email'],$post_array['name'],$post_array['username'],$post_array['cellphone'],$password);\r\n $this->event_model->track('user','add_user', $new_user_id);\r\n $this->form_validation->set_message('create_user', \"<script>window.location.replace('/distributors/distributor_profile/user');</script>\");\r\n return false;\r\n }\r\n \r\n }", "function user_create($params)\r\n{\r\n\t$params = is_array($params) ? $params : config_decode($params);\r\n\t$params = _class('params')->clean_newline($params);\r\n\tif(isset($params['params'])\r\n\t\t&& !empty($params['name'])\r\n\t\t&& isset($params['email'])\r\n\t\t&& is_email($params['email']))\r\n\t{\r\n\t\tglobal $db;\r\n\t\t/*=======================================\r\n\t\t * GET USER GROUP\r\n\t\t/*=====================================*/\r\n\t\tif(!empty($params['params']))\r\n\t\t{\r\n\t\t\tif(!is_array($params['params']))\r\n\t\t\t{\r\n\t\t\t\t$r = config_decode($params['params']);\r\n\t\t\t\tif(!empty($r) && is_array($r))\r\n\t\t\t\t{\r\n\t\t\t\t\t$params['params'] = $r;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(empty($params['group_ids']))\r\n\t\t\t{\r\n\t\t\t\tif(!empty($params['params']['group_ids']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$params['group_ids'] = $params['params']['group_ids'];\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$params['group_ids'] = config('rules', 'register_groups');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!empty($params['group_ids']))\r\n\t\t\t{\r\n\t\t\t\tif(!is_array($params['group_ids']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$params['group_ids'] = repairExplode($params['group_ids']);\r\n\t\t\t\t}\r\n\t\t\t}else return false;\r\n\t\t}else return false;\r\n\t\t$email_to\t\t= array();\r\n\t\t$def_params = array(\r\n\t\t\t'username',\r\n\t\t\t'password',\r\n\t\t\t'name',\r\n\t\t\t'email',\r\n\t\t\t'params',\r\n\t\t\t'group_ids'\r\n\t\t);\r\n\t\t$data = array('params' => '');\r\n\t\tforeach($def_params AS $key)\r\n\t\t{\r\n\t\t\t// Name\r\n\t\t\tif($key == 'name')\r\n\t\t\t{\r\n\t\t\t\t$data[$key] = trim($params[$key]);\r\n\t\t\t}\r\n\t\t\t// Username\r\n\t\t\tif($key == 'username')\r\n\t\t\t{\r\n\t\t\t\tif(isset($params[$key]) && !empty($params[$key]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$data[$key] = strtolower($params[$key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$data[$key] = strtolower($params['email']);\r\n\t\t\t\t}\r\n\t\t\t\t$data[$key] = str_replace(\"'\", \"\\'\", strtolower($data[$key]));\r\n\t\t\t}\r\n\t\t\t// Password\r\n\t\t\tif($key == 'password')\r\n\t\t\t{\r\n\t\t\t\tif(isset($params[$key]) && !empty($params[$key])) {\r\n\t\t\t\t\t$data[$key] = $params[$key];\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$data[$key] = preg_replace('~[^a-z0-9]~is', '', base64_encode(rand()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Email\r\n\t\t\tif($key == 'email')\r\n\t\t\t{\r\n\t\t\t\t$data[$key] = strtolower($params['email']);\r\n\t\t\t\t$email_to[] = $data[$key];\r\n\t\t\t}\r\n\t\t\t// Params\r\n\t\t\tif($key == 'params')\r\n\t\t\t{\r\n\t\t\t\t$r_field = array();\r\n\t\t\t\t$r_param = is_array($params[$key]) ? $params[$key] : config_decode($params[$key]);\r\n\t\t\t\t$user_field\t= user_field_group($params['group_ids']);\r\n\t\t\t\tforeach($user_field AS $dt)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(isset($r_param[$dt['title']]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$r_field[$dt['title']] = $r_param[$dt['title']];\r\n\t\t\t\t\t\tif(is_email($r_field[$dt['title']]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$r_field[$dt['title']] = strtolower($r_field[$dt['title']]);\r\n\t\t\t\t\t\t\t$email_to[] = $r_field[$dt['title']];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$r_field[$dt['title']] = @$dt['default'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$data[$key] = $r_field;\r\n\t\t\t}\r\n\t\t\t// Group_Ids\r\n\t\t\tif($key == 'group_ids')\r\n\t\t\t{\r\n\t\t\t\tif(empty($params[$key]) && !empty($params['params']['group_ids']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$params[$key] = $params['params']['group_ids'];\r\n\t\t\t\t}\r\n\t\t\t\tif(!empty($params[$key]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$data[$key] = is_array($params[$key]) ? $params[$key] : repairExplode($params[$key]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$data[$key] = config('rules', 'register_groups');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// $db->Execute('FLUSH TABLES WITH READ LOCK');\r\n\t\tif (user_create_validate($data))\r\n\t\t{\r\n\t\t\t// $db->Execute('UNLOCK TABLES');\r\n\t\t\t@unlink(_CACHE.'user_create_validate_msg.txt');\r\n\t\t\t$q = \"INSERT INTO `bbc_user` SET\r\n\t\t\t\t`group_ids` = '\".repairImplode(addslashes_r($data['group_ids'])).\"',\r\n\t\t\t\t`username` = '\".addslashes($data['username']).\"',\r\n\t\t\t\t`password` = '\".encode($data['password']).\"',\r\n\t\t\t\t`last_ip` = '',\r\n\t\t\t\t`last_ip_temp` = '',\r\n\t\t\t\t`last_login` = '',\r\n\t\t\t\t`last_login_temp` = '',\r\n\t\t\t\t`exp_checked` = '',\r\n\t\t\t\t`login_time` = 0,\r\n\t\t\t\t`created` = NOW(),\r\n\t\t\t\t`active` = 1\r\n\t\t\t\t\";\r\n\t\t\tif($db->Execute($q))\r\n\t\t\t{\r\n\t\t\t\t$user_id = $db->Insert_ID();\r\n\t\t\t\t$q = \"INSERT INTO `bbc_account` SET\r\n\t\t\t\t\t`user_id` = '\".$user_id.\"',\r\n\t\t\t\t\t`username` = '\".addslashes($data['username']).\"',\r\n\t\t\t\t\t`name` = '\".addslashes($data['name']).\"',\r\n\t\t\t\t\t`email` = '\".addslashes($data['email']).\"',\r\n\t\t\t\t\t`params` = '\".config_encode($data['params']).\"'\r\n\t\t\t\t\t\";\r\n\t\t\t\t$db->Execute($q);\r\n\t\t\t\tuser_call_func(__FUNCTION__, $user_id);\r\n\t\t\t\treturn $user_id;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$db->Execute('UNLOCK TABLES');\r\n\t}\r\n\treturn 0;\r\n}", "public function p_signup() {\n\n $q= 'Select email \n From users \n WHERE email=\"'.$_POST['email'].'\"';\n # see if the email exists\n $emailexists= DB::instance(DB_NAME)->select_field($q);\n \n # email exists, throw an error\n if($emailexists){ \n \n Router::redirect(\"/users/signup/error\"); \n \n }\n \n #requires all fields to be entered if java script is disabled, otherwise thow a different error\n \n elseif (!$_POST['email'] OR !$_POST['last_name'] OR !$_POST['first_name'] OR !$_POST['password']) {\n Router::redirect(\"/users/signup/error2\"); \n }\n # all is well , proceed with signup\n else{\n \n $_POST['created']= Time::now();\n $_POST['password']= sha1(PASSWORD_SALT.$_POST['password']); \n $_POST['token']= sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n # add user to the database and redirect to users login page \n $user_id=DB::instance(DB_NAME)->insert_row('users',$_POST);\n # Create users first Notebook\n $notebook['name']= $_POST['first_name'].' Notebook';\n $notebook['user_id']= $user_id;\n $notebook['created']= Time::now(); \n $notebook['modified']= Time::now(); \n DB::instance(DB_NAME)->insert_row('notebooks',$notebook); \n\n Router::redirect('/users/login');\n }\n \n }", "public function create()\n {\n return view(\"ContentManager::user.create\",['model' => \"\"]);\n }", "public function createUser()\n {\n }", "public function createUser($data,$fname,$lname,$username){\n\t\t\t$this->db->from('tbl_employees')->where(array('fname'=>$fname,'lname'=>$lname));\n\t\t\t$query = $this->db->get();\n\t\t\tif($query->num_rows() == 0){\n\t\t\t\t$this->db->from('tbl_employees')->where('username',$username);\n\t\t\t\t$query = $this->db->get();\n\t\t\t\tif($query->num_rows() == 0){\n\t\t\t\t\t$this->db->insert('tbl_employees',$data);\n\t\t\t\t\treturn \"created\";\n\t\t\t\t}else{\n\t\t\t\t\treturn \"username\";\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn \"person\";\n\t\t\t}\n\t\t}", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "function create_user()\n\t{\n\t\t/* Load */\n\t\t$this->load->config('admin/dp_config');\n\t\t$this->load->config('common/dp_config');\n\n\t\t/* Data */\n\t\t$this->data['title'] = $this->config->item('title');\n\t\t$this->data['title_lg'] = $this->config->item('title_lg');\n\t\t$this->data['auth_social_network'] = $this->config->item('auth_social_network');\n\t\t$this->data['forgot_password'] = $this->config->item('forgot_password');\n\t\t$this->data['new_membership'] = $this->config->item('new_membership');\n\n\t\t// if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t// {\n\t\t// \tredirect('auth', 'refresh');\n\t\t// }\n\t\t$this->data['first_name'] = array(\n\t\t\t'name' => 'first_name',\n\t\t\t'id' => 'first_name',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"First Name\",\n\t\t);\n\t\t$this->data['last_name'] = array(\n\t\t\t'name' => 'last_name',\n\t\t\t'id' => 'last_name',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Last Name\",\n\t\t);\n\t\t$this->data['email'] = array(\n\t\t\t'name' => 'email',\n\t\t\t'id' => 'email',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Email\",\n\t\t);\n\t\t$this->data['company'] = array(\n\t\t\t'name' => 'company',\n\t\t\t'id' => 'company',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Company\",\n\t\t);\n\t\t$this->data['phone'] = array(\n\t\t\t'name' => 'phone',\n\t\t\t'id' => 'phone',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Phone\",\n\t\t);\n\t\t$this->data['password'] = array(\n\t\t\t'name' => 'password',\n\t\t\t'id' => 'password',\n\t\t\t'type' => 'password',\n\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Password\",\n\t\t);\n\t\t$this->data['password_confirm'] = array(\n\t\t\t'name' => 'password_confirm',\n\t\t\t'id' => 'password_confirm',\n\t\t\t'type' => 'password',\n\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t'class' => 'form-control',\n\t\t\t'placeholder' => \"Confirm Password\",\n\t\t);\n\n\t\t$this->template->auth_render('auth/create_user', $this->data);\n\t}", "public function create(){\n\t\t$this->autenticate();\n\t\t$user_id = $_POST['id'];\n\t\t$nombre = \"'\".$_POST['nombre'].\"'\";\n\t\t$cedula = \"'\".$_POST['cedula'].\"'\";\n\t\t$nacimiento = \"'2000/1/1'\"; //fecha de nacimiento default, despues el mismo usuario la puede editar\n\t\trequire_once(\"../app/models/administrativo.php\");//conexion entre los controladores\n\t\t$administrativo=new Administrativo();// crea el perfil administrativo vacio\n\t\t$administrativo->new($nombre,$cedula,$nacimiento); // inserta la informacion antes ingresada en la base de datos\n\t\t$administrativo_id = $administrativo->where(\"cedula\",$cedula); // se trae el perfil administrativo recien creado con la cedula\n\t\t$administrativo_id = $administrativo_id[0][\"id\"];\n\t\t$administrativo->attach_user($user_id,$administrativo_id); // amarra el usuario a su nuevo perfil docente\n\t\t$administrativo_id = strval($user_id);//convierte el user_id de entero a string\n\t\theader(\"Location: http://localhost:8000/usuarios/show/$user_id\");\n\t\texit;\n\t\t$this->view('administrativos/index', []);\n\t}", "protected function create(array $data)\n {\n \n $fullname=$data['fname'].' '.$data['lname'];\n $userarray=array('full_name' => $fullname,\n 'email' => $data['email'],\n 'phone' => $data['phone'],\n 'subscription_id' => $data['subscription_id']);\n // print_r($userarray);\n // die;\n \n return User::create($userarray);\n \n }", "public function create()\n {\n $this->validate($this->request, User::createRules());\n\n $user = new User;\n $user->name = $this->request->name;\n $user->phone = $this->request->phone;\n $user->dob = $this->request->dob;\n $user->image = $this->request->image_path;\n $plainPassword = $this->request->password;\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return $this->response(201,\"User\", $user);\n }", "public function create_londontec_users(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/adduser';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Create Londontec New users',\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "static public function createPost(){\n\t\tinclude ($GLOBALS['PATH'] . '/classes/requests/users/CreateRequest.php');\n\n\t\t$requests = new CreateRequest;\n\t\t$errors = $requests->validate();\n\t\t\n\t\t//Criar url de redirecionar\n\t\t$back = explode('?', $_SERVER['HTTP_REFERER'])[0] ?? '/users/create';\n\n\t\tif(count($errors) > 0){\n\t\t\t//seta os params de retorno\n\t\t\t$back .= '?errors=' . json_encode($errors) . '&name='. $_POST['name'] . '&email='. $_POST['email'];\n\n\t\t}else{\n\n\t\t\t$conn = Container::getDB();\n\t\t\t$user = new User;\n\t\t\t\n\t\t\t//Cria criptografia de senha\n\t\t\t$password = crypt($_POST['password'], SALT);\n\n\t\t\t//seta os dados do usuario na instância da class User\n\t\t\t$user->setName($_POST['name'])\n\t\t\t\t->setEmail($_POST['email'])\n\t\t\t\t->setPassword($password);\n\t\t\n\t\t\t$crud = new CrudUser($conn, $user);\n\n\t\t\ttry {\n\t\t\t\t//metodo save(), salva os dados do usuario no banco de dados\n\t\t\t\t$save = $crud->save();\n\n\t\t\t\t//Verificação se o cadastro foi com successo\n\t\t\t\tif($save){\n\t\t\t\t\t$back .= '?success=Usuário cadastrado com sucesso!';\n\t\t\t\t}else{\n\n\t\t\t\t\t//cria message de retorno com erro\n\t\t\t\t\t$messageError = ['Error' => 'Erro ao salvar usuario'];\n\t\t\t\t\t$back .= '?errors=' . json_encode($messageError) . '&name='. $_POST['name'] . '&email='. $_POST['email'];\n\t\t\t\t\n\t\t\t\t}\n\t\t\t} catch (\\Throwable $th) {\n\t\t\t\techo '<pre>';\n\t\t\t\t\tprint_r($th);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//Redireciona para $back\n\t\theader('Location: ' . $back);\n\t}", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function postCreate() {\n \t$validator = Validator::make(Input::all(), User::$rules);\n\n \t// i made a user with [email protected], goodbye\n \tif ($validator->passes()) {\n \t\t// validation has passed, save user in DB\n \t\t$user = new User;\n \t\t$user->first_name = Input::get('first_name');\n \t\t$user->last_name = Input::get('last_name');\n \t\t$user->email = Input::get('email');\n \t\t$user->password = Hash::make(Input::get('password'));\n \t\t$user->save();\n\n \t\treturn Redirect::to('users/login')->with('message', '<div class=\"alert alert-success\" role=\"alert\">Thanks for registering!</div>');\n \t}\n \telse {\n \t\t// validation has failed, display error messages\n \t\treturn Redirect::to('users/register')->with('message', '<div class=\"alert alert-warning\" role=\"alert\">The following errors occurred</div>')->withErrors($validator)->withInput();\n \t}\n }", "function addCompany() {\n\t\t\t\t\tPartner::create(array( 'name'\t\t =>\t$_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t'city'\t\t =>\t$_POST['inputCity'],\n\t\t\t\t\t\t\t\t\t\t\t'unix_linux' =>\t$_POST['inputUnixLinux'],\n\t\t\t\t\t\t\t\t\t\t\t'sql'\t\t =>\t$_POST['inputSql'],\n\t\t\t\t\t\t\t\t\t\t\t'git'\t\t =>\t$_POST['inputGit'],\n\t\t\t\t\t\t\t\t\t\t\t'wordpress'\t =>\t$_POST['inputWordpress'],\n\t\t\t\t\t\t\t\t\t\t\t'drupal'\t =>\t$_POST['inputDrupal'],\n\t\t\t\t\t\t\t\t\t\t\t'python'\t =>\t$_POST['inputPython'],\n\t\t\t\t\t\t\t\t\t\t\t'svn'\t\t =>\t$_POST['inputSVN'],\n\t\t\t\t\t\t\t\t\t\t\t'objective_c' =>\t$_POST['inputObjectiveC'],\n\t\t\t\t\t\t\t\t\t\t\t'ruby_rails' =>\t$_POST['inputRuby'],\n\t\t\t\t\t\t\t\t\t\t\t'c_plusplus' =>\t$_POST['inputCPlusPlus'],\n\t\t\t\t\t\t\t\t\t\t\t'dot_net'\t =>\t$_POST['inputNet'],\n\t\t\t\t\t\t\t\t\t\t\t'php'\t\t =>\t$_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t'html_css'\t =>\t$_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t'java'\t\t =>\t$_POST['inputJava'],\n\t\t\t\t\t\t\t\t\t\t\t'javascript' =>\t$_POST['inputJavascript'],\n\t\t\t\t\t\t\t\t\t\t\t'comments'\t =>\t$_POST['inputComments'])\n\t\t\t\t\t);\n\n\t\t\t\t\t$success = new h2o('views/happySuccess.html');\n\t\t\t\t\techo $success->render();\n\t\t\t\t}", "public function create()\n\t{\n\t\t//\n return View::make('users.create')\n ->with('groups',DB::table('groups')->lists('name','id'))\n ->with('companies',DB::table('users_companies')->lists('name','id'));\n\t}", "public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $user = User::findOne(['username' => $model->username ]) ;\n return $this->redirect(['site/view','id' => $user->id]);\n } else {\n return $this->render('knpr/create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new User();\n\n if (isset($_POST['User']))\n {\n\n $transaction = Yii::app()->db->beginTransaction();\n\n try\n {\n $model->setAttributes($_POST['User']);\n $model->salt = Registration::model()->generateSalt();\n $model->password = Registration::model()->hashPassword($model->password, $model->salt);\n $model->registrationIp = Yii::app()->request->userHostAddress;\n\n if ($model->save())\n {\n $profile = new Profile();\n $profile->user_id = $model->id;\n if ($profile->save())\n {\n $transaction->commit();\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Новый пользователь добавлен!'));\n $this->redirect(array('view', 'id' => $model->id));\n }\n else\n {\n throw new CDbException(Yii::t('user', 'При создании пользователя произошла ошибка! Подробности в журнале исполнения.'));\n }\n }\n\n }\n catch (CDbException $e)\n {\n $transaction->rollback();\n Yii::log($e->getMessage(), CLogger::LEVEL_ERROR, UserModule::$logCategory);\n Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, $e->getMessage());\n $this->redirect(array('create'));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n\treturn view('user.createuser');\n }", "public function newAppUser()\n {\n $email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_STRING);\n $name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n $role = filter_input(INPUT_POST, 'role', FILTER_SANITIZE_STRING);\n $status = filter_input(INPUT_POST, 'status', FILTER_SANITIZE_NUMBER_INT);\n\n $errorList = [];\n if (empty($email)) {\n $errorList[] = 'Vous devez saisir un email';\n }\n if (empty($name)) {\n $errorList[] = 'Vous devez saisir un nom';\n }\n if (empty($password)) {\n $errorList[] = 'Vous devez saisir un mot de passe';\n }\n if (empty($role)) {\n $errorList[] = 'Vous devez saisir un rôle';\n }\n\n if (empty($errorList)) {\n $user = new AppUser();\n $user->setEmail($email);\n $user->setName($name);\n $user->setPassword($password);\n $user->setRole($role);\n $user->setStatus($status);\n\n $inserted = $user->create();\n\n if ($inserted) {\n global $router;\n header('Location: ' . $router->generate('appusers-list'));\n return;\n } else {\n $errorList[] = 'L\\'insertion des données s\\'est mal passée';\n }\n }\n\n if (!empty($errorList)) {\n $user = new AppUser();\n $user->setEmail($email);\n $user->setName($name);\n $user->setPassword($password);\n $user->setRole($role);\n $user->setStatus($status);\n\n $this->show('users/add', [\n 'errorList' => $errorList,\n 'user' => $user\n ]);\n }\n }", "protected function create(array $data)\n {\n $user = new User;\n $user->name = $data['name'];\n $user->email = $data['email'];\n $user->password = bcrypt($data['password']);\n $user->save();\n\n return User_bio::create([\n 'id_user' => $user->id,\n 'nama' => $data['name'].\" \".$data['namabelakang'],\n 'id_tempat_lahir' => $data['id_tempat_lahir'],\n 'id_kota' => $data['id_kota'],\n 'tanggal_lahir' => $data['tanggallahir'],\n 'gender' => $data['gender'],\n 'id_status' => $data['status'],\n 'nohp' => $data['nohp'],\n 'alamat' => $data['tempattinggal'],\n 'profesi' => $data['profesi'],\n 'foto' => \"asd\",\n 'transfer' => 0,\n ]);\n }", "public function create()\n {\n // TODO: Algún parámetro para no permitir el registro.\n \n // Es ya un usuario?\n if (Core::isUser())\n {\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('') . '\\';');\n return;\n }\n \n // Tenemos datos?\n if ($this->request->is('email'))\n {\n // Validamos los datos\n $form = Core::getLib('form.validator');\n $form->setRules(Core::getService('account.signup')->getValidation());\n \n // Si no hay errores procedemos a capturar los datos.\n if ($form->validate())\n {\n // Agregamos usuario\n if (Core::getService('account.process')->add($this->request->getRequest()))\n {\n if (Core::getParam('user.verify_email_at_signup'))\n {\n // Vamos a que verifique su email\n Core::getLib('session')->set('email', $this->request->get('email'));\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.verify') . '\\';');\n }\n else\n {\n // Iniciamos sesión\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.login') . '\\';');\n }\n \n return;\n }\n }\n }\n \n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.signup') . '\\';');\n }", "public function createUser($name, $pass, $profile, array $extra = []);", "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 }", "protected function create(array $data)\n {\n $user = User::create([\n 'name' => $data['name'],\n 'email' => $data['email'],\n 'password' => Hash::make($data['password']),\n ]);\n\n $userInfo = new UserInfo();\n $userInfo->UserID = $user->UserID;\n\n $userInfo->mobile = $data['mobile'];\n $userInfo->address = $data['address'];\n $userInfo->country_id = $data['country_id'];\n $userInfo->city_id = $data['city_id'];\n $userInfo->role_id = $data['role_id'];\n $userInfo->save();\n \n if ($data['role_id'] == 3){\n $company_info = new Company();\n $company_info->UserInfoID = $user->UserInfo->UserInfoID;\n $company_info->register_no = $data['register_no'];\n $company_info->save();\n }else{\n $member_info = new Member();\n $member_info->UserInfoID = $user->UserInfo->UserInfoID;\n $member_info->save();\n }\n \n\n \n\n Mail::to('[email protected]')->send(new adminEmail($user));\n \n return $user;\n\n }" ]
[ "0.7032582", "0.6811807", "0.6786634", "0.67664105", "0.6728088", "0.6699939", "0.669593", "0.6688208", "0.66465217", "0.66338116", "0.66199183", "0.6600758", "0.6593541", "0.65061486", "0.6504406", "0.64924735", "0.64901894", "0.64875484", "0.64734626", "0.64700794", "0.6468135", "0.6456272", "0.64506906", "0.64458007", "0.6433254", "0.6424176", "0.6424176", "0.6424176", "0.6424176", "0.64221764", "0.6417348", "0.6414856", "0.64029187", "0.63940966", "0.6387834", "0.63804126", "0.6379707", "0.63642776", "0.63609767", "0.63608056", "0.6350524", "0.63431185", "0.6341244", "0.633681", "0.63291746", "0.6326389", "0.63189745", "0.63161373", "0.63094336", "0.6308487", "0.63079846", "0.63065666", "0.6303713", "0.63020325", "0.63017815", "0.62993073", "0.6291047", "0.6284685", "0.6268091", "0.62663937", "0.62662375", "0.62598103", "0.62546855", "0.62546855", "0.62526405", "0.6225806", "0.62215024", "0.62191886", "0.6208141", "0.6202477", "0.6197682", "0.61949706", "0.6194465", "0.618195", "0.6161003", "0.615394", "0.6153266", "0.61512184", "0.6150985", "0.61491895", "0.6149044", "0.61473674", "0.61461335", "0.6140083", "0.61324227", "0.6129206", "0.6129069", "0.6118331", "0.6117703", "0.6116753", "0.6114656", "0.611179", "0.6111603", "0.61063874", "0.6102777", "0.61027765", "0.60918605", "0.6087817", "0.6086848", "0.6085619" ]
0.7341189
0
this action updates user people by people_id name is mandatory field company, phone, email, image is optional field
public function updateUserPeopleAction() { /** @var Object_People $people */ $data = $this->getRequestData(); if (isset($data['people_id'])) { $people = Object_People::getById($data['people_id']); if (!$people) { $this->setErrorResponse('no People with this people_id!'); } elseif ($this->getDeviceSession()->getUserId() != $people->getCreator()->getId()) { $this->setErrorResponse('you have no rights to change this People!'); } else { if (isset($data['name'])) { $people->setName($data['name']); } if (isset($data['company'])) { $people->setCompany($data['company']); } if (isset($data['phone'])) { $people->setPhone($data['phone']); } if (isset($data['email'])) { $people->setEmail($data['email']); } if (isset($data['image'])) { $people->setImage(Asset_Image::getById($data['image'])); } if (!$people->save()) { $this->setErrorResponse('cannot update People object'); } } } else { $this->setErrorResponse('people_id is mandatory field for this request!'); } $this->_helper->json($people); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function update_person() {\n $fdata = $this->input->post();\n unset($fdata['submit']);\n $where = array(\"admin_id\" => $this->admin_lib->admin_id, \"person_id\" => $fdata['person_id']);\n $this->person_db->update_person($where, $fdata);\n redirect(\"p_list/index\");\n }", "public function update() {\n $data = $this->load($people);\n \n if(isset($_Post['people']))\n {\n $data->attributes=$_Post['people'];\n if($data->save())\n $this->redirect(array('view'=>$data->firstname,lastname));\n }\n \n $this->render('update',array('data'=>$data,));\n }", "public function update(Request $request)\n\t{\n\t\tLog::info(\"PeopleController->update :- Inside \".json_encode($request->all()));\n\t\n\t\t$this->validate($request, [\n\t\t\t'first_name' => 'required',\n\t\t]);\t\t\n\n\t\t$people = People::findOrFail($request->input('id'));\n\t\t$people->title_id = $request->input('title_id');\n\t\t$people->first_name = $request->input('first_name');\n\t\t$people->last_name = $request->input('last_name');\n\t\t$people->display_name = $request->input('display_name');\n\t\t$people->mobile_no = $request->input('mobile_no');\n\t\t$people->email_address = $request->input('email');\n\t\t$people->payment_mode_id = $request->input('payment_mode_id');\n\t\t$people->term_id = $request->input('term_id');\n\t\t$people->phone = $request->input('phone');\n\t\t$people->pan_no = $request->input('pan_no');\n\t\t$people->gst_no = $request->input('gst_no');\n\t\t$people->group_id = $request->input('group_id');\n\t\t$people->save();\t\t\n\n\t\tif($people->person_id != null ) {\n\n\t\t\t$persons = Person::select('persons.id');\n\t\t\t$persons->where('persons.id', $people->person_id);\n\t\t\t$person = $persons->first();\n\n\t\t\t$update_person = Person::findOrFail($person->id);\n\t\t\t$update_person->first_name = $people->first_name;\n\t\t\t$update_person->save();\n\t\t} \n\n\t\tif($people->business_id != null ) {\n\n\t\t\t$businesses = Business::select('businesses.id');\n\t\t\t$businesses->where('businesses.id', $people->business_id);\n\t\t\t$business = $businesses->first();\n\n\t\t\t$update_business = Business::findOrFail($business->id);\n\t\t\t$update_business->business_name = $people->first_name;\n\t\t\t$update_business->gst = ($people->gst_no != null) ? $people->gst_no : null;\n\t\t\t$update_business->save();\n\t\t}\n\n \n\t\t$account_ledgers = AccountLedger::select('account_ledgers.id');\t\n\n\t\tif($people->person_id != null ) {\n\n\t\t\t$account_ledgers->where('person_id', $people->person_id);\n\t\t} else {\n\t\t\t$account_ledgers->where('business_id', $people->business_id);\n\t\t}\n\n\t\t$account_ledgers->where('organization_id', Session::get('organization_id'));\n\t\t$account_ledger = $account_ledgers->first();\t\t\n Log::info(\"PeopleController->update :- account_ledger \".json_encode($account_ledger));\n\n\t\tif($account_ledger == null) {\n\n\t\t\t$personal_ledger = AccountLedgerType::where('name', 'personal')->first();\n\t\t\t$organization = Organization::findOrFail(Session::get('organization_id'));\n\n\t\t\t$ledgergroup = AccountGroup::where('name', 'sundry_debtor')->where('organization_id', Session::get('organization_id'))->first();\n\n\t\t\t$ledger = Custom::create_ledger($people->first_name, $organization, $people->display_name, $personal_ledger->id,$people->person_id, $people->business_id, $ledgergroup->id, date('Y-m-d'), 'debit', '0.00', '1', '1', Session::get('organization_id'), false);\n\t\t} else {\n\n\t\t\t$update_ledger = AccountLedger::findOrFail($account_ledger->id);\n\n\t\t\t$update_ledger->name = $people->first_name;\n\t\t\t$update_ledger->display_name = $people->display_name;\n\t\t\t$update_ledger->person_id = $people->person_id;\n\t\t\t$update_ledger->business_id = $people->business_id;\n\t\t\t$update_ledger->save();\n\n\t\t\t$ledger = $account_ledger->id;\n\t\t}\n\n\t\t//People Ledger\n\t\t//$ledger\n\t\tLog::info(\"PeopleController->update :- after line 338 ledger_id \".$ledger);\n\n\t\t$credit_limit = AccountLedgerCreditInfo::findOrFail($ledger);\n\t\t$credit_limit->max_credit_limit = $request->input('credit_limit');\n\t\t$credit_limit->save();\t\n\n\t\t\n\n\t\t$billing = PeopleAddress::where('id',$request->input('billing_id'))->first();\n\t\tif($billing != null) {\n\t\t\t$billing_address = $billing;\n\t\t} else {\n\t\t\t$billing_address = new PeopleAddress();\n\t\t\t$billing_address->address_type = 0;\n\t\t\t$billing_address->people_id = $people->id;\n\t\t}\n\t\t\t\n\t\t$billing_address->address = $request->input('billing_address');\n\t\t$billing_address->city_id = $request->input('billing_city_id');\n\t\t$billing_address->google = $request->input('billing_google');\n\t\t$billing_address->pin = $request->input('billing_pin');\n\t\t$billing_address->save();\n\n\n\t\t$shipping = PeopleAddress::where('id',$request->input('shipping_id'))->first();\n\n\t\tif($request->input('shipping_address') && $request->input('shipping_city_id'))\n\t\t{\n\t\t\tif($shipping != null) {\n\t\t\t\t$shipping_address = $shipping;\n\t\t\t} else {\n\t\t\t\t$shipping_address = new PeopleAddress();\n\t\t\t\t$shipping_address->address_type = 1;\n\t\t\t\t$shipping_address->people_id = $people->id;\n\t\t\t}\n\n\t\t\t\t$shipping_address->address = $request->input('shipping_address');\n\t\t\t\t$shipping_address->city_id = $request->input('shipping_city_id');\n\t\t\t\t$shipping_address->google = $request->input('shipping_google');\n\t\t\t\t$shipping_address->pin = $request->input('shipping_pin');\n\t\t\t\t$shipping_address->save();\n\t\t}\n\t\telse{\n\t\t\t$address_delete = PeopleAddress::where('people_id',$people->id)->where('address_type',1)->first();\n\t\t\tif($address_delete != null)\n\t\t\t{\n\t\t\t\t$address_delete->delete();\n\t\t\t}\n\t\t\t$shipping_address = $billing_address;\n\t\t\t\n\t\t}\t\t\n\t\tLog::info(\"PeopleController->update :- return \");\n\n\t\treturn response()->json(['status' => 1, 'message' => 'People'.config('constants.flash.updated'), 'data' => ['id' => $people->id, 'first_name' => $people->first_name, 'last_name' => $people->last_name, 'display_name' => $people->display_name,'mobile_no' => $people->mobile_no,'email_address' => $people->email_address,'phone' => $people->phone,'pan_no' => $people->pan_no,'gst_no' => $people->gst_no,'status' =>$people->status,'billing_address' => $billing_address->address, 'address_type' => $billing_address->address_type , 'billing_city_id' => $billing_address->city_id, 'billing_google'=> $billing_address->google,'billing_pin' => $billing_address->pin,'shipping_address'=> $billing_address->address,'address_type' => $shipping_address->address_type,'shipping_city_id' => $shipping_address->city_id,'shipping_google' => $shipping_address->google,'shipping_pin'=>$shipping_address->pin,'billing_id' => $request->input('billing_id') , 'shipping_id' => $request->input('shipping_id'),'credit_limit' => $credit_limit->max_credit_limit ]]);\n\t}", "public function p_edit() { if(!$this->user) {\n Router::redirect('/');\n }\n \n $this->user->user_id = DB::instance(DB_NAME)->sanitize($this->user->user_id);\n $q = 'SELECT first_name, last_name, email\n FROM users\n WHERE user_id = \"'.$this->user->user_id.'\"';\n $user = DB::instance(DB_NAME)->select_row($q);\n \n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n \n $_POST['first_name'] = htmlspecialchars($_POST['first_name'], ENT_QUOTES, 'UTF-8');\n $_POST['last_name'] = htmlspecialchars($_POST['last_name'], ENT_QUOTES, 'UTF-8');\n \n $q = 'SELECT count(*)\n FROM users\n WHERE email = \"'.$_POST['email'].'\"'; \n $count = DB::instance(DB_NAME)->select_rows($q); \n //if the user enters an email which already exists in the data base kick them back\n if(intval($count[0]['count(*)']) >= 1) {\n Router::redirect('/users/edit/error');\n } else {\n \n if($_POST['first_name'] != NULL)\n {\n $user['first_name'] = $_POST['first_name'];\n }\n if($_POST['last_name'] != NULL )\n {\n $user['last_name'] = $_POST['last_name'];\n }\n if($_POST['email'] != NULL )\n {\n $user['email'] = $_POST['email'];\n }\n \n \n \n DB::instance(DB_NAME)->update(\"users\", $user, \"WHERE user_id =\".$this->user->user_id);\n Router::redirect('/users/profile/'.$this->user->user_id);\n }\n \n \n }", "public function update(Request $request, People $people)\n {\n //\n }", "public function editUserDetails($id, $name, $age, $jobTitle, $q1, $q2, $q3, $q4, $q5, $image, $email, $departments){\r\n $this->setSqlQuery(\"UPDATE users SET `name` = '$name', age = $age, jobTitle = '$jobTitle', q1 = '$q1', q2 = '$q2', q3 = '$q3', q4 = '$q4', q5 = '$q5', token = '', image = '$image' WHERE id = '$id'\");\r\n $statement = $this->_dbHandle->prepare($this->sqlQuery); // prepare a PDO statement\r\n $result = $statement->execute(); // execute the PDO statement\r\n\r\n //Delete all entry of user email row from database with department\r\n //Delete first\r\n $this->deleteUserDepartments($email);\r\n //Add second\r\n $this->addDepartments($email, $departments);\r\n return $result;\r\n }", "public function testUpdatePerson()\n {\n }", "public function update($id, $name, $email, $avatar);", "public function update(Request $request, UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function update($persona);", "public function edit(People $people)\n {\n //\n }", "public function edit(People $people)\n {\n //\n }", "function update()\n {\n global $db, $fullname, $email, $Dateofbirth, $Phonenumber, $Occupation, $Address, $gender, $path, $nationality, $user_type;\n\n $id = $_POST['id'];\n $fullname = $_POST['fullname'];\n $Dateofbirth = $_POST['dbirth'];\n $Phonenumber = $_POST['phonenumber'];\n $Occupation = $_POST['occupation'];\n $Address = $_POST['address'];\n $gender = $_POST['mradio'];\n $email = $_POST['email'];\n $$user_type = $_POST['user_type'];\n $path = $_FILES['image'];\n $nationality =$_POST['nationality'];\n $path = mysqli_real_escape_string($db, '../images/uploads/' . $_FILES['image']['name']);\n copy($_FILES['image']['tmp_name'], $path);\n\n mysqli_query($db, \"UPDATE users SET name='$fullname', 'admin','$Occupation','$Address','$Phonenumber', '$Dateofbirth','$gender','$email','$nationality','$path' WHERE id=$id\");\n $_SESSION['message'] = \"Address updated!\";\n header('location: ../members.php');\n \n }", "public function actionUpdateYurPersonal()\n { \n $user_id = Yii::$app->user->identity->id;\n $model = Users::find()->where(['id' => $user_id])->one();\n $model->step_validate = 4;\n $model->load(Yii::$app->getRequest()->getBodyParams(), '');\n if ($model->validate()) {\n $model->save();\n $model->company_image = UploadedFile::getInstanceByName('files');\n // return $model->passport_image;\n if($model->company_image != null){\n $path = Yii::getAlias('@app');\n $model->uploadPassport($path);\n }\n $response = \\Yii::$app->getResponse();\n $response->setStatusCode(202);\n return $model->getUsersYurPersonalValues();\n }\n else {\n throw new HttpException(422, json_encode($model->errors, JSON_UNESCAPED_UNICODE));\n }\n }", "public function update(PersonRequest $request, $id) {\n\t\t//\n\t\t$data = $request->all();\n\t\t//var_dump($data);var_dump('update');die;\n\t\t$res = $this->person->update($id, $data, 'manager'); //修改用户信息\n\n\t\tif (isset($data['operaId']) && $data['operaId'] > 0) {\n\t\t\t$this->opera->update($data['operaId'], array('uid' => $data['uid']), 'manager');\n\t\t}\n\t\techo $res;\n\t}", "function update_person($person_id,$params)\n {\n $this->db->where('person_id',$person_id);\n return $this->db->update('person',$params);\n }", "public function updateIdWiseUser($id,$picname){\n DB::table('users')\n ->where('id', $id)\n ->update(['photo' => $picname]);\n return true;\n }", "public function update_put(){\n $response = $this->PersonM->update_person(\n $this->put('id'),\n $this->put('name'),\n $this->put('hp'),\n $this->put('email'),\n $this->put('message')\n );\n $this->response($response);\n }", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function update($id, Request $request)\n\t{\n\t\t\n\t\t$userid = $request->user()->id;\n\t\t$user = User::find($userid);\n\n\t\tif($user->email!=$request->user()->email)\n\t\t{\n\t\t\t$this->validate($request,[\n\t\t\t\t'name' => 'required|max:255',\n\t\t\t\t// 'address' => 'required',\n\t\t\t\t'email' => 'required|unique:users|max:255',\n\t\t\t\t// 'ph1' => 'required',\n\t\t\t\n\t\t\t\t]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->validate($request,[\n\t\t\t\t'name' => 'required|max:255',\n\t\t\t\t// 'address' => 'required',\n\t\t\t\t'email' => 'required|max:255',\n\t\t\t\t// 'ph1' => 'required',\n\t\t\t\t\n\t\t\t\t]);\n\n\t\t}\n\t\t\n\t\t\n\t\t$input = $request->all();\n\t\t$photourl = $request->user()->photourl;\n\n\n\t\tif(Input::file('photourl')!=\"\")\n\t\t{\n\t\t\tif(Input::file('photourl')->isValid())\n\t\t\t{\n\n\n\t\t\t\t$name = time() . '-' . $request->user()->id . '.' . $input['photourl']->getClientOriginalExtension();\n\t\t\t\t$imagePath = public_path() . '/images/users/';\n\t\t\t\t$directory = $userid;\n\n\t\t\t\tif($photourl!=\"\"){\n\t\t\t\t\tif (file_exists(public_path() .$photourl)) {\n\n\t\t\t\t\t\t\n\t\t\t\t\t\tunlink(public_path() . $photourl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$destinationPath = $imagePath . $directory . '/profilePictures';\n\n\t\t\t\tFile::exists($destinationPath) or File::makeDirectory($destinationPath, 0777, true, true);\n\n\n\t\t\tInput::file('photourl')->move($destinationPath, $name); // uploading file to given path\n\n\t\t\t$photourl = \"/images/users/\" . $directory . '/profilePictures/' . $name;\n\t\t}\n\t}\n\t$user->name = $request->input(\"name\");\n\t$user->mname = $request->input(\"mname\");\n\t\n\t$user->address = $request->input(\"address\");\n\t$user->ph1 = $request->input(\"ph1\");\n\t$user->ph2 = $request->input(\"ph2\");\n\t$user->email = $request->input(\"email\");\n\tif($request->input(\"password\")!=\"\")\n\t{\n\t\t$user->password = Hash::make($request->input(\"password\"));\n\t}\n\t$user->photourl = $photourl;\n\t$user->bio = $request->input(\"bio\");\n\t$user->save();\n\n\tif($id==0)\n\t\t{return redirect()->action('DashboardController@index');}\n\telse\n\t\t{return redirect()->action('HomeController@index');}\n\t\n}", "public function update_userdetails($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $userId = Yii::$app->user->id;\n\n $query = new Query;\n\n $result = $query->createCommand()->update('core_users', ['user_name' => $name,'company_name' => $company_name,'company_address' => $address,'designation' => $designation,'company_email' => $company_email], 'user_id = \"'.$userId.'\"')->execute();\n\n if ($result == 1){\n return \"SUCCESS\";\n }else{\n return \"FAILED\";\n }\n }", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function update(Request $request, $id)\n {\n $user = Users::findOrFail($id);\n\n try{\n $user->name = $request->name;\n $request->filled('birth') ? $user->birth = $request->birth : $user->birth = \"\";\n $user->gender = $request->gender;\n $user->type = $request->type;\n $user->cpf = str_replace(\"/\", \"\", str_replace(\"-\", \"\", str_replace(\".\", \"\", $request->cpfcnpj)));\n $user->email = $request->email;\n $request->filled('phone1') ? $user->phone1 = str_replace(\" \", \"\", str_replace(\"-\", \"\", str_replace(\"(\", \"\", str_replace(\")\", \"\", $request->phone1)))) : $user->phone1 = \"\";\n $request->filled('phone2') ? $user->phone2 = str_replace(\" \", \"\", str_replace(\"-\", \"\", str_replace(\"(\", \"\", str_replace(\")\", \"\", $request->phone2)))) : $user->phone2 = \"\";\n $user->person1 = $request->person1;\n $request->filled('personphone1') ? $user->personphone1 = str_replace(\" \", \"\", str_replace(\"-\", \"\", str_replace(\"(\", \"\", str_replace(\")\", \"\", $request->personphone1)))) : $user->personphone1 = 0;\n $user->person2 = $request->person2;\n $request->filled('personphone2') ? $user->personphone2 = str_replace(\" \", \"\", str_replace(\"-\", \"\", str_replace(\"(\", \"\", str_replace(\")\", \"\", $request->personphone2)))) : $user->personphone2 = 0;\n $user->postalcode = str_replace(\"-\", \"\", $request->postalcode);\n $user->address = $request->address;\n $user->webaccess = $request->webaccess;\n $user->adminappaccess = $request->adminappaccess;\n $user->note = $request->note;\n $user->status = 1;\n $user->log = 'Alteração: '.auth()->user()->name.' '.date(\"d/m/Y H:i\").'| '.$user->log;\n $user->state_id = $request->state_id;\n $user->city_id = $request->city_id;\n $user->district_id = $request->district_id;\n $user->updated_at = date(\"Y-m-d H:i:s\");\n\n $user->save();\n\n session()->flash('alert-ok', 'Cliente alterado com sucesso!');\n return redirect()->route('users.show', $user->id );\n }\n catch(\\Exception $e)\n {\n try{\n $sqllog = new Sqllogs;\n $sqllog->name = 'Cliente: Alteração';\n $sqllog->sql = $e->getMessage();\n $sqllog->created_at = date(\"Y-m-d H:i:s\");\n $sqllog->user_id = auth()->user()->id;\n $sqllog->save();\n session()->flash('alert-fail', '<b>Erro!</b> Tente novamente e caso o erro persista, avise o administrador do sistema.');\n return redirect()->route('users.show', $user->id );\n }\n catch(\\Exception $e)\n {\n session()->flash('alert-fail', '<b>Erro!</b> Avise o administrador do sistema.');\n return redirect()->route('users.show', $user->id );\n } \n }\n }", "function updateUser($userId, $image, $password, $email, $phone, $about){\n //TODO Actually implement the function.\n // $dbQuery = \"UPDATE USERS SET \";\n }", "public function edit(UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function edit_user_info(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'contact' => 'required'\n ]);\n if ($validator->fails()) {\n return response()->json($validator->errors());\n }\n\n $user_id = $request->get('user_id');\n $first_name = $request->get('first_name');\n $last_name = $request->get('last_name');\n $contact = $request->get('contact');\n $dob = $request->get('dob');\n\n $update_array = array();\n if (!is_null($first_name)) {\n $update_array['first_name'] = $first_name;\n }\n if (!is_null($last_name)) {\n $update_array['last_name'] = $last_name;\n }\n if (!is_null($contact)) {\n $update_array['contact'] = $contact;\n }\n if (!is_null($dob)) {\n $update_array['dob'] = $dob;\n }\n if (!is_null($user_id)) {\n $user = User::find($user_id);\n }\n if ($request->hasfile('image')) {\n $image_file = request()->file('image');\n $fileName = str_replace(' ', '', $image_file->getClientOriginalName());\n $image = time() . '_' . $fileName;\n $originalPath = public_path() . '/images/users/';\n $img = Image::make($image_file->getRealPath());\n // if (!empty($user->profile_pic)) {\n // unlink(public_path() . '/images/users/' . $user->profile_pic);\n // }\n $img->resize(200, 200, function ($constraint) {\n $constraint->aspectRatio();\n })->save($originalPath . '/' . $image);\n\n $update_array['profile_pic'] = $image;\n }\n if (!is_null($user_id)) {\n DB::beginTransaction();\n try {\n User::where('id', $user_id)->update($update_array);\n DB::commit();\n return response()->json([\n 'success' => true,\n 'message' => 'Information updated successfully'\n ]);\n }catch (Exception $e){\n DB::rollback();\n return response()->json([ 'success' => false,'message' => 'Information update failed']);\n }\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'No user found for update'\n ]);\n }\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function updateRecord($id, $name, $email, $dob, $hobbies, $tel, $gender, $image)\r\n\t\t{\r\n\t\t\t$sql = \"UPDATE $this->customerTable SET name = '$name', email = '$email', dob = '$dob', hobbies = '$hobbies', tel = '$tel', gender = '$gender', image = '$image' \r\n\t\t\tWHERE id = '$id'\";\r\n\t\t\t$query = $this->con->query($sql);\r\n\t\t\tif ($query) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "function update_persona_perfil($id,$params)\n {\n $this->db->where('id',$id);\n return $this->db->update('persona_perfil',$params);\n }", "public function update(Request $request, $id)\n {\n try {\n $data = $request->input();\n $validation = Validator::make($request->all(), ValidationRequest::$EmpValid);\n if ($validation->fails()) {\n $errors = $validation->messages();\n return Redirect::back()->with('errors', $errors);\n }\n\n $user = User::find(decrypt($id));\n $user->first_name = $data['first_name'];\n $user->last_name = $data['last_name'];\n /*if($data['different_locations'] == '1') {\n $user->phone = $data['phone'];\n }*/\n //Check User Photo\n if (!empty($request->file())) {\n $file = $request->file();\n if (isset($file['company_logo'])) {\n $user->photo = $this->UploadFile($file, 'company_logo', $user->photo);\n }\n }\n\t\t\t//Check \n if (!empty($request->file())) {\n $file = $request->file();\n if (isset($file['order_limit'])) {\n $user->order_limit = $this->UploadFile($file, 'order_limit', $user->photo);\n }\n }\n\n if ($user->save()) {\n \n $empPro = $user->EmployerProfile()->whereUserId(decrypt($id))->first();\n $empPro->company_name = $data['company_name'];\n $empPro->company_address = $data['company_address'];\n\t\t\t\t $empPro->comp_street_name = $data['comp_street_name'];\n\t\t\t\t $empPro->comp_city = $data['comp_city'];\n\t\t\t\t $empPro->comp_country_id = $data['comp_country'];\n\t\t\t\t $empPro->comp_postcode = $data['comp_postcode'];\n $empPro->contact_tel = $data['contact_tel'];\n $empPro->comp_email = $data['comp_email'];\n $empPro->head_office_address = $data['head_office_address'];\n\t\t\t\t $empPro->head_office_street_name = $data['head_office_street_name'];\n\t\t\t\t $empPro->head_office_city = $data['head_office_city'];\n\t\t\t\t $empPro->head_office_country_id = $data['head_office_country'];\n\t\t\t\t $empPro->head_office_postcode = $data['head_office_postcode'];\n $empPro->head_office_contact_person = $data['head_office_contact_person'];\n $empPro->dept = $data['dept'];\n $empPro->head_o_no = $data['head_o_no'];\n $empPro->head_o_email = $data['head_o_email'];\n \n $empPro->authorised_user = $data['authorised_user'];\n $empPro->email = $data['email'];\n $empPro->dd_tel = $data['dd_tel'];\n $empPro->contact_no = $data['contact_no'];\n $empPro->authorised_user_second = $data['authorised_user_second'];\n $empPro->email_second = $data['email_second'];\n $empPro->dd_tel2 = $data['dd_tel2'];\n $empPro->contact_no_second = $data['contact_no_second'];\n $empPro->company_vat_reg_no = $data['company_vat_reg_no'];\n $empPro->company_reg_no = $data['company_reg_no'];\n /*$empPro->different_locations = $data['different_locations'];\n if($data['different_locations'] == '1') {\n $empPro->city = $data['city'];\n $empPro->state = $data['state'];\n $empPro->country_id = $data['country'];\n $empPro->address = $data['address'];\n $empPro->zip = $data['zip'];\n $empPro->address = $data['address'];\n }*/ // commented 30-07-2019\n \n // $empPro->report_name = $data['report_name'];\n\t\t\t\t $empPro->amount_limit = $data['amount_limit'];\n\t\t\t\t //$empPro->report_name = $data['report_name'];\n //$empPro->report_department = $data['report_department'];\n \n $empPro->save();\n }\n Session::flash('success', Config::get('message.options.UPDATE_SUCCESS'));\n return Redirect::back();\n } catch (Exception $ex) {\n return View::make('errors.exception')->with('Message', $ex->getMessage());\n }\n }", "public function update(UsersEditRequest $request, $id)\n {\n $request->validate([\n 'first_name' => 'required|regex:/^[\\pL\\s]+$/u|max:50',\n 'last_name' => 'required|regex:/^[\\pL\\s]+$/u|max:20',\n 'email' => \"required|email|unique:users,email,$id\",\n 'is_active' => 'required',\n 'password' => 'confirmed|nullable',\n 'photo_id' => 'mimes:jpeg,jpg,png | max:4096 | nullable',\n ]); \n\n $user = User::findOrFail($id);\n $input = $request->all();\n if(!empty($request->password)) {\n $request->validate([\n 'password' => 'confirmed|min:8'\n ]); \n $input['password'] = bcrypt($request->password);\n }\n else{\n $input['password'] = $user->password;\n }\n if($file = $request->file('photo_id')){\n $name = time() . $file->getClientOriginalName();\n $file->move('images', $name);\n $photo = Photo::create(['file'=>$name]);\n $input['photo_id'] = $photo->id;\n }\n \n if($user->is_active == 1){\n $activebefore = 'active';\n }\n else{\n $activebefore = 'not active';\n }\n if($request->is_active == 1){\n $active = 'active';\n }\n else{\n $active = 'not active';\n }\n $first_name = Auth::user()->first_name;\n $last_name = Auth::user()->last_name;\n $message = $first_name . ' ' . $last_name . ' <<UPDATED A USER FROM>> ' . '{' . 'name:' . $user->first_name .' '. \n $user->last_name. ' '.'email:'. $user->email.' ' .'role:'. $user->role->name . ' ' . 'is_active:'. \n $activebefore . '}' . ' <<TO>> ' . '{' . 'name:' . $request->first_name .' '. \n $request->last_name. ' '.'email:'. $request->email. ' ' . 'is_active:'. \n $active . '}';\n Log::info($message);\n $user->update($input);\n Session::flash('success', 'You successfully updated a user');\n return redirect('/admin/users');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:people,email,'.$id.',id,deleted_at,NULL',\n 'jabatan' => 'required',\n 'status' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect('persons/edit/'.$id)\n ->withErrors($validator)\n ->withInput();\n }\n\n $Person = Person::findOrFail($id);\n $this->authorize('update', $Person);\n $Person->institution_id = Institution::getIdForCurrentUser($request->input('institution_id'));\n $Person->name = $request->input('name');\n $Person->email = $request->input('email');\n $Person->jabatan = $request->input('jabatan');\n $Person->status = $request->input('status');\n if ($request->has('nip')) {\n $Person->nip = $request->input('nip');\n }\n if ($request->has('expertises')) {\n $Person->expertises = $request->input('expertises');\n }\n $Person->user_id = Auth::user()->id;\n if ($Person->update()) {\n Log::info('User: '.Auth::user()->id. '->Update Person: '. $Person->id);\n flash()->overlay('Berhasil diubah', 'Notification');\n return redirect('persons');\n }\n }", "public function edit($id = null)\n\t{\n\t\tif($id == null){\n\t\t\t$this->Session->setFlash('Please select a person to edit.');\n\t\t\t$this->redirect(array('controller' => 'sga_people', 'action' => 'index'));\n\t\t}\n\t\t\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t\n\t\tif (!$this -> SgaPerson -> exists($id))\n\t\t{\n\t\t\t$this->Session->setFlash('Please select a person to edit.');\n\t\t\t$this->redirect(array('controller' => 'sga_people', 'action' => 'index'));\n\t\t}\n\t\t\n\t\t// if form submited\n\t\tif (!$this -> request -> is('get'))\n\t\t{\n\t\t\t// use saveAll to create a transactional update for the belongsTo\n\t\t\t\n\t\t\t$this->loadModel('User');\n\t\t\t// get the associated user id and level\n\t\t\t$user = $this -> User -> find('first', array(\n\t\t\t\t'fields' => array('User.id', 'User.level'),\n\t\t\t\t'joins' => array(array(\n\t\t\t\t\t\t'table' => 'sga_people',\n\t\t\t\t\t\t'conditions' => array('sga_people.user_id = User.id')\n\t\t\t\t)),\n\t\t\t\t'conditions' => array('sga_people.id' => $id)\n\t\t\t));\n\t\t\t\n\t\t\t$this -> request -> data['SgaPerson']['id'] = $id;// needed for saveAll\n\t\t\t\n\t\t\t// if their status will be Inactive\n\t\t\tif($this->request->data['SgaPerson']['status'] === 'Inactive'){\n\t\t\t\t// if they had sga_ level\n\t\t\t\tif($user['User']['level'] === 'sga_exec' ||\n\t\t\t\t $user['User']['level'] === 'sga_user' ||\n\t\t\t\t $user['User']['level'] === 'sga_admin')\n\t\t\t\t{\n\t\t\t\t\t$this -> request -> data['User']['id'] = $user['User']['id'];\n\t\t\t\t\t$this -> request -> data['User']['level'] = 'gt_member';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if($this->request->data['SgaPerson']['status'] === 'Active'){\n\t\t\t\t// status will be Active\n\t\t\t\t\n\t\t\t\t// if the user is not already an sga_ level\n\t\t\t\tif($user['User']['level'] !== 'sga_exec' &&\n\t\t\t\t $user['User']['level'] !== 'sga_user' &&\n\t\t\t\t $user['User']['level'] !== 'sga_admin')\n\t\t\t\t{\n\t\t\t\t\t$this -> request -> data['User']['id'] = $user['User']['id'];\n\t\t\t\t\t$this -> request -> data['User']['level'] = 'sga_user';\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tif ($this -> SgaPerson -> saveAll($this -> request -> data))\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('The user has been edited.', 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(__('Error. Please try again.', true));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this -> SgaPerson -> id = $id;\n\t\t$sgaPerson = $this -> SgaPerson -> read();\n\t\t\n\t\t$this -> request -> data = $sgaPerson;\n\t\t$this -> set('sgaPerson', $sgaPerson);\n\t}", "public function edit_mentor_profile($id_user = \"\")\n {\n $data['firstname'] = html_escape($this->input->post('firstname'));\n $data['lastname'] = html_escape($this->input->post('lastname'));\n // $data['email'] = html_escape($this->input->post('email'));\n $data['phone'] = html_escape($this->input->post('phone'));\n $data['address'] = html_escape($this->input->post('address'));\n\n if (isset($_FILES['photo']) && $_FILES['photo']['name'] != \"\") {\n unlink('uploads/user_image/' . $this->db->get_where('ref_user', array('id_user' => $id_user))->row('photo') . '.jpg');\n $data['photo'] = md5(rand(10000, 10000000));\n $this->upload_photo($data['photo']);\n }\n\n $this->db->where('id_user', $id_user);\n $this->db->update('ref_user', $data);\n $this->session->set_flashdata('flash_message', 'Berhasil Dirubah');\n }", "function updateProfile($name, $phone, $email, $username, $userid) {\n $query = \"UPDATE users_account SET fullname = ?,mobileno = ?,email = ?,username WHERE userid = ?\";\n $paramType = \"ssssi\";\n $paramValue = array(\n $name,\n $phone,\n $email,\n $username,\n $userid\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }", "public function update()\n { if (is_null($this->id))\n trigger_error(\"User::update(): Attempt to update a User object that does not have its ID property set.\", E_USER_ERROR);\n \n // Update the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"UPDATE users SET user_name=:user_name, user_password_hash=:user_password_hash, user_email=:user_email, orcid=:orcid, orcid_code=:orcid_code, orcid_access_token=:orcid_access_token WHERE user_id = :id\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n $st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR);\n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR);\n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR);\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }", "public function setEditPersona($data){\r\n\t\t\tif(!empty($data['id'])){\r\n\t\t\t\t$query =\"UPDATE persona SET nombres='\".$data['nombres'].\"', apellidos='\".$data['apellidos'].\"', curp='\".$data['curp'].\"', tel='\".$data['tel'].\"', email='\".$data['email'].\"', pass='\".$data['pass'].\"', estado='\".$data['estado'].\"', ciudad='\".$data['ciudad'].\"' WHERE id=\".$data['id'];\r\n\t\t\t\t$result =mysqli_query($this->link,$query);\r\n\t\t\t\tif($result){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\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\treturn false;\r\n\t\t\t}\r\n\t\t}", "public function update(Request $request, $id)\n {\n\n $id = Auth::user()->id;\n $edit_data = EmployeeInfo::where('user_id', $id)->get();\n //return $edit_data;\n\n if ($request->hasFile('photo')) {\n $edit_img = $request->file('photo');\n $edit_photo_uname = md5(time() . rand()) . '.' . $edit_img->getClientOriginalExtension();\n $edit_img->move(public_path('files/uploads'), $edit_photo_uname);\n //unlink('files/uploads' . $edit_data->avatar);\n } else {\n $edit_photo_uname = $edit_data[0]->avatar;\n }\n\n $edit_data[0]->avatar = $edit_photo_uname;\n $edit_data[0]->full_name = $request->full_name;\n $edit_data[0]->contact = $request->contact;\n $edit_data[0]->emergency_contact = $request->emergency_contact;\n $edit_data[0]->age = $request->age;\n $edit_data[0]->gender = $request->gender;\n $edit_data[0]->nid = $request->nid;\n $edit_data[0]->present_address = $request->present_address;\n $edit_data[0]->permanent_address = $request->permanent_address;\n //$edit_data[0]->joining_date = $request->joining_date;\n //$edit_data->marital_status = $request->\n $edit_data[0]->academic_qualification = $request->academic_qualification;\n $edit_data[0]->professional_qualification = $request->professional_qualification;\n $edit_data[0]->experience = $request->experience;\n $edit_data[0]->update();\n\n if ($request->full_name != null) {\n $edit_data = User::find($id);\n $edit_data->name = $request->full_name;\n $edit_data->update();\n }\n\n Alert::success('Success', 'Profile Updated Successfully');\n return redirect()->route('employee.profile');\n }", "public function update_user($id, $name, $email)\n {\n// call usp_user_update('27','cokero','[email protected]');\n \n $sql = 'CALL usp_user_update(?,?,?)';\n return $this->db->query($sql,array($id,$name,$email)); \n \n }", "public function actionUpdate($id)\n { \n\t\t$model = $this->findModel($id);\n\n\t if(!CommonFunctions::lockThisRecord($id,$model,'bpr_person_company','company_id_pk'))\n\t {\n\t\t\t$session = Yii::$app->session;\n\t\t\t$session->set('LockError', 'This record is locked for you, because another user is accessing same record.');\n\t\t\theader('Location:'.Yii::$app->homeUrl.\"personcompany/personcompany\");\n\t\t\texit;\n\t }\n\t\t\n\t\t$request = Yii::$app->request;\n\t\t$gmp_company_name = trim($request->post('gmp_company_name',''));\n\t\t$gmp_address1 = trim($request->post('gmp_address1',''));\n\t\t$gmp_address2 = trim($request->post('gmp_address2',''));\n\t\t$gmp_city_id_fk = intval($request->post('gmp_city_id_fk',0));\n\t\t$gmp_state_id_fk = intval($request->post('gmp_state_id_fk',0));\n\t\t$gmp_country_id_fk = intval($request->post('gmp_country_id_fk',0));\n\t\t$gmp_pobox = trim($request->post('gmp_pobox',''));\n\t\t$gmp_zip_pincode = trim($request->post('gmp_zip_pincode',''));\n\t\t\n\t\t$gmp_company_id_pk = intval($request->post('gmp_company_id_pk',0));\n\t\t\n\t\tif(isset($_POST) && strlen($gmp_company_name) > 0){\n\t\t\n\t\t\t$command = Yii::$app->db->createCommand()\n\t\t\t\t->update('bpr_person_company', [\n\t\t\t\t'name' => trim($gmp_company_name),\n\t\t\t\t'address1' => trim($gmp_address1),\n\t\t\t\t'address2' => trim($gmp_address2),\n\t\t\t\t'city_id_fk' => $gmp_city_id_fk,\n\t\t\t\t'state_id_fk' => $gmp_state_id_fk,\n\t\t\t\t'country_id_fk' => $gmp_country_id_fk,\n\t\t\t\t'pobox'=> trim($gmp_pobox),\n\t\t\t\t'zip_postalcode' => trim($gmp_zip_pincode),\n\t\t\t\t'addedby_person_id_fk' => Yii::$app->user->id,\n\t\t\t\t'created_datetime' => date(\"Y-m-d H:i:s\"),\t\t\t\t\n\t\t\t],\"company_id_pk='\".$id.\"'\")->execute();\n\t\t\tActivityLog::logUserActivity(Yii::$app->user->id,Yii::$app->params['audit_log_screen_name']['PersonCompany'],Yii::$app->params['audit_log_action']['UPDATE'],'Updated person company',\"\");\n\t\t\treturn $this->redirect(['index']);\n\t\t}else{\n\t\t\t\t\t\t\n\t\t\treturn $this->render('update', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n }", "function updatePersonalInfo($user_id,$userData)\n\t\t{\n\t\t\t//getting id of given user id\n\t\t\t$idRow = $this->manageContent->getValue_where(\"user_info\",\"*\",\"user_id\",$user_id);\n\t\t\t$id = $idRow[0]['id'];\n\t\t\t//updating the values\n\t\t\tif(isset($userData['name']) && !empty($userData['name']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"name\",$userData['name'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['gender']) && !empty($userData['gender']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"gender\",$userData['gender'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['dob']) && !empty($userData['dob']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"dob\",$userData['dob'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['contact']) && !empty($userData['contact']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"contact_no\",$userData['contact'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add1']) && !empty($userData['add1']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line1\",$userData['add1'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add2']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line2\",$userData['add2'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['pin']) && !empty($userData['pin']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"pincode\",$userData['pin'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['city']) && !empty($userData['city']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"city\",$userData['city'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['state']) && !empty($userData['state']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"state\",$userData['state'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['country']) && !empty($userData['country']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"country\",$userData['country'],\"id\",$id);\n\t\t\t}\n\t\t}", "public function update(Request $request, $id)\n {\n\n \n \n $personalUpdate = User::findOrFail($id);\n \n\n $personalUpdate->name = $request->name;\n $personalUpdate->lastname = $request->lastname;\n $personalUpdate->email = $request->email;\n\n $personalUpdate->telefono = $request->telefono;\n $personalUpdate->identification = $request->identification;\n\n $personalUpdate->save();\n\n\n $personalUpdate2 = Personal::findOrFail($personalUpdate->personal->id);\n\n $personalUpdate2->oficio = $request->oficio;\n $personalUpdate2->save();\n\n Alert::success('Operación realizada con éxito','¡Personal editado!');\n\n return redirect()->route('personal.index');\n\n\n }", "public function actionPutUserProfile() {\n\t\t $id = $_REQUEST['id'];\n\t\t$_POST['UserProfile'] = array('FirstName'=>'deepali2222');\n\t\t$model=$this->loadModel( $id );\n\t\tif( isset($_POST['UserProfile']) ) {\n\t\t $model->attributes=$_POST['UserProfile'];\n\t\t\t//$model->attributes=$userProfileArray;\n\t\t\tif( $model->save() ) {\r\n\t\t\t\t// success message\r\n\t\t\t\t//parent::sendResponse( 'Updated successfully' );\r\n\t\t\t\t$str = 'Updated successfully';\r\n\t\t\t} else {\r\n\t\t\t\t//parent::errorMessage( 'Failed to update data' );\r\n\t\t\t\t$str = 'Failed to update data';\r\n\t\t\t}\r\n\t\t\treturn $str;\n\t\t}\n\t}", "public function update($id, Request $request)\n {\n $edit = role_priviledge::getPriviledge(2);\n $publish = role_priviledge::getPriviledge(4);\n $user = user::findorfail($id);\n $company = company::find(1);\n\n if($edit == '1')\n {\n \n $plan = plan::find(request('plan_id'));\n \n if (empty($user)) {\n Flash::error('contributor not found');\n\n return redirect(route('contributor.index'));\n }\n $date = date(\"Y-m-d H:i:s\");\n\n $img = \"user-thumb-sm.png\";\n $user_image = ImageUploadingHelper::upload_image(\"images/users\",request('img'),$request);\n\n $user->name = request('fname').' '.request('lname');\n $user->fname = request('fname');\n $user->lname = request('lname');\n $user->email = request('email');\n $user->username = request('email');\n $user->password = bcrypt($request->input('email'));\n $user->ref = encrypt($request->input('email'));\n $user->roleid = 4;\n $user->email_verify = 1;\n $user->phone_verify = 1;\n $user->bvn_verify = 1;\n $user->kyc_verify = 0;\n //$user->bank_id = request('bank_id');\n //$user->account_no = request('account_no');\n $user->referby = request('referby');\n //$user->accountname = request('accountname');\n //$user->bvn = request('bvn');\n //$user->dob = request('dob');\n $user->gender = request('gender');\n $user->location = request('location');\n //$user->city = request('city');\n //$user->state = request('state');\n //$user->country = request('country');\n $user->remember_token = encrypt($request->input('email'));\n $user->phonenumber = request('phonenumber');\n $user->status = 1;\n $user->created_at = $date;\n //$user->employer_address = request('employer_address');\n //$user->establishment = request('establishment');\n //$user->date_of_expiry = request('date_of_expiry');\n //$user->date_issued = request('date_issued');\n //$user->Identification_number = request('Identification_number');\n //$user->type_of_id = request('type_of_id');\n //$user->village = request('village');\n //$user->legal_status_id = request('legal_status_id');\n $user->business_address = request('business_address');\n //$user->marital_status_id = request('marital_status_id');\n //$user->pep = isset($request->pep) ? '1':'0';\n //$user->regulatory_status = request('regulatory_status');\n\n //$user->kin_name = request('kin_name');\n //$user->kin_relationship = request('kin_relationship');\n //$user->kin_phone = request('kin_phone');\n //$user->kin_email = request('kin_email');\n //$user->kin_gender_id = request('kin_gender_id');\n //$user->kin_dob = request('kin_dob');\n //$user->kin_id_type = request('kin_id_type');\n //$user->kin_id_number = request('kin_id_number');\n //$user->kin_home_address = request('kin_home_address');\n //$user->kin_occupation = request('kin_occupation');\n //$user->kin_occupation_address = request('kin_occupation_address');\n //$user->gar_name = request('gar_name');\n //$user->gar_occupation = request('gar_occupation');\n //$user->gar_position = request('gar_position');\n //$user->gar_relationship = request('gar_relationship');\n //$user->gar_gender = request('gar_gender');\n //$user->gar_phone = request('gar_phone');\n //$user->gar_address = request('gar_address');\n //$user->gar_id_type = request('gar_id_type');\n //$user->gar_id_number = request('gar_id_number');\n //$user->gar_date_issued = request('gar_date_issued');\n //$user->gar_date_expiry = request('gar_date_expiry');\n //$user->gar_date_signed = request('gar_date_signed');\n $user->plan_id = $plan->id;\n $user->plan_name = $plan->name;\n $user->plan_contribution_amount = $plan->contribution_amount;\n $user->plan_loan_amount = $plan->mininum_loan_amount;\n $user->plan_duration = $plan->duration;\n $user->updated_at = $date;\n $user->user_img = isset($user_image) ? $user_image : $img;\n $user->save();\n\n $idcount = user::where('roleid','4')->count();\n\n if($idcount == 0)\n {\n $idcount = 1;\n }\n else\n {\n $idcount = $idcount;\n }\n\n \n $id_len = strlen($idcount);\n\n $reg_no = \"\";\n \n if($id_len == 1)\n {\n $reg_no = $company->contributor_code_prefix . \"00\" . $idcount;\n }\n else if($id_len == 2)\n {\n $reg_no = $company->contributor_code_prefix . \"0\". $idcount;\n }\n else\n {\n $reg_no = $company->contributor_code_prefix . $idcount;\n }\n\n Flash::success('contributor was updated successfully.');\n GeneralHelper::audit_admin_trail(\"contributor was updated with id:\" . $user->id,Auth::user()->id,Auth::user()->name);\n return redirect(route('contributor.index'));\n }\n else\n {\n Flash::warning('No Permission to Edit contributor.');\n GeneralHelper::audit_admin_trail(\"Attempt to edit a contributor\",Auth::user()->id,Auth::user()->name);\n return redirect()->route('contributor.index');\n }\n }", "public function edit_user_details() {\n $this->check_auth();\n $update_data = array(\n 'email' => $this->input->post('email'),\n 'first_name' => $this->input->post('first_name'),\n 'prefix' => $this->input->post('prefix'),\n 'last_name' => $this->input->post('last_name'),\n );\n $this->load->helper('image_upload_helper');\n $cover_pic = do_image_upload(config_item('src_path_cover_images'), 10000, 500, 'image');\n $profile_pic = do_image_upload(config_item('src_path_profile_pictures'), 10000, 500, 'cover_image');\n if ($cover_pic) {\n if (isset($cover_pic['error'])) {\n return $this->send_error($cover_pic['error']);\n }\n $update_data['cover_image'] = $cover_pic[0];\n $update_data['image'] = $cover_pic[0];\n }\n if ($profile_pic) {\n if (isset($profile_pic['error'])) {\n return $this->send_error($profile_pic['error']);\n }\n $update_data['cover_image'] = $profile_pic[0];\n $update_data['image'] = $profile_pic[0];\n }\n if (!$this->db->where('id', $this->user_id)->update('users', $update_data)) {\n return $this->send_error('ERROR');\n }\n return $this->send_success();\n }", "public function update(Request $request){\n if(Auth::user()->id == $request->id){\n $user = \\App\\User::find(Auth::user()->id);\n $user->id = Auth::user()->id;\n $user->name = $request->name;\n $user->email = $request->email;\n $user->profile_pic = $request->photo;\n if($user->save()){\n $msg = 'user updated';\n return response($msg);\n }\n }\n }", "public function updateUser($data) {\n\t\t\n\t}", "private function updateUser () {\n $sql = \"UPDATE users SET avatar = :avatar,\n biography = :biography,\n birthdate = :birthdate,\n email = :email,\n nickname = :nickname,\n location = :location,\n password = :password,\n activated = :activated,\n phone = :phone,\n username = :username,\n website = :website WHERE id_user = :id_user\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':avatar', $this->avatar);\n $query->bindParam(':biography', $this->biography);\n $query->bindParam(':birthdate', $this->birthdate);\n $query->bindParam(':email', $this->email);\n $query->bindParam(':nickname', $this->nickname);\n $query->bindParam(':location', $this->location);\n $query->bindParam(':password', $this->password);\n $query->bindParam(':phone', $this->phone);\n $query->bindParam(':username', $this->username);\n $query->bindParam(':website',$this->website);\n $query->bindParam(':activated',$this->activated);\n $query->bindParam(':id_user',$_SESSION['auth']['id_user']);\n $query->execute();\n }", "public function update(Request $request, $id)\n {\n //\n\t\t$user = User::find($id);\n\n\t\t$user->info($request->all());\n\n\t\t$userInfo = $user->info;\n\n\t\t$userInfo->company_name = $request->input('company_name');\n\t\t$userInfo->description = $request->input('description');\n\n\t\t$userInfo->company_name = $request['company_name'];\n\t\t$userInfo->registration_code = $request['registration_code'];\n\t\t$userInfo->vat_number = $request['vat_number'];\n\t\t$userInfo->address = $request['address'];\n\t\t$userInfo->employees_number = $request['employees_number'];\n\t\t$userInfo->website = $request['website'];\n\t\t$userInfo->person_skype = $request['person_skype'];\n\t\t$userInfo->person_phone = $request['person_phone'];\n\t\t$userInfo->creation_year = $request['creation_year'];\n\t\t$userInfo->person_full_name = $request['person_full_name'];\n\t\t$userInfo->person_job_title = $request['person_job_title'];\n\n\n\t\t$userInfo->save($request->all());\n\n\t\t$userInfo->save();\n\t\t$user->save();\n\n\t\tSession::flash('message', __('Company details updated'));\n\n\t\treturn redirect()->back();\n }", "public function update(PersonalRequest $request, $id)\n {\n $person = $this->person->find($id);\n\n $this->handleUploads($person);\n app('API')->tags->sync($person);\n \n $person->update($request->all());\n\n $this->redirect();\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email1=\\\"$this->email1\\\",address1=\\\"$this->address1\\\",lastname=\\\"$this->lastname\\\",phone1=\\\"$this->phone1\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function updateFacebook($id, $name, $email, $avatar, $profile);", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'editusername' => 'required|string|min:6|max:30',\n 'editimajl' => ['required', 'min:6', 'max:30', 'email', 'regex:/(.*)@(met|gmail)\\.com/i'],\n 'editpassword' => 'required|string|min:6|max:30',\n ]);\n $update_array=[\n 'person_username'=>$request->input('editusername'),\n 'person_email'=>$request->input('editimajl'),\n 'person_password'=>$request->input('editpassword')\n ];\n\n DB::table('persons')->where('person_id', $id)->update($update_array);\n\n return redirect('/person')->with('success','Person is updated');\n }", "public function testUpdateSiteMembershipRequestForPerson()\n {\n }", "function editUser($id, $fname, $username, $password, $email){\n $pdo = Database::getInstance()->getConnection();\n\n //TODO: Run the proper SQL query to update tbl_user with proper values\n $update_user_query = 'UPDATE tbl_user SET user_fname = :fname, user_name = :username,';\n $update_user_query .= ' user_pass=:password, user_email =:email WHERE user_id = :id';\n $update_user_set = $pdo->prepare($update_user_query);\n $update_user_result = $update_user_set->execute(\n array(\n ':fname'=>$fname,\n ':username'=>$username,\n ':password'=>$password,\n ':email'=>$email,\n ':id'=>$id\n )\n );\n\n // echo $update_user_set->debugDumpParams();\n // exit;\n\n //TODO: if everything goes well, redirect user to index.php\n // Otherwise, return some error message...\n if($update_user_result){\n redirect_to('index.php');\n }else{\n return 'Guess you got canned...';\n }\n}", "static public function mdlEditUser($table, $data){\n\n\t\t$stmt = Connection::connect()->prepare(\"UPDATE $table set name = :name, email = :email, password = :password, role = :role, photo = :photo WHERE userName = :userName\");\n\n\t\t$stmt -> bindParam(\":name\", $data[\"name\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":userName\", $data[\"userName\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":email\", $data[\"email\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":password\", $data[\"password\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":role\", $data[\"role\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":photo\", $data[\"photo\"], PDO::PARAM_STR);\n\n\t\tif ($stmt->execute()) {\n\t\t\t\n\t\t\treturn 'ok';\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn 'error';\n\t\t\n\t\t}\n\t\t\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\t}", "public function update(Request $request, $id)\n {\n $user = User::findOrFail($id);\n\n if ($this->has_super_moderate_id($id)) {\n return response()->json($this->has_super_moderate_id($id));\n }\n\n $rules = array(\n 'firstname' => 'alpha|min:3|max:15',\n 'lastname' => 'alpha|min:3|max:15',\n 'email' => 'string|email|max:30|unique:users',\n 'password' => 'string|min:5|confirmed',\n 'photo' => 'image|mimes:jpeg,jpg,png|max:300',\n 'facebook' => 'nullable|string|max:20',\n 'twitter' => 'nullable|string|max:20',\n );\n\n $validator = $this->validate($request, $rules);\n \n $identityname =\"\";\n $data = [];\n\n if ($user->hasRole('super-admin') && Auth::user()->id != $id) {\n $data['errors'] = ['fail' =>['You can not edit a super-admin']];\n //$data['fail'] =\"You can not edit a super-admin\";\n return response()->json($data);\n }\n\n if ($request->hasFile('photo')) {\n //$destination = public_path('/images');\n $identity = $request->file('photo');\n $identityname = $user->email.\".\".$identity->getClientOriginalExtension();\n //$identity->move($destination, $identityname);\n Image::make($request->file('photo'))->resize(150, 150)->save(public_path('images/avatar/'.$identityname));\n $user->update(['photo' => '/images/avatar/'.$identityname]);\n\n $png = '/images/avatar/'.$user->email.\".png\";\n $jpeg = '/images/avatar/'.$user->email.\".jpeg\";\n $jpg = '/images/avatar/'.$user->email.\".jpg\";\n $photos = [$png, $jpeg, $jpg];\n $pic = $user->photo;\n //if (($key = array_search($pic, $photos)) !=false) {\n $key = array_search($pic, $photos);\n unset($photos[$key]);\n //}\n\n foreach ($photos as $photo) {\n $path = public_path().$photo;\n \n if (file_exists($path)) {\n unlink($path);\n }\n \n } \n }\n\n if ($request->password) {\n if (Auth::user()->id != $user->id) {\n $data['errors'] = ['fail' =>['You dont have permission to change user password']];\n return response()->json($data);\n }\n //$old = Hash::make($request->oldpass);\n if (Hash::check($request->oldpass, $user->password)) {\n $user->update(['password' => Hash::make($request->password)]);\n }else {\n $data['errors'] = ['fail' =>['Old password is invalid']];\n //$data['fail']= \"Old password is invalid\";\n return response()->json($data);\n }\n\n }\n\n if ($request->role) {\n\n if (!$user->hasRole('super-admin')) {\n if ($request->role!='super-admin') {\n $user->syncRoles([$request->role]);\n }else {\n $data['errors'] = ['fail' =>['User cant be assigned super-admin']];\n //$data['fail']= \"User cant be assigned super-admin\";\n return response()->json($data);\n }\n \n } else {\n $data['errors'] = ['fail' =>['super-admin role cant be changed']];\n //$data['fail']= \"super-admin role cant be changed\";\n return response()->json($data);\n }\n }\n \n if ($request->firstname) {\n $user->update(['firstname' => $request->firstname]);\n }\n if ($request->lastname) {\n $user->update(['lastname' => $request->lastname]);\n }\n if ($request->email) {\n $user->update(['email' => $request->email]);\n }\n if ($request->facebook) {\n $user->update(['facebook' => $request->facebook]);\n }\n if ($request->twitter) {\n $user->update(['twitter' => $request->twitter]);\n }\n\n $data['success'] = 'User updated successfully';\n $data['user'] = $user;\n //$data['name'] = $request->all();\n return response()->json($data);\n }", "public function updateProfile(array $data){\n $user = App_Auth::getInstance()->getIdentity();\n $data['id'] = $user->id;\n\n $this->save($data);\n }", "function updateUserSocialController(){\n\t\t\t$this->load->model('User_model');\n\t\t\t$id = $_POST[\"id\"];\n\t\t\t$facebook = $_POST[\"facebook\"]; \n\t\t\t$googleplus = $_POST[\"googleplus\"]; \n\t\t\t$linkedIn = $_POST[\"linkedIn\"];\n\t\t\t$twitter = $_POST[\"twitter\"];\n\t\t\t$website = $_POST[\"website\"];\n\t\t\tif($this->User_model->updateUserSocialModel($id,$facebook,$googleplus,$linkedIn,$twitter,$website)){\n\t\t\t \techo 'added';\n\t\t\t}else{\n\t\t\t\techo 'Failed';\n\t\t\t}\n\t\t\t \n\t\t}", "public function update(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'email' => [\n 'bail',\n 'nullable',\n 'email',\n 'max:191',\n Rule::unique('people')->ignore($request->input('id')),\n ],\n 'phone' => [\n 'bail',\n 'string',\n 'required',\n 'size:11',\n Rule::unique('people')->ignore($request->input('id'))\n ],\n 'name' => 'bail|required|string|max:191',\n 'password' => 'bail|nullable|string|min:6|confirmed'\n ]);\n\n if ($validator->fails()) {\n return json_encode([\"error\" => \"There is a problem with the form you submitted. Make sure all fields are of the correct type\"]);\n }\n\n $person = People::find($request->input('id'));\n if (empty($person)) return json_encode(['error' => \"Invalid user\"]);\n $person->name = $request->input('name');\n $person->email = !empty($request->input('email')) ? $request->input('email') : \"\";\n $person->phone = $request->input('phone');\n if(!empty($request->input('password')))\n $person->password = bcrypt($request->input('password'));\n if($person->save())\n return new PeopleResource($person);\n return json_encode([\"error\" => \"Error updating record. Try again\"]);\n }", "public function update_profile(){\n\t\t\t$data = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'zipcode' => $this->input->post('zipcode'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'username' => $this->input->post('username')\n\t\t\t);\n\n\t\t\t$this->db->where('id', $this->input->post('id'));\n \n return $this->db->update('users', $data);\n\t\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function updateUserPhoto($app) {\n $user = Users::findFirstById($this->request->get('user_id'));\n if ($user) {\n $extension;\n if ($this->request->hasFiles()) {\n //DEVUELVE SI O SI UN ARRAY\n $files = $this->request->getUploadedFiles();\n foreach ($files as $file) {\n $arrayextension = explode('.', $file->getName());\n $extension = $arrayextension[sizeof($arrayextension) - 1];\n if ($extension == 'jpg' || $extension == 'jpeg' || $extension == 'png') {\n $time = time();\n $file->moveTo('files/' . $user->id . $time . '.' . $extension);\n $user->photo = $user->id . $time . '.' . $extension;\n $user->update();\n return array('response' => true, 'user' => $user);\n } else {\n $resultado = array('response' => false, 'message' => 'Formato de la foto no valido');\n }\n }\n }\n } \n }", "public function updateUserinfo()\n\t{\n\t\t$user_array = Session::all();\n\n \t$userID = Session::get('id');\n\t\t$data = $this->request->all();\n\t\t$data['user'] = Auth::user();\n\t\t\t$rules = array(\n \t\t'full_name' => 'required',\n\t\t\t\t'zip_code' => 'required',\n\t\t\t\t'aniversary_date' => 'required',\n\t\t\t\t'phone_number' => 'required',\n\t\t\t\t'dob' => 'required',\n\t\t\t\t'gender' => 'required',\n\t\t\t\t'location_id' => 'required'\t\t\t\t\n\t\t\t);\n\n\t\t\t$message = array(\n\t\t\t\t'required' => 'The :attribute is required', \n\t\t\t);\n\n\t\t\t$validation = Validator::make($data, $rules, $message);\n\n\t\t\tif($validation->fails())\n\t\t\t{\n\t\t\t\treturn Redirect::to('/users/updateinfo')->withErrors($validation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t$arrResponse=Profile::updateProfileWeb($data, $userID);\n \treturn Redirect::to('/users/myaccount')\n\t\t ->with('flash_notice', '');\n\t\t }\n\t}", "public function update(personal $personal);", "public function update()\n {\n $user = Auth::user();\n\n $data = request()->validate([\n 'name' => 'required|string',\n 'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,\n ]);\n\n $user->update($data);\n }", "public function p_profile_edit() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"' AND email != '\" . $this->user->email . \"'\");\n\n //If email already exists \n if($duplicate){ \n \n //Redirect to error page \n Router::redirect('/users/profile/?duplicate=true');\n }\n\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n $q = \"UPDATE users\n SET first_name = '\".$_REQUEST['first_name'].\"',\n last_name = '\".$_REQUEST['last_name'].\"',\n email = '\".$_REQUEST['email'].\"'\n WHERE id = '\".$this->user->id.\"'\";\n\n DB::instance(DB_NAME)->query($q);\n Router::redirect(\"/users/profile\");\n\n \n }", "public function editCompanyProfile() {\n $id = Session::has('proxy_cpy_id') ? Session::get('proxy_cpy_id') : Session::get('cpy_id');\n $postData = Input::all();\n if (!empty($postData)) {\n if ($postData['logo']) {\n $allowed = array('jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'gif', 'GIF');\n $file = Input::file('logo');\n $extension = $file->getClientOriginalExtension();\n $fname = $file->getClientOriginalName();\n if (!in_array($extension, $allowed)) {\n return Redirect::back()->withInput()->with('erroralert', 'Please upload valid file.');\n }\n }\n if (empty($postData['forgot_status'])) {\n $postData['forgot_status'] = '1';\n }\n $updateArray = array('company_name' => $postData['cpy_name'],\n 'company_uen' => $postData['cpy_uen'],\n 'telephone' => $postData['ph_no'],\n 'fax_no' => $postData['fax_no'],\n 'Industry' => $postData['Industry'],\n 'e_year' => $postData['e_year'],\n 'bank_name' => $postData['bank_name'],\n 'bank_acc_no' => $postData['bank_acc_no'],\n 'payment_type' => $postData['payment_type'],\n 'cpf_sub' => $postData['cpf_sub'],\n 'cpf_pay' => $postData['cpf_pay'],\n 'cpf_sno' => $postData['cpf_sno'],\n 'business_address' => $postData['business_address']\n //'forgot_pstatus' => $postData['forgot_status'],\n //'block_no' => $postData['block_hse_no'],\n //'street_name' => $postData['street_name'],\n //'level' => $postData['level'],\n //'unit_no' => $postData['unit_no'],\n //'city' => $postData['city'],\n //'state' => $postData['state'],\n //'country' => $postData['country']\n );\n $updateStatus = DB::table('hr_company_dtls')->where('id', $id)->update($updateArray);\n if ($postData['logo']) {\n $updateimage = DB::table('hr_company_dtls')->where('id', $id)->update(array('logo' => $extension));\n $filename = $id . '.' . $file->getClientOriginalExtension();\n $cpath = 'public/company_info/' . $id;\n if (!file_exists($cpath)) {\n mkdir($cpath, 0755);\n }\n $path = 'public/company_info/' . $id . '/logo';\n if (!file_exists($path)) {\n mkdir($path, 0755);\n }\n $files_path = 'public/company_info/' . $id . '/logo';\n $destinationPath = $files_path;\n\n $img = Image::make($file);\n $img->resize(100, 100, function ($constraint) {\n $constraint->aspectRatio();\n });\n $img->save($destinationPath . '/' . $filename);\n }\n // if(!empty($updateStatus)){\n return Redirect::to('config/edit-account-register')->with('successalert', 'Company account updated successfully');\n //} \n }\n $cpyDtls = DB::table('hr_company_dtls')->where('id', $id)->first();\n return View::make('settings.company.companyProfile')->with(array('cpy' => $cpyDtls));\n }", "public function update(UpdateFacultyMemberRequest $request, $id)\n {\n $user = PersonalParticular::where('user_id', $id)->first();\n\n $this->validate($request, [\n 'email' => 'required|unique:users,email,' . $user->user_id,\n 'mobilephone' => 'required|numeric|unique:personal_particulars,mobilephone,' . $user->id,\n ]);\n\n $data = $request->all();\n\n $data['fullname'] = $request->get('lastname') . ', ' . $request->get('firstname');\n\n $data['age'] = Carbon::parse($request->get('birth'))->diff(Carbon::now())->format('%y');\n \n if($request->hasFile('image')){\n\n unlink(public_path() . '/images/' . auth()->user()->photo->file);\n\n $name = time() . $request->file('image')->getClientOriginalName();\n\n $request->file('image')->move('images', $name);\n\n $photo = Photo::create(['file'=>$name]);\n\n auth()->user()->update(['photo_id' => $photo->id]);\n }\n\n PersonalParticular::where('user_id', $id)->first()->update($data);\n\n PersonalParticular::where('user_id', $id)->first()->user()->update(['name' => $data['fullname'] , 'email' => $data['email']]);\n\n Log::channel('customlog')->info('User ' . $user->name . ' updated his/her Personal Particular.');\n\n session()->flash('success', 'User updated Successfully.');\n\n return redirect(route('head.index'));\n }", "public function editUser($id=0){\n\t if(Input::isMethod('post')){\n\t\t\t$rules = array(\n\t\t\t'first_name' \t=> 'required',\n\t\t\t'last_name' \t\t=> 'required',\n\t\t\t'username' \t=> 'required',\n\t\t\t'email' \t\t=> 'required|email|unique:users,id',\n\t\t\t'phone' \t\t\t=> 'required',\n\t\t\t);\n\t\t$validator = Validator::make(Input::all(),$rules);\n\t\t if ($validator->fails()) {\n\t\t\t$messages = $validator->messages();\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t } else {\n\t\t\t\t\t\t\tif(Input::file('image')){\n\t\t\t\t\t\t\t\t$image \t\t\t\t\t= \tInput::file('image');\n\t\t\t\t\t\t\t\t$filename \t\t\t= \ttime() . '_'.$image->getClientOriginalName();\n\t\t\t\t\t\t\t\t$path \t\t\t\t\t= \tpublic_path('uploads/users/' . $filename);\n\t\t\t\t\t\t\t\t$path2 \t\t\t\t\t= \tpublic_path('uploads/users/50x50/' . $filename);\n\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize(50,50)->save($path2);\n\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->save($path);\n\t\t\t\t\t\t\t\t\t$x \t\t= \t100;\n\t\t\t\t\t\t\t\t\t$y \t\t= \t100;\n\t\t\t\t\t\t\t\tfor($i=1;$i<6;$i++){\n\t\t\t\t\t\t\t\t\t$path \t=\tpublic_path('uploads/users/'.$x.'x'.$y.'/'. $filename);\n\t\t\t\t\t\t\t\t\tImage::make($image->getRealPath())->resize($x,$y)->save($path);\n\t\t\t\t\t\t\t\t\t$x = $x+100;\n\t\t\t\t\t\t\t\t\t$y = $y+100;\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\t$user\t\t\t=\tAdminUser::GetById($id); // getting user data by id.\n\t\t\t\t\t\t\t\t$filename\t=\t$user->image;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$update_user = AdminUser::UpdateUser($id,$filename); // calls function for update user data.\n\t\t\t\t\t\t\t\tif($update_user){\n\t\t\t\t\t\t\t\t\tSession::flash('flash_success', trans(\"User successfully updated.\"));\n\t\t\t\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tSession::flash('flash_error', trans(\"Technical error while updating user.\"));\n\t\t\t\t\t\t\t\t\treturn redirect()->route('userslist');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t }else{\n\t\t\t\t\t\t$user = AdminUser::GetById($id); // calls function for getting user data by id.\n\t\t\t\t\t\treturn view('admin.pages.users.edit', ['user' => $user]);\n\t }\n\t}", "public function actioneditProfile()\n\t{\t\n\t\t$data = array();\n\t\t$data['city'] = $_POST['city'];\n\t\t\n\t\t\n\t\t$userObj = new Users();\n\t\t$userObj->setData($data);\n\t\t$userObj->insertData($_POST['userId']);\n\t\tYii::app()->user->setFlash('success',\"Successfully updated\");\n\t\t$this->redirect('admin/users');\n\t\t//Yii::app()->user->setFlash('error',\"Please update your profile\");\n\t\t//$this->render('userProfile',$profileData);\n\t\n\t}", "public function update(ImageEditRequest $request, $id)\n {\n $profile = Profile::find($id);\n\n $profile->id = Auth::user()->id;\n $profile->gender = $request->gender;\n $profile->address = $request->address;\n $profile->dob = $request->dob;\n $profile->phone_number = $request->phone_number;\n $profile->school_name = $request->school_name;\n $profile->user_id = Auth::user()->id;\n\n\n $myArray =explode('@', Auth::user()->email);\n\n //your_photo upload\n if($request->has('your_photo')){\n unlink(public_path('/images/your_photos/'.$profile->your_photo));\n $your_photo = 'your_photo_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->your_photo->getClientOriginalExtension();\n $request->your_photo->move(public_path('/images/your_photos'), $your_photo);\n $profile->your_photo = $your_photo;\n }\n\n //citizenship_front upload\n if($request->has('citizenship_front')){\n unlink(public_path('/images/citizenship_fronts/'.$profile->citizenship_front));\n $citizenship_front = 'citizenship_front_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->citizenship_front->getClientOriginalExtension();\n $request->citizenship_front->move(public_path('/images/citizenship_fronts'), $citizenship_front);\n $profile->citizenship_front = $citizenship_front;\n }\n\n //citizenship_back upload\n if($request->has('citizenship_back')){\n unlink(public_path('/images/citizenship_backs/'.$profile->citizenship_back));\n $citizenship_back = 'citizenship_back_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->citizenship_back->getClientOriginalExtension();\n $request->citizenship_back->move(public_path('/images/citizenship_backs'), $citizenship_back);\n $profile->citizenship_back = $citizenship_back;\n }\n\n //marksheet_photo upload\n if($request->has('marksheet_photo')){\n unlink(public_path('/images/marksheet_photos/'.$profile->marksheet_photo));\n $marksheet_photo = 'marksheet_photo_'.Auth::user()->id.'_'.time().'_'.$myArray[0].'.'.$request->marksheet_photo->getClientOriginalExtension();\n $request->marksheet_photo->move(public_path('/images/marksheet_photos'), $marksheet_photo);\n $profile->marksheet_photo = $marksheet_photo;\n }\n\n //saving interests by implode function:\n if($request->has('interest')){\n $stringOfInterest = implode(',', $request->input('interest'));\n $profile->interest = $stringOfInterest.',Academic';\n }\n else{\n $profile->interest = \"Academic\";\n }\n\n\n //saving interests\n // $input = $request->all();\n // $input['interest'] = $request->input('interest');\n // $profile->interest = $input['interest'];\n \n\n $profile->save();\n\n return redirect()->route('profile.show', Auth::user()->id)->withStatus('Profile info updated!');\n }", "function updateUser(){\n\t$conn = db_connect();\n\n\tif(isset($_GET['id']) && (int)$_GET['id'] > 0){#proper data must be on querystring\n\t\t$myID = (int)$_GET['id']; #Convert to integer, will equate to zero if fails\n\t}\n\n\tif(isset($_POST['firstname'])){$firstName=$_POST['firstname'];}else{$firstName = '';}\n if(isset($_POST['lastname'])){$lastName=$_POST['lastname'];}else{$lastName = '';}\n if(isset($_POST['userPhone'])){$userPhone=$_POST['userPhone'];}else{$firstName = '';}\n if(isset($_POST['userEmail'])){$userEmail=$_POST['userEmail'];}else{$lastName = '';}\n if(isset($_POST['type'])){$type=$_POST['type'];}else{$type = '';}\n\n\t$sql = \"UPDATE users set firstName='%s',lastName='%s',PhoneNumber='%s',EmailAddress='%s',TypeId=%d WHERE UserId = \" . $myID;\n\n\t$sql = sprintf($sql,$firstName,$lastName, $userPhone,$userEmail, $type);\n\t$result = mysqli_query($conn,$sql); \n \n\tif ($result)\n\t{#successful update!\n\t\t$newURL = 'detail.php?id=' . $myID;\n\t}else{\n\t\t$newURL = 'edit.php?id=' . $myID;\n\t}\n\theader('Location: '.$newURL);\n die();\n}", "public function update_profile() {\n\t\tloggedOnly();\n\n\t\t// Busca o usuario\n\t\t$user = auth();\n\n\t\t// Pega o email\n\t\t$email = $this->input->post( 'email' ) ? \n\t\t\t\t $this->input->post( 'email' ) :\n\t\t\t\t $user->email;\n\n\t\t// Verifica se o email foi alterado\n\t\tif( $email !== $user->email ) {\n\n\t\t\t// Verifica se o email é unico\n\t\t\tif( $this->User->email( $email ) ) {\n\t\t\t\treturn reject( 'E-mail ja cadastrado no sistema' );\n\t\t\t}\n\t\t\t\n\t\t\t// Seta o email\n\t\t\t$user->email = $email;\n\t\t}\n\n\t\t// Verifica se a senha foi alterada\n\t\tif( $password = $this->input->post( 'password' ) ) {\n\t\t\t$user->setPassword( $password );\n\t\t}\n\n\t\t// seta o nome\n\t\t$user->name = $this->input->post( 'name' ) ? \n\t\t\t\t\t $this->input->post( 'name' ) : \n\t\t\t\t\t $user->name;\n\n\t\t// Verifica se a foto foi alterada\n\t\tif( $base64 = $this->input->post( 'image' ) ) {\n\n\t\t\t// Guarda a imagem\n\t\t\tif( $midia_id = $this->__saveUserImage( $base64 ) ) {\n\t\t\t\t$user->midia_id = $midia_id;\n\t\t\t} else return reject( 'Erro ao salvar a imagem do usuário' );\n\t\t}\n\n\t\t// salvar a alteração\n\t\tif( $user->save() ) {\n\t\t\treturn resolve( $user->authData() );\n\t\t} else return reject( 'Erro ao realizar a ação' );\n\t}", "public function update($id)\n {\n\n $this->validate($this->request, User::updateRules());\n \n $user= User::findOrFail($id);\n \n $user->name= $this->request->name;\n $user->image = $this->request->image;\n $user->dob = $this->request->dob;\n $user->phone = $this->request->phone;\n $this->request->privileges && $user->privileges = $this->request->privileges;\n\n $user->save();\n\n return $this->response(202,\"User\", $user );\n\n\n }", "public function update(Request $request, $id)\n {\n // $path = $request->photo->store('images', 's3');\n $user = User::find($id);\n $user->status = $request->status; \n $user->firstname = $request->firstname; \n $user->lastname = $request->lastname; \n $user->email = $request->email; \n $user->username = $request->username; \n $user->age = $request->age; \n $user->gender = $request->gender; \n $user->occupation = $request->occupation; \n $user->scholarship = $request->scholarship; \n $user->maritalstatus = $request->maritalstatus; \n $user->mobile = $request->mobile; \n $user->status = 'Complete';\n\n $user->country = $request->country; \n $user->state = $request->state; \n $user->delegation = $request->delegation; \n $user->colony = $request->colony; \n $user->street = $request->street; \n\n\n $user->postalcode = $request->postalcode; \n $user->latitude = $request->latitude; \n $user->longitude = $request->longitude; \n if($user->save())\n return redirect('user/profile/' . $id );\n }", "public function update_save(Request $request, $id) {\n\n\t\t$id = Crypt::decryptString($id);\n\t\t$coach = Coach::findOrFail($id);\n\t\t$user = User::findOrFail($coach->user_id);\n\t\t$input = AppHelper::getTrimmedData($request->all());\n\t\t// dump($input); exit();\n\t\t$extra_rules = array(\n\t\t\t'email' => [\n\t\t\t\t'required',\n\t\t\t\t'max:190',\n\n\t\t\t\tRule::unique('users')->ignore($user->id)->where(function ($query) {\n\t\t\t\t\t$query->where('deleted', '0');\n\t\t\t\t}),\n\t\t\t],\n\t\t);\n\n\t\t// Do we need to update the password as well?\n\t\tif ($request->has('password') && $request->has('password')!='') {\n\t\t\t$extra_rules['password'] = 'required|min:8|regex:/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9!@#$%^&*]+$/';\n\t\t}\n\n\t\t$this->validator($request->all(), 'edit', $extra_rules)->validate();\n\t\t//echo \"dfg\";exit;\n\n\t\t$input['name'] = $input['first_name'] . ' ' . $input['last_name'];\n\n\t\tif (empty($input['country_id'])) {\n\t\t\t($input['country_id'] = 0);\n\t\t}\n\t\tif (!isset($input['status'])) {\n\t\t\t$input['status'] = 'in_active';\n\t\t}\n\t\tif($input['status']=='in_active')\n\t\t{\n\t\t\t$active='1';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$active='0';\n\t\t}\n\n\t\t$file['image'] = '';\n\t\tif ($request->hasFile('image')) {\n\t\t\t$file['image'] = \\AppHelper::getUniqueFilename($request->file('image'), AppHelper::getImagePath());\n\t\t\t$request->file('image')->move(AppHelper::getImagePath(), $file['image']);\n\t\t\t$input['image'] = $file['image'];\n\t\t} else {\n\t\t\t$input['image'] = ($user->image) ?: '';\n\t\t}\n\n\t\t$userFields = array();\n\t\t$coachFields = array();\n\n\t\t$userFields = [\n\t\t\t'first_name' => $input['first_name'],\n\t\t\t'last_name' => $input['last_name'],\n\t\t\t'name' => $input['first_name'] . ' ' . $input['last_name'],\n\t\t\t'email' => $input['email'],\n\t\t\t'country_id' => $input['country_id'],\n\t\t\t'address_line_one' => $input['address_line_one'],\n\t\t\t'address_line_two' => $input['address_line_two'],\n\t\t\t'address_line_three' => $input['address_line_three'],\n\t\t\t'timezone' => $input['timezone'],\n\t\t\t'skype_id' => $input['skype_id'],\n\t\t\t'status' => $input['status'],\n\t\t\t'image' => $input['image'],\n\t\t\t//'role_id' => $input['role_id'],\n\t\t\t'gender' => $input['gender'],\n\t\t];\n\t\t// Do we need to update the password as well?\n\t\tif ($request->has('password')) {\n\t\t\t$userFields['password'] = bcrypt($input['password']);\n\t\t}\n\n\t\t$coachFields = [\n\t\t\t'paypal_id' => $input['paypal_id'],\n\t\t\t'zip_code' => $input['zip_code'],\n\t\t\t'biography' => $input['biography'],\n\t\t\t'qualifications' => $input['qualifications'],\n\t\t\t'experience' => $input['experience'],\n\t\t\t//'promotional_call' => $input['promotional_call'],\n\t\t\t'one_hour_session' => $input['one_hour_session'],\n\t\t\t'free_20_min_session' => $input['free_20_min_session'],\n\t\t\t'min_slots_availability_per_week' => $input['min_slots_availability_per_week'],\n\t\t\t'graduate_session' => $input['graduate_session'],\n\t\t\t// 'program_fee' => ($input['program_fee'] != '') ? : 0 ,\n\t\t\t'city' => $input['city'],\n\t\t\t'available' => $input['available'],\n\t\t\t'api_key'=>$input['api_key'],\n\t\t\t'api_secret'=>$input['api_secret'],\n\t\t\t'zoom_email'=>$input['zoom_email'],\n\t\t\t'active'=>$active,\n\t\t\t//'available_for_review' => $input['available_for_review'],\n\t\t];\n\n\t\tDB::transaction(function () use ($coach, $user, $coachFields, $userFields, $input, $id) {\n\t\t\t$coach->update($coachFields);\n\t\t\t$user->update($userFields);\n\t\t\tif (!empty($input['program_id']) && isset($input['program_id'])) {\n\t\t\t\tCoachProgram::where('coach_id', $id)->update(['deleted' => '1']);\n\t\t\t\tforeach ($input['program_id'] as $key => $program_id) {\n\t\t\t\t\t$sub_array = array();\n\t\t\t\t\t$sub_array['coach_id'] = $id;\n\t\t\t\t\t$sub_array['program_id'] = $program_id;\n\t\t\t\t\t$sub_array['deleted'] = '0';\n\t\t\t\t\tif (isset($input['coach_program_id'][$program_id]) && !empty($input['coach_program_id'][$program_id])) {\n\t\t\t\t\t\t// dump('if exist');\n\t\t\t\t\t\t// dump($input['coach_program_id'][$program_id]);\n\t\t\t\t\t\tCoachProgram::withoutGlobalScope('coach_program.deleted')->where('id', $input['coach_program_id'][$program_id])->update($sub_array);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// dump('create new');\n\t\t\t\t\t\tCoachProgram::create($sub_array);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($input['module']) && isset($input['module'])) {\n\n\t\t\t\t//CoachModuleRate::where('coach_id', $id)->update(['deleted' => '1']);\n\t\t\t\tforeach ($input['module'] as $program_id => $modules) {\n\t\t\t\t\tforeach ($modules as $module_id => $rate) {\n\n\t\t\t\t\t\t$sub_array = array();\n\t\t\t\t\t\t$sub_array['coach_id'] = $id;\n\t\t\t\t\t\t$sub_array['program_id'] = $program_id;\n\t\t\t\t\t\t$sub_array['module_id'] = $module_id;\n\t\t\t\t\t\tif($rate=='' || $rate==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sub_array['rate']=10;\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$sub_array['rate'] = $rate;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$sub_array['deleted'] = '0';\n\n\t\t\t\t\t\t$coachrate=CoachModuleRate::where('coach_id',$id)->where('program_id',$program_id)->where('module_id',$module_id)->count();\n\n\t\t\t\t\t\tif($coachrate>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tCoachModuleRate::where('coach_id',$id)->where('program_id',$program_id)->where('module_id',$module_id)->update(array('rate'=>$rate));\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\tCoachModuleRate::create($sub_array);\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// if (!empty($input['module']) && isset($input['module'])) {\n\t\t\t// CoachModuleRate::where('coach_id', $id)->update(['deleted' => '1']);\n\t\t\t// foreach ($input['module'] as $program_id => $modules) {\n\t\t\t// \tforeach ($modules as $module_id => $rate) {\n\t\t\t// \t\t$sub_array = array();\n\t\t\t// \t\t$sub_array['coach_id'] = $id;\n\t\t\t// \t\t$sub_array['program_id'] = $program_id;\n\t\t\t// \t\t$sub_array['module_id'] = $module_id;\n\t\t\t// \t\t$sub_array['rate'] = $rate;\n\t\t\t// \t\t$sub_array['deleted'] = '0';\n\t\t\t// \t\tif (isset($input['module_id'][$program_id][$module_id]) && !empty($input['module_id'][$program_id][$module_id])) {\n\t\t\t// \t\t\tCoachModuleRate::withoutGlobalScope('coach_module_rates.deleted')->where('id', $input['module_id'][$program_id][$module_id])->update($sub_array);\n\t\t\t// \t\t} else {\n\t\t\t// \t\t\tCoachModuleRate::create($sub_array);\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// \t}\n\t\t\t// }\n\t\t\tif (empty($input['proxy_coach_id'])) {\n\t\t\t\tOtherCoachFeedbackList::where('coach_id', $id)->delete();\n\t\t\t} else {\n\t\t\t\tOtherCoachFeedbackList::where('coach_id', $id)->delete();\n\t\t\t\tforeach ($input['proxy_coach_id'] as $key => $value) {\n\t\t\t\t\t$othercoach = [\n\t\t\t\t\t\t'coach_id' => $id,\n\t\t\t\t\t\t'proxy_coach_id' => $value,\n\t\t\t\t\t];\n\t\t\t\t\tOtherCoachFeedbackList::create($othercoach);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tFlash::success(trans(\"comman.coach_updated\"));\n\t\t});\n\t\tif ($request->get('save_exit')) {\n\t\t\treturn redirect()->route('coaches.index');\n\t\t} else {\n\t\t\treturn redirect()->route('coaches.show_details', Crypt::encryptString($id));\n\t\t}\n\t}", "public function actionUpdate($id)\n {\n $model = new SignupAdminuser();\n //$adminuser = new AdminUsers();\n $admininfo = User::find()->where(['id' => $id])->one();\n \n if(!empty($admininfo))\n {\n \t$model->username = $admininfo->username;\n \t$model->email = $admininfo->email;\n \t$model->status = $admininfo->status;\n \t$model->role = $admininfo->role;\n \t$model->id = $admininfo->id;\n \n \t$adminuser = AdminUsers::find()->where(['userId' => $admininfo->id])->one();\n \t\n }\n if(!empty($adminuser))\n {\n \t$model->first_name = $adminuser->first_name;\n \t$model->last_name = $adminuser->last_name;\n \t$model->mobile = $adminuser->mobile;\n \t$model->profileImage = $adminuser->profileImage;\t\n }\n \n \n\n if ($model->load(Yii::$app->request->post()) ) {\n \t\n \tif($model->validate())\n \t{\n \t//print_r($model); exit();\n \t$model->profileImage = UploadedFile::getInstance($model,'profileImage');\n \n \t\n \t\t$admininfo->username = $model->username;\n \t\t$admininfo->email = $model->email;\n \t\t$admininfo->status = $model->status ;\n \t\t$admininfo->role = $model->role ;\n \t\t\n \t\t$admininfo->update();\n \t\t$adminuser->first_name = $model->first_name;\n \t //print_r($adminuser->first_name);exit();\n \t\t$adminuser->last_name = $model->last_name;\n \t\t//print_r($adminuser->last_name);exit();\n \t\t$adminuser->mobile = $model->mobile;\n\n \t\t\n \t\t\n \t\tif(!empty($model->profileImage))\n \t\t{\n \t\t\t$imageName = time().$model->profileImage->name;\n \t\t\t$model->profileImage->saveAs('profileImage/'.$imageName );\n \t\t\t$model->profileImage = 'profileImage/'.$imageName;\n \t\t\t$adminuser->profileImage = $model->profileImage;\n \t\t\t \n \t\t}\n \t\t\n \t\t\n \t $adminuser->save();\n \t\t\n \t\t\n \t\tYii::$app->session->setFlash('success', \" Adminuser Updated successfully \");\n \t\t\n \t\treturn $this->redirect(['index']);\n \t}\n \telse{\n \t\t$model->errors;\n \t}\n \t\t\n \t\t\n \t\t\n \t\t//return $this->redirect(['view', 'id' => $model->aduserId]);\n \t\n \t\n \t\n \n }\n $rolesd = $model->getAllRoles();\n $model->roles = $rolesd;\n \n \n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function adminEditProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n\t{\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n \t$res = $this->processSql($sql);\n\t\t\tif(!$res) return 4;\n\t\t\treturn 99;\n\t}", "function edit_person($datafull)\n {\n\t $datafull['name']=str_replace(\"-\",\" \",trim($datafull['name']));\n\t \n\t $id=$datafull['id'];\n\t $data = array(\n 'name' => $datafull['name'],\n 'description' => $datafull['description'],\n 'wlink' => $datafull['wlink'],\n 'sex' => $datafull['sex']\n ); \n\t\t\t\t \n\t\t\t\t if ($datafull['defult'])\n\t\t\t\t {$data['defult'] = 'TRUE';}else{$data['defult'] = 'FALSE'; }\n\t\t\t\t \n\t\t\t\t if ($datafull['active'])\n\t\t\t\t {$data['active'] = 'TRUE';}else{$data['active'] = 'FALSE'; }\n \n\t $this->db->where('id', $id);\n $this->db->update('person', $data);\n\t\n }", "public function update(Request $request, $id)\n {\n\t $user = User::find($id);\n\t $this->validate($request, [\n\t\t 'name' => 'required|max:255',\n\t\t 'email' => 'required|unique:users,email,'.$user->id,\n 'phone' => 'required',\n 'first_name' => 'required',\n 'last_name' => 'required',\n 'gender' => 'required',\n\t ]);\n\t $input = $request->all();\n\n $user->last_name = $input['last_name'];\n $user->first_name = $input['first_name'];\n $user->name = $input['name'];\n $user->is_admin = 0;\n $user->email = $input['email'];\n $user->phone = $input['phone'];\n $user->gender = $input['gender'];\n $res = array_key_exists('active', $input);\n if ($res == false) {\n $user->active = 0;\n } else {\n $user->active = 1;\n\n }\n $res = array_key_exists('is_parent', $input);\n if ($res == false) {\n $user->is_parent = 0;\n } else {\n $user->is_parent = 1;\n\n }\n $res = array_key_exists('is_employee', $input);\n if ($res == false) {\n $user->is_employee = 0;\n } else {\n $user->is_employee = 1;\n\n }\n if ($request->hasFile('image')) {\n if ($request->file('image')->isValid()) {\n $this->validate($request, [\n 'image' => 'required|image|mimes:jpeg,png,jpg'\n ]);\n $file = $request->file('image');\n $destinationPath = public_path('/uploads');\n //$extension = $file->getClientOriginalExtension('logo');\n $image = $file->getClientOriginalName('image');\n $image = rand().$image;\n $request->file('image')->move($destinationPath, $image);\n $user->image = $image;\n\n }\n }\n\t if(!empty($input['password'])) {\n\t\t $user->password = bcrypt($input['password']);\n\t }\n\n\t $user->save();\n\n\t Session::flash('success_message', 'Great! Client successfully updated!');\n\t return redirect()->back();\n }", "public function actionEdit()\n {\n $userId = User::checkLogged();\n if ($userId == true) {\n $user = User::getUserById($userId);\n } else {\n header (\"Location: /login\");\n }\n\n // Variables for the form\n $firstName = $user['first_name'];\n $lastName = $user['last_name'];\n $email = $user['email'];\n $password = md5($user['password']);\n $birth = $user['birth'];\n $company = $user['company'];\n $address = $user['address'];\n $city = $user['city'];\n $state = $user['state'];\n $postcode = $user['postcode'];\n $country = $user['country'];\n $phone = $user['phone'];\n \n $result = false;\n \n if (isset($_POST['submit'])) {\n $firstName = $_POST['firstName'];\n $lastName = $_POST['lastName'];\n $email = $_POST['email'];\n $password = md5($_POST['password']);\n $birth = $_POST['birth'];\n $company = $_POST['company'];\n $address = $_POST['address'];\n $city = $_POST['city'];\n $state = $_POST['state'];\n $postcode = $_POST['postcode'];\n $country = $_POST['country'];\n $info = $_POST['info'];\n $phone = $_POST['phone'];\n \n // Flag of errors\n $errors = false;\n\n // Validation the fields\n if (!User::checkFirstName($firstName)) {\n $errors[] = 'First name must be at least 2 characters';\n }\n if (!User::checkLastName($lastName)) {\n $errors[] = 'Last name must be at least 2 characters';\n }\n if (!User::checkEmail($email)) {\n $errors[] = 'Email is wrong';\n }\n if (!User::checkPassword($password)) {\n $errors[] = 'Password must be at least 6 characters';\n }\n if (!User::checkPhone($phone)) {\n $errors[] = 'Phone must be at least 10 characters';\n }\n \n if ($errors == false) {\n // If there are no errors\n // Registrate a new user\n $result = User::update($userId, $firstName, $lastName, $email,\n $password, $birth, $company, $address, $city, \n $state, $postcode, $country, $info, $phone);\n } \n }\n \n require_once(ROOT . '/views/cabinet/edit.php');\n return true;\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'first_name' => 'required',\n 'middle_name' => 'required',\n 'last_name' => 'required',\n 'mobile_no1' => 'required|digits:10',\n 'email' => 'required|email',\n 'dob' => 'required',\n 'blood_group' => 'required',\n 'promoter_name' => 'required',\n 'promoter_mobile' => 'required',\n 'address' => 'required',\n 'city' => 'required',\n 'pincode' => 'required',\n ]);\n $user = User::findorfail($id);\n $userInfo = UserInfo::where('user_id', $id)->first();\n $image_name = $request->hidden_image;\n $image = $request->file('photo');\n if($image != '')\n {\n if($userInfo->photo)\n {\n unlink(public_path('UserPhoto/'.$userInfo->photo));\n }\n $image_name = rand() . '.' . $image->getClientOriginalExtension();\n // $image->storeAs('public/tempcourseimg',$image_name);\n $image->move(public_path('UserPhoto'), $image_name);\n }\n $input_data = array (\n 'first_name' => $request->first_name,\n 'middle_name' => $request->middle_name,\n 'last_name' => $request->last_name,\n 'mobile_no1' => $request->mobile_no1,\n 'mobile_no2' => $request->mobile_no2,\n 'land_line' => $request->land_line,\n 'email' => $request->email,\n );\n $input_data1 = array (\n 'dob' => $request->dob,\n 'blood_group' => $request->blood_group,\n 'promoter_name' => $request->promoter_name,\n 'promoter_mobile' => $request->promoter_mobile,\n 'address' => $request->address,\n 'city' => $request->city,\n 'pincode' => $request->pincode,\n 'photo' => $image_name,\n );\n User::whereId($id)->update($input_data);\n UserInfo::whereId($userInfo->id)->update($input_data1);\n return redirect('/admin/joiners')->with('success', 'Joiner Updated Successfully!');\n }", "public function actionUpdate($id) {\n //redirect a user if not super admin\n $site_url = Yii::$app->params['yii_url'];\n $upload_url = \"\";\n if($site_url == \"http://dev.digitalvidya.com/assist\") {\n $upload_url - $site_url.\"/uploads/user_image/\";\n } else {\n $upload_url = $site_url . \"/uploads/\";\n }\n if (!Yii::$app->CustomComponents->check_permission('edit_user')){ \n return $this->redirect(['index']);\n }\n $model = DvUsers::find()->where([\"id\"=>$id])->one();\n if (!empty($model->course)) {\n $model->course = explode(',', $model->course);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n if (!empty($model->course)) {\n unset($model->course);\n $model->course = implode(\",\", $_POST['DvUsers']['course']);\n }\n\n if (isset($_POST['usermeta']['day_avail'])) {\n $day_avail = $_POST['usermeta']['day_avail'];\n }\n\n if (!empty($day_avail)) {\n $day_avail = implode(\",\", $_POST['usermeta']['day_avail']);\n }\n\n $model->picture = UploadedFile::getInstance($model, 'picture');\n\n if (!empty($model->picture->baseName)) {\n $model->picture->saveAs('uploads/user_image/img_'.$id.'.'.$model->picture->extension);\n $model->picture = 'img_' . $id . '.' . $model->picture->extension;\n } else { \n unset($model->picture);\n }\n\n //encript pass before save\n $password = $_POST['DvUsers']['password']; \n if (!empty($password)) {\n $model->password = md5($model->password); \n } else {\n unset($model->password);\n }\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($model); die;\n\t\t\tif($_POST['usermeta']['role'] == 4 || $_POST['usermeta']['role'] == 5){\n\t\t\t\t$email = $model->email;\n\t\t\t\t$phone = $_POST['usermeta']['phone'];\n\t\t\t\t$fname = $_POST['DvUsers']['first_name'];\n\t\t\t\t$lname = $_POST['DvUsers']['last_name'];\n\t\t\t\t$fb_link = $_POST['usermeta']['fb_link'];\n\t\t\t\t$linkedin_link = $_POST['usermeta']['linkedin_link'];\n\t\t\t\t$twitter_link = $_POST['usermeta']['twitter_link'];\n\t\t\t\t//$profile_visibility = $_POST['usermeta']['profile_visibility'];\n\t\t\t\tif(isset($_POST['usermeta']['description'])){\n\t\t\t\t\t$desc = $_POST['usermeta']['description'];\n\t\t\t\t}else{\n\t\t\t\t\t$desc = \"\";\n\t\t\t\t}\n\t\t\t\tif($_POST['usermeta']['role'] == 4){\n\t\t\t\t\t$usre_role = 1;\n\t\t\t\t\t$profile_visibility = $_POST['usermeta']['profile_visibility'];\n\t\t\t\t}else{\n\t\t\t\t\t$usre_role = 2;\n\t\t\t\t\t$profile_visibility = 1;\n\t\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t\t // ***************** Start of curl ************************\n\t\t\t \n\t\t\t\t$curl = curl_init();\n\t\t\t\t// Set some options - we are passing in a useragent too here\n\t\t\t\tcurl_setopt_array($curl, [\n\t\t\t\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\t\t\t\tCURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n\t\t\t\t\tCURLOPT_USERAGENT => 'Get course data',\n\t\t\t\t\tCURLOPT_POST => 1,\n\t\t\t\t\tCURLOPT_POSTFIELDS => [\n\t\t\t\t\t\t\n\t\t\t\t\t\t'ta_email' => $email,\n\t\t\t\t\t\t'tm_fname' => $fname,\n\t\t\t\t\t\t'tm_lname' => $lname,\n\t\t\t\t\t\t'tm_phone' => $phone,\n\t\t\t\t\t\t'tm_facebook' => $fb_link,\n\t\t\t\t\t\t'tm_linkedin' => $linkedin_link,\n\t\t\t\t\t\t'tm_twitter' => $twitter_link,\n\t\t\t\t\t\t'tm_description' => $desc,\n\t\t\t\t\t\t'tm_image_url' => $upload_url.'img_'.$id.'.jpg',\n\t\t\t\t\t\t'tm_image_name' => 'img_'.$id.'.jpg',\n 'profile_visibility' => $profile_visibility,\n\t\t\t\t\t\t'user_role' => $usre_role\n\n\t\t\t\t\t]\n\t\t\t\t]);\n\t\t\t\t// Send the request & save response to $resp\n\t\t\t\t$resp = curl_exec($curl);\n\t\t\t\t// Close request to clear up some resources\n\t\t\t\t$resulst = json_decode($resp,true);\n\t\t\t\tcurl_close($curl);\n\t\t\t\t//echo \"<pre>\";\n\t\t\t\t//print_r($resulst); die;\n\t\t\t}\n\t\t\t\n $usermeta = $_POST['usermeta'];\n unset($usermeta['day_avail']);\n\n foreach ($usermeta as $key => $val) {\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$val' WHERE meta_key = '$key' AND uid = '$model->id' \")->execute();\n }\n\n if (isset($_POST['usermeta']['role'])) {\n \t$user_usermeta = $_POST['usermeta']['role'];\n\t if($user_usermeta == '6'){\n\t Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '' WHERE meta_key = 'team' AND uid = '$model->id' \")->execute();\n\t }\n } \n\n if (!empty($day_avail)) {\n Yii::$app->db->createCommand(\"UPDATE assist_user_meta SET meta_value = '$day_avail' WHERE meta_key = 'day_avail' AND uid = '$model->id' \")->execute();\n }\n unset($model->email);\n $model->save(false);\n Yii::$app->session->setFlash('success', 'Profile Updated successfully.');\n if (Yii::$app->CustomComponents->check_permission('all_users')) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $user_id = Yii::$app->getUser()->identity->id;\n return $this->redirect(['view', 'id' => $user_id]);\n }\n } else {\n return $this->render('update', [ 'model' => $model]);\n }\n }", "public function edit(Int $id){\n $fields = request()->validate([\n 'name' => 'string|min:3|required',\n 'sex' => 'string|required|in:M,F',\n 'cellphone' => 'required|regex:/^9[0-9]{8}+$/',\n 'first_lastname' => 'string|required',\n 'second_lastname' => 'string|required',\n 'birthday' => 'date|required',\n 'address' => 'required|string',\n 'type_people_id' => 'numeric|required|min:2|max:3',\n 'business_name' => 'required_if:type_people_id,2|string'\n ]);\n\n //Actualizando persona\n $person = Person::where('id',$id)->first();\n $person->update($fields);\n\n\n return response()->json([\n 'res' => true,\n 'message' => \"el cliente {$person->name} ha sido actualizado correctamente\"\n ]);\n }", "public function update(Request $request, $id)\n {\n $image_name = $request->hidden_image;\n $image_data = $request->file('Image');\n if($image_data != '')\n {\n \n\n $image_name = rand() . '.' . $image_data->getClientOriginalExtension();\n $image_data->move(public_path('upload'), $image_name);\n }\n else\n {\n \n \n }\n $user_data = array(\n 'FirstName' => $request->FirstName,\n 'LastName' => $request->LastName,\n 'UserName' => $request->UserName,\n 'Email' => $request->Email,\n 'password' => Hash::make($request->password),\n 'Phone' => $request->Phone,\n 'Address' => $request->Address,\n 'Country' => $request->Country,\n 'State' => $request->State,\n 'City' => $request->City,\n 'ZipCode' => $request->ZipCode,\n 'Gender' => $request->Gender,\n 'Hobbies' => implode(\",\",$request->Hobbies),\n 'Image' => $image_name\n );\n $user= UserDetail::find($id);\n $user->update($user_data);\n \n \n return redirect()->route('users.index')\n ->with('success', 'user updated successfully');\n }", "function updateProfile($data) {\ntry {\n\n if (!$conn = connectDB()) {\n return false;\n }\n\n $userId = $_SESSION[\"userId\"];\n $args = array(\n $data[\"firstName\"], $data[\"lastName\"],\n $data[\"phone\"], $data[\"email\"], $data[\"location\"],\n $userId\n );\n\n $sql = <<<SQL\nUPDATE WebUser\nSET firstName=$1, lastName=$2,\n phonenumber=$3, emailaddress=$4, location=$5\nWHERE userId=$6\nSQL;\n\n $result = executeSQL($conn, $sql, $args);\n\n if (getUpdateCount($result) != 1) {\n /* Update was unsuccessful */\n closeDB($conn);\n return false;\n }\n\n /* Update succeeded */\n closeDB($conn);\n return true;\n\n} catch (Exception $e) {\n error(\"updateProfile\");\n closeDB($conn);\n return false;\n}\n}", "public function update(Request $request, $id)\n {\n //Debugbar::warning('Update');\n\n // check user is either admin or owner\n if(!Auth::user()->isAdmin() && Auth::user()->id != $id) {\n return redirect('/home')->with('error', 'Incorrect permissions.');\n }\n\n // validate data\n $validatedData = $request->validate([\n 'name' => 'required|string|max:255',\n 'team_name' => 'sometimes|nullable|string|max:255',\n 'profile_pic' => 'sometimes|nullable'\n ]);\n\n // update the User\n $user = User::find($id);\n $user->name = $request->input('name');\n $user->team_name = $request->input('team_name');\n\n $is_admin = $request->input('is_admin') ? '1' : '0';\n // only check if the user was an admin and new status is 0 - not an admin\n // check if this is the only admin account, if so then fail\n if($user->is_admin == 1 && $is_admin == 0 && User::where('is_admin','=',1)->count() === 1) {\n return redirect()->back()->with('error', 'Cannot remove Administrator status from the only Administrator.')->withInput();\n }\n // if it didn't fail, assign the new admin status\n $user->is_admin = $is_admin;\n \n // if a file was uploaded\n if($request->file('profile_pic')) {\n // file upload\n $allowedfileExtension=['jpg','gif'];\n $file = $request->file('profile_pic');\n $extension = $file->getClientOriginalExtension();\n $path = public_path('storage/profile_pics/');\n $fileNameToStore = \"id_\".$id.\"_\".time().'.'.$extension;\n \n if(in_array($extension,$allowedfileExtension)) {\n // delete existing file\n $oldFileWithPath = 'public/profile_pics/' . $user->profile_pic;\n if(Storage::exists($oldFileWithPath)) {\n Storage::delete($oldFileWithPath);\n }\n // save new file in storage\n $imgPath = public_path('storage/profile_pics/' . $fileNameToStore);\n Debugbar::warning('imgPath');\n Image::make($file->getRealPath())\n ->resize(100, 100, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($imgPath);\n //old method - save just in case\n //$path = $file->storeAs($path, $fileNameToStore);\n\n // save file name in user\n $user->profile_pic = $fileNameToStore;\n }\n }\n\n $user->save();\n\t\treturn redirect('/users')->with('success', 'User Updated');\n\n // Only while debugging!!\n //return view('users.edit')->with('user', $user);\n }", "public function webeditprofile($user_id,$data)\n {\n \n $editprofile = DB::table('users')->where('id',$user_id)->update($data);\n return redirect('myprofile');\n\n }", "public function editAccount($person,$oldname);", "public function updateMyInfo()\n {\n // validate the info, create rules for the inputs\n $rules = array(\n 'user_firstname' => 'required',\n 'user_gender' => 'required',\n 'user_civil_status' => 'required',\n 'user_birth_date' => 'required|date_format:\"'.DATE_FORMAT_1,\n 'user_joined_date' => 'required|date_format:\"'.DATE_FORMAT_2,\n 'user_email' => 'required|email|unique:user,user_email,' . Auth::user()->user_key . ',user_key,deleted_at,NULL',\n 'country_key1' => 'required',\n 'user_contact_phone_number1' => 'required',\n 'user_hometown_address' => 'required',\n );\n\n // run the validation rules on the inputs from the form\n $validator = Validator::make(Input::all(), $rules);\n\n // if the validator fails, redirect back to the form\n if ($validator->fails()) {\n // redirect to list page\n Session::flash('danger', UNABLE_TO_SAVE);\n return Redirect::back()\n ->withErrors($validator)\n ->withInput();\n\n } else {\n // where condition\n $user = Auth::user();\n \n // check if the record can be updated\n if (empty($user->id)) {\n // redirect to list page\n Session::flash('danger', SOMETHING_WENT_WRONG);\n return Redirect::to(strtolower(USER_TITLE));\n }\n\t\t\t\n // fields to be updated\n $user->user_firstname = $this->getInput('user_firstname', '');\n $user->user_middlename = $this->getInput('user_middlename', '');\n $user->user_lastname = $this->getInput('user_lastname', '');\n $user->user_alias = $this->getInput('user_alias', '');\n $user->user_gender = $this->getInput('user_gender', '');\n $user->user_civil_status = $this->getInput('user_civil_status', '');\n $user->user_birth_date = \\Carbon\\Carbon::createFromFormat(DATE_FORMAT_1, $this->getInput('user_birth_date', DEFAULT_DATE))->format(DB_DATE_FORMAT);\n $user->user_joined_date = $this->getInput('user_joined_date', '');\n $user->user_email = $this->getInput('user_email', '');\n $user->user_hometown_address = $this->getInput('user_hometown_address', '');\n $user->user_overseas_address = $this->getInput('user_overseas_address', '');\n if (Session::has('user_photo')) {\n $user->user_photo = Session::get('user_photo');\n Session::forget('user_photo');\n }\n $user->updated_by = Auth::user()->id;\n \n // update record\n $user->save();\n \n for ($cnt = 1; $cnt <= $this->getInput('hdn_increment', ''); $cnt++) {\n if ($this->getInput('hdn_index' . $cnt, '') == YES && $this->getInput('country_key' . $cnt, '') != EMPTY_STRING && $this->getInput('user_contact_phone_number' . $cnt, '') != EMPTY_STRING) {\n if ($this->getInput('user_contact_key' . $cnt, '') == EMPTY_STRING) {\n $data = array();\n $data['user_contact_key'] = generateRandomID();\n $data['user_id'] = $user->id;\n $data['country_id'] = Country::countryKey($this->getInput('country_key' . $cnt, ''))->pluck('id');\n $data['user_contact_phone_number'] = $this->getInput('user_contact_phone_number' . $cnt, '');\n $data['created_by'] = Auth::user()->id;\n \n // create record\n UserContact::create($data);\n } else {\n // where condition\n $user_contact = UserContact::UserContactKey($this->getInput('user_contact_key' . $cnt, ''))->first();\n \n // check if the record can be updated\n if (isset($user_contact->id)) {\n $user_contact->country_id = Country::countryKey($this->getInput('country_key' . $cnt, ''))->pluck('id');\n $user_contact->user_contact_phone_number = $this->getInput('user_contact_phone_number' . $cnt, '');\n $user_contact->updated_by = Auth::user()->id;\n \n // update record\n $user_contact->save();\n }\n }\n }\n }\n \n // where condition\n $user_emergency = UserEmergency::userId($user->id)->first();\n \n // check if the record can be updated\n if (!empty($user_emergency->id)) {\n // fields to be updated\n $user_emergency->user_emergency_name = $this->getInput('user_emergency_name', '');\n $user_emergency->user_emergency_relation = $this->getInput('user_emergency_relation', '');\n $user_emergency->user_emergency_address = $this->getInput('user_emergency_address', '');\n $user_emergency->country_id = Country::countryKey($this->getInput('emergency_country_key', ''))->pluck('id');\n $user_emergency->user_emergency_phone = $this->getInput('user_emergency_phone', '');\n $user_emergency->updated_by = Auth::user()->id;\n \n // update record\n $user_emergency->save();\n }\n \n // redirect to list page\n Session::flash('success', SUCCESS_UPDATE);\n return Redirect::to('my_account/info');\n }\n }", "public function update(Request $request)\n {\n $id = $request->id_hidden;\n $first_name = $request->first_name;\n $last_name = $request->last_name;\n $phone_number = $request->phone_number;\n\n $update = [\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'phone_number' => $phone_number,\n ];\n \n if($file = $request->hasFile('avatar')) {\n \n $file = $request->file('avatar') ;\n $fileName = $file->getClientOriginalName() ;\n $destinationPath = public_path().'/uploads/users' ;\n $file->move($destinationPath,$fileName);\n // return redirect('/uploadfile');\n $update['avatar'] = $fileName;\n }\n // dd($update);\n $user = User::where('id',$id)->update($update);\n \n // echo json_encode(\n // [\n // 'success' => 200,\n // ]\n // );\n $message = \"Success\";\n return redirect()->route('developers.list')\n ->with(\"notice\", $message);\n }", "public function update(Request $request, $id)\n {\n \n $user=Contact::find($id);\n $user->companyName= $request->input('companyName');\n $user->activityType= $request->input('activityType');\n $user->tel= $request->input('tel');\n $user->email= $request->input('email');\n $user->servicesType= $request->input('servicesType');\n $user->type1= $request->input('type1');\n $user->type2= $request->input('type2');\n $user->type3= $request->input('type3');\n $user->file= $request->input('file');\n $user->save();\n \n return redirect('admin/contact');\n }", "public function update(Request $request, $id)\n {\n $user = User::find($id);\n\n $user->firstname = $request->firstname;\n $user->lastname = $request->lastname;\n $user->phone = $request->phone;\n $user->email = $request->email;\n $user->role = 'employe';\n $user->active = $request->active === 'on' ? true : false;\n $user->situation_id = $request->situation_id;\n $user->age = $request->age;\n $user->gender = $request->gender;\n $user->post = $request->post;\n $user->emp_category = $request->emp_category;\n $user->emp_function = $request->emp_function;\n if ($request->password !== '') {\n $user->password = Hash::make($request->password);\n }\n\n $user->save();\n\n if ($request->spouseFirstname && $request->spouseLastname) {\n $conjoint = Conjoint::where('user_id', $user->id)->first();\n if (!$conjoint) {\n $conjoint = new Conjoint();\n }\n \n $conjoint->firstname = $request->spouseFirstname;\n $conjoint->lastname = $request->spouseLastname;\n $conjoint->age = $request->spouseAge;\n $conjoint->gender = $request->spouseGender;\n $conjoint->user_id = $user->id;\n $conjoint->save();\n }\n\n if (\n count($request->childFirstname) !== 1 &&\n count($request->childLastname) !== 1 &&\n count($request->childAge) !== 1 &&\n count($request->childGender) !== 1\n ) {\n Child::where('user_id', $user->id)->delete();\n $childrenCount = count($request->childFirstname);\n for ($i=0; $i < $childrenCount; $i++) {\n if ($request->childFirstname[$i] !== null) {\n $child = new Child();\n $child->firstname = $request->childFirstname[$i];\n $child->lastname = $request->childLastname[$i];\n $child->age = $request->childAge[$i];\n $child->gender = $request->childGender[$i];\n $child->user_id = $user->id;\n $child->save();\n }\n }\n }\n return redirect()->route('backend.employes');\n }", "public function updateProfile()\n {\n $fname=Input::get(\"fname\");\n $lname=Input::get(\"lname\");\n $dob=Input::get(\"dob\");\n $contact=Input::get(\"contact\");\n $user=Auth::user();\n if($fname!=NULL && !empty($fname))\n {\n $user->fname=$fname;\n }\n\n if($lname!=NULL && !empty($lname))\n {\n $user->lname=$lname;\n\n }\n if($contact!=NULL && !empty($contact))\n {\n $user->contact=$contact;\n }\n\n\n\n if($dob!=NULL && !empty($dob))\n {\n $user->dob=$dob;\n }\n\n $user->save();\n echo '0';\n \n\n\n\n //\n }", "public function updateUserProfilePicture(Request $request)\n {\n $data= Validator::make($request->all(), [\n 'id' => 'required',\n 'avatar' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n if ($data->fails()) {\n return response()->json([\n 'status' => 400,\n 'message' => 'All fields are required',\n 'data'=> []\n ], 400);\n }\n\n if($request->id != $request->userID){\n return response()->json([\n 'status' => 400,\n 'message' => 'Not authorized to carry out this action',\n 'data'=> []\n ], 400);\n }\n\n $name = $request->id.\".jpg\";\n $path = Storage::disk('public')->putFileAs('avatars', $request->file('avatar'), $name, 'public');\n\n User::find($request->id)->update([\n 'pictureUrl' => Storage::disk('public')->url('avatars/'.$name)\n ]);\n $user = User::find($request->id);\n $user->followers = Follow::where('userId', $user->id)->count();\n $user->following = Follow::where('followedBy', $user->id)->count();\n $user->recipes = Recipe::where('userId', $user->id)->count();\n $user->saveCount = Favorite::where('userId', $user->id)->where('commentId', null)->count();\n return response()->json([\n 'status' => 200,\n 'message' => 'User account has been updated',\n 'data' => [\n // User::find($request->id)->only('id', 'name', 'email', 'phoneNumber','bio', 'pictureUrl'),\n $user\n ]\n ], 200);\n }", "public function update(UserFormRequest $request, $id)\n {\n $user = User::find($id);\n\n if($request->file('file'))\n {\n $file = $request->file('file');\n $filename = time() . rand(1, 9999) . '.' . $file->getClientOriginalExtension();\n\n if(!empty($user->image) || $user->image != null)\n {\n \\File::delete(public_path('img/profilepics/' . $user->image));\n }\n\n $request->file('file')->move(\n base_path() . '/public/img/profilepics', $filename //pass to file field\n );\n\n //getClientSize();\n\n $user->update([\n 'image' => $filename,\n ]);\n }\n\n // email not editable\n // $user->update([\n // 'email' => $request['email'],\n // ]);\n\n $user_type = $user->user_type;\n\n if($user_type === 's')\n {\n $student = $user->userable;\n\n $student->update($request->all());\n\n if($request['school_id'] != null)\n {\n // dd($request['school_id']);\n // $student_school = $request['school_id'];\n $school = School::find($request['school_id']);\n\n if($school != null)\n {\n $school->students()->save($student);\n }\n }\n\n if($request['degree_id'] != null)\n {\n $degree = Degree::find($request['degree_id']);\n $degree->students()->save($student);\n }\n\n if($request['skill_list'] != null && count($request['skill_list'] > 0))\n {\n // find a skill based on their name and if it doesn't exist create it in the Database\n // store all ids in the skills array , existing skills or new created skills\n\n $skills = array();\n foreach($request['skill_list'] as $skill_name)\n {\n $skill = Skill::firstOrCreate(array('name' => $skill_name));\n $skills[] = $skill->id;\n }\n\n $student->skills()->sync($skills);\n }\n }\n else if($user_type === 'c')\n {\n $company = $user->userable;\n\n $company->update($request->all());\n }\n else if($user_type === 'sa')\n {\n $school = $user->userable;\n\n $school->update($request->all());\n }\n else if($user_type === 'd' || $user_type === 'f')\n {\n $dean_faculty = $user->userable;\n\n $dean_faculty->update($request->all());\n\n if($request['skill_list'] != null && count($request['skill_list'] > 0))\n {\n // find a skill based on their name and if it doesn't exist create it in the Database\n // store all ids in the skills array , existing skills or new created skills\n\n $skills = array();\n foreach($request['skill_list'] as $skill_name)\n {\n $skill = Skill::firstOrCreate(array('name' => $skill_name));\n $skills[] = $skill->id;\n }\n\n $dean_faculty->skills()->sync($skills);\n }\n }\n\n return \\Redirect::to('/'. $id)->with([\n 'flash_message' => 'Profile successfully updated!',\n ]);\n }", "public function update_person_form($person_id) {\n $data['person_id'] = $person_id;\n $data['admin_id'] = $this->admin_lib->admin_id;\n $data['person'] = $this->person_db->get_person_by_person_id_admin_id($person_id, $this->admin_lib->admin_id);\n $this->load->view(\"layout/header\", $data);\n $this->load->view(\"p_list/update_person_form\", $data);\n $this->load->view(\"layout/footer\");\n }", "public function adminEditUserProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n {\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"', level_access = '\" . $level_access . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n $res = $this->processSql($sql);\n if(!$res) return 4;\n return 99;\n }" ]
[ "0.71162605", "0.70201784", "0.6972015", "0.67288595", "0.6640893", "0.66054374", "0.6480629", "0.6438632", "0.64283943", "0.6420584", "0.63782644", "0.63220465", "0.63220465", "0.6318497", "0.63162816", "0.6298133", "0.62908256", "0.6274238", "0.6273094", "0.6244721", "0.6243342", "0.62352735", "0.62225896", "0.62163085", "0.6214671", "0.621127", "0.62068784", "0.6198996", "0.61925185", "0.6184032", "0.6168694", "0.6154026", "0.61495924", "0.610924", "0.6101658", "0.609395", "0.6093547", "0.6092072", "0.6082983", "0.60810983", "0.60709834", "0.60705805", "0.6063638", "0.60592794", "0.6058165", "0.6057601", "0.60500443", "0.6047301", "0.6046433", "0.60454714", "0.6031102", "0.6028446", "0.60261905", "0.60220903", "0.6020251", "0.60020494", "0.60011744", "0.5994345", "0.59910727", "0.5988853", "0.598152", "0.5978059", "0.59776485", "0.59727466", "0.5972556", "0.5972463", "0.5952828", "0.59519535", "0.5946985", "0.594485", "0.5938265", "0.59348434", "0.5933751", "0.5926124", "0.5925446", "0.592299", "0.59221655", "0.59200287", "0.5915996", "0.5915687", "0.5911052", "0.59082323", "0.59054846", "0.5904482", "0.5902587", "0.5901309", "0.5900138", "0.58980036", "0.5894652", "0.5893957", "0.58914024", "0.58896714", "0.58828455", "0.58814067", "0.5881368", "0.5880714", "0.5877834", "0.5874941", "0.58726716", "0.58720696" ]
0.7930899
0
this method allows user to report sick history and already_sick is mandatory fields
public function reportSickAction(){ /** @var Object_User $user */ $data = $this->getRequestData(); if(isset($data['history']) && isset($data['already_sick'])){ $user = Object_User::getById($this->getDeviceSession()->getUserId()); $sickArr = $user->getSick_history()?$user->getSick_history():array(array('Date', 'Sick history', 'Sick status')); $sick = array(); $sick[] = date('Y-m-d'); $sick[] = $data['history']; $sick[] = $data['already_sick']; $sickArr[] = $sick; $user->setSick_history($sickArr); $user->setAlready_sick($data['already_sick']); if(!$user->save()){ $this->setErrorResponse('Cannot update User object'); } } else { $this->setErrorResponse('Please, report your sick history. history and already_sick is mandatory fields!'); } $this->_helper->json(array('added' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSickAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $sickArr = $user->getSick_history();\n if(isset($sickArr[0])){\n unset($sickArr[0]);\n }\n if(isset($data['date'])){\n foreach($sickArr as $sick){\n if($sick[0] == $data['date']){\n $this->_helper->json($sick);\n } else {\n $this->setErrorResponse('No sick for this day!');\n }\n }\n }\n $this->_helper->json($sickArr);\n }", "protected function setNoticesExist() {}", "public function beforeSave() {\n\n\t\t$checkin = new DateTime($this->date_check_in);\n\t\t$currendDate = new DateTime(\"NOW\");\n\n\t\t// Date Format to YYYY-MM-DD for MSSQL\n\t\t$this->date_check_in = DateUtil::reformatDateForDatabase($this->date_check_in);\n\t\t$this->date_check_out = DateUtil::reformatDateForDatabase($this->date_check_out);\n\t\t$this->finish_date = DateUtil::reformatDateForDatabase($this->finish_date);\n\t\t$this->card_returned_date = DateUtil::reformatDateForDatabase($this->card_returned_date);\n\n\t\t$this->time_check_in = DateUtil::reformatTimeForDatabase($this->time_check_in);\n\t\t$this->time_check_out = DateUtil::reformatTimeForDatabase($this->time_check_out);\n\t\t$this->time_in = DateUtil::reformatTimeForDatabase($this->time_in);\n\t\t$this->time_out = DateUtil::reformatTimeForDatabase($this->time_out);\n\t\t$this->finish_time = DateUtil::reformatTimeForDatabase($this->finish_time);\n\n\n\t\t// fOR Preregister a Visit if check In date is greater than the current\n\t\t$PDate = $currendDate->diff($checkin)->format(\"%r%a\");\n\t\tif($PDate > 1) {\n\t\t\t$this->visit_status = VisitStatus::PREREGISTERED;\n\t\t}\n\t\treturn parent::beforeSave();\n\t}", "function save() {\n \t\n \tif (checkPerms('can_create_grabsheets',true)) { // check permissions\n\t\t\t\n\t\t\t$errors = \"\";\t\n\t\t\n\t\t\tif (!$postdata['grabsheetgroupid'] = $this->input->post('grabsheetgroupid'))\n\t\t\t\t$errors .= \"Grabsheet has no Group!<br />\";\n\t\t\t\n\t\t\tif (!$postdata['title'] = $this->input->post('title'))\n\t\t\t\t$errors .= \"Grabsheet has no Title!<br />\";\n\t\t\t\t\n\t\t\tif (!$postdata['grabsheettemplateid'] = $this->input->post('grabsheettemplateid'))\n\t\t\t\t$errors .= \"Grabsheet has no Template!<br />\";\n\t\t\t\t\n\t\t\tif (!$postdata['itemids'] = $this->input->post('itemids'))\n\t\t\t\t$errors .= \"Grabsheet appears to be empty!<br />\";\n\t\t\t\t\n\t\t\tif (!$postdata['headerimageid'] = $this->input->post('headerimageid'))\n\t\t\t\t$errors .= \"Grabsheet has no header (branding) image!<br />\";\n\t\t\t\t\n\t\t\tif ($errors) {\n\t\t\n\t\t\t\t$this->opm->displayError($errors);\n\t\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$postdata['property_imageid'] = $this->input->post('property_imageid');\n\t\t\t$postdata['grabsheetid'] = $this->input->post('grabsheetid');\n\t\t\t$postdata['savePermanent'] = $this->input->post('savePermanent');\n\t\t\t$postdata['showProductCodes'] = $this->input->post('showProductCodes');\n\t\t\t\n\t\t\tif ($postdata['showProductCodes'] == 'on')\n\t\t\t\t$postdata['showProductCodes'] = 1;\n\t\t\telse\n\t\t\t\t$postdata['showProductCodes'] = 0;\n\t\t\t\t\n\t\t\t\n\t\t\tif ($grabsheetid = $this->grabsheets_model->saveGrabsheet($postdata)) {\n\t\t\t\n\t\t\t\tif ($postdata['savePermanent'] == 'on') { // try to save perm, if success, write entry to db, else alert\n\t\t\t\t\n\t\t\t\t\tif ($this->opm->createPDF($grabsheetid, false, true)) {\n\t\t\t\t\t\n\t\t\t\t\t\t$this->grabsheets_model->setGrabToFile($grabsheetid);\n\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t$this->opm->displayError(\"Grabsheet could not be saved as a file, it has been saved as regular grab instead.\");\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif ($postdata['grabsheetid'])\n\t\t\t\t\t$this->opm->displayAlert(\"Grabsheet Saved!\",\"/grabsheets/search\");\n\t\t\t\telse\n\t\t\t\t\t$this->opm->displayAlert(\"Grabsheet Successfully Created!\",\"/grabsheets/search\");\t\n\t\t\t\t\t\n\t\t\t\treturn true;\t\n\t\t\t\n\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$this->opm->displayError(\"Could Not Save Grabsheet!\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\n\t\t}\t\t\n\t\t\t\n\t}", "public function show(Sick $sick)\n {\n //\n }", "function report_availabilty($student_id)\n {\n global $CFG;\n\n $now=time();\n\n //if a maximum number of entries has been set lets see if the student has reached this number\n if (!empty($this->reportmaxentries)) {\n $studententries = $this->dbc->count_report_entries($this->report_id,$student_id);\n\n if ($studententries >= $this->reportmaxentries) {\n $extension = $this->extension_check('reportmaxentries');\n\n if (empty($extension) || $studententries >= $extension->value) {\n $temp = new stdClass();\n $temp->entries = $studententries;\n $temp->maxentries = (!empty($extension))? $extension->value : $this->reportmaxentries;\n return false;\n }\n }\n }\n\n //if this report has a lock date check if the date has passed\n if ($this->reporttype == ILP_RT_RECURRING_FINALDATE || $this->reporttype == ILP_RT_FINALDATE) {\n\n if ( $this->reportlockdate < $now ) {\n //find out if this student has been given a report extension\n $extension = $this->extension_check('reportlockdate');\n if (empty($extension) || $extension->value < $now) {\n $temp = new stdClass();\n $temp->expiredate = (!empty($extension))? date('d-m-Y',$extension->value) : date('d-m-Y',$this->reportlockdate);\n return false;\n }\n }\n }\n\n //if the report is a recurring report\n if ($this->reporttype == ILP_RT_RECURRING || $this->reporttype == ILP_RT_RECURRING_FINALDATE) {\n $recurringstart = 0;\n\n if ($this->recurstart == ILP_RECURRING_REPORTCREATION) {\n //rules started at report creation\n $recurringstart = $this->timecreated;\n } else if ($this->recurstart == ILP_RECURRING_SPECIFICDATE) {\n //rules started at specific date\n $recurringstart = $this->recurdate;\n } else {\n //rules started at first entry\n $studententries = $this->dbc->get_user_report_entries($this->id,$student_id);\n\n if (!empty($studententries)) {\n //get the creation time of the first user entry\n $recurringstart = reset($studententries);\n $recurringstart = $recurringstart->timecreated;\n }\n }\n\n if (!empty($recurringstart)) {\n $recurringperiod = $this->recurring_period($recurringstart,$this->recurfrequency);\n\n $entriescount = $this->dbc->count_report_entries($this->id,$student_id,$recurringperiod['start'],$recurringperiod['end']);\n\n if (!empty($entriescount) && $entriescount >= $this->recurmax) {\n $extension = $this->extension_check('recurmax');\n if (empty($extension) || $extension->value <= $entriescount) {\n $temp = new stdClass();\n $temp->entries = $entriescount;\n $temp->maxentries = (!empty($extension))? $extension->value : $this->recurmax;\n return false;\n }\n }\n }\n }\n return true;\n }", "public function seance()\n {\n $this->form_validation->set_rules('i_date', 'date', 'required');\n $this->form_validation->set_rules('i_time', 'time', 'required');\n\n if ($this->form_validation->run() === FALSE) // si formulaire non rempli OU rempli mais incomplet\n {\n $seances = $this->admin_model->regroup_user();\n\n $data['seances'] = $seances;\n $data['title'] = 'Administrateur';\n $this->load->view('layouts/header');\n $this->load->view('admin/seance', $data);\n $this->load->view('layouts/footer');\n }else{ \n \n $insert_seance = $this->admin_model->insert_newdate();\n\n $data['title'] = 'Administrateur';\n $this->load->view('layouts/header');\n $this->load->view('admin/seance', $data);\n $this->load->view('layouts/footer');\n }\n }", "function show_risk_stratification(){\n\t\t\n\t\t//print_r($_SESSION);\n\t\t$q_location = mysql_query(\"SELECT risk_assessment_type, presence_diabetes, systolic_1st, systolic_2nd, date_assessment, patient_id, smoking FROM m_consult_ncd_risk_assessment WHERE consult_risk_id='$_GET[ncd_consult]'\") or die(\"Cannot query 1923: \".mysql_error());\n\t\tlist($location,$diabetes,$systolic_1st,$systolic_2nd,$date_assess,$pxid,$smoking_id) = mysql_fetch_array($q_location);\n\n\t\tif($location=='community'):\n\t\t\t$presence_diabetes = $diabetes;\n\t\telseif($location=='facility'):\n\t\t\t$q_diabetes = mysql_query(\"SELECT presence_diabetes FROM m_consult_ncd_risk_screen_diabetes WHERE consult_risk_id='$_GET[ncd_consult]'\") or die(\"Cannot query 1929: \".mysql_error());\n\t\t\tlist($presence_diabetes) = mysql_fetch_array($q_diabetes);\n\t\telse:\t\t\t\n\t\t\t$presence_diabetes = 'NA';\n\t\tendif;\n\t\t\n\t\t$q_cholesterol = mysql_query(\"SELECT total_cholesterol FROM m_consult_ncd_risk_screen_lipid WHERE consult_risk_id='$_GET[ncd_consult]'\") or die(\"Cannot query 1933: \".mysql_error());\n\n\t\tif(mysql_num_rows($q_cholesterol)!=0):\n\t\t\tlist($cholesterol_mgl) = mysql_fetch_array($q_cholesterol);\n\t\t\t\n\t\t\t//list($mg,$liter) = explode('/',$cholesterol_mgl);\t\t\n\t\t\t//$cholesterol = round(($mg/38),0);\n\n\t\t\t$cholesterol = $cholesterol_mgl;\n\t\telse:\n\t\t\t$cholesterol = '';\n\t\tendif;\n\n\t\t$sbp = round(($systolic_1st + $systolic_2nd)/2,1);\n\t\t\n\t\t$q_pxage = mysql_query(\"SELECT round((to_days('$date_assess')-to_days(patient_dob))/365 , 0) as computed_age, patient_gender FROM m_patient WHERE patient_id='$pxid'\") or die(\"Cannot query 1945: \".mysql_error());\n\t\tlist($px_age,$px_gender) = mysql_fetch_array($q_pxage);\n\t\t\n\t\t$q_smoking = mysql_query(\"SELECT smoking_status_label, red_flag FROM m_lib_ncd_smoking_status WHERE smoking_id='$smoking_id'\") or die(\"Cannot query 1951: \".mysql_error());\t\n\t\tlist($smoking_label,$smoking_status) = mysql_fetch_array($q_smoking);\n\t\n\t\t//echo $presence_diabetes.'/'.$cholesterol.'/'.$sbp.'/'.$px_age.'/'.$px_gender.'/'.$smoking_label.'/'.$smoking_status;\n\t\t\n\t\t$age_group = $this->age_group_stratification($px_age);\n\t\t$sbp_group = $this->sbp_stratification($sbp);\t\n\n\t\t\n\t\techo \"<table>\";\n\t\techo \"<tr><td>\";\n\n\t\t\techo \"<table bgcolor='#66FF66'>\";\n\t\t\techo \"<tr><td colspan='2' align='center' bgcolor='#339966' class='whitetext'>RISK STRATIFICATION DETAILS</td></tr>\";\n\t\n\t\t\techo \"<tr><td>Location of Assessment</td>\";\n\t\t\techo \"<td>$location</td>\";\n\t\t\techo \"</tr>\";\n\t\n\t\t\techo \"<tr><td>Presence of Diabetes</td>\";\n\t\t\techo \"<td>$presence_diabetes</td>\";\n\t\t\techo \"</tr>\";\n\t\n\t\t\techo \"<tr><td>Patient Gender and Age</td>\";\n\t\t\techo \"<td>$px_gender / $px_age</td>\";\n\t\t\techo \"</tr>\";\n\t\n\t\t\techo \"<tr><td>Smoking Status</td>\";\n\t\t\techo \"<td>$smoking_status, $smoking_label</td>\";\n\t\t\techo \"</tr>\";\n\t\n\t\t\techo \"<tr><td>Systolic Blood Pressure (Actual SBP)</td>\";\n\t\t\techo \"<td>$sbp_group ($sbp)</td>\";\n\t\t\techo \"</tr>\";\n\t\n\t\t\techo \"<tr><td>Cholesterol (mmol/l)</td>\";\n\t\t\techo \"<td>$cholesterol mmol/l</td>\";\n\t\t\techo \"</tr>\";\n\t\n\t\t\techo \"</table>\";\n\t\n\n\t\techo \"</td><td valign='top'>\";\n\t\t\n\t\t$this->show_risk_chart($location,$presence_diabetes,$px_gender,$age_group,$smoking_status,$smoking_label,$sbp_group,$cholesterol);\n\n\t\techo \"</td></tr></table>\";\n\n\t}", "function attendance_can_student_mark($sess, $log = true) {\n global $DB, $USER, $OUTPUT;\n $canmark = false;\n $reason = 'closed';\n $attconfig = get_config('attendance');\n\n if (!empty($attconfig->studentscanmark) && !empty($sess->studentscanmark)) {\n if (empty($attconfig->studentscanmarksessiontime) ||\n (attendance_is_status_availablebeforesession($sess->id)) && time() < $sess->sessdate) {\n $canmark = true;\n $reason = '';\n } else {\n $duration = $sess->duration;\n if (empty($duration)) {\n $duration = $attconfig->studentscanmarksessiontimeend * 60;\n }\n if (!isset($sess->studentsearlyopentime)) {\n // Sanity check just in case not set in this session.\n $sess->studentsearlyopentime = 0;\n }\n if (($sess->sessdate - $sess->studentsearlyopentime) < time() && time() < ($sess->sessdate + $duration)) {\n $canmark = true;\n $reason = '';\n }\n }\n }\n // Check if another student has marked attendance from this IP address recently.\n if ($canmark && !empty($sess->preventsharedip)) {\n if ($sess->preventsharedip == ATTENDANCE_SHAREDIP_MINUTES) {\n $time = time() - ($sess->preventsharediptime * 60);\n $sql = 'sessionid = ? AND studentid <> ? AND timetaken > ? AND ipaddress = ?';\n $params = array($sess->id, $USER->id, $time, getremoteaddr());\n $record = $DB->get_record_select('attendance_log', $sql, $params);\n } else {\n // Assume ATTENDANCE_SHAREDIP_FORCED.\n $sql = 'sessionid = ? AND studentid <> ? AND ipaddress = ?';\n $params = array($sess->id, $USER->id, getremoteaddr());\n $record = $DB->get_record_select('attendance_log', $sql, $params);\n }\n\n if (!empty($record)) {\n $canmark = false;\n $reason = 'preventsharederror';\n if ($log) {\n // Trigger an ip_shared event.\n $attendanceid = $DB->get_field('attendance_sessions', 'attendanceid', array('id' => $record->sessionid));\n $cm = get_coursemodule_from_instance('attendance', $attendanceid);\n $event = \\mod_attendance\\event\\session_ip_shared::create(array(\n 'objectid' => 0,\n 'context' => \\context_module::instance($cm->id),\n 'other' => array(\n 'sessionid' => $record->sessionid,\n 'otheruser' => $record->studentid\n )\n ));\n\n $event->trigger();\n }\n }\n }\n return array($canmark, $reason);\n}", "public function report_history(){ \r\n $periode = $this->input->post('periode_download');\r\n $getDate = explode(\" - \", $periode);\r\n $startDate = $getDate[0];\r\n $endDate = $getDate[1];\r\n \r\n $this->excel->setActiveSheetIndex(0);\r\n\r\n //name the worksheet\r\n $this->excel->getActiveSheet()->setTitle('History worksheet');\r\n\r\n $styleArray = array(\r\n 'borders' => array(\r\n 'allborders' => array(\r\n 'style' => PHPExcel_Style_Border::BORDER_THIN\r\n )\r\n )\r\n );\r\n\r\n $this->excel->getActiveSheet()->setCellValue('A1', 'History User');\r\n $this->excel->getActiveSheet()->getStyle(\"A1\")->getFont()->setSize(20);\r\n if(!empty($periode)){\r\n $this->excel->getActiveSheet()->setCellValue('A3', 'Start Date History : '.$startDate);\r\n $this->excel->getActiveSheet()->getStyle(\"A3\")->getFont()->setSize(12);\r\n \r\n $this->excel->getActiveSheet()->setCellValue('A4', 'End Date History : '.$endDate);\r\n $this->excel->getActiveSheet()->getStyle(\"A4\")->getFont()->setSize(12);\r\n }\r\n \r\n \r\n //set cell A1 content with some text\r\n $arrField = array('No', 'Name', 'Address', 'Agent Code', 'Agent Name', 'MG User ID', 'Email User', 'Status History', 'Gift Name', 'Value Gift', 'Point Gift', 'Last Point', 'In Point', 'Out Point', 'Current Point', 'Approved By','Tanggal History', 'Notes');\r\n \r\n $arrCellsTitle = $this->excel->setValueHorizontal($arrField, 6, 65); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n\r\n $i = 0;\r\n foreach($arrCellsTitle as $cells){\r\n\r\n $this->excel->getActiveSheet()->setCellValue($cells, $arrField[$i]);\r\n $i++;\r\n $this->excel->getActiveSheet()->freezePane('A7');\r\n } \r\n\r\n $report_history = $this->report_model->data_ReportHistory($startDate,date('Y-m-d', strtotime($endDate. ' + 1 days')));\r\n \r\n if($report_history){\r\n $no=1;\r\n $startNum = 7;\r\n foreach ($report_history as $row) { \r\n $tanggal_history = new DateTime($row['date_create']);\r\n $tanggal_history = date_format($tanggal_history, 'd M Y H:i');\r\n \r\n $arrItem = array($no, $row['name'], $row['address'], $row['kode_agent'], $row['agent_name'], $row['mg_user_id'],$row['email'], $row['status'], $row['gift_name'], $row['value'], $row['point'], $row['last_point'], $row['in_point'], $row['out_point'], $row['current_point'], $row['username'],$tanggal_history, $row['notes']);\r\n\r\n $arrCellsItem = $this->excel->setValueHorizontal($arrItem, $startNum, 65); //array field, nomer cells, abjad cells (start 65 = A, end 90 = Z)\r\n \r\n\r\n $i = 0;\r\n foreach($arrCellsItem as $cellsItem){\r\n\r\n $this->excel->getActiveSheet()->setCellValue($cellsItem, $arrItem[$i]);\r\n $i++;\r\n\r\n //make border\r\n $this->excel->getActiveSheet()->getStyle($cellsItem)->applyFromArray($styleArray);\r\n $this->excel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);\r\n } \r\n\r\n $no++;\r\n $startNum++;\r\n }}\r\n \r\n \r\n //make border\r\n $this->excel->getActiveSheet()->getStyle('A6:R6')->applyFromArray($styleArray);\r\n\r\n //change the font size\r\n //$this->excel->getActiveSheet()->getStyle()->getFont()->setSize(10);\r\n\r\n //make the font become bold\r\n $this->excel->getActiveSheet()->getStyle('A1:R6')->getFont()->setBold(true);\r\n\r\n //merge cell\r\n $this->excel->getActiveSheet()->mergeCells('A1:R1');\r\n \r\n if(!empty($periode)){\r\n $this->excel->getActiveSheet()->mergeCells('A3:D3');\r\n $this->excel->getActiveSheet()->mergeCells('A4:D4');\r\n }\r\n \r\n //set aligment to center for that merged cell \r\n $this->excel->getActiveSheet()->getStyle('A1:R6')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\r\n $this->excel->getActiveSheet()->getStyle('A1:R6')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);\r\n\r\n $filename = 'history-user.xls'; //save our workbook as this file name\r\n header('Content-Type: application/vnd.ms-excel'); //mime type\r\n header('Content-Disposition: attachment;filename=\"'.$filename.'\"'); //tell browser what's the file name\r\n header('Cache-Control: max-age=0'); //no cache\r\n \r\n //save it to Excel5 format (excel 2003 .XLS file), change this to 'Excel2007' (and adjust the filename extension, also the header mime type)\r\n //if you want to save it as .XLSX Excel 2007 format\r\n $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); \r\n //force user to download the Excel file without writing it to server's HD\r\n $objWriter->save('php://output');\r\n }", "public function store(\\Illuminate\\Http\\Request $request){\n // return view('survey::survey-add');\n\n\n $valid = $this->validate($request,[\n 'name' => 'required|min:3'\n ]);\n\n $publised = false;\n\n if($request->has('published')){\n $publised = true;\n }\n if($valid) {\n // dd($request->all());\n Audit::create([\n 'name' => $request->input('name'),\n 'user_id' => 1,\n 'is_published' => $publised,\n 'is_archieved' => 1,\n 'checklist_id' => 1\n ]);\n\n return redirect()->route('survey-add')->with(['success'=>'Audit information added successfully.']);\n }\n else{\n return redirect()->route('survey-add')->withErrors();\n }\n }", "public function edit(Sick $sick)\n {\n //\n }", "public static function maybe_track_usage() {\n\n\t\t/** checking optin state */\n\t\tif ( 'yes' == self::get_optIn_state() ) {\n\t\t\t$data = self::collect_data();\n\n\t\t\t//posting data to api\n\t\t\tXL_API::post_tracking_data( $data );\n\t\t}\n\t}", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "function getMarksheet(){\n \n //get student datails to print in marksheet\n $unique_id1 = $this->session->userdata('unique_id1');\n $session1 = $this->session->userdata('session1');\n $q = $this->db->where('unique_id',$unique_id1)\n ->get('userinfo');\n \n\t if( $q->num_rows()>0 ){\n\t\t\t\t//login valid\n\t\t\t\t$name1 = $q->row('name');\n\t\t\t\t$contact_number1 = $q->row('contact_number');\n\t\t\t\t$city1 = $q->row('city');\n\t\t\t\t$state1 =\t$q->row('state');\n\t\t\t\t$address1 = $q->row('address');\n\t\t\t\t$school_name1 = $q->row('school_name');\n\t\t\t\t$father_name1 = $q->row('father_name');\n\t\t\t\t$enroll_no1 = $q->row('enroll_no');\n\t\t\t\t$class11 = $q->row('class1');\n\t\t\t\t$profile_img_path1 = $q->row('profile_img_path');\n\t\t\t\t$sign_img_path1 = $q->row('sign_img_path');\n\t\t\t\t$parent_sign_path1 = $q->row('parent_sign_path');\n\t\t\t\t$dob1 = $q->row('dob');\n\t\t\t\t$gender1 = $q->row('gender');\n\t\t\t\t$aadhar_no1 = $q->row('aadhar_no');\n\t\t\t\t$section1 = $q->row('section');\n\t\t\t\t\n\t\t\t\t$this->session->set_userdata('name1',$name1);\n\t\t\t\t$this->session->set_userdata('contact_number1',$contact_number1);\n\t\t\t\t$this->session->set_userdata('city1',$city1);\n\t\t\t\t$this->session->set_userdata('state1',$state1);\n\t\t\t\t$this->session->set_userdata('address1',$address1);\n\t\t\t\t$this->session->set_userdata('school_name1',$school_name1);\n\t\t\t\t$this->session->set_userdata('father_name1',$father_name1);\n\t\t\t\t$this->session->set_userdata('enroll_no1',$enroll_no1);\n\t\t\t\t$this->session->set_userdata('class11',$class11);\n\t\t\t\t$this->session->set_userdata('section1',$section1);\n $this->session->set_userdata('profile_img_path1',$profile_img_path1);\n $this->session->set_userdata('dob1',$dob1);\n\t\t\t\t$this->session->set_userdata('sign_img_path1',$sign_img_path1);\n\t\t\t\t$this->session->set_userdata('aadhar_no1',$aadhar_no1);\n\t\t\t\t$this->session->set_userdata('parent_sign_path1',$parent_sign_path1);\n\t\t\t\t$this->session->set_userdata('gender1',$gender1);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//get school details to display in marksheet\n\t\t\t\t$school_name = $this->session->userdata('school_name');\n\t $q = $this->db->like('school_name',$school_name)\n\t\t\t\t\t\t->get('userinfo');\n\n\t\t\tif( $q->num_rows()>0 ){\n\t\t\t\t//login valid\n\t\t\t\t$contact_number2 = $q->row('contact_number');\n\t\t\t\t$email2 = $q->row('email');\n\t\t\t\t$city2 = $q->row('city');\n\t\t\t\t$state2 =\t$q->row('state');\n\t\t\t\t$address2 = $q->row('address');\n\t\t\t\t$profile_img_path2 = $q->row('profile_img_path');\n\t\t\t\t\n\t\t\t\t$this->session->set_userdata('contact_number2',$contact_number2);\n\t\t\t\t$this->session->set_userdata('email2',$email2);\n\t\t\t\t$this->session->set_userdata('city2',$city2);\n\t\t\t\t$this->session->set_userdata('state2',$state2);\n\t\t\t\t$this->session->set_userdata('address2',$address2);\n\t\t\t\t$this->session->set_userdata('profile_img_path2',$profile_img_path2);\n\t\t\t\t\n\t\t\t}\n \n $q = $this->db->where('student_id',$unique_id1)\n\t\t ->where('session1',$session1)\n\t\t ->get('marks_table');\n\t\t \n\t\t $result = $q->result();\n\t\t $this->load->view('view_marksheet_operator',['dblist'=>$result]);\n \n\t }\n }", "function galaxy_add_spy($galaxy, $system, $row, $planet, $timestamp, $report, $phalanx, $gate) {\n\tglobal $db, $user_data, $server_config;\n\n\t$spy_added = array();\n\t$request = \"insert into \".TABLE_SPY.\" (spy_galaxy, spy_system, spy_row, sender_id, datadate, rawdata)\".\n\t\" values ('$galaxy', '$system', '$row', \".$user_data[\"user_id\"].\", '$timestamp', '\".mysql_real_escape_string($report).\"')\";\n\tif ($db->sql_query($request, false)) {\n\t\t$request = \"select spy_id from \".TABLE_SPY;\n\t\t$request .= \" where active = '1'\";\n\t\t$request .= \" and spy_galaxy = '\".$galaxy.\"'\";\n\t\t$request .= \" and spy_system = '\".$system.\"'\";\n\t\t$request .= \" and spy_row = '\".$row.\"'\";\n\t\t$request .= \" order by datadate\";\n\t\t$result = $db->sql_query($request);\n\t\tif ($db->sql_numrows($result) > $server_config[\"max_spyreport\"]) {\n\t\t\t$nb = $db->sql_numrows($result) ;\n\t\t\twhile ($nb > $server_config[\"max_spyreport\"]) {\n\t\t\t\tlist($spy_id) = $db->sql_fetch_row($result);\n\t\t\t\t$request = \"update \".TABLE_SPY.\" set active = '0' where spy_id = \".$spy_id;\n\t\t\t\t$db->sql_query($request);\n\t\t\t\t$nb--;\n\t\t\t}\n\t\t}\n\n\t\t$spy_added[] = \"galaxy=$galaxy&system=$system&row=$row\";\n\n\t\t$moon = false;\n\t\tif ((strcasecmp($planet, \"lune\") == 0 || strpos($planet, \" (Lune)\") != 0 ) && !preg_match(\"#Mine#\", $report) && !preg_match(\"#deutérium#\", $report)) { // http://www.ogsteam.fr/forums/viewtopic.php?pid=27284#p27284\n\t\t\t$moon = true;\n\t\t}\n\n\t\t$request = \"select last_update, last_update_moon from \".TABLE_UNIVERSE.\" where galaxy = $galaxy and system = $system and row = $row\";\n\t\t$result = $db->sql_query($request);\n\t\tlist($last_update, $last_update_moon) = $db->sql_fetch_row($result);\n\n\t\tif ($timestamp > $last_update) {\n\t\t\t/*//Incompatible MySQL 4.0\n\t\t\t$request = \"insert into \".TABLE_UNIVERSE.\" (galaxy, system, row, name, last_update, last_update_user_id)\".\n\t\t\t\" values ('\".$galaxy.\"', \".$system.\", '\".$row.\"', '\".$planet.\"', \".$timestamp.\", \".$user_data[\"user_id\"].\")\".\n\t\t\t\" on duplicate key update name = '\".$planet.\"', last_update = '\".$timestamp.\"', last_update_user_id = \".$user_data[\"user_id\"];*/\n\n\t\t\t$request = \"update \".TABLE_UNIVERSE.\" set last_update = '\".$timestamp.\"', last_update_user_id = \".$user_data[\"user_id\"];\n\t\t\tif (!$moon) $request .= \", name = '\".mysql_real_escape_string($planet).\"'\";\n\t\t\t$request .= \" where galaxy = '\".$galaxy.\"' and system = \".$system.\" and row = '\".$row.\"'\";\n\t\t\t$db->sql_query($request);\n\n\t\t\tif ($db->sql_affectedrows() == 0) {\n\t\t\t\t$request = \"insert ignore into \".TABLE_UNIVERSE.\" (galaxy, system, row, name, last_update, last_update_user_id)\";\n\t\t\t\t$request .= \" values ('\".$galaxy.\"', \".$system.\", '\".$row.\"', '\".mysql_real_escape_string($planet).\"', \".$timestamp.\", \".$user_data[\"user_id\"].\")\";\n\t\t\t\t$db->sql_query($request);\n\t\t\t}\n\t\t}\n\n\t\tif ($timestamp > $last_update_moon && $moon) {\n\t\t\t$request = \"update \".TABLE_UNIVERSE.\" set moon = '1', last_update_moon = \".$timestamp.\", phalanx = \".$phalanx.\", gate = '\".$gate.\"' where galaxy = '\".$galaxy.\"' and system = \".$system.\" and row = '\".$row.\"'\";\n\t\t\t$db->sql_query($request);\n\t\t}\n\n\t\treturn true;\n\t}\n\treturn false;\n}", "function recommends_req_wizard_student_info($form, &$form_state) {\n $form = array();\n $form['streq'] = array(\n '#type' => 'fieldset',\n '#title' => variable_get('recommends_req_student_professor'),\n '#prefix' => '<div id=\"formlimit\">',\n '#suffix' => '</div>'\n );\n \n \n $form['streq']['prefix'] = array(\n '#type' => 'select',\n '#title' => t('Name prefix'),\n '#size' => 1,\n '#required' => TRUE,\n '#options' => array(\n \t'Mr.' => t('Mr.'),\n \t'Ms.' => t('Ms.'),\n \t'Mrs.' => t('Mrs.'), \n ),\n );\n \n $form['streq']['first_name'] = array(\n '#type' => 'textfield',\n '#title' => t('First name'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['first_name']) ? $form_state['values']['first_name'] : '',\n );\n $form['streq']['initial'] = array(\n '#type' => 'textfield',\n '#title' => t('Initial'),\n '#size' => 3,\n '#maxlength' => 20,\n '#default_value' => !empty($form_state['values']['initial']) ? $form_state['values']['initial'] : '',\n );\n $form['streq']['last_name'] = array(\n '#type' => 'textfield',\n '#title' => t('Last name'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['last_name']) ? $form_state['values']['last_name'] : '',\n );\n \n $form['streq']['suffix'] = array(\n '#type' => 'textfield',\n '#title' => t('Name suffix'),\n '#size' => 5,\n '#maxlength' => 50,\n '#default_value' => !empty($form_state['values']['suffix']) ? $form_state['values']['suffix'] : '',\n );\n $form['streq']['email'] = array(\n '#type' => 'textfield',\n '#title' => t('Email'),\n '#size' => 25,\n '#maxlength' => 50,\n '#required' => TRUE,\n '#default_value' => !empty($form_state['values']['email']) ? $form_state['values']['email'] : '',\n\n );\n $form['streq']['reqby'] = array(\n '#type' => 'hidden',\n '#title' => t('Date recommendations required by'),\n '#size' => 10,\n '#maxlength' => 15,\n '#description' => t('Date in the form of yyyy/mm/dd.'),\n \n );\n $form['streq']['comments'] = array(\n '#type' => 'textarea',\n '#title' => t('Statement of intent, Point of view'),\n '#cols' => 25,\n '#resizable' => TRUE,\n '#rows' => 5,\n '#default_value' => !empty($form_state['values']['comments']) ? $form_state['values']['comments'] : '',\n\n );\n return $form;\n}", "protected function _saveTry()\n {\n $this->_history[] = $this->_number;\n }", "public function noticeBoard(){\n\t\t\t $totalSiaNumber=DB::table('sia_program')->where('date','<',date('Y-m-d'))->lists('sia_number');\n\t\t\t $executedSiaNumber=DB::table('sia_action')->lists('sia_number');\n\t\t\t $notExecuted=array_diff($totalSiaNumber,$executedSiaNumber);\n\t\t\t $numberOfNotExecutedSia=count($notExecuted);\n\t\t\t //my associated sias\n\t\t\t $myNoticeNumberOfNotExecutedSia=$this->countMyAssociatedSia($notExecuted);\n\n\t\t//SIA : Finding Target Time Exceed\n\t\t \t//list of finding \n\t\t \t $findingList=DB::table('sia_findings')->lists('finding_number');\n\n\t\t \t//list finding corrective action\n\t\t \t $findingCorrectiveActionList=DB::table('sia_corrective_action')->lists('finding_number');\n\t\t \t \n\t\t \t//get diff of 2 array\n\t\t \t $notGivenCorrAction=array_diff($findingList, $findingCorrectiveActionList);\n\t\t \t \n\t\t \t//check the diff values whether they are target date exceed \n\t\t \t $exceedDateArray=[];\n\t\t \t foreach ($notGivenCorrAction as $info) {\n\t\t \t \t $exceedDate=DB::table('sia_findings')\n\t\t \t \t\t\t->where('target_date','<',date('Y-m-d'))\n\t\t \t \t\t\t->where('finding_number',$info)->pluck('finding_number');\n\t\t\t \t \t if($exceedDate){\n\t\t\t \t \t \t\t$exceedDateArray[]=$exceedDate;\n\t\t\t \t \t }\n\t\t \t }\n\t\t \t //count number \n\t\t \t $exceedDateFindingNumbers=count($exceedDateArray);\n\t\t \t //my associated Findings\n\t\t \t \t//get sia list\n\t\t \t \t\t$siaNumberofExceedDateFindingNumbers=[];\n\t\t \t \t\tforeach ($exceedDateArray as $findingNumber) {\n\t\t \t \t\t\t$exceedDateFindingNumber=DB::table('sia_findings')->where('finding_number',$findingNumber)->pluck('sia_number');\n\t\t \t \t\t\t$siaNumberofExceedDateFindingNumbers[]=$exceedDateFindingNumber;\n\t\t \t \t\t}\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeFindingDateExceed=$this->countMyAssociatedSia($siaNumberofExceedDateFindingNumbers);\n\n\t\t\n\t\t//SC : Safety Concern Target Time Exceed\n\t\t \t //safety concern list\n\t\t \t \t $scList=DB::table('sc_safety_concern')->lists('safety_issue_number');\n\t\t \t //Corrective Action sc list\n\t\t \t \t $correctiveActionScList=DB::table('sc_corrective_action')->lists('safety_issue_number');\n\t\t \t //diff number\n\t\t \t \t $scExceedDateArray=[];\n\t\t \t \t $notGivenCorrActionList=array_diff($scList,$correctiveActionScList);\n\t\t \t \t foreach ($notGivenCorrActionList as $info) {\n\t\t \t \t \t$exceedDate=DB::table('sc_safety_concern')\n\t\t \t \t \t\t->where('target_date','<',date('Y-m-d'))\n\t\t \t \t\t\t->where('safety_issue_number',$info)->pluck('safety_issue_number');\n\t\t\t \t \t if($exceedDate){\n\t\t\t \t \t \t\t$scExceedDateArray[]=$exceedDate;\n\t\t\t \t \t }\n\t\t \t \t }\n\n\t\t \t \t $exceedDateScNumbers=count($scExceedDateArray);\n\t\t \t \t//my associated sc\n\t\t \t \t//get sia list\n\t\t \t \t\t$siaNumberofExceedDateSc=[];\n\t\t \t \t\tforeach ($scExceedDateArray as $scNumber) {\n\t\t \t \t\t\t$exceedDateScSiaNumbers=DB::table('sc_safety_concern')->where('safety_issue_number',$scNumber)->pluck('sia_number');\n\t\t \t \t\t\t$siaNumberofExceedDateSc[]=$exceedDateScSiaNumbers;\n\t\t \t \t\t}\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeScDateExceed=$this->countMyAssociatedSia($siaNumberofExceedDateSc);\n\t\t//EDP:Waiting for approval\n\t\t \t \t//EDP list of legal\n\t\t \t \t $edpLegalList=DB::table('edp_legal_opinion')->lists('edp_number');\n\t\t \t \t//EDP list Approval\n\t\t \t \t $edpLegalListApproval=DB::table('edp_approval')->lists('edp_number');\n\t\t \t \t//Not Approval EDP\n\t\t \t \t $notApproveEdp=array_diff($edpLegalList, $edpLegalListApproval);\n\n\t\t \t \t $pendingApproveEdpNumber=count($notApproveEdp);\n\n\t\t \t \t //my associated EDP\n\t\t \t \t//get sia list\n\t\t \t \t\t$siaNumberofWaitingForApproval=[];\n\t\t \t \t\tforeach ($notApproveEdp as $edpNumber) {\n\t\t \t \t\t\t$edpApprovalWaitingSiaNumbers=DB::table('edp_primary')->where('edp_number',$edpNumber)->pluck('sia_number');\n\t\t \t \t\t\t$siaNumberofWaitingForApproval[]=$siaNumberofWaitingForApproval;\n\t\t \t \t\t}\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeEdpWaitingForApproval=$this->countMyAssociatedSia($siaNumberofExceedDateSc);\n\t\t//EDP:Legal Opinion pending\n\t\t\t \t//total edp list\n\t\t\t \t\t$edpTotal=DB::table('edp_primary')->lists('edp_number');\t \t\t\n\t\t\t \t//total legalopinion list\n\t\t\t \t\t$edpLegalList=DB::table('edp_legal_opinion')->lists('edp_number');\n\t\t\t \t//Diff\n\t\t\t \t\t$legalOpinionNotGiven=array_diff($edpTotal,$edpLegalList);\n\t\t\t \t//Count\n\t\t\t \t\t$totalEdpLegalOpinionPending=count($legalOpinionNotGiven);\n\t\t\t \t//my associated\n\t\t\t \t\t//get sia list\n\t\t \t \t \t$keys=$legalOpinionNotGiven;\n\t\t \t \t \t$tableName='edp_primary';\n\t\t \t \t \t$columnName='edp_number';\t\t \t \t\t\n\t\t\t \t \t//Sia list \n\t\t\t \t \t$siaNumberofPendingLegal=$this->getSiaList($keys,$tableName,$columnName);\n\t\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeEdpPendingLegalOpinion=$this->countMyAssociatedSia($siaNumberofPendingLegal);\n\t\t//SC:waiting for Approval\n\t\t \t \t //Sc finalize list\n\t\t \t \t \t$scFinalizeList=DB::table('sc_finalization')->lists('safety_issue_number');\n\t\t \t \t //Sc Approval list\n\t\t \t \t \t$scApproval=DB::table('sc_approval_info')->lists('safety_issue_number');\n\t\t \t \t //Not Approval Sc List\n\t\t \t \t \t$notApprovalScList=array_diff($scFinalizeList,$scApproval);\n\t\t \t \t \t$pendingApprovalScNumber=count($notApprovalScList);\n\n\t\t \t \t//my associated Sc waiting for Approval\n\t\t \t \t//get sia list\n\t\t \t \t \t$keys=$notApprovalScList;\n\t\t \t \t \t$tableName='sc_safety_concern';\n\t\t \t \t \t$columnName='safety_issue_number';\n\t\t \t \t\t\n\t\t \t \t//Sia list \n\t\t \t \t\t$siaNumberofNotApprovalSc=$this->getSiaList($keys,$tableName,$columnName);\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeScWaitingForApproval=$this->countMyAssociatedSia($siaNumberofNotApprovalSc);\n\t\t//SC: Corrective Action Approval pending\n\t\t\t \t//not approved corr action\n\t\t\t \t\t$scApprovalPendingCorrAction=DB::table('sc_corrective_action')->where('approve','0')->lists('safety_issue_number');\n\t\t\t \t//count\n\t\t\t \t\t$totalScCorrApprovalPending=count($scApprovalPendingCorrAction);\n\t\t\t \t//Associate with me\n\t\t\t \t\t//get sia list\n\t\t \t \t \t$keys=$scApprovalPendingCorrAction;\n\t\t \t \t \t$tableName='sc_safety_concern';\n\t\t \t \t \t$columnName='safety_issue_number';\n\t\t \t \t\t\n\t\t \t \t//Sia list \n\t\t \t \t\t$siaNumberofCorrPendingApprovalSc=$this->getSiaList($keys,$tableName,$columnName);\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeScCorrPendignApproval=$this->countMyAssociatedSia($siaNumberofCorrPendingApprovalSc);\n\n\t\t//SIA:waiting for SIA Approval \t\n\t\t\t\t//SMS sia_number list\n\t\t \t \t \t$smsSiaNumberList=DB::table('sia_sms')->where('approve','1')->lists('sia_number');\n\t\t\t\t//Approval sia_number list\n\t\t \t \t \t$approvalSiaNumberList=DB::table('sia_approval')->lists('sia_number');\n\t\t\t\t//Not Approve Sia List\n\t\t \t \t $notApprovalSiaList=array_diff($smsSiaNumberList,$approvalSiaNumberList);\n\t\t \t \t $pendingSiaApproval=count($notApprovalSiaList);\n\n\t\t \t //my associated SIA waiting for Approval\n\t\t \t \t\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeSiaWaitingForApproval=$this->countMyAssociatedSia($notApprovalSiaList);\n\n\t\t//SIA:SMS waiting For Approval \t\n\t\t\t\t//SMS sia_number list\n\t\t \t \t \t$smsApprovalPendingList=DB::table('sia_sms')->where('approve','0')->lists('sia_number');\n\t\t \t \t $pendingSmsApproval=count($smsApprovalPendingList);\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticeSmsWaitingForApproval=$this->countMyAssociatedSia($smsApprovalPendingList);\n\t\t//Findign:finding corrective action waiting For Approval \t\n\t\t\t\t//corrective finding number list\n\t\t \t \t \t$pendingCorrectiveActionLists=DB::table('sia_corrective_action')\n\t\t \t \t \t\t->where('approve','0')\n\t\t \t \t \t\t->where('regulation_mitigation','<>','')\n\t\t \t \t \t\t->lists('finding_number');\n\t\t \t \t $pendingCorrectiveActionList=count($pendingCorrectiveActionLists);\n\n\t\t \t //my associated Sc waiting for Approval\n\t\t \t \t//get sia list\n\t\t \t \t \t$keys=$pendingCorrectiveActionLists;\n\t\t \t \t \t$tableName='sia_corrective_action';\n\t\t \t \t \t$columnName='finding_number';\n\t\t \t \t\t\n\t\t \t \t//Sia list \n\t\t \t \t\t$siaNumberofPendingCorrApproval=$this->getSiaList($keys,$tableName,$columnName);\n\t\t \t \t//my associated sia\n\t\t\t \t\t$myNoticePendingCorrApproval=$this->countMyAssociatedSia($siaNumberofPendingCorrApproval);\n\n\n\t\treturn View::make('surveillance.noticeBoard')\n\t\t->with('PageName','SIA Board')\n\t\t->with('active','sia')\n\t\t->with('numberOfNotExecutedSia',$numberOfNotExecutedSia)\n\t\t->with('myNoticeNumberOfNotExecutedSia',$myNoticeNumberOfNotExecutedSia)\n\t\t->with('exceedDateFindingNumbers',$exceedDateFindingNumbers)\n\t\t->with('myNoticeFindingDateExceed',$myNoticeFindingDateExceed)\n\t\t->with('exceedDateScNumbers',$exceedDateScNumbers)\n\t\t->with('myNoticeScDateExceed',$myNoticeScDateExceed)\n\t\t->with('totalScCorrApprovalPending',$totalScCorrApprovalPending)\n\t\t->with('myNoticeScCorrPendignApproval',$myNoticeScCorrPendignApproval)\n\t\t->with('pendingSiaApproval',$pendingSiaApproval)\n\t\t->with('myNoticeSiaWaitingForApproval',$myNoticeSiaWaitingForApproval)\n\t\t->with('myNoticeEdpWaitingForApproval',$myNoticeEdpWaitingForApproval)\n\t\t->with('pendingApprovalScNumber',$pendingApprovalScNumber)\n\t\t->with('myNoticeScWaitingForApproval',$myNoticeScWaitingForApproval)\n\t\t->with('pendingApproveEdpNumber',$pendingApproveEdpNumber)\n\t\t->with('totalEdpLegalOpinionPending',$totalEdpLegalOpinionPending)\n\t\t->with('myNoticeEdpPendingLegalOpinion',$myNoticeEdpPendingLegalOpinion)\n\t\t->with('pendingSmsApproval',$pendingSmsApproval)\n\t\t->with('myNoticeSmsWaitingForApproval',$myNoticeSmsWaitingForApproval)\n\t\t->with('pendingCorrectiveActionList',$pendingCorrectiveActionList)\n\t\t->with('myNoticePendingCorrApproval',$myNoticePendingCorrApproval)\n\t\t\n\t\t\n\t\t;\n\t}", "public function dispense()\n {\n //$this->bean->setMeta('buildcommand.unique', array(array('name')));\n $this->addConverter('invoicedate', 'mySQLDate');\n $this->addValidator('name', 'hasvalue');\n $this->addValidator('yearname', 'hasvalue');\n $this->addValidator('yearname', 'isunique', array('bean' => $this->bean, 'attribute' => 'yearname'));\n $this->addValidator('invoicedate', 'isdate');\n $this->setAutoInfo(true);\n if ( ! $this->bean->getId()) {\n $this->bean->invoicedate = date('Y-m-d'); // now\n }\n }", "public function studentDroopOutInfo(Request $request)\n {\n $this->validate($request, [ \n 'right_semister' \t\t=> 'required',\n 'confirm_right_semister' => 'required',\n 'student_id' \t\t\t=> 'required',\n 'wrong_semister_id' \t=> 'required'\n ]);\n $right_semister \t\t = trim($request->right_semister);\n $confirm_right_semister = trim($request->confirm_right_semister);\n $student_id \t\t\t = trim($request->student_id);\n $wrong_semister_id \t\t = trim($request->wrong_semister_id);\n // check two semister\n if($right_semister != $confirm_right_semister){\n \tSession::put('failed','Sorry ! Right Semester And Confirm Right Semester Did Not Match');\n return Redirect::to('studentDroopOut/'.$student_id);\n \texit();\n }\n // detail student information \n $studentInfo = DB::table('student')->where('studentID',$student_id)->where('semister_status',1)->first();\n\n $session = $studentInfo->session ;\n \t$year = $studentInfo->year ;\n \t$shift = $studentInfo->shift_id ;\n \t$department = $studentInfo->dept_id ;\n \t$semister = $studentInfo->semister_id ;\n $section = $studentInfo->section_id ;\n \t$roll = $studentInfo->roll ;\n \t$studentID = $studentInfo->studentID ;\n \t$registration = $studentInfo->registration ;\n $semister_status = 1 ;\n \t$activity_status = 2 ;\n \t$student_type \t = 1 ;\n \t// check duplicate entry\n \t$count = DB::table('student')->where('studentID',$student_id)->where('semister_id',$right_semister)->count();\n \tif($count > 0)\n \t{\n \t\t Session::put('failed','Sorry ! Already Exits Of This Student');\n return Redirect::to('studentDroopOut/'.$student_id);\n \texit();\n \t}\n \t// insert query\n \t$data = array();\n \t$data['studentID'] \t\t= $studentID ;\n \t$data['session'] \t\t = $session ;\n \t$data['year'] \t\t\t = $year ;\n \t$data['shift_id'] \t\t= $shift ;\n \t$data['dept_id'] \t\t = $department ;\n \t$data['semister_id'] \t= $right_semister ;\n \t$data['section_id'] \t= $section ;\n \t$data['roll'] \t\t\t = $roll ;\n \t$data['registration'] \t = $registration ;\n \t$data['semister_status'] \t = $semister_status ;\n \t$data['activity_status'] \t = $activity_status ;\n \t$data['student_type'] \t\t = $student_type ;\n \t$data['created_at'] \t\t = $this->rcdate ;\n \tDB::table('student')->insert($data);\n // insert droop out table\n $data_droopout = array();\n $data_droopout['year'] = $year ;\n $data_droopout['student_id'] = $student_id ;\n $data_droopout['session_id'] = $session ;\n $data_droopout['wrong_semister_id'] = $wrong_semister_id ;\n $data_droopout['right_semister_id'] = $right_semister ;\n $data_droopout['create_time'] = $this->current_time ;\n $data_droopout['created_at'] = $this->rcdate ;\n DB::table('tbl_droopout')->insert($data_droopout);\n //delete wrong semester\n DB::table('student')->where('studentID',$student_id)->where('semister_id','>',$right_semister)->delete();\n Session::put('succes','Drop Out Complete Succssfully');\n return Redirect::to('studentVerify/');\n }", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}", "function submit_rating(){\n $previous_form = $_SESSION['step_one'];\n \n $data['staff1'] = $this->User_model->get_user($previous_form['user_id']);\n\n if($previous_form['rating_type'] == 3){\n $this->load->library('form_validation');\n $this->form_validation->set_rules('reason', 'Reason', 'required');\n if (!$this->form_validation->run()) {\n redirect('rating/form_step_two');\n }\n }\n\n $params = array(\n 'rating_type' => $previous_form['rating_type'],\n 'user_id' => $previous_form['user_id'],\n 'mobile_no' => $this->input->post('mobile_no'),\n 'reason' => $this->input->post('reason'),\n );\n $this->Rating_model->add_rating($params);\n $userinfo=$this->User_model->get_user($previous_form['user_id']);\n $_SESSION['userrname']=$userinfo['first_name'].' '.$userinfo['last_name'];\n redirect('rating/success');\n }", "public function reportForDuty()\n {\n //Do stuff ...\n }", "function recommends_req_wizard_next_submit($form, &$form_state) {\n\n $current_step = &$form_state['step'];\n $form_state['step_information'][$current_step]['stored_values'] = $form_state['values'];\n \n/////////////// \nif ($form_state['step'] == 1) {\n \n $format = variable_get('date_format_long', 'l, F j, Y - H:i');\n date_default_timezone_set('America/New_York');\n $date = date(\"c\") ;\n $timestamp = substr($date,0,19); \n \n $form_state['prefix'] = $form_state['values']['prefix'];\n $form_state['firstname'] = $form_state['values']['first_name'] ;\n $form_state['lastname'] = $form_state['values']['last_name'];\n $form_state['initial'] = $form_state['values']['initial'];\n $form_state['suffix'] = $form_state['values']['suffix'] ;\n $form_state['s_email'] = $form_state['values']['email'];\n $form_state['s_school'] = \"Clayton\";\n $form_state['s_req_date'] = $timestamp;\n $form_state['s_master_doc'] = $form_state['values']['reqby'] ;\n $form_state['s_comments'] = $form_state['values']['comments'] ;\n $form_state['s_timestamp'] = $timestamp;\n }\n \n if ($form_state['step'] == 2) {\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n \t\t$form_state['schoolname'][$i] = $form_state['values']['schname'][$i]['schoolname'];\n \t\t$form_state['schoolprogram'][$i] = $form_state['values']['schname'][$i]['schoolprogram'];\n \t\t\n \t\t$form_state['r_school_contact_email'][$i] = $form_state['values']['schname'][$i]['school_contact_email'];\n \t\t$form_state['r_school_contact_postal'][$i] = $form_state['values']['schname'][$i]['school_contact_postal'];\n \t\t\n \t\t$form_state['r_date_due'][$i]['month'] = $form_state['values']['schname'][$i]['r_date_due']['month'];\n \t\t\n \t\t$form_state['r_date_due'][$i]['day'] = $form_state['values']['schname'][$i]['r_date_due']['day'];\n \t\t$form_state['r_date_due'][$i]['year'] = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \t\t\n \t\t\n };\n }\n \n if ($form_state['step'] == 3) {\n if ($form_state['num_courses'] == 0) {\n drupal_goto('recommends_req/wizard/intro');\n }\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n \t\t$pid = $form_state['step_information'][3]['stored_values']['crsname'][$i]['i_pid'];\n \t\t\n \t\n \t\t\n \t\tif (in_array($pid, $form_state['entries'])) {\n \t\t\n \t\t\n \t\t $form_state['coursenum'][$i] = $form_state['entries'][$pid]->i_course;\n \t\t $form_state['coursesemester'][$i] = $form_state['entries'][$pid]->i_semester;\n \t\t $form_state['courseyear'][$i] = $form_state['entries'][$pid]->i_year;\n \t\t $form_state['courseother'][$i] = \" \";\n \t\t} else\n \t\t{\n \t\t $form_state['coursenum'][$i] = $form_state['complete form']['crsname'][1]['i_pid']['#options'][$pid];\n \t\t $form_state['coursesemester'][$i] = \"NA\";\n \t\t $form_state['courseyear'][$i] = \"NA\";\n \t\t $form_state['courseother'][$i] = $form_state['step_information'][3]['stored_values']['crsname'][$i]['i_other']; \n \t\t}\n \t\t\n \t\t\n };\n }\n \n if ($current_step < count($form_state['step_information'])) {\n $current_step++;\n if (!empty($form_state['step_information'][$current_step]['stored_values'])) {\n $form_state['values'] = $form_state['step_information'][$current_step]['stored_values'];\n }\n else {\n $form_state['values'] = array();\n }\n $form_state['rebuild'] = TRUE; // Force rebuild with next step.\n return;\n }\n}", "public function save(){\n\t\t// yei bata feri \"index.php\" ma falne jun chai profile ma jancha\n\t\t$req = new Requirement();\n\n\t\tif(isset($_POST['title'])){\n\t\t$req->setTitle($_POST['title']);\n\t\t}else{\n\t\t\t$req->setTitle(\"\");\n\t\t}\n\t\tif(isset($_POST['date'])){\n\n\t\t$req->setDate($_POST['date']);\n\t\t}else{\n\t\t\t$req->setDate(\"01-01-2001\");\n\t\t}\n\t\tif(isset($_POST['details'])){\n\t\t$req->setDescription($_POST['details']);\n\t\t}else{\n\t\t\t$req->setDescription(\"\");\n\t\t}\n\t\t$req->setStatus(1);\n\t\t$req->setOrgname(\"\");\n\t\t$this->requirement_repository->insert($req);\n\n\t}", "public function beforeSave() {\n $this->name = $this->title_name;\n// $this->created_version = parent::CREATED_VERSION_PARAMOUNT;//TODO:!\n $this->create_type = parent::CREATE_TYPE_REGULAR;\n\n $this->due_date = $this->client_due_date;\n\n return parent::beforeSave();\n }", "public function addclaimwatchnews($users_creditor_id, $spis_id, $oddil, $date) {\n $key = array(\n \"users_creditor_id\" => $users_creditor_id,\n \"spis_id\" => $spis_id,\n \"oddil\" => $oddil,\n );\n\n // check whether it does not already exist\n $this->isirdb->where($key);\n $existing = $this->isirdb->get('users_creditors_news')->first_row();\n\n // make data to insert/update by extending key with non key properties\n $data = $key;\n $data[\"date\"] = $date;\n $data[\"modified_on\"] = date(\"Y-m-d H:i:s\");\n\n if ($existing == null) {\n // insert it\n $this->isirdb->insert('users_creditors_news', $data);\n } else {\n // update it\n $this->isirdb->where('id', $existing->id);\n $this->isirdb->update('users_creditors_news', $data);\n }\n\t}", "public function setRecordLog() {\n \t$msg = '';\n \t$defaultFilterFields = array( 'id', 'modify_user_id' ,'modify_time', 'create_user_id', 'create_time','check_user_id','check_time');\n \t$addFilterFields = !empty($this->filterFields) ? $this->filterFields : array();\n \t$filterFields = array_merge($defaultFilterFields,$addFilterFields);\n \tforeach ( $this->getAttributes() as $key => $val ) {\n \t\tif ( ! $this->getIsNewRecord() && $val == $this->beforeSaveInfo[$key] ) {\n \t\t\tcontinue;\n \t\t}\n// \t\t$label = $this->getAttributeLabel($key);\n $label = get_class($this) . ':'.$key; //by shenll\n \t\tif (in_array($key, $filterFields)) {\n \t\t\tcontinue;\n \t\t}else {\n \t\t\tif ( $this->getIsNewRecord() ) {\n \t\t\t\t$msg .= MHelper::formatInsertFieldLog($label, $val);\n \t\t\t} else {\n \t\t\t\t$msg .= MHelper::formatUpdateFieldLog($label, $this->beforeSaveInfo[$key], $val);\n \t\t\t}\n \t\t}\n \t}\n //\treturn $msg;\n \t$this->addLogMsg($msg);\n }", "public function infoSickName($sickName)\n\t\t{\n\t\t\t//DATA for informations\n\t\t\t$data = array();\n\t\t\t\n\t\t\t//Index on CSV\n\t\t\t$this->csv->searchIndex($sickName);\n\t\t\t\n\t\t\t//Read line\n\t\t\t$this->csv->nextLine();\n\t\t\t\n\t\t\t//CSV Line\n\t\t\t$lineCsv = $this->csv->getLineCSV();\n\t\t\t\n\t\t\t//Index on TXT\n\t\t\t$this->txt->searchIndex($lineCsv->getPreferred_Label());\n\t\t\t\n\t\t\t//Read record\n\t\t\t$this->txt->readNextRecord();\n\t\t\t\n\t\t\t//TXT Record\n\t\t\t$recordTxt = $this->txt->getRecordTxt();\n\t\t\t\n\t\t\t//DATA for informations\n\t\t\t$data = array();\n\t\t\t$data['Preferred_Label'] = $lineCsv->getPreferred_Label();\n\t\t\t$data['Synonyms'] = $lineCsv->getSynonyms();\n\t\t\t$data['CUI'] = $lineCsv->getCUI();\n\t\t\t\n\t\t\t$data['TX'] = $recordTxt->getTX();\n\t\t\t$data['CS'] = $recordTxt->getCS();\n\t\t\t\n\t\t\t//Return\n\t\t\treturn $data;\n\t\t}", "function save() {\n\t\tif ($this->input->post('contracts_show_due')) {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', $this->input->post('contracts_show_due'));\n\n\t\t}\n\n\t\telse {\n\n\t\t\t$this->mdl_mcb_data->save('contracts_show_due', \"FALSE\");\n\n\t\t}\n\t}", "function nnr_stats_record_impresssion_v1() {\n\n\t$data_id = $_POST['data_id'];\n\t$table_name = $_POST['table_name'];\n\n\t// Return false if no data is given\n\n\tif ( !isset($data_id) ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because no Data ID given.');\n\t}\n\n\t// Return false if crawler\n\n\tif ( nnr_stats_is_bot_v1() ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because a crawler was detected.');\n\t}\n\n\t// Return if user is admin or higher\n\n\tif ( current_user_can('edit_published_posts') ) {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored because current user is an admin.');\n\t}\n\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . $table_name;\n\t$today = date('Y-m-d');\n\n\t// Check if entry already exsits\n\n\t$impressions = $wpdb->query($wpdb->prepare('SELECT * FROM ' . $table_name . ' WHERE `date` = %s AND `data_id` = %d', $today, $data_id));\n\n\t// Entry aleady exists, just add 1\n\n\tif ( isset($impressions) && $impressions != 0 ) {\n\n\t\t$result = $wpdb->query($wpdb->prepare('UPDATE ' . $table_name . ' SET\n\t\t\t`impressions` = `impressions` + 1\n\t\t\tWHERE `date` = %s AND `data_id` = %d', $today, $data_id\n\t\t));\n\n\t}\n\n\t// Entry does not exist, create a new one and set impressions to 1\n\n\telse {\n\n\t\t$result = $wpdb->query($wpdb->prepare('INSERT INTO ' . $table_name . ' (\n\t\t\t`date`,\n\t\t\t`data_id`,\n\t\t\t`impressions`,\n\t\t\t`conversions`\n\t\t\t) VALUES (%s, %d, 1, 0)',\n\t\t\t$today,\n\t\t\t$data_id\n\t\t));\n\n\t}\n\n\tif ( $result ) {\n\t\tnnr_stats_return_data_v1('Impression was able to be recored.');\n\t} else {\n\t\tnnr_stats_return_data_v1('Impression was NOT able to be recored.');\n\t}\n}", "public function indexAction(){\n \t$logger \t= new Frogg_Log('/home2/bleachse/public_html/seriando/log/new_series.log');\n \t$control = new Application_Model_NewSeriesControl(1);\n \t$series_control = $control->nextSeries();\n \tif(!$series_control){ $logger->warn('No new series'); $logger->close(); die();}\n \t\n \t$xml = new XMLReader();\n\t if(!$xml->open('http://services.tvrage.com/feeds/full_show_info.php?sid='.$series_control->rage_id)){\n\t \t$logger->err('Failed to open input file : '.$series_control->rage_id);\n\t \t\t$logger->close();\n\t die();\n\t }\n\t $logger->info('Starting to log new_series_id : '.$series_control->rage_id);\n\t $series = new Application_Model_Series();\n\t while ($xml->read()){\n\t \twhile($xml->read() && $xml->name != 'name');\n\t \tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'name'){\n\t\t\t\t$series->name = $xml->readString();\n\t \t}\n \t\twhile($xml->read() && $xml->name != 'showid');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'showid'){\n \t\t\t$series->rage_id = $xml->readString();\n \t\t\t$double_check = new Application_Model_Series();\n \t\t\t$logger->info('Double check [my_id]:[rage_id] '.$series_control->rage_id.':'.$series->rage_id);\n \t\t\tif($double_check->loadField('rage_id', $series->rage_id)){\n \t\t\t\t//This piece of code will probably NEVER run.\n \t\t\t\t//Why? NewSeriesControl only fetches UNREAD series AND 'newseries.rage_id' MUST be unique.\n \t\t\t\t//If this ever happen: Either you forgot to set 'rage_id' as unique or the DB crapped itself\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::ERROR;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->err('Series already registered rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'origin_country');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'origin_country'){\n \t\t\tif(!$this->allowedCountry($xml->readString())){\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::INVALID;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->warn('Series country not allowed rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'status');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'status'){\n \t\t\t$series->status = $this->parseStatus($xml->readString());\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'classification');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'classification'){\n \t\t\tif($this->avoidedClassification($xml->readString())){\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::INVALID;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->warn('Series classification invalid rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'runtime');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'runtime'){\n \t\t\t$series->runtime = $xml->readString();\n \t\t}\n \t\t$series->image\t = 'default.png';\n \t\t$series->timestamp = time();\n \t\t$series->permalink = $series->permalinkFor('name');\n \t\t$series->order\t = NEW_SERIES;\n\t \tif(!$series->rage_id){\n\t \t\t$series_control->flag = Application_Model_NewSeries::ERROR;\n\t \t\t$series_control->update();\n\t \t\t$logger->err('Empty XML');\n\t \t\t$logger->close();\n\t \t\tdie;\n\t \t}\n \t\t$series_id = $series->save();\n \t\t$logger->ok('Saved');\n \t\t\n \t\t$series_bucket = new Application_Model_SeriesBucket($series->name,$series->permalink);\n \t\t$series_bucket->save();\n \t\t\n\t \t$has_episodes = $xml->next('Episodelist');\n \t\tif($has_episodes){\n \t\t\twhile($xml->read() && !($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'Episodelist')){\n \t\t\t\twhile($xml->read() && $xml->name != 'Season');//Goes to next <Season>\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'Season'){\n\t\t \t\t\t$season_num = $xml->getAttribute('no');\n\t\t \t\t\t$season = new Application_Model_Series();\n\t\t \t\t\t$season->series_id \t= $series_id;\n\t\t \t\t\t$season->name \t \t= $season_num.'ª Temporada';\n\t\t \t\t\t$season->order\t\t= $season_num * 1000; //According to format XXX.000 for seasons \n\t\t \t\t\tif($season_num < 10){ $season_num = '0'.$season_num; }\n\t\t \t\t\t$season->release \t= $series->name.' Season '.$season_num;\n\t\t \t\t\t$season->timestamp \t= time();\n\t\t \t\t\t$season_id \t\t\t= $season->save();\n\t\t \t\t\t$release\t\t\t= new Application_Model_Release($season_id,$season->release,time());\n\t\t \t\t\t$release->save();\n \t\t\t\t}\n \t\t\t\twhile($xml->read()){ //Season episodes reading\n\t \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'episode'){ //Found new episode\n\t\t \t\t\t\t$episode = new Application_Model_Series();\n\t\t \t\t\t\t$episode->season_id = $season_id;\n\t\t \t\t\t\t$episode->series_id = $series_id;\n\t\t \t\t\t\t$episode->timestamp = time();\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'seasonnum');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'seasonnum'){\n\t\t\t\t \t\t\t$episode_num = $xml->readString();\n\t\t\t\t \t\t\t$episode->release = $series->name.' S'.$season_num.'E'.$episode_num;\n\t\t\t\t \t\t\t$episode->order = $season->order + ($episode_num*1); //According to format XXX.yyy for episodes\n\t\t\t \t\t\t}\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'airdate');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'airdate'){\n\t\t\t\t \t\t\t$date = new Frogg_Time_Time($xml->readString());\n \t\t\t\t\t\t\t$episode->airdate = $date->getUnixTstamp();\n\t\t\t \t\t\t}\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'title');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'title'){\n\t\t\t\t \t\t\t$episode->name = $xml->readString();\n\t\t\t \t\t\t}\n\t\t\t \t\t\t$episode_id = $episode->save();\n\t\t\t \t\t\t$release\t= new Application_Model_Release($episode_id,$episode->release,$episode->airdate);\n\t\t \t\t\t\t$release->save();\n\t\t \t\t\t\t$xml->next('episode');\n\t\t\t\t\t\t} else if($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'Season'){ //Found season finale\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n \t\t\t\t}//END - Season episodes reading\n \t\t\t}\n \t\t}\n \t\t$series_control->flag = Application_Model_NewSeries::READ;\n \t\t$series_control->update();\n\t\t\t$logger->ok('Great Success !!');\n \t\t$logger->close(); \t\t\n\t\t\tdie;\n\t }\n }", "public function checkScoredCompetition()\n {\n if (!$this->competition_helper->isScoredCompetitionDate($this->selected_date)) {\n $competitions = $this->query_competitions->getCompetitionBySeasonId($this->selected_season,\n ['Scored' => 'Y']);\n /** @var QueryCompetitions $competition */\n $competition = end($competitions);\n $date_object = new \\DateTime($competition->Competition_Date);\n $this->selected_date = $date_object->format(('Y-m-d'));\n }\n }", "public function save_shot() {\n\n // Has any form data been POSTed?\n if ($this->request->is('post')) {\n // If the form data can be validated and saved...\n $breed_data = $this->request->data;\n\n $this->loadModel('User');\n // Load current logged in user and debit amount from credit or fund\n $user = $this->User->find('first', array('conditions' => array('User.id' => $this->Auth->user('id'))));\n\t\tif($user['User']['funds'] >= 75) {\n\t\t \t$user['User']['funds'] = $user['User']['funds'] - 75;\n\t\t \t$this->User->save($user);\n\t \t\t$this->Session->write('Auth.User.funds', $user['User']['funds']);\n\t\t \t$this->Session->setFlash(__('Congratulations !! Shot successful.'), 'default', array('class' => 'success'));\n\t \t} else {\n\t \t\t$this->Session->setFlash(__('Sorry ! You dont have sufficent funds.'), 'default', array('class' => 'error'));\n\t \t}\n\t \t\n $veterinarian['user_id'] = $this->Auth->user('id');\n $veterinarian['shots_checkups'] = $breed_data['breed'];\n $veterinarian['b_locus_testing'] = 0;\n $veterinarian['d_locus_testing'] = 0;\n $veterinarian['e_locus_testing'] = 0;\n $veterinarian['s_locus_testing'] = 0;\n $veterinarian['health_testing'] = 0;\n $veterinarian['spay_neuter'] = 0;\n $veterinarian['groomer'] = 0;\n $this->loadModel('Veterinarian');\n \n if ($this->Veterinarian->save($veterinarian)) {\n\t\t\t\n\t\t\t$this->loadModel('GameBreed');\n\t\t\t\n\t\t\t$gamebreed = $this->GameBreed->findById($breed_data['breed']);\t\t\t\n\t\t\t$shotsVal = intval($gamebreed['GameBreed']['shots']) + 1;\n\t\t\t\n\t\t\t$this->GameBreed->id = $breed_data['breed'];\n\t\t\t$this->GameBreed->save(array('shots' => $shotsVal));\n\t\t\t\t\t\t\n return $this->redirect('/vet');\n }\n }\n return $this->redirect('/vet');\n }", "public function shouldReportToSentry()\n {\n $this->shouldExit = true;\n }", "protected function notify_changes_saved() {\n $this->notify->good('gradessubmitted');\n }", "public function watchAction() {\n\t\t$dbseries = new Application_Model_DbTable_Series();\n\t\t$this->view->series = $dbseries->getNotMySeries($this->userid);\n\t}", "public function beforeSave(){\n $existing_flag = false;\n if(!isset($this->data['Voucher']['id'])){\n $this->data['Voucher']['name'] = $this->_detemine_voucher_name(); \n } \n }", "public function storeInsuranceInfo(Request $request){\n $data=array();\n $data['sys_users_id'] = $request->sys_users_id;\n $data['claim_type']=$request->claim_type;\n $data['claim_date']=$request->claim_date;\n $data['claim_amount']=$request->claim_amount;\n $data['claim_details']=$request->claim_details;\n $data['claim_status']=$request->claim_status;\n\n if (isset($request->insurance_id) && $request->insurance_id!=''){\n $update = DB::table('hr_insurance_claims')->where('hr_insurane_claim_id', $request->insurance_id)->update($data);\n// AuditTrailEvent::updateForAudit($update, $data);\n $dataReturn = DB::table('hr_insurance_claims')->where('sys_users_id', $request->sys_users_id)->get();\n return response()->json([\n 'success'=>true,\n 'data'=>$dataReturn,\n 'message'=>'Insurance information update successfully',\n ]);\n }else{\n DB::table('hr_insurance_claims')->insert($data);\n\n $dataReturn=DB::table('hr_insurance_claims')->where('sys_users_id', $request->sys_users_id)->get();\n return response()->json([\n 'success'=>true,\n 'data'=>$dataReturn,\n 'message'=>'Insurance information added successfully',\n ]);\n }\n\n\n }", "function checkSPHistory($sp_id){\n\t\t$track = new trackModel();\n\t\t$track->sp_id = $sp_id;\n\t\t$track->status = \"Completed\";\n\t\treturn $track->checkSPHistory();\n\t}", "function srTracker($access) {\n\t\t$sql= \"SELECT `date`, `sr` FROM `match` WHERE `sr`!=0 GROUP BY `date`;\";\n\t\t$data=$access->query($sql);\n\t\twhile ($row=$data->fetch_assoc()) {\n\t\t\techo \"['\" . $row[\"date\"] . \"', \" . $row[\"sr\"] . \"],\";\n\t\t}\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 }", "function validates(){\n\t\t\tif($this->RequestHandler->isAjax()==true){ \n\t\t\t//echo \"<pre>\"; print_r($this->params); die;\n\t\t\t//echo \"<pre>\"; print_r($this->params); die;\n\t\t\t$logArray = $this->params['form'];\n\t\t\tif($logArray['log_entry']=='accepted'){\n\t\t\t\t$log_entry = 'scenario_accepted';\n\t\t\t\t$state = '5';\n\t\t\t}elseif($logArray['log_entry']=='rejected'){\n\t\t\t\t$log_entry = 'scenario_rejected';\n\t\t\t\t$state = '6';\n\t\t\t}\n\t\t\t$datatosave = array();\n\t\t\t\t\t$datatosave = array (\n\t\t\t\t\t\t\t'Log' => array (\n\t\t\t\t\t\t\t'affected_obj' => $this->params['pass'][0],\n\t\t\t\t\t\t\t'log_entry' => $log_entry,\n\t\t\t\t\t\t\t'created' => date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t'status' => 1,\n\t\t\t\t\t\t\t'customer_id' => $logArray['cust_id'],\n\t\t\t\t\t\t\t'bsk' => $this->Session->read('BSK'),\n\t\t\t\t\t\t\t'user' => $this->Session->read('ACCOUNTNAME'),\n\t\t\t\t\t\t\t'app_type' => 'Gate',\n\t\t\t\t\t\t\t'modified' => '0000-00-00 00:00:00',\n\t\t\t\t\t\t\t'modification_status' => 1,\n\t\t\t\t\t\t\t'modification_response' => $logArray['comment']\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t$this->Log->create();\n\t\t\t\t$this->Log->save($datatosave);\n\t\t\t\t$this->Scenario->updateAll(\n\t\t\t\t\t\t\tarray('Scenario.status' => \"'\".$state.\"'\"),\n\t\t\t\t\t\t\tarray('Scenario.id' => $this->params['pass'][0])\n\t\t\t\t);\n\t\t\t\techo $log_entry; die;\n\t\n\t\t}\n\t}", "private function checkPrintCondition()\r\n {\r\n // is queryResult is empty this means it is a new claim\r\n if(empty($this->queryResult))\r\n {\r\n return \"checked\";\r\n }\r\n }", "function __saveLog() {\n $this->__UserLog->save($this->__UserLog->data,false);\n }", "public function store(Request $request)\n {\n DB::table('history_log')->insert(\n array('user'=>Auth::user()->name,'history_type'=>'stored','path'=>url()->current())\n );\n $request->validate([\n 'report_name' => 'required|string|min:1|max:200',\n ]);\n\n $project_id = $request->project_id;\n $project = ErpProject::find($project_id);\n\n $reporting = new ErpProjectReporting();\n $reporting->project_id = $project_id;\n $reporting->project_phase = $project->project_phase;\n $reporting->report_name = $request->report_name;\n $reporting->no_of_copies = $request->no_of_copies;\n if($request->submitted_on != null){\n $reporting->submitted_on = date('Y-m-d', strtotime($request->submitted_on));\n }\n if($request->due_date != null){\n $reporting->due_date = date('Y-m-d', strtotime($request->due_date));\n }\n $reporting->description = $request->description;\n\n if ($request->amendment == null) {\n $reporting->amendment = 0;\n } else {\n\n $reporting->amendment = $request->amendment;\n }\n $result = $reporting->save();\n\n if($result){\n return redirect('/project/'.$project_id )->with('message-success', 'New Reporting has been assigned.');\n } else {\n return redirect('/project/'.$project_id )->with('message-danger', 'Something went wrong. Please try again.');\n }\n }", "function addLoginStrikes()\n\t{\n\t\t$currentAttempts = $this->getLoginStrikes();\n\t\t\n\t\tif($currentAttempts == false) //This is the first strike, so insert in DB\n\t\t{\n\t\t\t$this->DB->database_insert('activity',\n\t\t\t\t\t\t array('activity_ip' => $_SERVER['REMOTE_ADDR'],\n\t\t\t\t\t\t\t'activity_type' => 'logins',\n\t\t\t\t\t\t\t'activity_strikes' => 1));\n\t\t}\n\t\telse //Update current strike count otherwise\n\t\t{\n\t\t\t$currentAttempts++;\n\t\t\t$time = get_timestamp(); //Time strike occurred. Offset against time required for user to wait\n\t\t\t$this->DB->database_update('activity', array('activity_strikes' => $currentAttempts, 'activity_time' => $time),\n\t\t\t\t\t\t array('activity_type' => 'logins',\n\t\t\t\t\t\t\t 'activity_ip' => $_SERVER['REMOTE_ADDR']));\n\t\t\t\n\t\t}\n\t}", "public function store(Request $request){\n\n\n $this->validate(\n $request, \n ['preferred_time' => 'required_if:service_request_warrant_issued_schedule_date,==,null'],\n ['required_if' => 'This scheduled fix date is required'],\n );\n\n \n \n\n if($request->intiate_rfq == 'yes' && $request->new_supplier_id ){\n \n $this->validate($request, [\n \"new_manufacturer_name\" => \"required|array\",\n \"new_manufacturer_name.*\" => \"required|string|min:2\",\n \"new_component_name\" => \"required|array\",\n \"new_component_name.*\" => \"required|string|min:2\",\n \"new_quantity\" => \"required|array\",\n \"new_quantity.*\" => \"required|integer\",\n ]);\n }\n \n\n $service_request_warranty_id = $request['service_request_warranty_id'];\n $serviceRequest = \\App\\Models\\ServiceRequestWarrantyIssued::where('service_request_warranty_id', $request['service_request_warranty_id'])->first();\n $preferredTime = $saveTechnician= $uploadReportImage= $serviceRequestReport = $causalWarrantReport=$saveRfq = $deliveryStatus = $acceptMaterial= $saveRfqSupplierInoviceStatus='';\n \n if($request->preferred_time)\n {\n $preferredTime = $this->preferredTime($serviceRequest, $service_request_warranty_id,$request);\n }\n\n if($request['technician_user_uuid'] )\n {\n $saveTechnician = $this->saveTechnician($serviceRequest, $service_request_warranty_id,$request);\n }\n\n if($request->hasFile('upload_image'))\n {\n $uploadReportImage = $this->uploadReportImage($request,$serviceRequest); \n } \n\n if($request->causal_reason || $request->causal_agent_id)\n {\n $causalWarrantReport = $this->causalWarrantReport($request,$serviceRequest);\n }\n\n if($request->cse_comment) \n {\n $serviceRequestReport = $this->serviceRequestReport($request,$serviceRequest);\n }\n\n if($request->intiate_rfq == 'yes')\n {\n $saveRfq = $this->saveRfq($request);\n }\n if($request->approve_invoice)\n {\n $saveRfqSupplierInoviceStatus = $this->saveRfqSupplierInoviceStatus($request);\n \n }\n\n if($request->delivery_status){\n $deliveryStatus = $this->deliveryStatus($request);\n\n }\n\n if($request->accept_materials){\n $acceptMaterial= $this->acceptMaterial($request);\n\n }\n \n \n\n if ($saveRfq || $preferredTime || $saveTechnician || $uploadReportImage || $serviceRequestReport || $causalWarrantReport || \n $saveRfq || $deliveryStatus || $acceptMaterial || $saveRfqSupplierInoviceStatus)\n {\n $type = 'Others';\n $severity = 'Informational';\n $actionUrl = Route::currentRouteAction();\n $message = Auth::user()->email.' Warranty Claim Updated successfully ';\n $this->log($type, $severity, $actionUrl, $message);\n return back()->with('success','Warranty Claim Updated successfully');\n\n }\n else {\n $type = 'Errors';\n $severity = 'Error';\n $actionUrl = Route::currentRouteAction();\n $message = 'An Error Occured while '. Auth::user()->email. 'was trying to update warranty claim ';\n $this->log($type, $severity, $actionUrl, $message);\n return back()->with('error', 'An error occurred while trying to update warranty claim ');\n }\n \n\n \n }", "public function beforeSave($options = array()){\n foreach(array_keys($this->data[$this->alias]) as $field)\n if(!$this->hasField($field)){\n $field_value = $this->data[$this->alias][$field];\n trigger_error(\"ERR DB field missing: `\" . $this->alias . '`.' . $field, E_USER_ERROR);\n }\n }", "function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }", "function edit_history_vitals($summary_id = NULL)\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$this->load->model('mconsult_wdb');\r\n\t\t$data['title'] = 'Vital Signs';\r\n\t\t$data['form_purpose'] = $this->uri->segment(3);\r\n $data['patient_id'] = $this->uri->segment(4);\r\n $data['patient_vital'] = $this->uri->segment(5);\r\n\t\t//$data['clinic_info'] = $this->mbio->get_clinic_info($_SESSION['location_id']);\r\n\t\t//$data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n //$data['patcon_info'] = $this->memr_rdb->get_patcon_details($data['patient_id']);\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['now_time'] = date(\"H:i\",$data['now_id']);\r\n\r\n if(count($_POST)) {\r\n // User has posted the form\r\n $data['now_id'] = $_POST['now_id'];\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['init_patient_id'] = $_POST['patient_id'];\r\n $data['patient_id'] = $data['init_patient_id'];\r\n $data['init_vital_id'] = $_POST['vital_id'];\r\n $data['vital_id'] = $data['init_vital_id'];\r\n $data['init_reading_date'] = $_POST['reading_date'];\r\n $data['init_reading_time'] = $_POST['reading_time'];\r\n $data['init_height'] = trim($_POST['height']);\r\n $data['init_weight'] = trim($_POST['weight']);\r\n $data['init_left_vision'] = $_POST['left_vision'];\r\n $data['init_right_vision'] = $_POST['right_vision'];\r\n $data['init_temperature'] = trim($_POST['temperature']);\r\n $data['init_pulse_rate'] = trim($_POST['pulse_rate']);\r\n $data['init_bmi'] = $_POST['bmi'];\r\n $data['init_waist_circumference'] = trim($_POST['waist_circumference']);\r\n $data['init_bp_systolic'] = trim($_POST['bp_systolic']);\r\n $data['init_bp_diastolic'] = trim($_POST['bp_diastolic']);\r\n $data['init_respiration_rate'] = trim($_POST['respiration_rate']);\r\n $data['init_ofc'] = trim($_POST['ofc']);\r\n $data['init_remarks'] = $_POST['remarks'];\r\n \r\n if ($data['patient_id'] == \"new_patient\"){\r\n // New form\r\n\t\t //$data['patient_id'] = \"\";\r\n \t\t$data['save_attempt'] = 'VITAL SIGNS';\r\n\t\t $data['patient_info'] = array();\r\n } else {\r\n // Edit form\r\n \t\t$data['save_attempt'] = 'VITAL SIGNS';\r\n // These fields were passed through as hidden tags\r\n $data['patient_id'] = $data['init_patient_id']; //came from POST\r\n\t\t $data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n $data['init_patient_id'] = $data['patient_info']['patient_id'];\r\n //$data['init_ic_other_no'] = $data['patient_info']['ic_other_no'];\r\n } //endif ($patient_id == \"new_patient\")\r\n\r\n } else {\r\n // First time form is displayed\r\n $data['init_location_id'] = $_SESSION['location_id'];\r\n $data['init_end_date'] = NULL;\r\n $data['init_clinic_name'] = NULL;\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $patient_id = $this->uri->segment(4);\r\n $data['patient_id'] = $patient_id;\r\n $data['init_patient_id'] = $patient_id;\r\n $data['summary_id'] = $this->uri->segment(5);\r\n $data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n $data['patcon_info'] = $this->memr_rdb->get_patcon_details($data['patient_id'],$data['summary_id']);\r\n $data['vitals_info'] = $this->memr_rdb->get_patcon_vitals($data['summary_id']);\r\n\r\n if ($data['vitals_info']['vital_id'] == \"new_vitals\") {\r\n // New vitals\r\n \t\t$data['save_attempt'] = 'ADD VITAL SIGNS';\r\n\t //$data['vitals_info'] = array();\r\n $data['init_vital_id'] = $data['vitals_info']['vital_id'];\r\n $data['init_reading_date'] = $data['now_date'];\r\n $data['init_reading_time'] = $data['now_time'];\r\n $data['init_height'] = NULL;\r\n $data['init_weight'] = NULL;\r\n $data['init_left_vision'] = NULL;\r\n $data['init_right_vision'] = NULL;\r\n $data['init_temperature'] = NULL;\r\n $data['init_pulse_rate'] = NULL;\r\n $data['init_bmi'] = NULL;\r\n $data['init_waist_circumference']= NULL;\r\n $data['init_bp_systolic'] = NULL;\r\n $data['init_bp_diastolic'] = NULL;\r\n $data['init_respiration_rate'] = NULL;\r\n $data['init_ofc'] = NULL;\r\n $data['init_remarks'] = NULL;\r\n } else {\r\n // Editing vitals\r\n \t\t$data['save_attempt'] = 'EDIT VITAL SIGNS';\r\n $data['init_patient_id'] = $data['patient_id'];\r\n $data['init_vital_id'] = $data['vitals_info']['vital_id'];\r\n $data['init_reading_date'] = $data['vitals_info']['reading_date'];\r\n $data['init_reading_time'] = $data['vitals_info']['reading_time'];\r\n $data['init_height'] = $data['vitals_info']['height'];\r\n $data['init_weight'] = $data['vitals_info']['weight'];\r\n $data['init_left_vision'] = $data['vitals_info']['left_vision'];\r\n $data['init_right_vision'] = $data['vitals_info']['right_vision'];\r\n $data['init_temperature'] = $data['vitals_info']['temperature'];\r\n $data['init_pulse_rate'] = $data['vitals_info']['pulse_rate'];\r\n $data['init_bmi'] = $data['vitals_info']['bmi'];\r\n $data['init_waist_circumference']= $data['vitals_info']['waist_circumference'];\r\n $data['init_bp_systolic'] = $data['vitals_info']['bp_systolic'];\r\n $data['init_bp_diastolic'] = $data['vitals_info']['bp_diastolic'];\r\n $data['init_respiration_rate'] = $data['vitals_info']['respiration_rate'];\r\n $data['init_ofc'] = $data['vitals_info']['ofc'];\r\n $data['init_remarks'] = $data['vitals_info']['remarks'];\r\n } //endif ($patient_id == \"new_vitals\")\r\n } //endif(count($_POST))\r\n\r\n\t\t$this->load->vars($data);\r\n // Run validation\r\n\t\tif ($this->form_validation->run('edit_vitals') == FALSE){\r\n\t\t //$this->load->view('ehr_patient/emr_edit_patient_html');\t\t\t\r\n if ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_wap\";\r\n //$new_body = \"ehr/emr_edit_vitals_wap\";\r\n $new_body = \"ehr/ehr_indv_edit_history_vitals_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n } else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_html\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_html\";\r\n $new_body = \"ehr/ehr_indv_edit_history_vitals_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n }\r\n $this->load->view($new_header);\t\t\t\r\n $this->load->view($new_banner);\t\t\t\r\n $this->load->view($new_sidebar);\t\t\t\r\n $this->load->view($new_body);\t\t\t\r\n $this->load->view($new_footer);\t\t\t\r\n } else {\r\n //echo \"\\nValidated successfully.\";\r\n //echo \"<pre>\";\r\n //print_r($data);\r\n //echo \"</pre>\";\r\n //echo \"<br />Insert record\";\r\n if($data['vital_id'] == \"new_vitals\") {\r\n // New patient vital signs\r\n $ins_vitals_array = array();\r\n $ins_vitals_array['staff_id'] = $_SESSION['staff_id'];\r\n $ins_vitals_array['now_id'] = $data['now_id'];\r\n $ins_vitals_array['vital_id'] = $data['now_id'];\r\n $ins_vitals_array['patient_id'] = $data['init_patient_id'];\r\n //$ins_vitals_array['session_id'] = $data['summary_id'];\r\n $ins_vitals_array['adt_id'] = $data['summary_id'];\r\n $ins_vitals_array['reading_date'] = $data['init_reading_date'];\r\n $ins_vitals_array['reading_time'] = $data['init_reading_time'];\r\n if(is_numeric($data['init_height'])){\r\n $ins_vitals_array['height'] = $data['init_height'];\r\n }\r\n if(is_numeric($data['init_weight'])){\r\n $ins_vitals_array['weight'] = $data['init_weight'];\r\n }\r\n $ins_vitals_array['left_vision'] = $data['init_left_vision'];\r\n $ins_vitals_array['right_vision'] = $data['init_right_vision'];\r\n if(is_numeric($data['init_temperature'])){\r\n $ins_vitals_array['temperature'] = $data['init_temperature'];\r\n }\r\n if(is_numeric($data['init_pulse_rate'])){\r\n $ins_vitals_array['pulse_rate'] = $data['init_pulse_rate'];\r\n }\r\n if(is_numeric($data['init_bmi'])){\r\n $ins_vitals_array['bmi'] = $data['init_bmi'];\r\n }\r\n if(is_numeric($data['init_waist_circumference'])){\r\n $ins_vitals_array['waist_circumference']= $data['init_waist_circumference'];\r\n }\r\n if(is_numeric($data['init_bp_systolic'])){\r\n $ins_vitals_array['bp_systolic'] = $data['init_bp_systolic'];\r\n }\r\n if(is_numeric($data['init_bp_diastolic'])){\r\n $ins_vitals_array['bp_diastolic'] = $data['init_bp_diastolic'];\r\n }\r\n if(is_numeric($data['init_respiration_rate'])){\r\n $ins_vitals_array['respiration_rate'] = $data['init_respiration_rate'];\r\n }\r\n if(is_numeric($data['init_ofc'])){\r\n $ins_vitals_array['ofc'] = $data['init_ofc'];\r\n }\r\n $ins_vitals_array['remarks'] = $data['init_remarks'];\r\n if($data['offline_mode']){\r\n $ins_vitals_array['synch_out'] = $data['now_id'];\r\n }\r\n\t $ins_vitals_data = $this->mconsult_wdb->insert_new_vitals($ins_vitals_array);\r\n $this->session->set_flashdata('data_activity', 'Vital signs added.');\r\n } else {\r\n //Edit patient vital signs\r\n $ins_vitals_array = array();\r\n $ins_vitals_array['staff_id'] = $_SESSION['staff_id'];\r\n $ins_vitals_array['now_id'] = $data['now_id'];\r\n $ins_vitals_array['vital_id'] = $data['vital_id'];\r\n $ins_vitals_array['patient_id'] = $data['init_patient_id'];\r\n //$ins_vitals_array['session_id'] = $data['summary_id'];\r\n $ins_vitals_array['adt_id'] = $data['summary_id'];\r\n $ins_vitals_array['reading_date'] = $data['init_reading_date'];\r\n $ins_vitals_array['reading_time'] = $data['init_reading_time'];\r\n if(is_numeric($data['init_height'])){\r\n $ins_vitals_array['height'] = $data['init_height'];\r\n }\r\n if(is_numeric($data['init_weight'])){\r\n $ins_vitals_array['weight'] = $data['init_weight'];\r\n }\r\n $ins_vitals_array['left_vision'] = $data['init_left_vision'];\r\n $ins_vitals_array['right_vision'] = $data['init_right_vision'];\r\n if(is_numeric($data['init_temperature'])){\r\n $ins_vitals_array['temperature'] = $data['init_temperature'];\r\n }\r\n if(is_numeric($data['init_pulse_rate'])){\r\n $ins_vitals_array['pulse_rate'] = $data['init_pulse_rate'];\r\n }\r\n if(is_numeric($data['init_bmi'])){\r\n $ins_vitals_array['bmi'] = $data['init_bmi'];\r\n }\r\n if(is_numeric($data['init_waist_circumference'])){\r\n $ins_vitals_array['waist_circumference']= $data['init_waist_circumference'];\r\n }\r\n if(is_numeric($data['init_bp_systolic'])){\r\n $ins_vitals_array['bp_systolic'] = $data['init_bp_systolic'];\r\n }\r\n if(is_numeric($data['init_bp_diastolic'])){\r\n $ins_vitals_array['bp_diastolic'] = $data['init_bp_diastolic'];\r\n }\r\n if(is_numeric($data['init_respiration_rate'])){\r\n $ins_vitals_array['respiration_rate'] = $data['init_respiration_rate'];\r\n }\r\n if(is_numeric($data['init_ofc'])){\r\n $ins_vitals_array['ofc'] = $data['init_ofc'];\r\n }\r\n $ins_vitals_array['remarks'] = $data['init_remarks'];\r\n\t $ins_vitals_data = $this->mconsult_wdb->update_vitals($ins_vitals_array);\r\n $this->session->set_flashdata('data_activity', 'Vital signs updated.');\r\n \r\n } //endif($data['patient_id'] == \"new_patient\")\r\n $new_page = base_url().\"index.php/ehr_individual_history/list_history_vitals/\".$data['patient_id'];\r\n header(\"Status: 200\");\r\n header(\"Location: \".$new_page);\r\n\r\n } // endif ($this->form_validation->run('edit_vitals') == FALSE)\r\n\t\t//$this->load->view('bio/bio_new_case_hosp');\r\n }", "public function beforeSave($options)\n\t{\n\t\tif( empty( $this->data[$this->alias]['visit_time_count'] ))\n\t\t\t$this->data[$this->alias]['visit_time_count'] = 0;\n\t\t\n\t\t$this->data['PatientDisclosure']['modified_timestamp'] = __date(\"Y-m-d H:i:s\");\n\t\t$this->data['PatientDisclosure']['modified_user_id'] = $_SESSION['UserAccount']['user_id'];\n\t\treturn true;\n\t}", "public function submit_filled_record()//16032560\n {\n $user = session('user');\n $sale_filled = session('sale_filled');\n $submit_record_id = $sale_filled['record_id'];\n //$record = Record::where('id','=',$sale_filled['record_id'])->first();\n $select_record = SelectRecord::where('record_id','=',$sale_filled['record_id'])->first();\n\n $select_record->result = $sale_filled['call_result'];\n $select_record->result_date = date(\"Y-m-d\");\n\n $select_record->branch_amount = $sale_filled['branch_amount'];\n $select_record->sending_address = $sale_filled['sending_address'];\n\n if($sale_filled['edit_address']!=\"\")\n {\n $select_record->edit_address = $sale_filled['edit_address'];\n }\n\n if($sale_filled['edit_contact_person']!=\"\")\n {\n $select_record->edit_contact_person = $sale_filled['edit_contact_person'];\n }\n\n if($sale_filled['call_result']==\"yes\")\n {\n $select_record->yes_sale_name = $user->first_name;\n $new_yes_privilege_start = explode('/', $sale_filled['start_priviledge_date']);\n $new_yes_privilege_end = explode('/', $sale_filled['end_priviledge_date']);\n $select_record->yes_privilege_start = $new_yes_privilege_start[2].\"-\".$new_yes_privilege_start[1].\"-\".$new_yes_privilege_start[0];\n $select_record->yes_privilege_end = $new_yes_privilege_end[2].\"-\".$new_yes_privilege_end[1].\"-\".$new_yes_privilege_end[0];\n $select_record->yes_feedback = $sale_filled['feedback'];\n $select_record->yes_condition = $sale_filled['condition'];\n $select_record->has_reply_doc = $sale_filled['has_reply_doc'];\n $select_record->has_confirm_product_img = $sale_filled['has_confirm_product_img'];\n $select_record->has_confirm_logo_img = $sale_filled['has_confirm_logo_img'];\n $select_record->has_shop_img = $sale_filled['has_shop_img'];\n $select_record->has_product_img = $sale_filled['has_product_img'];\n $select_record->has_logo_img = $sale_filled['has_logo_img'];\n\n $select_record->status=\"Not_Available\";\n }\n else if($sale_filled['call_result']==\"no_reply\")\n {\n $select_record->cannot_contact_reason = $sale_filled['cannot_contact_reason'];\n $new_cannot_contact_appointment = explode('/', $sale_filled['cannot_contact_appointment_date']);\n $select_record->cannot_contact_appointment = $new_cannot_contact_appointment[2].\"-\".$new_cannot_contact_appointment[1].\"-\".$new_cannot_contact_appointment[0];\n }\n else if($sale_filled['call_result']==\"rejected\")\n {\n $select_record->no_reason = $sale_filled['no_reason'];\n $select_record->status=\"Not_Available\";\n }\n else if($sale_filled['call_result']==\"waiting\")\n {\n $select_record->consider_reason = $sale_filled['consider_reason'];\n $new_consider_appointment_feedback = explode('/', $sale_filled['consider_appointment_feedback_date']);\n $select_record->consider_appointment_feedback = $new_consider_appointment_feedback[2].\"-\".$new_consider_appointment_feedback[1].\"-\".$new_consider_appointment_feedback[0];\n }\n else if($sale_filled['call_result']==\"closed\")\n {\n $select_record->close = \"1\";\n $select_record->status=\"Not_Available\";\n }\n\n if($sale_filled['is_tel_correct']==\"0\")\n {\n $select_record->is_tel_correct = \"0\";\n $select_record->wrong_number_new_tel_number = $sale_filled['new_tel'];\n }\n else\n {\n $select_record->is_tel_correct = \"1\";\n $select_record->wrong_number_new_tel_number = \"\";\n }\n \n $select_record->updated_by = $user->id;\n $select_record->updated_at = date(\"Y-m-d H:i:s\");\n \n $select_record->call_status =\"called\";\n\n // print_r($select_record);\n $select_record->save();\n\n \n\n if($sale_filled['call_result']==\"yes\")\n {\n //redirect to edit_record_info\n Session::forget('sale_filled');\n return redirect('/sale/edit_record/record/show/'.$submit_record_id);\n\n }\n else\n {\n //redirect to success page\n Session::forget('sale_filled');\n return redirect('/sale/select_record/call/success/'.$submit_record_id);\n }\n \n\n }", "function eventclass_staff_info()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "protected function recordUniqueStatHit($stat_name, $date_created = NULL)\n\t{\n\t\t$this->stat_history[$stat_name] = $this->formatStatDate($date_created);\n\t}", "public function business_service_adding_slot() {\n \n $logged_in_user_details = $this->session->userdata('logged_in_user_data');\n if ($logged_in_user_details->is_logged_in == 1) {\n \t$data['logged_in_user_details'] = $logged_in_user_details;\n $post_data = $this->input->post();\n $this->form_validation->set_rules('no_slots', 'No. of slots', 'required');\n $this->form_validation->set_rules('date', 'Date', 'required');\n $this->form_validation->set_error_delimiters('<label for=\"name\" generated=\"true\" class=\"error\">', '</label>');\n if ($this->form_validation->run() == FALSE) {\n $data['business_info'] = $this->Cs_vendor->get_vendorid_businessid_by_serviceid($post_data['service_id']);\n $data['business_id']= $data['business_info'][0]->id;\n $data['title'] = \"Zinguplife Customer support | Vendors\";\n $data['url'] = 'customer_support/vendors';\n $data['sub_url'] = 'customer_support/one_time_slots';\n $data['service_details'] = $this->Cs_vendor->get_single_service_detail($post_data['service_id']);\n $data['main_content'] = 'admin/cs/one_time_slot';\n $this->load->view('admin/includes/cs_vendor_template', $data);\n } else {\n $this->Cs_vendor->add_one_time_slot($post_data);\n $this->session->set_flashdata('service_success_message', 'Slot added successfully !!!');\n redirect(\"cs/business_service_edit/\" . $post_data['service_id'] . \"\");\n }\n } else {\n $this->session->set_flashdata('login_required_message', 'Please login to continue !!!.');\n redirect(\"/admin\");\n }\n }", "public function toDrush() {\n if ($this->percent == SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO) {\n drush_print(dt('!label: Info', array(\n '!label' => $this->getLabel(),\n )));\n }\n else {\n drush_print(dt('!label: @percent%', array(\n '!label' => $this->getLabel(),\n '@percent' => $this->percent,\n )));\n }\n if ($this->percent == 100) {\n drush_log(str_repeat(' ', 2) . dt('No action required.'), 'success');\n }\n if (drush_get_option('detail') || $this->percent != 100) {\n foreach ($this->checks as $check) {\n if (drush_get_option('detail') || $check->getScore() != SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS || $this->percent == SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO) {\n if (drush_get_option('detail')) {\n drush_print(str_repeat(' ', 2) . dt('!label: !description', array(\n '!label' => $check->getLabel(),\n '!description' => $check->getDescription(),\n )));\n }\n else {\n if ($check->getScore() != SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO) {\n drush_print(str_repeat(' ', 2) . dt('!label', array(\n '!label' => $check->getLabel(),\n )));\n }\n }\n if ($this->percent == SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO || drush_get_option('detail')) {\n if (($check->getScore() != SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO) || drush_get_option('detail')) {\n drush_print(str_repeat(' ', 4) . dt('!result', array(\n '!result' => $check->getResult(),\n )));\n }\n else {\n drush_print(str_repeat(' ', 2) . dt('!result', array(\n '!result' => $check->getResult(),\n )));\n }\n }\n else {\n drush_log(str_repeat(' ', 4) . dt('!result', array(\n '!result' => $check->getResult(),\n )), $check->getScoreDrushLevel());\n }\n if ($check->renderAction()) {\n drush_print(str_repeat(' ', 6) . dt('!action', array(\n '!action' => $check->renderAction(),\n )));\n }\n }\n }\n }\n }", "public function beforeSave()\r\n {\r\n $pageToShow = $this->getData('fieldset_data')['which_page_to_show'];\r\n $inPage = $this->getData('fieldset_data')['include_pages'];\r\n $inPageUrl = $this->getData('fieldset_data')['include_pages_with_url'];\r\n\r\n if ($pageToShow == 1 && !($inPage || $inPageUrl)) {\r\n throw new Exception(__('Please enter the value into one of the following boxes: Include page(s) and Include Page(s) with URL contains.'));\r\n }\r\n\r\n return parent::beforeSave();\r\n }", "public function reportShare(Request $request) {\n $notesService = new NotesService();\n if($request->has('last_access_time') == false) {\n return json_encode(array(\"error\" => 'parameter \"last_access_time\" missing'));\n }\n $lastAccess = $request->input(\"last_access_time\");\n $newNotes = $notesService->getNewOtherNotes($lastAccess);\n $changedNotes = $notesService->getUpdatedOtherNotes($lastAccess);\n if(count($newNotes) + count($changedNotes) > 0) {\n return response()->json([\"last_access_time\" => date(\"Y-m-d H:i:s\")]);\n }\n return response()->json([\"status\" => \"no change\"]);\n }", "public function storemissecurity(StoreWspRequest $request)\n \n { \n\t\n\t$year = $request['year'];\n\t $month = $request['month'];\n\t \n\t if(isset($request['report_status'])) { $request['report_status'] = $request['report_status'];}\n\t else {$request['report_status'] = 0;}\n\t \n \n\t\t if((int)$request['record_id'] > 0){\n\t\t $report = Securitymisreport::findOrFail($request['record_id']);\n\n\t\t\t\t\t /* $store_val = array('site'=>$request['site'],'nw_bores_num'=>$request['nw_bores_num'], 'no_ground_water'=>$request['no_ground_water'],'over_load'=>$request['over_load'],'motor_brunt'=>$request['motor_brunt'],'cable_prblm'=>$request['cable_prblm'],'pumpormotorwear'=>$request['pumpormotorwear'],'others'=>$request['others'],'motor_brunt'=>$request['motor_brunt'],'dry_run_protectn'=>$request['dry_run_protectn'],'flow_meter'=>$request['flow_meter'],'remarks'=>$request['remarks'],'report_status'=>$request['report_status']);\n\t\t\t\t\t \n\t\t\t\t\t */ \n\t\t\t\t\t \t \n\t\t\t\t\t \n $report = Securitymisreport::findOrFail($request['record_id']);\n\t\t\t\t\t $report->update($request->all()); \n\t\t\t\t\t \n\n\t\t\t\t\t return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t } \n\t\t else{ \n\t\t \n\t\t\t\t \n\t\t\t\t // $store_val = array('site'=>$request['site'], 'month'=>$request['month'], 'year'=>$request['year'], 'user_id'=>$request['user_id'], 'nw_bores_num'=>$request['nw_bores_num'], 'no_ground_water'=>$request['no_ground_water'],'over_load'=>$request['over_load'],'motor_brunt'=>$request['motor_brunt'],'cable_prblm'=>$request['cable_prblm'],'pumpormotorwear'=>$request['pumpormotorwear'],'others'=>$request['others'],'motor_brunt'=>$request['motor_brunt'],'dry_run_protectn'=>$request['dry_run_protectn'],'flow_meter'=>$request['flow_meter'],'remarks'=>$request['remarks'],'report_status'=>$request['report_status']);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t $create = Securitymisreport::create($request->all()); \n\t\t\t\t\t\n\t\t\t\t// return redirect()->route('misreports.index');\n\t\t\t return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t\t}\n \n return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t \n }", "public function onBeforeCheck(&$model)\n\t{\n\t\t$model->addSkipCheckField('created_on');\n\t\t$model->addSkipCheckField('created_by');\n\t}", "function insert()\n\t{\n\t\t//@TODO email advisor and student(?)\n\t\t$kReport = $this->report->insert();\n\t\tif($this->input->post(\"email_advisor\")){\n\t\t\t$this->notify($kReport);\n\t\t}\n\t\tredirect(\"report/view/$kReport\");\n\t}", "function formlift_track_impression( $formID ) {\n\tglobal $FormLiftUser;\n\n// if ( is_user_logged_in() && current_user_can( 'manage_options' ) )\n// return;\n\n\tif ( ! $FormLiftUser->hasImpression( $formID ) ) {\n\t\t$FormLiftUser->addImpression( $formID );\n\t\tformlift_add_impression( $formID );\n\n\t\t$imps = formlift_get_form_impressions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\t\t$subs = formlift_get_form_submissions( date( 'Y-m-d H:i:s', strtotime( '-7 days' ) ), current_time( 'mysql' ), $formID );\n\n\t\tformlift_update_form_stats( $formID, $imps, $subs );\n\t}\n}", "function actionSecurity()\r\n\t{\r\n\t\tif (!empty($_POST[$this->input->system_id->name]))\r\n\t\t{\r\n\t\t\t$ids = array();\r\n\t\t\t$ids = $this->db->getCol($this->nav->completeQuery);\r\n\t\t\tif ($_POST[$this->input->system_id->name] != $ids)\r\n\t\t\t{\r\n\t\t\t\t$this->setActionExecute(false, 'please try again, it looks like another user has made changes to the data');\r\n\t\t\t\t$this->error = true;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function NotAuthed( ){\n\t\t\n\t\t$this->StartCardPanel();\n\t\t\n\t\techo \"<h5>SolarPower SprayLoader P.O.C</h5>\";\n\t\techo \"<p>Welcome! This page is used to upload sprays to use on the server. Simply select the image you wish to upload, and press submit. Please remember that these images are submitted to moderation, and must respect the guidelines. These include but are not limited to not uploading images of a pornographic nature, and other such images. Just use common sense and you'll be fine.</p>\";\n\t\techo \"<p>To upload an image, you must first be logged in. Please do this by pressing the button below.</p>\";\n\t\techo \"<center>\";\n\t\tsteamlogin(); //login button\n\t\techo \"</center>\";\n\t\t\n\t\t$this->EndCardPanel();\n\t}", "private function __dailyHealthIndicator() {\n\t\t\t\t\n\t\t$userTimezone = $this->Auth->user('timezone');\n\t\t\n\t\tif ($this->_requestedUser['id'] != $this->Auth->user('id')) {\n $userId = $this->_requestedUser['id']; \n\t\t} else {\n\t\t\t$userId = $this->Auth->user('id');\t\t\t\n\t\t}\n\t\t //set date as today\n\n $todayInUserTimeZone = CakeTime::convert(time(), new DateTimeZone($userTimezone));\n $date_today = CakeTime::format($todayInUserTimeZone, '%m/%d/%Y');\n\t\t\n $dailyHealthIndicator = array();\n // it contains symptoms with latest_record_value null\n $userSymptoms = $this->UserSymptom->getSymptomIdsWithLatestValue($userId);\n\n /*\n * Fetch symptom details \n */\n foreach ($userSymptoms as $userSymptom) {\n $symptomId = $userSymptom ['UserSymptom'] ['symptom_id']; // symptom id\n $symptomName = $this->Symptom->getSymptomNameFromId($symptomId); // symptom name\n $symptomRecordValueJSON = $userSymptom ['UserSymptom'] ['latest_record_value']; // recorded value\n $symptomSeverityValue = 0;\n $lastUpdatedDate = NULL;\n if (!empty($symptomRecordValueJSON)) {\n $symptomLatestRecordValue = json_decode($symptomRecordValueJSON, TRUE); // Decode the json value\n $userTodayDate = date('Y-m-d', $todayInUserTimeZone);\n $lastUpdatedDateInTime = key($symptomLatestRecordValue);\n\n if (!is_null($lastUpdatedDateInTime)) {\n $symptomSeverityValue = $symptomLatestRecordValue [$lastUpdatedDateInTime];\n $lastUpdatedDate = date('m/d/Y', $lastUpdatedDateInTime);\n }\n// debug($lastUpdatedDate);\n // check todays severity added\n// if ( array_key_exists ( strtotime ( $userTodayDate ) , $symptomLatestRecordValue )) {\n// $symptomSeverityValue = $symptomLatestRecordValue[ strtotime ( $userTodayDate ) ];\n// }\n// foreach ($symptomRecordValue as $key => $value) {\n// //$record_date = date('Y-m-d', $key);\n// //debug($symptomName.\" \".date('Y-m-d H:i:s', $key) . \" \". strtotime($userTodayDate));\n// //check if there is record for user's today\n// if ($record_date == $userTodayDate) { //debug($key. \" \".strtotime($userTodayDate)); // debug($record_date. \" \".$userTodayDate); \n// //fetch todays reading\n// $symptomSeverityValue = $symptomRecordValue [$key];\n// }\n//// else {\n////\t\t\t\t\t$symptomSeverityValue = 0;\n////\t\t\t\t}\n// }\n }\n\n switch ($symptomSeverityValue) {\n case 1: $symptomSeverity = 'None';\n break;\n case 2: $symptomSeverity = 'Mild';\n break;\n case 3: $symptomSeverity = 'Moderate';\n break;\n case 4: $symptomSeverity = 'Severe';\n break;\n default:$symptomSeverity = 'No Data';\n }\n /*\n * save details to an array\n */\n $dailyHealthIndicator[] = array('id' => $symptomId, 'name' => $symptomName,\n 'severity' => $symptomSeverity, 'lastUpdated' => $lastUpdatedDate);\n }\n\t\t\n\t\treturn $dailyHealthIndicator; \n\n\t}", "function save_truck()\n\t{\n\t\n \t$truckid= $this->session->userdata('sess_id');\n\t $truck['truck_id']=$truckid;\n\t\t# Get the passed details into the url data array if any\n\t\t$urldata = $this->uri->uri_to_assoc(4, array('action','truck_id'));\n\t\tsecurity($this);\n\t\t$this->session->set_userdata('local_allowed_extensions','.gif,.png,.jpeg,.jpg');\n\t\t$this->session->set_userdata('local_max_file_size', 1000000);\n\t $_POST['datebought'] = changeDateFromPageToMySQLFormat($_POST['startyear'].\"-\".$_POST['startmonth'].\"-\".$_POST['startday']);\n#\n $_POST['startdate'] = changeDateFromPageToMySQLFormat($_POST['startyear3'].\"-\".$_POST['startmonth3'].\"-\".$_POST['startday3']);\n\t\t $_POST['enddate'] = changeDateFromPageToMySQLFormat($_POST['startyear2'].\"-\".$_POST['startmonth2'].\"-\".$_POST['startday2']);\n\t\t $_POST['puchdate'] = changeDateFromPageToMySQLFormat($_POST['startyear4'].\"-\".$_POST['startmonth4'].\"-\".$_POST['startday4']);\n\t\t $_POST['warrdate'] = changeDateFromPageToMySQLFormat($_POST['startyear5'].\"-\".$_POST['startmonth5'].\"-\".$_POST['startday5']);\n\t\t $_POST['licedate'] = changeDateFromPageToMySQLFormat($_POST['startyear6'].\"-\".$_POST['startmonth6'].\"-\".$_POST['startday6']);\n\t\t $_POST['endlicedate'] = changeDateFromPageToMySQLFormat($_POST['startyear7'].\"-\".$_POST['startmonth7'].\"-\".$_POST['startday7']);\n\t\t \n// insurance & waranty + license deadlines\n $time= $_POST['enddate'];\n $num2= $_POST['num'];\t\n\t $period2= $_POST['dayy'];\n $my=strtotime(date(\"Y-m-d\", strtotime($time)) . \" -$num2 $period2\");\n $_POST['show']=date(\"Y-m-d\", $my);\t\n\t $time2= $_POST['endlicedate'];\n $num3= $_POST['nums'];\t\n\t $period3= $_POST['dayys'];\n $my2=strtotime(date(\"Y-m-d\", strtotime($time2)) . \" -$num3 $period3\");\n $_POST['licdate']=date(\"Y-m-d\", $my2);\t\n\t\n\t//processing an image\n\t\t$_POST['image']=$_FILES['image']['name'];\n\t\t\t\n\t\tif(!empty($_POST['image']))\n\t\t\t{\n\t\t\t\n\t\t\t\t $_POST['image']=$_POST['image'];\n\t\t\t}\n\t\t\telse\t\n\t\t\t{\n\t\t\t $_POST['image']=$_POST['dphoto'];\n\t\t\t}\n\t\n\t\t\t//upload image\n $config['upload_path'] = './system/application/views/documents/'; \n $config['allowed_types']= 'gif|jpg|png|pdf|doc'; \n $config['max_size'] = '70000000000000'; \n $config['max_width'] = '1024000000000'; \n $config['max_height'] = '768000000000'; \n $this->load->library('upload', $config); \n if ($this->upload->do_upload('image'))\n {\n $data = $this->upload->data();\n }\n\t\t\n\t\n\t\t \n if(is_array($_POST['allowedcargo'])){\n\tforeach ($_POST['allowedcargo'] as $value){\n\t#\n\t $_POST['allowedcargo']=$value;\n\t#\n\t }\n }\n\t\t# Display appropriate message based on the results\n\t\tif(($this->input->post('saveandnew') || $this->input->post('save')) && $this->process_form_data($urldata, $_POST, 'save'))\n\t\t{\n\t\t\t# Load view base on where the user wants to go\n\t\t\tif($this->input->post('save'))\n\t\t\t{\n\t\t\t\n\t\t\t\t$view_to_load = 'userprofile/trucks';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$data['msg'] = \"The truck data was successfully saved.\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# For each error to be displayed as an error, it should start with \"ERROR:\"\n\t\t\t$data['msg'] = \"ERROR: The truck data was not saved or may not be saved correctly.\";\n\t\t\t\n\t\t\t# Check if error is because query already exists\n\t\t\tif($urldata['truck_id'] === FALSE)\n\t\t\t{\n\t\t\t\t$data['msg'] .= $this->Control_check->check_if_already_exists('pick_truck_by_regno', array('regnumber'=>$_POST['regnumber']));\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif($truckid !== FALSE){\n\t\t$data['truck']=$this->session->userdata('sess_id');\n\t\t\t$data['truck_id'] = $truckid;\n\t\t\t$data['companytruckdetails'] = $this->Query_reader->get_row_as_array('pick_truck_by_id', array('truck_id'=>$truckid));\n\t\t}\n\t\t\n\n\t\t$data['userdetails'] = $this->session->userdata('alluserdata');\n\t\t$id=$data['userdetails']['companyid'];\n\t\t$query2 = $this->Query_reader->get_query_by_code('pick_drivers_by_company_id', array('companyid'=>$id));\n\t\t$result2 = $this->db->query($query2);\n\t\t$data['companydriverdetails'] = $result2->result_array();\n\n\t\t$result = $this->db->query('SELECT drivers.company_id,drivers.fname,drivers.lname,trucks.regnumber,trucks.company_id,drivers.driver_id,trucks.truck_id FROM drivers RIGHT OUTER JOIN trucks ON drivers.driver_id = trucks.driver_id WHERE trucks.company_id = \"'.$id.'\"');\n\t $data['returned']= $result->num_rows();\n\t\t$data['truck_array'] = $result->result_array();\n\t\t#pick fuel used\n\t\t$fquery = $this->Query_reader->get_query_by_code('pick_all_fuel_for_truck', array('truck_id'=>$truckid));\n\t\t$fresult = $this->db->query($fquery);\n\t $data['freturned']= $fresult->num_rows();\n\t\t$data['fuel_array'] = $fresult->result_array();\n\t\t# service views\n\t\t $squery = $this->Query_reader->get_query_by_code('pick_all_services_for_truck', array('truck_id'=>$truckid));\n\t\t$sresult = $this->db->query($squery);\n\t $data['returneds']= $sresult->num_rows();\n\t\t$data['service_array'] = $sresult->result_array();\n\t\t#aCCIDENT VIEW\n\t\t $resultt = $this->db->query('SELECT\naccidents.company_id,\ndrivers.fname,\ndrivers.lname,\ndrivers.driver_id,\naccidents.occured,\naccidents.date_created,\naccidents.truck_id,\naccidents.accident_id\nFROM\ndrivers\nLEFT OUTER JOIN accidents ON drivers.driver_id = accidents.driver_id\nWHERE\naccidents.company_id = \"'.$id.'\" AND\naccidents.truck_id = \"'.$truckid.'\"');\n\t $data['returnedt']= $resultt->num_rows();\n\t\t$data['accident_array'] = $resultt->result_array();\n\t\t#tire view\n\t\t $tquery = $this->Query_reader->get_query_by_code('pick_all_tires_for_truck', array('truck_id'=>$truckid));\n\t\t$tresult = $this->db->query($tquery);\n\t $data['treturned']= $tresult->num_rows();\n\t\t$data['tire_array'] = $tresult->result_array();\n\t\t\t//pick all service reminders\t\t\n\t$data['userdetails'] = $this->session->userdata('alluserdata');\n\t$id=$data['userdetails']['companyid'];\n\t$rd=\"N\";\n\t$tym=date(\"Y-m-d\");\n\t\n $rmresult = $this->db->query('SELECT trucks.regnumber, services.`name`, services.duenext, services.service_id, services.truck_id,\n services.company_id FROM services INNER JOIN trucks ON trucks.truck_id = services.truck_id\n WHERE services.company_id = \"'.$id.'\" AND \"'.$tym.'\" >= services.lastdate AND trucks.odoqui >= services.set_odo AND services.regnsd = \"'.$rd.'\"');\n\t$data['returnedserv']= $rmresult->num_rows();\n\t$data['rm']=$data['returned'];\n\t$data['service_array2'] = $rmresult->result_array();\n //insurance remiders\t\n\t\n\t$result2 = $this->db->query('SELECT trucks.show_lice_on, trucks.inscompany, trucks.endlicedate, trucks.enddate, trucks.show_ins_on,\n trucks.regnumber FROM trucks WHERE trucks.company_id = \"'.$id.'\" AND \"'.$tym.'\" >= trucks.show_ins_on ');\n $data['ins']= $result2->num_rows();\n\t $data['insnumm']=$data['ins'];\n\t $data['ins_array'] = $result2->result_array();\n //licence reminders\n\n $result3 = $this->db->query('SELECT trucks.show_lice_on, trucks.endlicedate, trucks.regnumber FROM trucks WHERE\n \"'.$tym.'\" >= trucks.show_lice_on AND trucks.company_id = \"'.$id.'\"');\n $data['lic']= $result3->num_rows();\n\t $data['licnumm']=$data['lic'];\n\t $data['lic_array'] = $result3->result_array();\n\t // notices\n\t\t$this->db->where( 'to_employee' ,$data['userdetails']['userid']);\t\t\n\t\t$this->db->where( 'has_read', '0');\t\t\n\t\t$notices = $this->db->get('notice_details');\n\t\t$data['count_notices'] = $notices->num_rows();\n\t\t$data['notice_details'] = $notices->result_array();\n\t \t $data['curPage']='company';\n $data['service'] = $this->reminder->get_reminders();\n $data['insurance'] = $this->reminder->insurance_reminder();\n $data['license'] = $this->reminder->license_reminder();\n\n\n\t\t$this->load->view('userprofile/trucks', $data);\n\t\t\n\t\t\n\t\n\t }", "public function sendReportCheckin()\n { // $sended = $this->TBLTSendMail\n // ->exists([\n // 'Date' => date(\"Y-m-d\"),\n // 'Result' => 'success'\n // ]);\n\n // if($sended) { exit; }\n\n $alert = $this->TBLMItem->find()\n ->where([\n 'Code' => 'alert_time',\n 'Value IS NOT NULL'\n ])\n ->first();\n $mail1 = $this->TBLMItem->find()\n ->where([\n 'Code' => 'mail_receipt_1',\n 'Value IS NOT NULL'\n ])\n ->first();\n $mail2 = $this->TBLMItem->find()\n ->where([\n 'Code' => 'mail_receipt_2',\n 'Value IS NOT NULL'\n ])\n ->first();\n \n $allow = false;\n if (isset($alert['Value']) && (isset($mail1['Value']) || isset($mail2['Value']))) {\n if ($alert['Value'] == date(\"H:i\")) {\n $allow = true;\n } \n }\n\n // debug\n // $allow = true;\n\n if ($allow) {\n // set_time_limit(0);\n // ini_set(\"memory_limit\", \"-1\");\n // $builder = $this->viewBuilder();\n // // configure as needed\n // $builder->setLayout(false);\n // $builder->setTemplate('/Element/Pdf/ExportResultCheckin');\n // $builder->setHelpers(['Html']);\n // create a view instance\n\n\n $data[\"checked_in\"] = $this->TBLTTimeCard->find()\n ->contain(['TBLMStaff'])\n ->where([\n 'Date' => date(\"Y-m-d\"),\n // 'TimeIn <=' => $alert\n ])\n ->order(['TimeIn' => 'ASC'])\n ->toArray();\n\n $data[\"not_come\"] = $this->TBLMStaff->find()\n ->where([\n \"StaffID NOT IN (SELECT StaffID FROM tblTTimeCard WHERE Date ='\" . date(\"Y-m-d\") . \"')\",\n \"Position LIKE '%Leader%'\",\n \"FlagDelete = 0\"\n ])\n ->order(['StaffID' => 'ASC'])\n ->toArray();\n\n // echo '<pre>';\n // var_dump($data);\n // echo '</pre>';\n // exit;\n\n\n\n // $view = $builder->build(compact('data'));\n // $content = $view->render();\n\n // $dompdf = new Dompdf(array('enable_font_subsetting' => true));\n // $dompdf->loadHtml(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), \"UTF-8\");\n // $dompdf->set_option('defaultFont', 'Times-Roman');\n\n // // (Optional) Setup the paper size and orientation\n // $dompdf->setPaper('A4');\n\n // // Render the HTML as PDF\n // $dompdf->render();\n\n // /* save file */\n // $path = WWW_ROOT . \"files/PdfResultCheckin\";\n // if (!file_exists($path)) {\n // mkdir($path);\n // }\n\n // $fileNameExport = \"ASM SYSTEM \" . date(\"Ymd\") . \" (\" . date(\"D\") . \") \" . date(\"Hi\") . \".pdf\";\n // $output = $path . \"/\" . $fileNameExport;\n\n // $file = $dompdf->output();\n // file_put_contents($output, $file);\n\n // debug\n // exit;\n\n $result_sended = self::__sendFileToMail($data, $mail1['Value'], $mail2['Value']);\n // mails receipt\n $mails_receipt = \"\";\n if ($mail1['Value']) {\n $mails_receipt .= $mail1['Value'];\n }\n\n if ($mail2['Value']) {\n $mails_receipt .= \", \" . $mail2['Value'];\n }\n // result\n $result = \"\";\n if(isset($result_sended['success']) && $result_sended['success'] == 1){\n $result = \"success\";\n } else {\n $result = \"fail\";\n }\n\n // ==> SAVE RESULT TO DB\n $sended = TableRegistry::getTableLocator()->get('TBLTSendMail')->newEntity();\n $sended->Date = date(\"Y-m-d\");\n $sended->Time = date(\"H:i\");\n $sended->ToEmail = $mails_receipt;\n $sended->FileSend = '';\n $sended->Result = $result;\n TableRegistry::getTableLocator()->get('TBLTSendMail')->save($sended);\n\n // ==> WRITE LOG\n $content = \n \"Date: \".date(\"Y-m-d\") . \"\\n\" .\n \"Time: \".date(\"H:i\") . \"\\n\" . \n \"To emails: \" . $mails_receipt .\"\\n\".\n \"Filename attachment: \".'' . \"\\n\" .\n \"Result: \".$result . \"\\n \\n\";\n Log::info($content, ['scope' => ['SENDMAIL']]);\n }\n exit;\n }", "public function hallticketnoexist($smuid) {\n $is_exist = $this->commodel->isduplicate('student_admission_cancel','sac_hallticketno',$smuid);\n\t//print_r($is_exist);\n if ($is_exist)\n {\n\t\t$this->form_validation->set_message('hallticketnoexist','This Hall Ticket Number' .\" \".$smuid. \" \".'Student Admission Is Cancelled.');\n return false;\n }\n else {\n return true;\n }\n }", "public function hasNotices() {}", "public function beforeSave()\n {\n\t\t$apiKey = $this->getData('groups/settings/fields/api_key/value');\n\n\t\tif ($apiKey != \"\") {\n\t\t\t$this->api->setApiKey($apiKey);\n\t\t\t$response = $this->api->checkSubscriptionSKU();\n\t\t\t\n\t\t\tif ($response->getStatusCode() != 200) {\n\t\t\t\t$msg = \"\";\n\t\t\t\tif ($response->getStatusCode() == 401) {\n\t\t\t\t\t$msg = __(\"Unauthorized - Your Shop API key is wrong.\");\n\t\t\t\t}\n\t\t\t\telseif ($response->getStatusCode() == 403) {\n\t\t\t\t\t$msg = __(\"Forbidden.\");\n\t\t\t\t}\n\t\t\t\tthrow new \\Magento\\Framework\\Exception\\LocalizedException($msg);\n\t\t\t}\n\t\n\t\t\t$json = json_decode($response->getBody()->getContents());\n\t\t\t$this->setValue($json->skuAmound);\n\t\t}\n\t\telse {\n\t\t\t$this->setValue('0');\n\t\t}\n\n return parent::beforeSave();\n }", "function report_it($id)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t//First checking weather object exists or not\r\n\t\tif($this->exists($id))\r\n\t\t{\r\n\t\t\tif(userid())\r\n\t\t\t{\r\n\t\t\t\tif(!$this->report_check($id))\r\n\t\t\t\t{\r\n\t\t\t\t\t$db->insert(\r\n\t\t\t\t\t\ttbl($this->flag_tbl),\r\n\t\t\t\t\t\tarray('type','id','userid','flag_type','date_added'),\r\n\t\t\t\t\t\tarray($this->type,$id,userid(),post('flag_type'),NOW())\r\n\t\t\t\t\t);\r\n\t\t\t\t\te(sprintf(lang('obj_report_msg'), lang($this->name)),'m');\r\n\t\t\t\t} else {\r\n\t\t\t\t\te(sprintf(lang('obj_report_err'), lang($this->name)));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\te(lang(\"you_not_logged_in\"));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\te(sprintf(lang(\"obj_not_exists\"), lang($this->name)));\r\n\t\t}\r\n\t}", "public function hallticketexist($smuid) {\n $is_exist = $this->commodel->isduplicate('student_transfer','st_hallticketno',$smuid);\n\t//print_r($is_exist);\n if ($is_exist)\n {\n\t\t$this->form_validation->set_message('hallticketexist','Hall Ticket Number' .\" \".$smuid. \" \".'is already exist check your hall ticket number again.');\n return false;\n }\n else {\n return true;\n }\n }", "public function actionCreate() {\n if (User::userIsAllowedTo('Submit back to office report')) {\n $model = new MeBackToOfficeReport();\n if (Yii::$app->request->isAjax) {\n $model->load(Yii::$app->request->post());\n return Json::encode(\\yii\\widgets\\ActiveForm::validate($model));\n }\n\n if (!empty(Yii::$app->request->post()) && Yii::$app->request->post('submit_for_review') == 'true') {\n //var_dump(Yii::$app->request->post());\n $model->load(Yii::$app->request->post());\n $model->team_members = implode(\", \", $model->team_members);\n list( $model->start_date, $model->end_date) = explode('to', $model->travel_dates);\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n $model->status = \\backend\\models\\Storyofchange::_submitted_for_review;\n if ($model->save()) {\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Submitted a back to office report for review\";\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n $role_model = \\common\\models\\RightAllocation::find()->where(['right' => 'Review back to office report'])->all();\n if (!empty($role_model)) {\n $subject = \"Back to office report:\" . $model->name_of_officer;\n foreach ($role_model as $_role) {\n //We now get all users with the fetched role\n $resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/login']);\n $_user_model = User::find()\n ->where(['role' => $_role->role])\n ->all();\n if (!empty($_user_model)) {\n //We send the emails\n foreach ($_user_model as $_model) {\n $msg = \"\";\n $msg .= \"<p>Dear \" . $_model->first_name . \" \" . $_model->other_name . \" \" . $_model->last_name . \",<br/>\";\n $msg .= $model->name_of_officer . \" has submitted a 'Back to office report' below is the summary of the assignment outcome<br/>\";\n $msg .= $model->summary_of_assignment_outcomes . \"</b></p>\";\n $msg .= '<p>You can login <i style=\"color: blue;\">' . Html::a('(Click Here to Login)', $resetLink) . '</i> to see more details and review the submitted BtOR</p>';\n \\backend\\models\\Storyofchange::sendEmail($msg, $subject, $_model->email);\n }\n }\n }\n }\n\n Yii::$app->session->setFlash('success', 'Back to office report was successfully submitted for review');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $message = \"\";\n foreach ($model->getErrors() as $error) {\n $message .= $error[0];\n }\n Yii::$app->session->setFlash('error', 'Error occured while submitting back to office report for review.Error::' . $message);\n }\n }\n\n\n if (!empty(Yii::$app->request->post()) && Yii::$app->request->post('submit for review') != 'true') {\n $model->load(Yii::$app->request->post());\n $model->team_members = implode(\", \", $model->team_members);\n list( $model->start_date, $model->end_date) = explode('to', $model->travel_dates);\n $model->created_by = Yii::$app->user->id;\n $model->updated_by = Yii::$app->user->id;\n $model->status = 0;\n if ($model->save()) {\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Saved back to office report as draft\";\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n Yii::$app->session->setFlash('success', 'Back to office report was successfully saved as a draft');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $message = \"\";\n foreach ($model->getErrors() as $error) {\n $message .= $error[0];\n }\n Yii::$app->session->setFlash('error', 'Error occured while saving back to office report.Error::' . $message);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n } else {\n Yii::$app->session->setFlash('error', 'You are not authorised to perform that action.');\n return $this->redirect(['home/home']);\n }\n }", "public function storemistraffic(StoreStpRequest $request)\n \n { \n\t\n\t $year = $request['year'];\n\t $month = $request['month'];\n\t\n\t if(isset($request['report_status'])) { $request['report_status'] = $request['report_status'];}\n\t else {$request['report_status'] = 0;}\n\t \n \n\t\t if((int)$request['record_id'] > 0){\n\t\t\t\t\t \n $report = Trafficmisreport::findOrFail($request['record_id']);\n\t\t\t\t\t $report->update($request->all()); \n\n\t\t\t\t\t return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t } \n\t\t else{ \n\t\t\t\t\t $create = Trafficmisreport::create($request->all()); \n\t\t\t\t\t $firesafeid = $create->id;\n\t\t\t\t\t \n\t\t\t\t\t $edata = $request->all(); \n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t\t \n\t\t\t}\n \n return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t\n }", "protected function _preSave()\n {\n $titlePhrase = $this->getExtraData(self::DATA_TITLE);\n if ($titlePhrase !== null && strlen($titlePhrase) == 0) {\n $this->error(new XenForo_Phrase('please_enter_valid_title'), 'title');\n }\n }", "public function store(Request $request)\n {\n // dd($request);\n $validate=$request->validate([\n 'name' => 'required',\n 'year' => 'required',\n 'examDate' => 'required',\n \n ]);\n\n if ($request->input('current') == 'on') {\n $current=1;\n }else {\n $current=0;\n }\n\n if ($validate) {\n $store=Semester::create([\n 'name'=>$request->input('name'),\n 'year_id'=>$request->input('year'),\n 'exam_date'=>$request->input('examDate'),\n 'current' =>$current,\n ]);\n\n flash('Semester created')->success()->important();\n return redirect()->route('semester.index');\n }\n }", "public function onBeforeSave()\n\t{\n\t\tif ($this->id == NULL && ee('Model')->get('hop_new_relic:Hnp_settings')->filter('name', $this->name)->count() != 0)\n\t\t{\n\t\t\tthrow new \\Exception('Hnp_settings cannot be saved, a setting with that name already exists.');\n\t\t}\n\t}", "public function register($data)\n\t{\n if($data['operation'] != 'edit'){\n $validation = $this->validate(\n $data,\n array(\n 'academic_session' =>'required',\n 'semester_name' =>'required',\n 'start_date' =>'required',\n 'end_date' =>'required',\n 'status' =>'required'\n ),\n array(\n 'academic_session' => 'Academic session',\n 'semester_name' => 'Semester',\n 'start_date' => 'Semester start date',\n 'end_date' => 'Semester end date',\n 'status' => 'Status'\n )\n );\n if(!$validation['error']){\n $session_name = filter_var($data[\"academic_session\"], FILTER_SANITIZE_STRING);\n $semester_number = filter_var($data[\"semester_name\"], FILTER_SANITIZE_STRING);\n if($semester_number == '1'){\n $semester_name = \"First Semester\";\n }else{\n $semester_name = \"Second Semester\";\n }\n $session_id = $this->getitemlabel('session_setup', 'session_name', $session_name, 'session_id');\n $sql = \"SELECT semester_id FROM semester_setup ORDER BY semester_id DESC LIMIT 1\";\n $result = mysql_query($sql);\n $semester_id = mysql_fetch_row($result);\n $semester_id = $semester_id[0];\n $query = $this->db_query(\"SELECT semester_end FROM semester_setup WHERE semester_id = \".$semester_id);\n $semester_dates = $query[0];\n $start_date = date($data['start_date'].' h:i:s');\n $end_date = date($data['end_date'].' h:i:s');\n $date_diff = strtotime($end_date) - strtotime($start_date);\n $sql = \"SELECT semester_end FROM semester_setup ORDER BY semester_id DESC LIMIT 1\";\n $result = mysql_query($sql);\n $semester = mysql_fetch_row($result);\n $semester = $semester[0];\n if($semester > $start_date){\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'Semester cannot start on/before prevoius semester end date. Please choose a later date.'));\n }\n if($start_date > $end_date){\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'Semester start cannot be greater then semester end.'));\n }\n if($start_date <= $semester_dates[\"semester_end\"]){\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'Wrong semester start date, please choose an earlier date.'));\n }\n $months = floor($date_diff/2628000);\n // var_dump()\n if($months < 3){\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'There should be at least 3 months difference between semester start and semester end.'));\n }\n $semester_id = $semester_id + 1;\n $query = \"INSERT INTO semester_setup VALUES (\".$semester_id.\", '\".$session_id.\"', '\".$semester_name.\"', '\".$start_date.\"', '\".$end_date.\"', \".$data['status'].\", '\".$data['posted_by'].\"')\";\n $count = $this->db_query($query, false);\n if($count > 0){\n return json_encode(array(\"response_code\"=>0,\"response_message\"=>'Record saved successfully'));\n }else{\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'Failed to save record'));\n }\n \n }else{\n return json_encode(array(\"response_code\"=>20,\"response_message\"=>$validation['messages'][0]));\n }\n }else{\n// EDIT EXISTING FACULTY \n // $data['modified_date'] = date('Y-m-d h:i:s');\n $validation = $this->validate(\n $data,\n array(\n 'academic_session' =>'required',\n 'semester_name' =>'required',\n 'start_date' =>'required',\n 'end_date' =>'required',\n 'status' =>'required'\n ),\n array(\n 'academic_session' => 'Academic session',\n 'semester_name' => 'Semester',\n 'start_date' => 'Semester start date',\n 'end_date' => 'Semester end date',\n 'status' => 'Status'\n )\n );\n if(!$validation['error']){\n $session_name = filter_var($data[\"academic_session\"], FILTER_SANITIZE_STRING);\n $semester_number = filter_var($data[\"semester_name\"], FILTER_SANITIZE_STRING);\n if($semester_number == '1'){\n $semester_name = \"First Semester\";\n }else{\n $semester_name = \"Second Semester\";\n }\n $session_id = $this->getitemlabel('session_setup', 'session_name', $session_name, 'session_id');\n $start_date = date($data['start_date'].' h:i:s');\n $end_date = date($data['end_date'].' h:i:s');\n $date_diff = strtotime($end_date) - strtotime($start_date);\n if($start_date > $end_date){\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'Semester start cannot be greater then semester end.'));\n }\n $months = floor($date_diff/2628000);\n // var_dump($months);\n if($months < 3){\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'There should be at least 3 months difference between semester start and semester end.'));\n }\n $query = \"UPDATE semester_setup SET academic_session = '\".$session_id.\"', semester_name = '\".$semester_name.\"', semester_start = '\".$start_date.\"', semester_end = '\".$end_date.\"', status = \".$data['status'].\", posted_by = '\".$data['posted_by'].\"' WHERE semester_id = \".$data['semester_id'];\n // echo $query;\n $count = $this->db_query($query, false);\n // echo $count;\n if($count > 0){\n return json_encode(array(\"response_code\"=>0,\"response_message\"=>'Record updated successfully'));\n }else if($count == 0){\n return json_encode(array(\"response_code\"=>0,\"response_message\"=>'No changes made. Record saved successfully'));\n }else{\n return json_encode(array(\"response_code\"=>78,\"response_message\"=>'Failed to save record'));\n }\n }else{\n return json_encode(array(\"response_code\"=>20,\"response_message\"=>$validation['messages'][0]));\n }\n }\n \n\t}", "public function addnewpenifitandtowait(Request $request){\n\n\n $first_name = $request->input('first_name');\n $father_name = $request->input('father_name');\n $last_name = $request->input('last_name');\n $city_name = $request->input('city_name');\n $bd = $request->input('birth_date');\n $gender=$request->input('gender_select');\n $card_id = $request->input('card_id');\n\n $currentpenifit=Penifit::where('card_id','=',$card_id)->get('id');\n\n if ($currentpenifit->isEmpty())\n {\n\n $penifit=new Penifit();\n $penifit->first_name=$first_name;\n $penifit->father_name=$father_name;\n $penifit->last_name=$last_name;\n $penifit->city_name=$city_name;\n $penifit->birth_date=$bd;\n $penifit->gender=$gender;\n $penifit->card_id=$card_id;\n $penifit->added_by=Auth::user()->id;\n $penifit->wait='1';\n $penifit->save();\n\n\n\n/////////////////////////////////////////////////////////saving to log\n// $currentid=Penifit::where('card_id','=',$card_id)->get('id');\n// $logofpenifit=new Logofpenifit();\n// $currentDate=Carbon::now();\n// $logofpenifit->entering_time=$currentDate;\n// $logofpenifit->penifit_id=$currentid[0]->id;\n// $logofpenifit->save();\n\n\n\n }\n else{ ///////////////////////////// user exist and return his data\n ///\n// $currentid=Penifit::where('card_id','=',$card_id)->get('id');\n// $logofpenifit=new Logofpenifit();\n// $currentDate=Carbon::now();\n// $logofpenifit->entering_time=$currentDate;\n// $logofpenifit->penifit_id=$currentid[0]->id;\n// $logofpenifit->save();\n\n// DB::table('penifits')\n// ->where('id','=' , $currentid[0]->id)\n// ->update(['wait' => \"1\"]);\n ////////////////////////////////////////////////////////////////////Booking\n// $serviceProvider=Serviceprovider::find(2);\n// $penifit=new Penifit();\n// $penifit=Penifit::find($currentid);\n//\n// $serviceBooking =new \\App\\Models\\Availability();\n// $serviceBooking->make(['range' => 'dates', 'from' => '08:00 am', 'to' => '12:30 pm',\n// 'is_bookable' => true ])\n// ->bookable()->associate($serviceProvider)\n// ->save();\n//\n////\n// $Booking= new Booking();\n// $Booking->make(['starts_at' => \\Carbon\\Carbon::now(),\n// 'ends_at' => \\Carbon\\Carbon::tomorrow(),\n// 'price' => 1,\n// 'quantity' => 1,\n// 'total_paid' => 1,\n// 'currency' => 'EUR',\n// 'notes'=>'no notes',\n// 'customer_id'=>$penifit[0]->id,\n// 'customer_type'=>'type'\n//\n// ])\n\n// ->bookable()->associate($serviceProvider)\n//// ->customer()->associate( $penifit)\n//\n// ->save();\n\n\n\n\n\n\n\n\n// $currentpenifit=Penifit::where('card_id','=',$card_id)->get();\n return response() -> json([\n 'status'=> true,\n 'msg'=>'user already exist added to log list',\n\n\n\n\n ////////////////////////////////////////////////////////////// change wait to 1 and add to log\n ]);\n\n }\n\n if($penifit){\n return response() -> json([\n 'status'=> true,\n 'msg'=>'saved and added to log',\n\n\n\n ]);\n }\n else{\n return response() -> json([\n 'status'=> false,\n 'msg'=>' حدث خطأ الرجاء إعادة المحاولة'\n ]);\n }\n\n\n// $data=array('first_name'=>$first_name,\"father_name\"=>$father_name,\"last_name\"=>$last_name,\"city_name\"=>$city_name,\"age\"=>$age);\n// DB::table('student')->insert($data);\n// echo \"Record inserted successfully.<br/>\";\n// echo \"Redirecting you to main page.<br/>\";\n\n }", "function sports_add($sports_id) {\r\n\t\t$uid = $map1 ['uid'] = $this->mid;\r\n\t\t// $award = M ( 'sport_award' )->where($map1)->select ();\r\n\t\t$award = M ( 'sport_award' )->select ();\r\n\t\t$model = getModelByName ( 'lottery_prize_list' );\r\n\t\t\r\n\t\t$fafangjp = D ( 'LuckyFollow' )->getAwardNum ( $sports_id );\r\n\t\t\r\n\t\t$dao = D ( 'LotteryPrizeList' );\r\n\t\t$lotteryPrizedata = $dao->getList ( $sports_id );\r\n\t\tforeach ( $lotteryPrizedata as $l ) {\r\n\t\t\t$lp [$l ['award_id']] = intval ( $l ['award_num'] );\r\n\t\t}\r\n\t\t\r\n\t\tforeach ( $award as $v ) {\r\n\t\t\t$v ['has_pay'] = intval ( $fafangjp [$v ['id']] );\r\n\t\t\t$v ['set_num'] = intval ( $lp [$v ['id']] );\r\n\t\t\t\r\n\t\t\t$awardArr [$v ['id']] = $v;\r\n\t\t}\r\n\t\tif (IS_POST) {\r\n\t\t\t$awardNumArr = I ( 'post.award_num' );\r\n\t\t\t$prizeNum = 0;\r\n\t\t\tforeach ( $awardNumArr as $id => $num ) {\r\n\t\t\t\tif ($num < 0) {\r\n\t\t\t\t\t$this->error ( '奖品数量不能小于0' );\r\n\t\t\t\t}\r\n\t\t\t\tif ($num > 0) {\r\n\t\t\t\t\t$prizeNum ++;\r\n\t\t\t\t}\r\n\t\t\t\tif ($awardArr [$id] ['award_type'] == 1) {\r\n\t\t\t\t\tif ($lp [$id] + $awardArr [$id] ['count'] < $num) {\r\n\t\t\t\t\t\t$this->error ( $awardArr [$id] ['name'] . '数量不能超过奖品库剩余的数量!' );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$awardArr [$id] ['count'] = $awardArr [$id] ['count'] + $lp [$id] - $num;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// if ($prizeNum>9){\r\n\t\t\t// $this->error('一场比赛只能设置 9 种奖品');\r\n\t\t\t// }\r\n\t\t\tforeach ( $awardNumArr as $id => $num ) {\r\n\t\t\t\t\r\n\t\t\t\tif (isset ( $lp [$id] )) { // 更新数据\r\n\t\t\t\t\t$map ['sports_id'] = $sports_id;\r\n\t\t\t\t\t$map ['award_id'] = $id;\r\n\t\t\t\t\t$data ['award_num'] = $num;\r\n\t\t\t\t\t$res = M ( 'lottery_prize_list' )->where ( $map )->save ( $data );\r\n\t\t\t\t\t$dao->getInfo ( $id, true );\r\n\t\t\t\t\t$dao->getList ( $sports_id, true );\r\n\t\t\t\t} else { // 增加数据\r\n\t\t\t\t\t$data ['sports_id'] = $sports_id;\r\n\t\t\t\t\t$data ['award_id'] = $id;\r\n\t\t\t\t\t$data ['award_num'] = $num;\r\n\t\t\t\t\t$data ['uid'] = $this->mid;\r\n\t\t\t\t\t$res = M ( 'lottery_prize_list' )->add ( $data );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$awardDao = D ( 'Award' );\r\n\t\t\tforeach ( $awardArr as $id => $vo ) {\r\n\t\t\t\t$res = $awardDao->update ( $id, $vo );\r\n\t\t\t}\r\n\t\t\t$prizelist = $dao->getList ( $sports_id, true );\r\n\t\t\tforeach ( $prizelist as &$v ) {\r\n\t\t\t\tif ($fafangjp [$v ['award_id']]) {\r\n\t\t\t\t\t$v ['award_num'] = $v ['award_num'] - $fafangjp [$v ['award_id']];\r\n\t\t\t\t}\r\n\t\t\t\tif ($v ['award_num'] > 0) {\r\n\t\t\t\t\tif ($v ['awardarr'] ['award_type'] == 1) {\r\n\t\t\t\t\t\t$shiwu [] = $v;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// $xuni[]=$v;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// $d [] = $v;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach ( $shiwu as $v ) {\r\n\t\t\t\t$shiwuArr [] = array (\r\n\t\t\t\t\t\t'prize_id' => $v ['award_id'],\r\n\t\t\t\t\t\t'prize_num' => $v ['award_num'] \r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t// foreach ( $xuni as $v ) {\r\n\t\t\t// $xuniArr [] = array (\r\n\t\t\t// 'prize_id' => $v ['award_id'],\r\n\t\t\t// 'prize_num' => $v ['award_num']\r\n\t\t\t// );\r\n\t\t\t// }\r\n\t\t\t$prizeArr ['shiwu'] = $shiwuArr;\r\n\t\t\t// $prizeArr['xuni']=$xuniArr;\r\n\t\t\t\r\n\t\t\t// foreach ( $d as $v ) {\r\n\t\t\t// $prizeArr [] = array (\r\n\t\t\t// 'prize_id' => $v ['award_id'],\r\n\t\t\t// 'prize_num' => $v ['award_num']\r\n\t\t\t// );\r\n\t\t\t// }\r\n\t\t\t$sports = D ( 'Addons://Sports/Sports' )->getInfo ( $sports_id );\r\n\t\t\t$start_time = $sports ['start_time'];\r\n\t\t\t$end_time = $start_time + 120 * 60;\r\n\t\t\t\r\n\t\t\t// if ($end_time < NOW_TIME) {\r\n\t\t\t// $prizeid = - 1;\r\n\t\t\t// } else {\r\n\t\t\tget_lottery ( $prizeArr, $start_time, $end_time, $sports_id, true );\r\n\t\t\t\r\n\t\t\t$this->success ( '添加' . $model ['title'] . '成功!' );\r\n\t\t}\r\n\t\t\r\n\t\t$this->assign ( 'sports_id', $sports_id );\r\n\t\t// $this->assign ( 'prizes', $prizes );\r\n\t\t$this->assign ( 'awards', $awardArr );\r\n\t\t$this->display ();\r\n\t}", "public function actionReportuser(){\n $type = htmlentities($_GET['type']);\n $page = preg_replace('/[^-a-zA-Z0-9_]/', '', $type);\n $id = (int) $_GET['id'];\n $reason = htmlentities($_GET['reason']);\n if($type == 'others' && $reason != ''){\n $type = $reason;\n }\n $report = new FlagReports;\n $report->reported_by = \\Yii::$app->user->getId();\n $report->user_id = $id;\n $report->report = $type;\n $report->datetimestamp = date('Y-m-d H:i:s', time());\n if($report->save()){\n echo \"true\";\n }else{\n echo \"false\";\n }\n }", "function beforeSave(&$record){\r\n\t\t\t$purchase_history_records = $record->getRelatedRecords('inventory_purchase_history');\r\n\r\n\t\t\t$purchase_total = 0;\r\n\t\t\t$count = 0;\r\n\r\n\t\t\tforeach($purchase_history_records as $purchase_history_record){\r\n\t\t\t\t$count++;\r\n\t\t\t\t$purchase_total += $purchase_history_record['purchase_price'];\r\n\t\t\t\tif($count == 10)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif($count > 0){\r\n\t\t\t\t$average = number_format($purchase_total / $count, 2);\r\n\t\t\t\t$record->setValue('average_purchase',$average);\r\n\t\t\t}\r\n\r\n\t}", "public function beforeSave()\n\t{\n\t\t//Set null for empty field in table\n\t\tif($this->sale_date=='') $this->sale_date = NULL;\n\t\tif($this->next_sale_date=='') $this->next_sale_date = NULL;\n\t\treturn true;\n\t}", "public function store(Request $request){\n $request->validate([\n 'customer_id' => 'required|numeric',\n 'name' => 'required',\n 'collected_by' => 'required',\n 'posted_by' => 'nullable',\n 'amount' => 'string',\n 'request_type' => 'string',\n 'savings_type' => 'required',\n 'collected_on' => 'required',\n 'description' => '',\n ]);\n\n $is_registered_customer = Customer::where('customer_id', '=', $request->customer_id)->first();\n\n //get his last contribution and see if it is null, a debit or a credit\n $last_contribution = Contribution::where('customer_id', $request->customer_id)->latest('id')->first();\n if($last_contribution == null){\n // It means he is a first timer\n if($request->request_type === 'credit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n $amount = (int)$request->amount;\n $available_balance = $amount - ($amount * 0.033);\n $gain = $amount * 0.033;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $amount,\n 'balance' => $available_balance,\n 'gain' => $gain,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n\n return back()->with(['success' => 'Account credited successfully']);\n }elseif($request->savings_type === 'loan'){\n return back()->with(['status' => 'You have no loan to payback']);\n }else{\n return back()->with(['error' => 'This request is not understood']);\n }\n }elseif($request->request_type === 'debit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n if($last_contribution->balance >= $request->amount){\n $remaining_balance = $last_contribution->balance - (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $remaining_balance,\n 'gain' => 0,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success' => 'Savings debit successful']);\n\n }else{\n return back()->with(['error' => 'Available balance is less than them amount you want to withdraw']);\n\n }\n }elseif($request->savings_type === 'loan'){\n $loan = (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => 0,\n 'gain' => 0,\n 'loan' => $loan,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success'=> 'Loan debit successful']);\n\n }else{\n //bad request\n return back()->with(['error'=> 'Request not understood']);\n }\n }else{\n //Something is wrong with the request\n return back()->with(['error'=> 'There is an error with this request']);\n }\n\n }else{\n /*\n * When he is no long a first timer\n */\n if($request->request_type === 'credit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n $amount = (int)$request->amount;\n $available_balance = (int)$last_contribution->balance + ($amount - ($amount * 0.033));\n $gain = $amount * 0.033;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $amount,\n 'balance' => $available_balance,\n 'gain' => $gain,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n\n return back()->with(['success' => 'Account credited successfully']);\n\n }elseif($request->savings_type === 'loan'){\n if((int)$last_contribution->loan > 0 and (int)$request->amount <= (int)$last_contribution->loan){\n $loan_balance = $last_contribution->loan - $request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $last_contribution->balance,\n 'gain' => 0,\n 'loan' => $loan_balance,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n\n return back()->with(['success' => 'Loan credited successfully']);\n\n }else{\n return back()->with('error', 'The amount you want to pay back is bigger than the loan');\n\n }\n\n }else{\n //bad request\n return back()->with('error', 'This request is not understood');\n }\n }elseif($request->request_type === 'debit'){\n if($request->savings_type === 'savings' or $request->savings_type === 'property'){\n if($last_contribution->balance >= $request->amount){\n $remaining_balance = $last_contribution->balance - (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $remaining_balance,\n 'gain' => 0,\n 'loan' => 0,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success' => 'Savings debit successful']);\n\n }else{\n return back()->with('error', 'Available balance is less than them amount you want to withdraw');\n }\n }elseif($request->savings_type === 'loan'){\n $loan = (int)$last_contribution->loan + (int)$request->amount;\n Contribution::create([\n 'contribution_id' => $this->generateInvoiceNo(),\n 'customer_id' => $request->customer_id,\n 'amount' => $request->amount,\n 'balance' => $last_contribution->balance,\n 'gain' => 0,\n 'loan' => $loan,\n 'request_type' => $request->request_type,\n 'savings_type' => $request->savings_type,\n 'collected_by' => $request->collected_by,\n 'posted_by' => $request->posted_by,\n 'collected_on' => $request->collected_on,\n 'description' => $request->description,\n 'status' => 'pending'\n ]);\n return back()->with(['success' => 'Loan debit successful']);\n\n }else{\n //bad request\n return back()->with('error', 'This request is not understood');\n }\n }else{\n return back()->with('error', 'This request is not understood');\n }\n }\n\n\n\n }", "public function storemisfiresafe(StoreFiresafemisRequest $request)\n \n { \n\t\n\t $year = $request['year'];\n\t\t $month = $request['month'];\n\t\n\t if(isset($request['report_status'])) { $request['report_status'] = $request['report_status'];}\n\t else {$request['report_status'] = 0;}\n\t \n \n\t\t if((int)$request['record_id'] > 0){\n\t\t $report = Firesafetymisreport::findOrFail($request['record_id']);\n\n\t\t\t\t\t /* $store_val = array('site'=>$request['site'],'nw_bores_num'=>$request['nw_bores_num'], 'no_ground_water'=>$request['no_ground_water'],'over_load'=>$request['over_load'],'motor_brunt'=>$request['motor_brunt'],'cable_prblm'=>$request['cable_prblm'],'pumpormotorwear'=>$request['pumpormotorwear'],'others'=>$request['others'],'motor_brunt'=>$request['motor_brunt'],'dry_run_protectn'=>$request['dry_run_protectn'],'flow_meter'=>$request['flow_meter'],'remarks'=>$request['remarks'],'report_status'=>$request['report_status']);\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 $report = Firesafetymisreport::findOrFail($request['record_id']);\n\t\t\t\t\t $report->update($request->all()); \n\t\t\t\t\t \n\t\t\t\t\t// $firesafe_issue = Firesafenotworkingissue::create($cat_arr);\n\t\t\t\t\t DB::table('firesafenotworkingissues')->where('ref_id', '=', $request['record_id'])->delete();\n\t\t\t\t\t \n\t\t\t\t\t $edata = $request->all();\n\t\t\t\t\t if(isset($edata['category'])){\n\t\t\t\t\t if(count($edata['category'])> 0){\n\t\t\t\t\t \tforeach($edata['category'] as $key => $cat){\n\t\t\t\t\t\t $cat_arr = array(\"category\"=>$cat,\"issue_des\"=>$edata['issue_des'][$key],\"root_cause\"=>$edata['root_cause'][$key],\"act_req_plan\"=>$edata['act_req_plan'][$key],\"pendingfromdays\"=>$edata['pendingfromdays'][$key],\"reponsibility\"=>$edata['reponsibility'][$key],\"notify_concern\"=>$edata['notify_concern'][$key],\"ref_id\"=>$request['record_id'],\"site\"=>$edata['site']);\n\t\t\t\t\t\t $firesafe_issue = Firesafenotworkingissue::create($cat_arr);\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 \n\t\t\t\t\t return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t } \n\t\t else{ \n\t\t \n\t\t\t\t \n\t\t\t\t // $store_val = array('site'=>$request['site'], 'month'=>$request['month'], 'year'=>$request['year'], 'user_id'=>$request['user_id'], 'nw_bores_num'=>$request['nw_bores_num'], 'no_ground_water'=>$request['no_ground_water'],'over_load'=>$request['over_load'],'motor_brunt'=>$request['motor_brunt'],'cable_prblm'=>$request['cable_prblm'],'pumpormotorwear'=>$request['pumpormotorwear'],'others'=>$request['others'],'motor_brunt'=>$request['motor_brunt'],'dry_run_protectn'=>$request['dry_run_protectn'],'flow_meter'=>$request['flow_meter'],'remarks'=>$request['remarks'],'report_status'=>$request['report_status']);\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t $create = Firesafetymisreport::create($request->all()); \n\t\t\t\t\t $firesafeid = $create->id;\n\t\t\t\t\t \n\t\t\t\t\t $edata = $request->all();\n\t\t\t\t\t if(isset($edata['category'])){\n\t\t\t\t\t if(count($edata['category'])> 0){\n\t\t\t\t\t \tforeach($edata['category'] as $key => $cat){\n\t\t\t\t\t\t $cat_arr = array(\"category\"=>$cat,\"issue_des\"=>$edata['issue_des'][$key],\"root_cause\"=>$edata['root_cause'][$key],\"act_req_plan\"=>$edata['act_req_plan'][$key],\"pendingfromdays\"=>$edata['pendingfromdays'][$key],\"reponsibility\"=>$edata['reponsibility'][$key],\"notify_concern\"=>$edata['notify_concern'][$key],\"ref_id\"=>$firesafeid,\"site\"=>$edata['site']);\n\t\t\t\t\t\t $firesafe_issue = Firesafenotworkingissue::create($cat_arr);\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\n\t\t\t\t return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t\t \n\t\t\t}\n \n return redirect('/misreports?y='.$year.'&m='.$month);\n\t\t\n }", "public function store(Request $request)\n {\n $this->validate($request, [ 'type' => 'required', 'group' => 'required', 'date' => 'required', 'time' => 'required' ,'nic' => 'required']);\n $student = new mark([\n 'nic' => $request->get('nic'),\n 'type' => $request->get('type'),\n 'group' => $request->get('group'),\n 'time' => $request->get('time'),\n 'date' => $request->get('date'),\n // => $nic1\n ]);\n $student->save();\n\n $val['nic']=$request->get('nic');\n //Sunday\n $data1 = Scheduls::select('nic','id','type','group','day','time')\n ->where([['day', '=', \"Sunday\"] , ['nic' ,'=',$val['nic']]])\n ->paginate(100);\n //Monday\n $data2 = Scheduls::select('nic','id','type','group','day','time')\n ->where([['day', '=', \"Monday\"] , ['nic' ,'=',$val['nic']]])\n ->paginate(100);\n\n //Tuesday\n $data3 = Scheduls::select('nic','id','type','group','day','time')\n ->where([['day', '=', \"Tuesday\"] , ['nic' ,'=',$val['nic']]])\n ->paginate(100);\n //Wednesday\n $data4 = Scheduls::select('nic','id','type','group','day','time')\n ->where([['day', '=', \"Wednesday\"] , ['nic' ,'=',$val['nic']]])\n ->paginate(100);\n //Thursday\n $data5 = Scheduls::select('nic','id','type','group','day','time')\n ->where([['day', '=', \"Thursday\"] , ['nic' ,'=',$val['nic']]])\n ->paginate(100);\n //Friday\n $data6 = Scheduls::select('nic','id','type','group','day','time')\n ->where([['day', '=', \"Friday\"] , ['nic' ,'=',$val['nic']]])\n ->paginate(100);\n //Sataday\n $data7 = Scheduls::select('nic','id','type','group','day','time')\n ->where([['day', '=', \"Sataday\"] , ['nic' ,'=',$val['nic']]])\n ->paginate(100);\n\n return view('Admin.attendence',compact('val','data1','data2','data3','data4','data5','data6','data7'));\n\n }", "public static function count_unmarked_registers_before_date($ebs_user, $date = null) {\r\n\t\r\n\t\tif(!$date) {\r\n\t\t\t$date = time();\r\n\t\t}\r\n\t\r\n\t\t$person_code = $ebs_user->get_person_code();\r\n\t\t$date_string = date(\"Y-m-d H:is\", $date);\r\n\r\n\t\t$sql = \"\r\n\t\t\tSELECT\r\n\t\t\t\tCount(1) AS number_of_registers\r\n\t\t\tFROM\r\n\t\t\t\tregister_event_slots RES\r\n\t\t\t\tINNER JOIN register_events RE ON RE.id = RES.register_event_id\r\n\t\t\t\tINNER JOIN sessions S ON S.session_code = RE.session_code\r\n\t\t\tWHERE\r\n\t\t\t\tRES.startdate < To_Date(:date_string,'yyyy-MM-dd HH24:mi:ss')\r\n\t\t\t\tAND Nvl(RES.slot_status,'^') NOT IN ('M','O')\r\n\t\t\t\tAND RE.register_type = 'EREG'\r\n\t\t\t\tAND S.start_date <= To_Date(:date_string, 'yyyy-MM-dd HH24:mi:ss')\r\n\t\t\t\tAND S.end_date >= To_Date(:date_string, 'yyyy-MM-dd HH24:mi:ss')\r\n\t\t\t\tAND EXISTS ( -- There are learners\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tNULL\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\tregister_event_details_slots REDS\r\n\t\t\t\t\t\tINNER JOIN register_event_details RED ON RED.id = REDS.register_event_detail_id\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tRED.object_type = 'L'\r\n\t\t\t\t\t\tAND REDS.register_event_slot_id = RES.id\r\n\t\t\t\t\t\tAND RED.detail_status = 'A'\r\n\t\t\t\t)\r\n\t\t\t\tAND EXISTS ( -- The user is assigned as a marking member of staff\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\tNULL\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\tregister_event_details_slots REDs\r\n\t\t\t\t\t\tINNER JOIN register_event_details RED ON RED.id = REDS.register_event_detail_id\r\n\t\t\t\t\t\tINNER JOIN person_functions PF ON PF.function_code = RED.person_function\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tRED.object_type = 'T'\r\n\t\t\t\t\t\tAND RED.object_id = :person_code\r\n\t\t\t\t\t\tAND REDS.register_event_slot_id = RES.id\r\n\t\t\t\t\t\tAND PF.can_tutor_mark = 'Y'\r\n\t\t\t\t)\r\n\t\t\";\r\n\t\t\r\n\t\t//Connect\r\n\t\t$connection = ebs_utility::connect();\r\n\t\t\r\n\t\tif(!$connection) {\r\n\t\t\t$error = oci_error();\r\n\t\t\tdie(\"An error was encountered connecting to the database: \" . $error[\"message\"]);\r\n\t\t}\r\n\t\r\n\t\t//Parse the query\r\n\t\t$statement = oci_parse($connection, $sql);\r\n\t\t\r\n\t\tif(!$statement) {\r\n\t\t\t$error = oci_error($connection);\r\n\t\t\tdie(\"An error was encountered parsing the unmarked e-registers query: \" . $error[\"message\"]);\r\n\t\t}\r\n\t\t\r\n\t\t//Bind variables\r\n\t\toci_bind_by_name($statement, \":date_string\", $date_string);\r\n\t\toci_bind_by_name($statement, \":person_code\", $person_code);\r\n\t\t\r\n\t\t//Execute\r\n\t\tif(!oci_execute($statement, OCI_DEFAULT)) {\r\n\t\t\t$error = oci_error($statement);\r\n\t\t\tdie(\"An error was encountered executing the unmarked e-registers query: \" . $error[\"message\"]);\r\n\t\t}\r\n\t\t\r\n\t\t$data = oci_fetch_array($statement, OCI_DEFAULT);\r\n\t\t\r\n\t\toci_close($connection);\r\n\t\t\r\n\t\treturn $data[\"NUMBER_OF_REGISTERS\"];\r\n\t}", "public function isSaveToHistoryEnabled(): bool\n\t{\n\t\treturn false;\n\t}", "function beforeSave() {\n\t\tif (isset($this->data['BPCSRepSale']['c_s_rep_id']) && isset($this->data['BPCSRepSale']['rep_name']) && empty($this->data['BPCSRepSale']['rep_name'])) {\n\t\t\t$this->data['BPCSRepSale']['c_s_rep_id'] = null;\n\t\t}\n\t\n\t\t// odnastavim id OP, pokud nemam nastaveno jmeno OP\n\t\tif (isset($this->data['BPCSRepSale']['business_partner_id']) && isset($this->data['BPCSRepSale']['business_partner_name']) && empty($this->data['BPCSRepSale']['business_partner_name'])) {\n\t\t\t$this->data['BPCSRepSale']['business_partner_id'] = null;\n\t\t}\n\t\t\n\t\t// uprava tvaru data z dd.mm.YYYY na YYYY-mm-dd\n\t\tif (isset($this->data['BPCSRepSale']['due_date']) && preg_match('/\\d{2}\\.\\d{2}\\.\\d{4}/', $this->data['BPCSRepSale']['due_date'])) {\n\t\t\t$date = explode('.', $this->data['BPCSRepSale']['due_date']);\n\t\n\t\t\tif (!isset($date[2]) || !isset($date[1]) || !isset($date[0])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->data['BPCSRepSale']['due_date'] = $date[2] . '-' . $date[1] . '-' . $date[0];\n\t\t}\n\t\t\n\t\t// uprava tvaru data z dd.mm.YYYY na YYYY-mm-dd\n\t\tif (isset($this->data['BPCSRepSale']['date_of_issue']) && preg_match('/\\d{2}\\.\\d{2}\\.\\d{4}/', $this->data['BPCSRepSale']['date_of_issue'])) {\n\t\t\t$date = explode('.', $this->data['BPCSRepSale']['date_of_issue']);\n\t\t\n\t\t\tif (!isset($date[2]) || !isset($date[1]) || !isset($date[0])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$this->data['BPCSRepSale']['date_of_issue'] = $date[2] . '-' . $date[1] . '-' . $date[0];\n\t\t}\n\n\t\treturn true;\n\t}", "public function handle()\n {\n \n //get today\n $dt = Carbon::now();\n $tArray = explode('-', $dt->format('Y-m-d'));\n $tArray = array_map('intval', $tArray);\n //$now_month = $tArray[1];\n\n $student = Scholarship::all();\n\n foreach($student as $v){\n \n $repot = (ReportUploadModel::where('student_id',$v->user_id)->latest()->get())[0];\n $type = (User::select('registrationType')->where('id',$v->user_id)->get())[0]->registrationType;\n // echo $repot.\"- \";\n echo $type.\"\\n\";\n $ls = explode('-', $repot->created_at->format('Y-m-d'));\n $ls = array_map('intval', $tArray);\n\n $user = User::find($v->user_id); \n\n if($type == \"schoolStudent\"){\n\n if($tArray[1] == 11 && $repot->term !=3 ){//10 venuwata 1 danna\n\n $text = \"Your \".($tArray[0]-1).\", 3rd term test report not yet uploaded.\";\n Notification::send($user, new ReportUploadReminder($text));\n\n $student = new ReportUploadRem([\n 'student_id' => $user->id,\n 'grade' => ($tArray[0]-1),\n 'term' => 3\n ]);\n\n }else if($tArray[1] == 5 && $repot->term !=1){\n\n $text = \"Your \".$tArray[0].\", 1st term test report not yet uploaded.\";\n Notification::send($user, new ReportUploadReminder($text));\n\n $student = new ReportUploadRem([\n 'student_id' => $user->id,\n 'grade' => $tArray[0],\n 'term' => 1\n ]);\n\n }else if($tArray[1] == 9 && $repot->term !=2){\n\n $text = \"Your \".$tArray[0].\", 2nd term test report not yet uploaded.\";\n Notification::send($user, new ReportUploadReminder($text));\n\n $student = new ReportUploadRem([\n 'student_id' => $user->id,\n 'grade' => $tArray[0],\n 'term' => 2\n ]);\n }\n }else{\n //echo \"sds\\n\";\n if($repot->created_at <= Carbon::now()->subMonths(4)){\n if($repot->semester==1){\n\n $text = \"Your level \".$repot->acadamic_year.\" semester 2 report not yet uploaded.\";\n\n $student = new ReportUploadRem([\n 'student_id' => $user->id,\n 'level' => $repot->acadamic_year,\n 'semester' => 2\n ]);\n \n\n\n }else{\n $text = \"Your level \".($repot->acadamic_year+1).\" semester 1 report not yet uploaded.\";\n\n $student = new ReportUploadRem([\n 'student_id' => $user->id,\n 'level' => ($repot->acadamic_year+1),\n 'semester' => 1\n ]);\n\n }\n Notification::send($user, new ReportUploadReminder($text));\n }\n }\n\n $student->save();\n } \n \n }", "private function validateStudioID() {\n\t\tif (empty($this->request->post['price_studio_id']) || !isset($this->session->data['studio_data'][$this->request->post['price_studio_id']])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_studio_id');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t} elseif (empty($this->session->data['studio_data'][$this->request->post['price_studio_id']]['printing_method'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_printing_method');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function saveStatisticsSections() {\n\t\t// generate statistics.\n\n\t\tparent::validate();\n\n\t\t$journal = &Request::getJournal();\n\n\t\t$sectionIds = Request::getUserVar('sectionIds');\n\t\tif (!is_array($sectionIds)) {\n\t\t\tif (empty($sectionIds)) $sectionIds = array();\n\t\t\telse $sectionIds = array($sectionIds);\n\t\t}\n\n\t\t$journal->updateSetting('statisticsSectionIds', $sectionIds);\n\t\tRequest::redirect(null, null, 'statistics', null, array('statisticsYear' => Request::getUserVar('statisticsYear')));\n\t}", "public function mockupRiskScreening()\n {\n $f = Questionaire::with('questions.choices.subchoices')\n ->find(env('APP_RISK_ID'));\n\n $participants = Participant::all();\n $i = 0;\n $c = count($participants);\n foreach ($participants as $p) {\n $this->createAnswers($f, $p);\n\n // Points doesn't really matter alot in risk form\n $this->createResults($f, $p, 999); \n\n echo \"risk results & answers \".($i+1).\"/\".$c.\" created\\r\";\n\n $i++;\n }\n }", "function recommends_req_wizard_schools_info_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n $date_due_month = $form_state['values']['schname'][$i]['r_date_due']['month'];\n $date_due_day = $form_state['values']['schname'][$i]['r_date_due']['day'];\n $date_due_year = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \n $d2=mktime(0,0,0,$date_due_month,$date_due_day,$date_due_year);\n $d1=time();\n $days_diff = floor(($d2-$d1)/86400);\n if ($days_diff < 30 ) {\n form_set_error(\"schname][$i][r_date_due\", 'The due date must be at least 30 days from today. Please contact the professor to discuss exceptions.');\n }\n\n }\n}", "function sondMHA(){\n $_SESSION['connect'] == true;\n return $allSondageMHA = $this->query(\" SELECT question_id, `question`, `image_question`, `date_fin`, `point` FROM `sondage_question` WHERE `type` = 1 AND date_fin >= NOW() ORDER BY date_fin ASC\");\n }", "function ensure_log()\r\n\t{\r\n\t\tglobal $wpdb;\r\n\t\t// Create table if it doesn't exist, log the hit, delete outdated hits\r\n\t\t$sql = \"create table if not exists `$wpdb->three_strikes` (\" .\r\n\t\t\t\t\"`strike_id` bigint(20) not null auto_increment, \" .\r\n\t\t\t\t\"`strike_ip` varchar(50) not null default '', \" .\r\n\t\t\t\t\"`strike_time` datetime not null default '0000-00-00 00:00:00', \" .\r\n\t\t\t\t\"`source` varchar(100) not null default '', \" .\r\n\t\t\t\t\"`message` varchar(100) not null default '', \" .\r\n\t\t\t\t\"PRIMARY KEY(`strike_id`))\";\r\n\t\t$wpdb->query($sql);\r\n\t}" ]
[ "0.6082249", "0.5182344", "0.5026466", "0.4939968", "0.48449332", "0.4841538", "0.48369083", "0.48230287", "0.4797174", "0.4795118", "0.47714025", "0.47653452", "0.47515208", "0.47300866", "0.47232798", "0.47156665", "0.47121125", "0.47025135", "0.46956047", "0.4688611", "0.46875444", "0.46824765", "0.46653834", "0.46627983", "0.46546257", "0.46507543", "0.4649086", "0.46475685", "0.4647282", "0.46462452", "0.46426567", "0.4626942", "0.46253386", "0.46188325", "0.4617498", "0.4612228", "0.46083808", "0.45987478", "0.4598059", "0.45956767", "0.4584975", "0.45755133", "0.45700988", "0.45647857", "0.45647857", "0.45608717", "0.45515957", "0.45370376", "0.45304257", "0.45234954", "0.4507721", "0.4498897", "0.44982904", "0.44956768", "0.44933793", "0.44883916", "0.44872898", "0.44848657", "0.4479203", "0.44789308", "0.44771934", "0.44765642", "0.44723502", "0.44719517", "0.4468145", "0.4464113", "0.4461122", "0.44598594", "0.44579887", "0.4457681", "0.44561002", "0.44523725", "0.4444128", "0.4442864", "0.44397402", "0.4434894", "0.44323474", "0.44318557", "0.4430665", "0.4429948", "0.44292176", "0.4428495", "0.44268605", "0.44249618", "0.44212157", "0.44205248", "0.44192934", "0.44145143", "0.44119427", "0.44094473", "0.44049206", "0.44020817", "0.4400041", "0.4399252", "0.43960008", "0.43958697", "0.43957216", "0.43943", "0.4391752", "0.43909127" ]
0.7929138
0
this method allows user to get sick history, or sick for each day date is optional field for this request
public function getSickAction(){ /** @var Object_User $user */ $data = $this->getRequestData(); $user = Object_User::getById($this->getDeviceSession()->getUserId()); $sickArr = $user->getSick_history(); if(isset($sickArr[0])){ unset($sickArr[0]); } if(isset($data['date'])){ foreach($sickArr as $sick){ if($sick[0] == $data['date']){ $this->_helper->json($sick); } else { $this->setErrorResponse('No sick for this day!'); } } } $this->_helper->json($sickArr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reportSickAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n if(isset($data['history']) && isset($data['already_sick'])){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $sickArr = $user->getSick_history()?$user->getSick_history():array(array('Date', 'Sick history', 'Sick status'));\n $sick = array();\n $sick[] = date('Y-m-d');\n $sick[] = $data['history'];\n $sick[] = $data['already_sick'];\n $sickArr[] = $sick;\n $user->setSick_history($sickArr);\n $user->setAlready_sick($data['already_sick']);\n if(!$user->save()){\n $this->setErrorResponse('Cannot update User object');\n }\n } else {\n $this->setErrorResponse('Please, report your sick history. history and already_sick is mandatory fields!');\n }\n\n $this->_helper->json(array('added' => true));\n }", "public function getHistory()\n {\n \treturn QuizResult::where('user_id', '=', Auth::user()->id)->orderBy('id', 'DESC')->limit(5)->get();\n }", "public function get_user_history(){\n \t$s = \"SELECT * FROM user_history WHERE username = ? group by ETF order by Date ASC\";\n \tif($stmt = $this->connection->prepare($s)){\n \t\t$stmt->bind_param(\"s\", $_SESSION['username']);\n \t\t$stmt->execute();\n \t\t$res = $stmt->get_result();\n \t\twhile($row = $res->fetch_object()){\n \t\t\t$history[] = $row;\n \t\t}\n \t\treturn $history;\n \t}\n \t \t\n }", "public function viewHistory() {\n $historyRows = $this->db->query(\"SELECT * FROM history\");\n if (!$historyRows) die(\"Fatal Error.\");\n\n // Looping through all rows in the histoy table.\n $history = [];\n foreach($historyRows as $historyRow) {\n $regNr = htmlspecialchars($historyRow[\"regNr\"]);\n $ssNr = htmlspecialchars($historyRow[\"ssNr\"]);\n $checkOut = htmlspecialchars($historyRow[\"checkOutTime\"]);\n $checkIn = htmlspecialchars($historyRow[\"checkInTime\"]);\n $days = htmlspecialchars($historyRow[\"days\"]);\n $cost = htmlspecialchars($historyRow[\"cost\"]);\n\n // Setting 0 as default value on days and cost if car not checked in yet.\n if (!$checkIn) {\n $checkIn = \"Checked Out\";\n $days = 0;\n $cost = 0;\n }\n \n $histor = [\"regNr\" => $regNr,\n \"ssNr\" => $ssNr, \n \"checkOut\" => $checkOut,\n \"checkIn\" => $checkIn, \n \"days\" => $days,\n \"cost\" => $cost,\n \"days\" => $days];\n \n $history[] = $histor;\n }\n return $history;\n }", "function srTracker($access) {\n\t\t$sql= \"SELECT `date`, `sr` FROM `match` WHERE `sr`!=0 GROUP BY `date`;\";\n\t\t$data=$access->query($sql);\n\t\twhile ($row=$data->fetch_assoc()) {\n\t\t\techo \"['\" . $row[\"date\"] . \"', \" . $row[\"sr\"] . \"],\";\n\t\t}\n\t}", "private function __dailyHealthIndicator() {\n\t\t\t\t\n\t\t$userTimezone = $this->Auth->user('timezone');\n\t\t\n\t\tif ($this->_requestedUser['id'] != $this->Auth->user('id')) {\n $userId = $this->_requestedUser['id']; \n\t\t} else {\n\t\t\t$userId = $this->Auth->user('id');\t\t\t\n\t\t}\n\t\t //set date as today\n\n $todayInUserTimeZone = CakeTime::convert(time(), new DateTimeZone($userTimezone));\n $date_today = CakeTime::format($todayInUserTimeZone, '%m/%d/%Y');\n\t\t\n $dailyHealthIndicator = array();\n // it contains symptoms with latest_record_value null\n $userSymptoms = $this->UserSymptom->getSymptomIdsWithLatestValue($userId);\n\n /*\n * Fetch symptom details \n */\n foreach ($userSymptoms as $userSymptom) {\n $symptomId = $userSymptom ['UserSymptom'] ['symptom_id']; // symptom id\n $symptomName = $this->Symptom->getSymptomNameFromId($symptomId); // symptom name\n $symptomRecordValueJSON = $userSymptom ['UserSymptom'] ['latest_record_value']; // recorded value\n $symptomSeverityValue = 0;\n $lastUpdatedDate = NULL;\n if (!empty($symptomRecordValueJSON)) {\n $symptomLatestRecordValue = json_decode($symptomRecordValueJSON, TRUE); // Decode the json value\n $userTodayDate = date('Y-m-d', $todayInUserTimeZone);\n $lastUpdatedDateInTime = key($symptomLatestRecordValue);\n\n if (!is_null($lastUpdatedDateInTime)) {\n $symptomSeverityValue = $symptomLatestRecordValue [$lastUpdatedDateInTime];\n $lastUpdatedDate = date('m/d/Y', $lastUpdatedDateInTime);\n }\n// debug($lastUpdatedDate);\n // check todays severity added\n// if ( array_key_exists ( strtotime ( $userTodayDate ) , $symptomLatestRecordValue )) {\n// $symptomSeverityValue = $symptomLatestRecordValue[ strtotime ( $userTodayDate ) ];\n// }\n// foreach ($symptomRecordValue as $key => $value) {\n// //$record_date = date('Y-m-d', $key);\n// //debug($symptomName.\" \".date('Y-m-d H:i:s', $key) . \" \". strtotime($userTodayDate));\n// //check if there is record for user's today\n// if ($record_date == $userTodayDate) { //debug($key. \" \".strtotime($userTodayDate)); // debug($record_date. \" \".$userTodayDate); \n// //fetch todays reading\n// $symptomSeverityValue = $symptomRecordValue [$key];\n// }\n//// else {\n////\t\t\t\t\t$symptomSeverityValue = 0;\n////\t\t\t\t}\n// }\n }\n\n switch ($symptomSeverityValue) {\n case 1: $symptomSeverity = 'None';\n break;\n case 2: $symptomSeverity = 'Mild';\n break;\n case 3: $symptomSeverity = 'Moderate';\n break;\n case 4: $symptomSeverity = 'Severe';\n break;\n default:$symptomSeverity = 'No Data';\n }\n /*\n * save details to an array\n */\n $dailyHealthIndicator[] = array('id' => $symptomId, 'name' => $symptomName,\n 'severity' => $symptomSeverity, 'lastUpdated' => $lastUpdatedDate);\n }\n\t\t\n\t\treturn $dailyHealthIndicator; \n\n\t}", "public function excelMedicineRestockingHistory(Request $request)\n {\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n return $this->report->excelMedicineRestockingHistory($request); \n }", "function nex_day_stats()\n{\n\t\t\tdate_default_timezone_set(\"GMT\");// gmt as defult\n\t\t\t$today = date('Y-m-d');// simply get time in gmt \n\t\t\t\n\t\t\t$query=$this->db->get('person');\n\t\t\t\t\n\t\t\t\tforeach($query-> result() as $row):\n\t\t\t\t\t \n\t\t\t\t\t $id=$row->id;\n\t\t\t\t\t\t// testing if the date exist already before just to provide more security \n\t\t\t\t\t\t$testexist=$this->db->get_where('stats',array('personid' => $id, 'date' => $today));\n\t\t\t\t\t \n\t\t\t\t\t if(!$testexist->result())\n\t\t\t\t\t {\n\t\t\t\t\t $array = array(\n\t\t\t\t\t\t\t 'personid' => $id,\n\t\t\t\t\t\t\t 'inlike' => 0, \n\t\t\t\t\t\t\t 'outlike' => 0, \n\t\t\t\t\t\t\t 'inhate' => 0, \n\t\t\t\t\t\t\t 'outhate' => 0, \n\t\t\t\t\t\t\t 'date' =>$today // insert gmt time in table\n\t\t\t\t\t\t\t );\t\n\t\t\t\t\t $this->db->set($array);\t\t \n\t\t\t\t\t $this->db->insert('stats'); \n\t\t\t\t\t } \n\t\t\telse { \n\t\t\techo \"this person:\" .$row->name.\" ID:\".$row->id.\" already has an entry in stat table for today:\".$today.'<br><br>' ; \n\t\t\t}\n\t\t\t\tendforeach;\n\t\t\t\t$this->db->limit(1);\n\t\t\t\t$this->db->set('today',$today);\n\t\t\t\t$this->db->update('site');\n}", "function getHistory() {\n\t\treturn db_query_params ('SELECT * FROM artifact_history_user_vw WHERE artifact_id=$1 ORDER BY entrydate DESC, id ASC',\n\t\t\t\t\tarray ($this->getID())) ;\n\t}", "public function fetchHistory(): array;", "public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }", "public function getPatientHistory(Request $request)\n { \n if($request->number){\n // Get particular patient's medical history\n $categorizedArray = array();\n $patientHistory = Prescription::where('patient_id', $request->patient_id)->orderBy('date', 'desc')->get()->groupBy('date');\n foreach ($patientHistory as $oneDay) {\n array_push($categorizedArray, $oneDay);\n }\n \n // Get relevant panel number using session id of logged doctor\n $panel = DoctorSession::where('session', Session::getId())->get()->first()->panel;\n // dd($panel);\n \n // Update queue_summary table \n DB::table('queue_summary')->where('status', 1)->update(['current'=> $request->number, $panel=> $request->number]);\n \n // Get current number of overall progress\n $currentNumber = QueueSummary::where('status', 1)->select('current')->get()->first();\n \n event(new NumberCalled($currentNumber->current+1, $panel)); // update each doctor next number using pusher\n \n return ['patient_history'=>$categorizedArray, 'next_number'=> $currentNumber->current+1];\n }else{\n $categorizedArray = array();\n $patientHistory = Prescription::where('patient_id', $request->patient_id)->orderBy('date', 'desc')->get()->groupBy('date');\n foreach ($patientHistory as $oneDay) {\n array_push($categorizedArray, $oneDay);\n }\n // return $categorizedArray;\n dd($request->patient_id);\n }\n }", "public function action_index()\n{\n $history = Jelly::select( 'user_history' )\n ->where(':primary_key', '=', $this->user->id)\n ->limit( 25 )\n ->execute();\n\n $this->template->content = View::factory('history/index')\n ->set('history', $history);\n\n}", "public function getMedicineRestockingHistory(Request $request){\n\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n $data['histories'] = $this->medicine_inventory->getMedicineInventory($request);\n $data['sort'] = 'desc';\n \n return view('hact.reports.medicine.history', $data);\n }", "public function getHistory()\n {\n return Wrapper\\Player\\Senior::history($this->getId());\n }", "public function index()\n {\n $userId = auth()->user()->id;\n $donations = Histories::where('user_id','=',$userId)->where('activity_id','=',Lookup::DONATE)->get();\n $takes = Histories::where('user_id','=',$userId)->where('activity_id','=',Lookup::REQUEST)->get();\n\n return view('users.history',compact('donations','takes'));\n\n }", "function sondMHA(){\n $_SESSION['connect'] == true;\n return $allSondageMHA = $this->query(\" SELECT question_id, `question`, `image_question`, `date_fin`, `point` FROM `sondage_question` WHERE `type` = 1 AND date_fin >= NOW() ORDER BY date_fin ASC\");\n }", "public function index()\n {\n\n $last_request = auth()->user()\n ->requesthistories()\n ->where('request_type', 'index_business')\n ->orderBy('created_at', 'desc')\n ->first();\n \n\n if($last_request){\n $businesses = auth()->user()->businesses()->where('created_at','>',$last_request->created_at)->orWhere('updated_at','>',$last_request->created_at);\n\n }else{\n $businesses = auth()->user()->businesses; \n }\n\n $last_request = new RequestHistory(); \n $last_request->user_id = auth()->user()->id; \n $last_request->request_type = 'index_business'; \n $last_request->created_at = carbon::now(); \n $last_request->save(); \n\n\n $businesses = auth()->user()->businesses;\n \n return response()->json($businesses);\n }", "function get_usersaleshistoryinvoicedate($limit = 10, $page = 1, $sortrule, $filter = false, $filterable = false, $loginID = '', $useclass = false, $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$q = (new QueryBuilder())->table('saleshist');\n\t\t$q->field('saleshist.*');\n\t\t$q->field($q->expr(\"STR_TO_DATE(invoice_date, '%Y%m%d') as dateofinvoice\"));\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep']) {\n\t\t\t$q->where('salesperson_1', DplusWire::wire('user')->salespersonid);\n\t\t}\n\t\tif (!empty($filter)) {\n\t\t\t$q->generate_filters($filter, $filterable);\n\t\t}\n\t\t$q->order('dateofinvoice ' . $sortrule);\n\t\t$q->limit($limit, $q->generate_offset($page, $limit));\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\tif ($useclass) {\n\t\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'SalesOrderHistory');\n\t\t\t\treturn $sql->fetchAll();\n\t\t\t}\n\t\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t}", "function history() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($id, $auth)) {\n $this->response('', 400);\n }\n\n if ($id > 0) {\n $query = \"select * from videos where id in (select video_id from history where user_id=$id group by video_id order by view_date desc);\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }", "private function getAllNotifHistoryByPage() {\n $this->user_panel->checkAuthAdmin();\n $this->notif_history->findAllByPage();\n }", "public function watchAction() {\n\t\t$dbseries = new Application_Model_DbTable_Series();\n\t\t$this->view->series = $dbseries->getNotMySeries($this->userid);\n\t}", "function woolman_upcoming_semesters($n = 0) {\n return woolman_get_civi_options(80, array('where' => 'is_active = 1 AND DATE(SUBSTR(value, 1, 10)) > CURDATE()', 'order' => 'value', 'limit' => $n));\n}", "public function getHistories($user_id = null ,$fromDate = null ,$toDate = null,$params = array())\n {\n \n $condition = array();\n $condition =\" 1=1 \";\n if ($user_id != null)\n {\n $condition .= \" AND his.user_id = \".$user_id;\n }\n if ($fromDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$fromDate.\"')>=0\";\n }\n if ($toDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$toDate.\"')<=0\";\n }\n foreach($params as $key=>$value)\n {\n if ( $key != 'limit' && $key!='group_by')\n $condition .= $value;\n }\n if(!isset($params['limit']))\n $params['limit'] = 50;\n $count = 0;\n if(!isset($params['group_by']))\n {\n $count = 0;\n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d')\")\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') DESC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n else\n {\n $count = 0; \n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group($params['group_by'])\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') ASC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n \n }", "public function actionHistory()\n {\n $model= User::findOne(['id' => Yii::$app->user->identity->getId()]);\n $orders = Order::find()->where(['id_user' => $model->id])->with('orderProds')->orderBy('date DESC')->all();\n return $this->render('history', [\n 'model' => $model,\n 'orders' => $orders,\n 'page' => SmapPages::find()->where(['id_class'=>4,'alias' => 'history'])->one()\n ]);\n }", "function medicalHistory()\n{\n\t $token = $this->input->post('token');\n \n\n if (empty($token)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Token is empty';\n echo json_encode($response);die;\n }\n $checkToken = $this->user_model->getCondResultArray(USER,'id',array('token'=>$token));\n if($checkToken)\n {\n \t //hospital\n\t\t $hostpital = $this->user_model->getCondResultArray('user_hospital_records','id,hospital_name,provider_name,provider_specility,service_date,type',array('user_id'=>$checkToken[0]['id']));\n\n\t\t \n\t\t \n //print_r($hos_img);die;\n\t\t \n if(!empty($hostpital))\n {\n\n\n\t\t \n\n\t\t \n foreach($hostpital as $hos)\n {\n \t\n $hos_img = $this->user_model->getCondResult('medical_record_image','image',array('record_id'=>$hos['id'],'type'=>'hospital'));\n\n if(empty($hos_img))\n\t\t \t $hos_img = array();\n\n \t $HospitalArr[] = array(\n\t\t \t 'id' => $hos['id'],\n\t\t \t 'hospital_name' => $hos['hospital_name'],\n\t\t \t 'provider_name' => $hos['provider_name'],\n\t\t \t 'provider_specility' => $hos['provider_specility'],\n\t\t \t 'service_date' => $hos['service_date'],\n\t\t \t 'type' => $hos['type'],\n\t\t \t 'images' => $hos_img,\n\n\t\t );\n }\n }else\n {\n \t$HospitalArr = array();\n }\n\t\t \n\t\t \n\t\t // $HospitalArr = array_merge($hostpital,$img);\n\n\t\t //end hospital\n //specialty\n\t\t $specialty = $this->user_model->getCondResultArray('user_specialty_records','id,specialty,specialty_type,service_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\t\t if(!empty($specialty))\n\t\t \t{\n\n\t\t \n\t\t foreach($specialty as $spe)\n\t\t {\n\t\t \t $spe_img = $this->user_model->getCondResult('medical_record_image','image',array('record_id'=>$spe['id'],'type'=>'specialty'));\n\t\t \t if(empty($spe_img))\n\t\t \t$spe_img = array();\n\t\t \t $SpecialtyArr[] = array(\n 'id' => $spe['id'],\n 'specialty' => $spe['specialty'],\n 'specialty_type' => $spe['specialty_type'],\n 'service_date' => $spe['service_date'],\n 'type' => $spe['type'],\n 'images' => $spe_img,\n\t\t );\n\t\t }\n\n\t\t }else\n\t\t {\n\t\t \t$SpecialtyArr = array();\n\t\t }\n\t\t \n\t\t //end specialty\n\n\t\t //lab \n\t\t $lab = $this->user_model->getCondResultArray('user_lab_records','id,lab_name,prescription_name,lab_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t if(!empty($lab))\n\t\t {\n\t\t \t\n\t\t \n\t\t \n\t\t \n\t\t \n foreach($lab as $lb)\n\t\t {\n\t\t \t$lab_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$lb['id'],'type'=>'lab'));\n\n\t\t \tif(empty($lab_img))\n\t\t \t $lab_img = array();\n\n\t\t \t $LabArr[] = array(\n 'id' => $lb['id'],\n 'lab_name' => $lb['lab_name'],\n 'prescription_name' => $lb['prescription_name'],\n 'lab_date' => $lb['lab_date'],\n 'type' => $lb['type'],\n 'images' => $lab_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n $LabArr =array();\n\t\t }\n\t\t //end lab\n\n\t\t //physical\n\n\t\t $physical = $this->user_model->getCondResultArray('user_physical_therapist_records','id,therapy_name,therapy_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\t\t if(!empty($physical))\n\t\t {\n\t\t \t\n\n\t\t \n\t\t foreach($physical as $py)\n\t\t {\n\t\t \t $phy_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$py['id'],'type'=>'physical'));\n\n\t\t \t if(empty($phy_img))\n\t\t \t $phy_img = array();\n\n\n\t\t \t $PhyArr[] = array(\n 'id' => $py['id'],\n 'therapy_name' => $py['therapy_name'],\n 'therapy_date' => $py['therapy_date'],\n 'type' => $py['type'],\n 'images' => $phy_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n\t\t \t$PhyArr = array();\n\t\t }\n\n\t\t //end physical\n //other\n\t\t $other = $this->user_model->getCondResultArray('user_other_records','id,description,date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\t\t if(!empty($other))\n\t\t {\n\n \n\t\t foreach($other as $othr)\n\t\t {\n\n\t\t \t $other_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$othr['id'],'type'=>'other'));\n\t\t \t if(empty($other_img))\n\t\t \t $other_img = array();\n\t\t \t $OtherArr[] = array(\n 'id' => $othr['id'],\n 'description' => $othr['description'],\n 'date' => $othr['date'],\n 'type' => $othr['type'],\n 'images' => $other_img,\n\t\t );\n\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t \t$OtherArr =array();\n\t\t }\n\n\t\t //end other\n\n\t\t $pharmacy = $this->user_model->getCondResultArray('user_pharmacy_script','id,pharmacy_name,pharmacy_provider_name,service_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\n\t\t if(!empty($pharmacy))\n\t\t {\n\t\t \t\n\n\t\t \tforeach($pharmacy as $ph)\n\t\t {\n\t\t \t $ph_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$ph['id'],'type'=>'pharmacy'));\n\n\t\t \t if(empty($ph_img))\n\t\t \t $ph_img = array();\n\n\t\t $PharmacyArr[] = array(\n\t\t 'id' => $ph['id'],\n\t\t 'pharmacy_name' => $ph['pharmacy_name'],\n\t\t 'pharmacy_provider_name' => $ph['pharmacy_provider_name'],\n\t\t 'service_date' => $ph['service_date'],\n\t\t 'type' => $ph['type'],\n\t\t 'images' => $ph_img,\n\t\t\t\t );\n\t\t\t }\n\n\t\t \t}\n\n\t\t else\n\t\t {\n\t\t \t$PharmacyArr =array();\n\t\t }\n \n \t\t$response = [ 'status' => \"SUCCESS\",'message'=>'medical detail seen successfully.','hospitalDetail' => $HospitalArr,'specialtyDetail'=>$SpecialtyArr,'labDetail'=>$LabArr,'physicalDetails'=>$PhyArr,'otherDetail'=>$OtherArr,'pharmacyDetail'=>$PharmacyArr];\n \t\t\techo json_encode($response);die;\n//\n}else\n{\n\t \t $response['status'] = \"FAILURE\";\n $response['message'] = 'token mismatch ...Please logOut.';\n echo json_encode($response);\n}\n\n}", "public function cmn_history()\r\n\t{\r\n $content = $this->input->get(\"content\") ? trim($this->input->get(\"content\", TRUE)) : \"\";\r\n $start = $this->input->get(\"start\") ? trim($this->input->get(\"start\", TRUE)) : \"\";\r\n $end = $this->input->get(\"end\") ? trim($this->input->get(\"end\", TRUE)) : \"\";\r\n $date_arr = \"\";\r\n if (! empty($start) || ! empty($end))\r\n {\r\n $this->load->helper(\"common\");\r\n $date_arr = make_date_start_before_end($start, $end);\r\n }\r\n\r\n\t\t$limit = $this->_get_limit();\r\n\t\t$history = $this->model->get_cmn_history($limit, $content, $date_arr);\r\n\r\n\t\tif ( empty($history))\r\n\t\t\t$this->meret(NULL, MERET_EMPTY);\r\n\t\telse\r\n\t\t\t$this->meret($history);\r\n\t}", "public function historyable()\n {\n return $this->morphTo('histories', 'histories_type', 'histories_id')->orderBy('date');\n }", "private function getHistory()\n {\n $history = [];\n\n foreach ($this->getResponse()->data as $k => $v) {\n $history[$k]['tanggal'] = Utils::setDate($v->Tanggal);\n\n switch ($v->StatusInternal) {\n case 'Baru':\n $history[$k]['posisi'] = preg_replace('/Diterima di Sales Counter (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Manifest Pickup':\n $posisi = preg_replace('/Di pickup oleh petugas (.*)/', '$1', $v->TrackStatusNama);\n $history[$k]['posisi'] = $posisi;\n $this->kotaPengirim = strtoupper($posisi);\n break;\n\n case 'Serah Terima Pickup':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Moda Angkutan':\n $history[$k]['posisi'] = preg_replace('/Pengiriman dari (.*) ke (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Serah Terima Surat Muatan':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Serah Terima Manifest':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Surat Jalan Kurir':\n $history[$k]['posisi'] = preg_replace('/Proses pengantaran oleh kurir (.*), (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Terkirim/Diterima':\n $history[$k]['posisi'] = 'Diterima';\n $this->tanggalTerima = $v->Tanggal;\n $this->namaPenerima = preg_replace('/Diterima oleh (.*)\\((.*)/', '$1', $v->TrackStatusNama);\n break;\n\n default:\n $history[$k]['posisi'] = null;\n break;\n }\n\n $history[$k]['message'] = $v->TrackStatusNama;\n }\n\n return $history;\n }", "public function GetSavenDate(Request $request)\n {\n\n $current = Carbon::now();\n $day = array();\n\n for ($i = 0; $i < 7; $i++) {\n\n $day[$i][\"Date\"] = Carbon::now()->addDays($i)->format('D');\n $day[$i][\"name_Day\"] = Carbon::now()->addDays($i);\n }\n\n\n $message = \"show specified info date\";\n return $this->Data('Data', [\n \"day\" => $day,\n \"lang\" => $this->lang(),\n\n ], $message, 200);\n }", "public function actionStorerecords()\n\t{\n\t\t$charts = $this->parsehtml();\n\t\t$today = date(\"Y-m-d\"); \n\t\t\n\t\t// if we haven't store todays charts. We store charts for each day\n\t\tif(Dates::find()->where(['date' => $today])->one() == NULL)\n\t\t{\n\t\t\t$date = new Dates();\n\t\t\t$date->date = $today;\n\t\t\t$date->save();\n\t\t\n\t\t\tforeach ($charts as $m) \n\t\t\t{\n\t\t\t\t\n\t\t\t\t$movie = Movies::find()->where(['title' => $m['title']])->one();\n\t\t\t\t// if the movie does not exist in the \"movies\" table then save it\n\t\t\t\tif($movie == NULL)\n\t\t\t\t{\t\n\t\t\t\t\t$movie = new Movies();\n\t\t\t\t\t$movie->title = $m['title'];\n\t\t\t\t\t$movie->save();\n\t\t\t\t}\n\n\t\t\t\t$date_movie = new DatesMovies();\n\t\t\t\t$date_movie->date_id = $date->id;\n\t\t\t\t$date_movie->movie_id = $movie->id;\n\t\t\t\t$date_movie->rank = $m['rank'];\n\t\t\t\t$date_movie->was = $m['was'];\n\t\t\t\t$date_movie->save();\n\t\t\t}\n\t\t}\n\t}", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getCareerHistory(Request $request)\n {\n $managerProfile = null;\n try\n {\n $managerProfile = ManagerProfile::getManagerProfile(Session::get(SiteSessions::USER_ID));\n }\n catch(ModelNotFoundException $e)\n {\n $this->updateRequestStatus(RequestStatusEnum::MODEL_NOT_FOUND);\n return $this->sendResponse();\n }\n $managerCareerHistory = ManagerCareerHistory::getCareerHistoryAndAchievements($managerProfile->profile_id);\n return $this->sendResponse([\"careerHistory\"=>$managerCareerHistory]);\n }", "function history($jenis, $show = ''){\n\t\t/*set parameter */\n\t\t$jenis = $this->security->xss_clean($this->uri->segment(5));\n\t\t$show = $this->security->xss_clean($this->uri->segment(6));\n\t\t$data = array(\n\t\t\t'kode' => $jenis,\n\t\t\t'thn' => $this->input->post(\"thn\"),\n\t\t\t'smt' => $this->input->post(\"smt\")\n\t\t);\n\t\t\n\t\t# set new session \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t!important\n\t\t// $this->session->unset_userdata('ta');\n\t\t// $this->session->set_userdata('ta', $data['thn']);\n\t\t// $this->session->unset_userdata('smt');\n\t\t// $this->session->set_userdata('smt', $data['smt']);\n\n\t\t$this->session->set_userdata('ta_bk', $data['thn']);\n\t\t$this->session->set_userdata('smt_bk', $data['smt']);\n\t\t\t\n\t\t$kd_ta = $this->setting->_generate_kd_ta($this->session->userdata('ta_bk'));\n\t\t$kd_smt = $this->setting->_generate_kd_smt($this->session->userdata('smt_bk'));\n\t\t\n\t\t$kd = $this->session->userdata(\"kd_dosen\");\n\t\t$status = $this->session->userdata(\"jenis_dosen\");\n\t\t\n\t\t$data['is_crud'] = $this->setting->_is_crud_bkd_lalu($kd_ta, $kd_smt);\n\t\t#echo $data['is_crud'];\n\t\tif($data['is_crud'] == true){\n\t\t\t$data['tombol'] = 'style=\"display:block\"';\n\t\t}else{\n\t\t\t$data['tombol'] = 'style=\"display:none\"';\n\t\t}\n\t\t\n\t\tif($data['kode'] == 'D' && ($status == 'PR' || $status == 'DS')){\n\t\t\t# load view\n\t\t\t$this->output99=$this->s00_lib_output;\n\t\t\t$this->output99->output_display('dosen/beban_tambahan_message');\n\t\t}\n\t\telse{\t\t\t\n\t\t\t$api_url \t= URL_API_BKD.'bkd_beban_kerja/data_bebankerja';\n\t\t\t$parameter = array('api_search' => array($data['kode'], $kd, $data['thn'], $data['smt']));\n\t\t\t$data['data_beban'] = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\n\t\t\tif ($show == true){\n\t\t\t\t$this->output99->output_display('dosen/history_data',$data);\n\t\t\t}else{\n\t\t\t\t$this->output99->output_display('dosen/form_history',$data);\n\t\t\t}\n\t\t}\n\t}", "public function taskhistory(){\n\n // SQL statement\n $sql = \"SELECT user_id FROM user WHERE user_name = '\".$_SESSION['user'].\"'\";\n $result = $this->con->query($sql);\n $result = $result->fetch_assoc();\n $id = $result['user_id'];\n\n\n // Get Task History Based on user ID\n\n // SQL statement\n $sql = \"SELECT * FROM approval WHERE user_id = '\".$id.\"' ORDER BY date DESC LIMIT 10\";\n $result = $this->con->query($sql);\n if ($result->num_rows > 0){\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }", "public function getTimesheetRecent(){\n $emp_id = Auth::user()->id;\n $data['response'] = $this->timesheet->getInformRecent($emp_id);\n $data = $this->formatDate($data);\n return $data;\n }", "public function getDistribusiHistory($date)\n {\n $distribusi = PenyimpananDistribusi::whereMonth('created_at', Carbon::now()->format('m'))\n ->whereYear('created_at', Carbon::now()->format('Y'))\n ->get();\n\n \n if($date !== \"\")\n {\n $distribusi = PenyimpananDistribusi::whereMonth('created_at', Carbon::parse($date)->format('m'))\n ->whereYear('created_at', Carbon::parse($date)->format('Y'))\n ->get();\n }\n return $distribusi;\n }", "public function stock_history(){\n\t\treturn $stock_info = $this->db->select('*')\n\t\t ->from('store')\n\t\t ->where('isactive',1)\n\t\t ->get()\n\t\t ->result();\n\t}", "public function canShowHistory() {}", "public function getRequestsHistory()\n {\n /** @var \\App\\User $user */\n $user = auth()->user();\n\n $requestsHistory = RequestsHistory::where('user_id', $user->id)\n ->orderBy('created_at', 'asc')\n ->get();\n\n $result = response()->view('requests-history.history_table',\n ['requestsHistory' => $requestsHistory],\n Response::HTTP_OK\n );\n\n return $result;\n }", "function show_user_history() {\n if (!$this->session->userdata('logged_in')) {\n redirect('logout');\n }\n\n $id = $this->session->userdata('userid');\n $query = $this->db->get_where('tb_app_prev_info', array('app_id' => $id));\n if ($query->num_rows() == 1) {\n foreach ($query->result() as $ro) {\n $value1 = array(\n 'specializ' => $ro->specialization,\n 'high_edu' => $ro->high_edu_attained,\n 'institut' => $ro->institution,\n 'gradu_year' => $ro->year_of_gradu,\n 'gpa' => $ro->gpa,\n 'other_qualification' => $ro->other_qualification,\n 'dof' => $ro->dof,\n 'dot' => $ro->dot,\n 'responsibility' => $ro->nature_of_work,\n 'employer' => $ro->comp_employed,\n 'release' => $ro->comp_release_agre,\n 'position' => $ro->position\n );\n }\n unset($ro);\n return $value1;\n } else {\n $value1 = array(\n 'specializ' => '',\n 'high_edu' => '',\n 'institut' => '',\n 'gradu_year' => '',\n 'gpa' => '',\n 'other_qualification' => '',\n 'dof' => '',\n 'dot' => '',\n 'responsibility' => '',\n 'employer' => '',\n 'release' => '',\n 'position' => ''\n );\n return $value1;\n }\n }", "public function history()\n {\n $data['title'] = 'Cuci Sepatu | Kang Cuci';\n $data['user'] = $this->workerModel->datauser();\n\n $this->load->view('worker/worker_header', $data);\n $this->load->view('worker/panel/sepatu', $data);\n $this->load->view('worker/worker_footer');\n }", "function get_history($id)\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering get_history(\".$id.\") method ...\");\n\t\t$userNameSql = getSqlForNameInDisplayFormat(array('first_name'=>\n\t\t\t\t\t\t\t'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');\n\t\t$query = \"SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status\n\t\t\t, vtiger_activity.eventstatus,vtiger_activity.activitytype, vtiger_activity.date_start,\n\t\t\tvtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.time_end,\n\t\t\tvtiger_contactdetails.contactid, vtiger_contactdetails.firstname,\n\t\t\tvtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime,\n\t\t\tvtiger_crmentity.createdtime, vtiger_crmentity.description,vtiger_crmentity.crmid,\n\t\t\tcase when (vtiger_users.user_name not like '') then $userNameSql else vtiger_groups.groupname end as user_name\n\t\t\t\tfrom vtiger_activity\n\t\t\t\tinner join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid\n\t\t\t\tinner join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid\n\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid\n\t\t\t\tleft join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid\n left join vtiger_groups on vtiger_groups.groupid=vtiger_crmentity.smownerid\n\t\t\t\tleft join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\twhere (vtiger_activity.activitytype != 'Emails')\n\t\t\t\tand (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != ''))\n\t\t\t\tand vtiger_cntactivityrel.contactid=\".$id.\"\n and vtiger_crmentity.deleted = 0\";\n\t\t//Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php\n\t\t$log->debug(\"Entering get_history method ...\");\n\t\treturn getHistory('Contacts',$query,$id);\n\t}", "public function userHistory() {\n\t\t[ $response, $error ] = $this->api('user/history');\n\n\t\tif($error) return $this->response($response, $error);\n\n\t\treturn $this->response($response['links']);\n\t}", "function get_request_history($request_id,$logtype=NULL)\n\t{\n\t\t$this->db->select(\"lic_requests_history.*,meta.first_name,meta.last_name\");\n\t\t$this->db->join(\"users\",\"lic_requests_history.user_id=users.email\",\"inner\");\n\t\t$this->db->join(\"meta\",\"meta.user_id=users.id\",\"inner\");\n\t\t$this->db->where('lic_req_id',$request_id);\n\t\tif ($logtype!=NULL)\n\t\t{\n\t\t\t$this->db->where('logtype',$logtype);\n\t\t}\n\t\t$this->db->order_by('created','DESC');\n\t\treturn $this->db->get('lic_requests_history')->result_array();\n\t}", "static function dailyrecord()\n {\n \t\n \t$all_game_ids = Game::listAllGameIds();\n \t\n \t$cur = time();\n\t\t$dt = strftime('%Y-%m-%d', $cur);\n\t\t//当天0:0:0的总秒数\n\t\t$today = strtotime($dt);\t\t\n\t\t//一周\n\t\t$dayago = $today - 3600*24;\n\t\t$cachestr = date('Y-m-d', $dayago);\n \t\n \tforeach ($all_game_ids as $agi) {\n \t\t \n \t\tif(!Game_stat::staticGet('game_id',$agi)) {\n // \t\t\techo $agi.\"\\n\";\n \t\t\t$newrecord = new Game_stat();\n//\t\t\t\t$newrecord->game_id = $agi;\n//\t\t\t\techo $newrecord->game_id.\"aa \\n\";\n//\t\t\t\t$newrecord->video_num = 0;\n//\t\t\t\t$newrecord->music_num = 0;\n//\t\t\t\t$newrecord->pic_num = 0;\n//\t\t\t\t$newrecord->text_num = 0;\n//\t\t\t\t$newrecord->user_num = 0;\n//\t\t\t\t$result = $newrecord->insert();\n\t\t\t\t//insert()存在问题,会产生game_stat_seq表,而且插入的数据不正确。\n\t\t\t\t$query = \"INSERT INTO game_stat(`game_id`, `video_num`, `music_num`, `pic_num`, `text_num`, `user_num`) values(\" .$agi. \",0,0,0,0,0)\";\n//\t\t\t\techo $query;\n\t\t\t\t$result = $newrecord -> query($query);\n//\t\t if (!$result) {\n//\t\t common_log_db_error($newrecord, 'INSERT', __FILE__);\n//\t\t return false;\n//\t\t }\n \t\t}\n \t\t$game_stat = Game_stat::staticGet('game_id', $agi);\n \t\tif ($game_stat && !Game_stat_history::stathisGetbyidtime($agi,$cachestr)) {\n \t\t\t$hisrecord = new Game_stat_history();\n\t\t\t\t$hisrecord->game_id = $agi;\n\t\t\t\t$hisrecord->video_num = $game_stat->video_num;\n\t\t\t\t$hisrecord->music_num = $game_stat->music_num;\n\t\t\t\t$hisrecord->pic_num = $game_stat->pic_num;\n\t\t\t\t$hisrecord->text_num = $game_stat->text_num;\n\t\t\t\t$hisrecord->user_num = $game_stat->user_num;\n\t\t\t\t$hisrecord->his_date = $cachestr;\n\t\t\t\t$result = $hisrecord->insert();\n\t\t if (!$result) {\n\t\t common_log_db_error($hisrecord, 'INSERT', __FILE__);\n\t\t return false;\n\t\t }\n \t\t\n\t \t\t$game_stat->user_num = User::getUsernumbyGame($agi);\n\t \t\t$game_stat->video_num = Notice::getNoticenumbyGameandctype(3 ,$agi);\n\t \t\t$game_stat->music_num = Notice::getNoticenumbyGameandctype(2 ,$agi);\n\t \t\t$game_stat->pic_num = Notice::getNoticenumbyGameandctype(4 ,$agi);\n\t \t\t$game_stat->text_num = Notice::getNoticenumbyGameandctype(1 ,$agi);\n\t \t\t$game_stat->update();\n\t \t\t\n\t \t\t\n \t\t}\n \t\t\n \t\tif ($game_stat) {\n \t\t\t$game = Game::staticGet('id', $agi);\n\t \t\t$gameorig = clone($game);\n\t \t\t$game->gamers_num = $game_stat->user_num;\n\t \t\t$game->notice_num = $game_stat->video_num + $game_stat->music_num + $game_stat->pic_num + $game_stat->text_num;\n\t \t\t$game->update($gameorig);\n \t\t}\n \t}\n \t\n \t \t\n }", "public function show(Sick $sick)\n {\n //\n }", "public function clienthistoryAction()\n {\n // If no client ID was provided, bail out.\n if (!$this->_hasParam('id')) {\n throw new UnexpectedValueException('No client ID parameter provided');\n }\n\n $clientId = $this->_getParam('id');\n\n // Pass current and past client and household history.\n $service = new App_Service_Member();\n\n $this->view->pageTitle = 'View Household History';\n $this->view->client = $service->getClientById($clientId);\n $this->view->householders = $service->getHouseholdersByClientId($clientId);\n $this->view->history = $service->getClientHouseholdHistory($clientId);\n }", "function QueryByGivenDay( $dayDate )\n\t{\n\t\n\t\t//Staff = Query\n\t\t$this->staff = \"\";\t\t\n\t\t$CI =& get_instance(); \t\t\t\t\n\t\t$writeQuery = \"SELECT DISTINCT s.CurrentOwnerEmployeeID, e.Firstname, e.Lastname FROM `Shifts` s JOIN `Employees` e ON s.CurrentOwnerEmployeeID = e.employeeID WHERE `date` = '\".$dayDate.\"' ;\"\t;\t\t\t\t\n\t\t$query = $CI->db->query($writeQuery);\n\t\t$staff = $query->result_array(); \n\t\t\t\t\n\t\tforeach( $staff as $Key => $employee)\n\t\t{\n\t\t\t$thisEmployeeID = $employee[\"CurrentOwnerEmployeeID\"];\t\t\t\n\t\t\t$QueryForShift = \"SELECT s.startTime, s.endTime, s.Position, s.ShiftID FROM `Shifts` s JOIN `Employees` e ON s.CurrentOwnerEmployeeID = e.employeeID WHERE `date` = '\".$dayDate.\"' AND `CurrentOwnerEmployeeID` = '\".$thisEmployeeID.\"' \";\t\t\t\n\t\t\t$query = $CI->db->query($QueryForShift);\t\t\t\n\t\t\t$SHIFTS = $query->result_array(); \n\t\t\t\t\t\t\t\t\n\t\t\tforeach( $SHIFTS as $Shiftkey => $shift\t)\n\t\t\t{\n\t\t\t\t$ST = $shift[\"startTime\"];\n\t\t\t\t$ET = $shift[\"endTime\"];\t\t\t\t\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\tdetermine duration and attach it to shifts.\n\t\t\t\t\ttimes are in hh:mm:ss format\n\t\t\t\t\tduration will be in 1 to 48 halfhours. \n\t\t\t\t\tdetermine the duration given the start and end times.\n\t\t\t\t*/\t\t\t\t\t\n\t\t\t\t\t$starthour = substr($ST, 0, 2);\n\t\t\t\t\t$starthour = $starthour;\n\t\t\t\t\t$halfhour = substr($ST, 3, 1);\n\t\t\t\t\tif ( $halfhour == 3 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$halfhour = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$halfhour = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$ST = ( $starthour * 2 ) + $halfhour;\n\t\t\t\t\t\n\t\t\t\t\t$endhour = substr($ET, 0, 2);\n\t\t\t\t\t$endhour = (int)$endhour;\n\t\t\t\t\t$endhalf = substr($ET, 3, 1);\n\t\t\t\t\tif ( $endhalf == 3)\n\t\t\t\t\t{\n\t\t\t\t\t\t$endhalf = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$endhalf = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$ET = ( $endhour * 2 ) + $endhalf;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t$duration = $ET - $ST;\t\t\t\t\n\t\t\t\t$SHIFTS[$Shiftkey][\"duration\"] = $duration;\n\t\t\t\t\n\t\t\t\t$pos = \"\";\n\t\t\t\t$position = (int)$shift[\"Position\"];\n\t\t\t\t\n\t\t\t\tswitch ($position)\n\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$pos = \"Lifeguard\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t$pos = \"Instructor\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t$pos = \"Headguard\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\t$pos = \"Supervisor\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: \n\t\t\t\t\t\t$pos = \"ERROR\".$position;\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$SHIFTS[$Shiftkey][\"Position\"] = $pos;\t\t\n\t\t\t\t$SHIFTS[$Shiftkey][\"ShiftID\"] = $shift[\"ShiftID\"];\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\t//Place shifts in employee array\n\t\t\t$staff[$Key][\"Shifts\"] = $SHIFTS;\n\t\t\t$staff[$Key][\"TheDate\"] = $dayDate;\n\t\t\t$staff[$Key][\"EmployeeID\"] = $thisEmployeeID;\t\t\t\n\t\t}\t\t\n\t\treturn json_encode( $staff );\n\t}", "private function _request()\n {\n if (!$this->history) {\n $file = 'http://download.finance.yahoo.com/d/quotes.csv?s=' . $this->symbol . '&f=' . $this->_convertStat($this->stat) . '=.csv';\n } elseif (is_array($this->history)) {\n \n //Make sure they aren't trying to use multiple stocks. Unsupported as of 11-5-14.\t\n if (strstr($this->symbol, \"+\")) {\n trigger_error(\"This method is not supported by the Yahoo! Finance API. You cannot select a date range AND multiple stocks.\");\n return;\n }\n \n $this->history['start'] = isset($this->history['start']) ? $this->history['start'] : '1-1-' . (date('Y') - 1);\n $start = explode('-', $this->history['start']); // dd-mm-yyyy\n $a = $start[0] - 1; // Month\n $b = $start[1]; // Day\n $c = $start[2]; // Year\n \n $this->history['end'] = isset($this->history['end']) ? $this->history['end'] : '12-31-' . date('Y');\n $end = explode('-', $this->history['end']); // dd-mm-yyyy\n $d = $end[0] - 1; // Month\n $e = $end[1]; // Day\n $f = $end[2]; // Year\n \n $g = isset($this->history['interval']) ? $this->history['interval'] : 'd'; // d = Daily, w = Weekly, m = Monthly\n \n $file = 'http://ichart.yahoo.com/table.csv?s=' . $this->symbol . '&a=' . $a . '&b=' . $b . '&c=' . $c . '&d=' . $d . '&e=' . $e . '&f=' . $f . '&g=' . $g . '&ignore=.csv';\n }\n \n $handle = fopen($file, \"r\");\n if (!$this->history) {\n while (($data = fgetcsv($handle, false, \",\")) !== FALSE) {\n $return[] = $data;\n } //Loop through and store each item in an indice\n \n } elseif (is_array($this->history)) {\n $return = array();\n $row = 0;\n while (($data = fgetcsv($handle, false, ',')) !== FALSE) {\n $num = count($data);\n $return[$this->symbol][$row] = array();\n for ($c = 0; $c < $num; $c++) {\n switch ($c) {\n case 0:\n $key = 'date';\n break;\n case 1:\n $key = 'open';\n break;\n case 2:\n $key = 'high';\n break;\n case 3:\n $key = 'low';\n break;\n case 4:\n $key = 'close';\n break;\n case 5:\n $key = 'volume';\n break;\n case 6:\n $key = 'adj_close';\n break;\n }\n $return[$this->symbol][$row][$key] = $data[$c];\n }\n $row++;\n } //end while\n \n }\n \n fclose($handle);\n return $return;\n }", "public function getHistory() {\n $rentalModel = new RentalModel($this->db);\n\n try {\n $rentals = $rentalModel->getAll();\n } catch (\\Exception $e) {\n $properties = ['errorMessage' => 'Error getting rental history.'];\n return $this->render('error.twig', $properties);\n }\n\n $properties = [\"rentals\" => $rentals];\n return $this->render('history.twig', $properties);\n }", "public function testFinderHistory() {\n $MIN_LIFE = 90;\n $MAX_LIFE = 96;\n\n $array = $this->Links->find('history', ['min_life' => $MIN_LIFE , 'max_life' => $MAX_LIFE, 'user_id' => 1])\n ->toArray();\n $this->assertEquals(count($array), 1, 'Exactly 1 links is retrieved by views');\n\n $array = $this->Links->find('history', ['title' => 'I do not exist',\n 'min_life' => $MIN_LIFE ,\n 'max_life' => $MAX_LIFE, 'user_id' => 1])\n ->toArray();\n $this->assertEquals(count($array), 0, 'Test filter on title');\n\n $array = $this->Links->find('history', ['status' => 1,\n 'min_life' => $MIN_LIFE ,\n 'max_life' => $MAX_LIFE, 'user_id' => 1])\n ->toArray();\n $this->assertEquals(count($array), 1, 'Test filter on status');\n }", "public function recentVisits_get()\n {\n $em = $this->doctrine->em;\n $morevisitsRepo = $em->getRepository('Entities\\Service');\n $morevisits = $morevisitsRepo->findBy(array(), array('visit_at' => 'DESC'), 4);\n\n foreach ($morevisits as $service) {\n $service->loadRelatedData(null, null, site_url());\n }\n\n if ($morevisits) {\n $response[\"desc\"] = \"Servicios mas visitados\";\n $response[\"count\"] = count($morevisits);\n $response[\"data\"] = $morevisits;\n } else {\n $response[\"desc\"] = 'No existen servicios mas visitados';\n $response[\"count\"] = 0;\n $response[\"data\"] = array();\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "function getEmployeeShiftByDate($date, $employee_id)\n{\n global $con;\n $shifts=array();\n /*\n Add Filter based on employee id\n */\n // $change_shifts=$con->myQuery(\"SELECT id,shift_name,time_in,time_out,beginning_in,beginning_out,ending_in,ending_out FROM shifts LIMIT 1\")->fetchAll(PDO::FETCH_ASSOC);\n // if (!empty($change_shifts)) {\n // $shifts=$change_shifts;\n // }\n /*\n Get Default Sheep of the employee\n */\n $default_shift=$con->myQuery(\"SELECT id,'Default Shift' as shift_name,time_in,time_out,beginning_in,beginning_out,ending_in,ending_out FROM employees_default_shifts WHERE (:date BETWEEN start_date AND end_date) OR (:date>= start_date AND ISNULL(end_date)) ORDER BY start_date DESC LIMIT 1\", array(\"date\"=>$date->format('Y-m-d')))->fetch(PDO::FETCH_ASSOC);\n if (!empty($default_shift)) {\n array_push($shifts, $default_shift);\n }\n\n return $shifts;\n}", "public function watchedAction() {\n\t\t$request = $this->getRequest();\n\t\t$values = $request->getParams();\n\t\t$dbuserseries = new Application_Model_DbTable_Userseries();\n\t\t$row = $dbuserseries->getEpisode( $values['seriesid'] , $this->userid);\n\t\tif ($row) {\n\t\t\t$row->latest_ep = (int) $values['episode'];\n\t\t\t$row->save();\n\t\t}\n\t\t$dbseries = new Application_Model_DbTable_Series();\n\t\t$row = $dbseries->fetchRow('id = ' . (int) $values['seriesid']);\n\t\t$cseries = strtolower(trim(preg_replace('/[!;\\/\\?]/', '', $row->stitle)));\n\t\t$cseries = strtr($cseries, ' ', '-');\n\t\t\n\t\t$dbrlseries = new Application_Model_DbTable_Urlseries();\n\t\t$row = $dbrlseries->getSeries( $values['seriesid'], $values['episode']);\n\t\t\n\t\t$this->_redirect('http://crunchyroll.com/' . $cseries . $row->url);\n\t}", "function searchHistoryScreen($request) {\n\n DEFINE(\"RESULTS_ON_PAGE\", \"5\");\n \n $pageNumber = $request->form->get(\"pageNumber\", \"int\", 1);\n \n if( $pageNumber < 1 ) $pageNumber = 1;\n\n $searchHistory = new SearchLogList($request->config->mysqlConnection);\n $searchHistory->setOrder(\"search_date\");\n $searchHistory->setDirection(\"desc\");\n \n $pageCount = ceil($searchHistory->getCount()/RESULTS_ON_PAGE);\n \n $offset = (($pageNumber-1)*RESULTS_ON_PAGE);\n \n $searchHistory->setLimit($offset.\", \".RESULTS_ON_PAGE);\n \n $searchHistory->load();\n \n Leolos\\Status\\Status::OK();\n require_once \"templ/search_history.html\";\n return ;\n}", "public function getEmpHistoryOf30()\n {\n $orgid = isset($_REQUEST['refno']) ? $_REQUEST['refno'] : 0;\n $emp = isset($_REQUEST['emp']) ? $_REQUEST['emp'] : 0;\n $datafor = isset($_REQUEST['datafor']) ? $_REQUEST['datafor'] : '';\n $zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n $date =date('Y-m-d');\n $edate =date('Y-m-d',strtotime('-30 days'));\n $time = date('H:i:s');\n $data = array();\n\t\tif($datafor=='present'){\n\t\t$query = $this->db->query(\"SELECT AttendanceDate,SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,EntryImage,ExitImage,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (`AttendanceDate` BETWEEN ? AND ?) and EmployeeId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `AttendanceDate` Desc\",\n\t\tarray($edate,$date,$emp));\n $data['present'] = $query->result();\n\t\t} else if($datafor=='absent'){\n\t\t\t//////////abs\n\t\t\t$query = $this->db->query(\"SELECT AttendanceDate,'-' as TimeIn,'-' as TimeOut FROM `AttendanceMaster` WHERE (`AttendanceDate` BETWEEN ? AND ?) and EmployeeId=? and (AttendanceStatus=2 or AttendanceStatus=7 or AttendanceStatus=6 ) order by `AttendanceDate` Desc\",\n\t\tarray($edate,$date,$emp));\n $data['absent'] = $query->result();\n\t\t\t\n\t}else if($datafor=='latecomings'){\n //////// late\n\t\t\n /* $query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate`=? \".$dept_cond.\" and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `name`\", array(\n $date,\n $orgid\n ));*/\n\t\t\t$query = $this->db->query(\"SELECT AttendanceDate,SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,EntryImage,ExitImage,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (`AttendanceDate` BETWEEN ? AND ?) and (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and EmployeeId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `AttendanceDate` Desc\",\n\t\tarray($edate,$date,$emp));\n $data['lateComings'] = $query->result();\n\t}else if($datafor=='earlyleavings'){\t\t\n ////////early\n /*$query = $this->db->query(\"SELECT AttendanceDate,SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,EntryImage,ExitImage,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (`AttendanceDate` BETWEEN ? AND ?) and (time(TimeOut) < (select time(TimeOut) from ShiftMaster where ShiftMaster.Id=shiftId) and TimeOut!='00:00:00') and EmployeeId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `AttendanceDate` Desc\",\n\t\tarray($edate,$date,$emp));*/\n\t\t\t $query = $this->db->query(\"select ShiftId,EmployeeId , AttendanceDate from AttendanceMaster where `AttendanceDate` BETWEEN ? AND ? and TimeIn != '00:00:00' AND TimeOut!='00:00:00' AND AttendanceStatus in (1,3,4,5,8) and EmployeeId = ? order by `AttendanceDate` Desc \" , array($edate,$date,$emp));\n\t\t $res = array();\n\t\t $name = getEmpName($emp);\n foreach ($query->result() as $row) {\n $ShiftId = $row->ShiftId;\n \n\t\t\t$attendanceDate = $row->AttendanceDate;\n $query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n if ($data123 = $query->row()) {\n $shiftout = $data123->TimeOut;\n $shiftout1 = $attendanceDate. ' '.$data123->TimeOut;\n\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t{\n\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($attendanceDate . \"+1 days\"));\n\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t}\n $shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n $ct = date('H:i:s');\n \n \n $query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId = $emp and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$attendanceDate' \" );\n\t\t\t\t\t\n\t\t\t\t\t\n if ($row333 = $query333->row()) {\n $a = new DateTime($row333->TimeOut);\n $b = new DateTime($data123->TimeOut);\n $interval = $a->diff($b);\n $data1['earlyby'] = $interval->format(\"%H:%I\");\n $data1['timeout'] = substr($row333->TimeOut, 0, 5);\n $data1['name'] = $name ;\n $data1['shift'] = $shift;\n $data1['TimeIn'] = $row333->TimeIn;\n $data1['TimeOut'] = $row333->TimeOut;\n $data1['CheckOutLoc'] = $row333->CheckOutLoc;\n $data1['checkInLoc'] = $row333->checkInLoc;\n $data1['latit_in'] = $row333->latit_in;\n $data1['longi_in'] = $row333->longi_in;\n $data1['latit_out'] = $row333->latit_out;\n $data1['EntryImage'] = $row333->EntryImage;\n $data1['ExitImage'] = $row333->ExitImage;\n $data1['longi_out'] = $row333->longi_out;\n $data1['AttendanceDate'] = $attendanceDate;\n $res[] = $data1;\n }\n }\n }\n\t\t $data['earlyLeavings'] =\t $res;\n\t}\t \n echo json_encode($data, JSON_NUMERIC_CHECK);\n }", "function get_dishes_of_meals_from($date, $number_of_days)\n {\n $date_from = new DateTime($date);\n $date_to = new DateTime($date);\n $date_to->add(new DateInterval('P'.$number_of_days.'D'));\n $this->db->select('dishes.*, pictures.image, pictures.dish_id, meals.meal_date');\n $this->db->from('meals');\n $this->db->join('menus', 'meals.menu_id = menus.id');\n $this->db->join('dishes_menus', 'dishes_menus.menu_id = menus.id');\n $this->db->join('dishes', 'dishes_menus.dish_id = dishes.id');\n $this->db->join('pictures', 'dishes.id = pictures.dish_id');\n $this->db->where('meal_date >=', $date_from->format('Y-m-d'));\n $this->db->where('meal_date <=', $date_to->format('Y-m-d'));\n $this->db->order_by('meal_date', 'asc');\n $dishes_grouped_by_date = array();\n $dishes = $this->db->get()->result();\n if ($dishes != NULL)\n {\n foreach ($dishes as $key1 => $dish1)\n {\n $date = $dish1->meal_date;\n $dishes_grouped_by_date[$date] = array();\n foreach ($dishes as $key2 => $dish2)\n {\n if ($dish2->meal_date == $date)\n {\n array_push($dishes_grouped_by_date[$date], $dish2);\n }\n }\n }\n }\n return $dishes_grouped_by_date;\n }", "function search_history()\n{\n\tglobal $database, $url, $results_per_page, $p, $search_text, $t, $search_objects, $results, $total_results;\n\n\t// CONSTRUCT QUERY\n $sql = \"\n SELECT\n se_historyentries.historyentry_id,\n se_historyentries.historyentry_title,\n se_historyentries.historyentry_body,\n se_users.user_id,\n se_users.user_username,\n se_users.user_photo,\n se_users.user_fname,\n se_users.user_lname\n FROM\n se_historyentries,\n se_users,\n se_levels\n WHERE\n se_historyentries.historyentry_user_id=se_users.user_id &&\n se_users.user_level_id=se_levels.level_id &&\n (\n se_historyentries.historyentry_search='1' ||\n se_levels.level_history_search='0'\n ) \n \";\n \n $sql .= \" && MATCH (`historyentry_title`, `historyentry_body`) AGAINST ('{$search_text}' IN BOOLEAN MODE)\";\n \n /*\n $sql .= \" && (\n historyentry_title LIKE '%$search_text%' ||\n historyentry_body LIKE '%$search_text%'\n )\n \";\n */\n \n\t// GET TOTAL ENTRIES\n $sql2 = $sql . \" LIMIT 201\";\n $resource = $database->database_query($sql2);\n\t$total_entries = $database->database_num_rows($resource);\n \n\t// IF NOT TOTAL ONLY\n\tif( $t==\"history\" )\n {\n\t // MAKE history PAGES\n\t $start = ($p - 1) * $results_per_page;\n\t $limit = $results_per_page+1;\n \n\t // SEARCH historyS\n $sql3 = $sql . \" ORDER BY historyentry_id DESC LIMIT {$start}, {$limit}\";\n $resource = $database->database_query($sql3);\n \n\t while( $historyentry_info=$database->database_fetch_assoc($resource) )\n {\n\t // CREATE AN OBJECT FOR AUTHOR\n\t $profile = new se_user();\n\t $profile->user_info['user_id'] = $historyentry_info['user_id'];\n\t $profile->user_info['user_username'] = $historyentry_info['user_username'];\n\t $profile->user_info['user_photo'] = $historyentry_info['user_photo'];\n\t $profile->user_info['user_fname'] = $historyentry_info['user_fname'];\n\t $profile->user_info['user_lname'] = $historyentry_info['user_lname'];\n\t $profile->user_displayname();\n \n\t // IF EMPTY TITLE\n\t if( !trim($historyentry_info['historyentry_title']) )\n $historyentry_info['historyentry_title'] = SE_Language::get(589);\n \n $historyentry_info['historyentry_body'] = cleanHTML($historyentry_info['historyentry_body'], '');\n \n\t // IF BODY IS LONG\n\t if( strlen($historyentry_info['historyentry_body'])>150 )\n $historyentry_info['historyentry_body'] = substr($historyentry_info['historyentry_body'], 0, 147).\"...\";\n \n $result_url = $url->url_create('history_entry', $historyentry_info['user_username'], $historyentry_info['historyentry_id']);\n $result_name = 1500118;\n $result_desc = 1500119;\n \n\t $results[] = array(\n 'result_url' => $result_url,\n\t\t\t\t'result_icon' => './images/icons/history_history48.gif',\n\t\t\t\t'result_name' => $result_name,\n\t\t\t\t'result_name_1' => $historyentry_info['historyentry_title'],\n\t\t\t\t'result_desc' => $result_desc,\n\t\t\t\t'result_desc_1' => $url->url_create('profile', $historyentry_info['user_username']),\n\t\t\t\t'result_desc_2' => $profile->user_displayname,\n\t\t\t\t'result_desc_3' => $historyentry_info['historyentry_body']\n );\n\t }\n \n\t // SET TOTAL RESULTS\n\t $total_results = $total_entries;\n\t}\n\n\t// SET ARRAY VALUES\n\tSE_Language::_preload_multi(1500118, 1500119, 1500120);\n\tif( $total_albums>200 )\n $total_albums = \"200+\";\n \n\t$search_objects[] = array(\n 'search_type' => 'history',\n 'search_lang' => 1500120,\n 'search_total' => $total_entries\n );\n}", "function getHistory(){\r\n\t\t// pobranie informacji o poprzedniej erze\r\n\t\t$zapytanie=\"select * from historia_koalicje where nr_ery = (select max(nr_ery) from historia_koalicje) and nazwa='\".$this->getName().\"';\";\r\n\t\t$historia=mysql_query($zapytanie)or Die(\"ups :)\");\r\n\t\tif(mysql_num_rows($historia)>0){\r\n\t\t\t$wiersz_h->dane=mysql_fetch_array($historia);\r\n\t\t\t$wiersz_h->czyJest='ok';\r\n\t\t}else{\r\n\t\t\t$wiersz_h->czyJest=false;\r\n\t\t}\r\n\t\treturn $wiersz_h;\r\n\t}", "public function chartNewVistors()\n {\n $dayOfTheWeek = [] ; $newVistors = [] ;\n\n for ($i=0; $i <7 ; $i++) {\n $dayOfTheWeek[] = Carbon::now()->subDays($i)->format('D');\n $subscribes = Subscribe::all();\n $count = 0 ;\n foreach ($subscribes as $key => $value) {\n if (Carbon::parse($value->created_at)->format('Y-m-d') == Carbon::now()->subDays($i)->format('Y-m-d')) {\n $count += 1 ;\n }\n }\n $newVistors[] = $count;\n }\n return response()->json([ 'dayOfTheWeek' => $dayOfTheWeek , 'newVistors' => $newVistors ]);\n }", "public function index()\n {\n $historys = History::with('getApiKeys')\n ->with('getWorkflow')\n ->with('getStateFrom')\n ->with('getStateTo')\n ->with('getUserName')\n ->paginate(10);\n $now = Carbon::now();\n $dates = [];\n foreach($historys as $history)\n {\n $end = Carbon::parse($history->created_at);\n array_push($dates,$end->diffForHumans($now));\n }\n return view('workflow.history.index',compact('historys', 'dates'));\n }", "public function getHistories(Request $request)\n {\n //takes trip ended, user cancelled, driver cancelled ride requests\n $rideRequests = $this->rideRequest->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::COMPLETED, Ride::TRIP_ENDED, Ride::USER_CANCELED, Ride::DRIVER_CANCELED])\n ->with(['user', 'invoice'])\n ->orderBy('updated_at', 'desc')\n ->paginate(500);\n\n $rideRequests->map(function($rideRequest){\n \n if($rideRequest->invoice) {\n $rideRequest->invoice['map_url'] = $rideRequest->invoice->getStaticMapUrl();\n }\n \n });\n\n return $this->api->json(true, 'RIDE_REQUEST_HISTORIES', 'Ride request histories', [\n 'ride_requests'=> $rideRequests->items(),\n 'paging' => [\n 'total' => $rideRequests->total(),\n 'has_more' => $rideRequests->hasMorePages(),\n 'next_page_url' => $rideRequests->nextPageUrl()?:'',\n 'count' => $rideRequests->count(),\n ]\n ]);\n\n\n }", "public function bookingHistory() {\n return view('history', [\n \"history\" => app('App\\Http\\Controllers\\BookingController')->byUser(Auth::user())\n ]);\n }", "public function actionHistory()\n {\n /*$auditdata = AuditTrailSearch::find()\n ->select(['entry_id', 'model_id', 'user_id', 'created', 'old_value'])\n ->where([\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event',\n ])\n ->andFilterWhere(['>', 'old_value', \"''\"])\n ->orderBy(['model_id' => SORT_DESC])\n ->all();*/\n// $historyData = \\yii\\helpers\\ArrayHelper::map($auditdata, 'model_id', 'old_value');\n// \\yii\\helpers\\VarDumper::dump($historyData);\n\n $searchModel = new AuditTrailSearch;\n $searchFilter = [\n 'AuditTrailSearch' => [\n 'action' => 'DELETE',\n 'model' => 'backend\\models\\Event'\n ]\n ];\n $dataProvider = $searchModel->search(\\yii\\helpers\\ArrayHelper::merge(Yii::$app->request->get(), $searchFilter));\n //var_dump(Yii::$app->request->get());\n //\\yii\\helpers\\VarDumper::dump($searchModel);\n $message = \"<ol>恢复操作指引<li><删除内容>中输入内容筛选</li><li>点击复选框选中需要恢复的记录</li><li>点击<恢复记录>按钮</li></ol>\";\n Yii::$app->session->setFlash('info', $message);\n return $this->render('history', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }", "function showMedicalHistory()\n {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') \n {\n $token = $this->input->post('token');\n $id = $this->input->post('id');\n $type = $this->input->post('type');\n \n\n if (empty($token)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Token is empty';\n echo json_encode($response);die;\n }\n\n if (empty($id)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Id is empty';\n echo json_encode($response);die;\n }\n\n if (empty($type)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Type is empty';\n echo json_encode($response);die;\n }\n\n \n \n\n $checkToken = $this->user_model->getCondResultArray(USER,'id',array('token'=>$token));\n if($checkToken)\n {\n if($type=='hospital')\n {\n \t//echo \"gg\";die;\n\n \t $hostpital = $this->user_model->getCondResultArray('user_hospital_records','id,hospital_name,provider_name,provider_specility,service_date,type',array('id'=>$id));\n\n\t\t $hos_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$hostpital[0]['id'],'type'=>'hospital'));\n\t\t \n // print_r($img);die;\n\t\t \n if(!empty($hostpital))\n {\n\n\n\t\t if(empty($hos_img))\n\t\t \t$hos_img = array();\n\n\t\t \n foreach($hostpital as $hos)\n {\n \t\n \n \t $HospitalArr = array(\n\t\t \t 'id' => $hos['id'],\n\t\t \t 'hospital_name' => $hos['hospital_name'],\n\t\t \t 'provider_name' => $hos['provider_name'],\n\t\t \t 'provider_specility' => $hos['provider_specility'],\n\t\t \t 'service_date' => $hos['service_date'],\n\t\t \t 'type' => $hos['type'],\n\t\t \t 'images' => $hos_img,\n\n\t\t );\n }\n }else\n {\n \t$HospitalArr = array();\n }\n \n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'medical detail seen successfully.','editdetail' => $HospitalArr];\n\t\t echo json_encode($response);die;\n }\n if($type=='specialty')\n {\n \t $specialty = $this->user_model->getCondResultArray('user_specialty_records','id,specialty,specialty_type,service_date,type',array('id'=>$id));\n \t $spe_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$id,'type'=>'specialty'));\n\n\t\t \t if(empty($spe_img))\n\t\t \t $spe_img = array();\n\t\t \n\t\t if(!empty($specialty))\n\t\t \t{\n\n\t\t foreach($specialty as $spe)\n\t\t {\n \n\t\t \n\n\t\t \t\n\n\t\t \t $SpecialtyArr = array(\n 'id' => $spe['id'],\n 'specialty' => $spe['specialty'],\n 'specialty_type' => $spe['specialty_type'],\n 'service_date' => $spe['service_date'],\n 'type' => $spe['type'],\n 'images' => $spe_img,\n\t\t );\n\t\t }\n\n\t\t }else\n\t\t {\n\t\t \t$SpecialtyArr = array();\n\t\t }\n\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'specialty detail seen successfully.','editdetail' => $SpecialtyArr];\n\t\t echo json_encode($response);die;\n\n }\n if($type=='lab')\n {\n $lab = $this->user_model->getCondResultArray('user_lab_records','id,lab_name,prescription_name,lab_date,type',array('id'=>$id));\n\t\t if(!empty($lab))\n\t\t {\n\t\t \t\n\t\t \n\t\t $lab_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$lab[0]['id'],'type'=>'lab'));\n\t\t \n\t\t if(empty($lab_img))\n\t\t \t$lab_img = array();\n foreach($lab as $lb)\n\t\t {\n\t\t \t $LabArr = array(\n 'id' => $lb['id'],\n 'lab_name' => $lb['lab_name'],\n 'prescription_name' => $lb['prescription_name'],\n 'lab_date' => $lb['lab_date'],\n 'type' => $lb['type'],\n 'images' => $lab_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n $LabArr =array();\n\t\t }\n\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'Lab detail seen successfully.','editdetail' => $LabArr];\n\t\t echo json_encode($response);die;\n }\n if($type=='other')\n {\n\n $other = $this->user_model->getCondResultArray('user_other_records','id,description,date,type',array('id'=>$id));\n\t\t $other_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$other[0]['id'],'type'=>'other'));\n\t\t if(!empty($other))\n\t\t {\n\n if(empty($other_img))\n\t\t \t$other_img = array();\n\t\t foreach($other as $othr)\n\t\t {\n\t\t \t $OtherArr = array(\n 'id' => $othr['id'],\n 'description' => $othr['description'],\n 'date' => $othr['date'],\n 'type' => $othr['type'],\n 'images' => $other_img,\n\t\t );\n\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t \t$OtherArr =array();\n\t\t }\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'other detail seen successfully.','editdetail' => $OtherArr];\n\t\t echo json_encode($response);die;\n }\n\n if($type=='pharmacy')\n {\n $pharmacy = $this->user_model->getCondResultArray('user_pharmacy_script','id,pharmacy_name,pharmacy_provider_name,service_date,type',array('id'=>$id));\n\t\t $ph_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$pharmacy[0]['id'],'type'=>'pharmacy'));\n\n\t\t if(!empty($pharmacy))\n\t\t {\n\t\t \t if(empty($ph_img))\n\t\t \t $ph_img = array();\n\n\t\t \tforeach($pharmacy as $ph)\n\t\t {\n\t\t $PharmacyArr = array(\n\t\t 'id' => $ph['id'],\n\t\t 'pharmacy_name' => $ph['pharmacy_name'],\n\t\t 'pharmacy_provider_name' => $ph['pharmacy_provider_name'],\n\t\t 'service_date' => $ph['service_date'],\n\t\t 'type' => $ph['type'],\n\t\t 'images' => $ph_img,\n\t\t\t\t );\n\t\t\t }\n\n\t\t \t}\n\n\t\t else\n\t\t {\n\t\t \t$PharmacyArr =array();\n\t\t }\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'pharmacy detail seen successfully.','editdetail' => $PharmacyArr];\n\t\t echo json_encode($response);die; \n }\n if($type=='physical')\n {\n $physical = $this->user_model->getCondResultArray('user_physical_therapist_records','id,therapy_name,therapy_date,type',array('id'=>$id));\n\t\t $phy_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$physical[0]['id'],'type'=>'physical'));\n\t\t if(!empty($physical))\n\t\t {\n\t\t \t\n\n\t\t if(empty($phy_img))\n\t\t \t$phy_img = array();\n\n\t\t foreach($physical as $py)\n\t\t {\n\t\t \t $PhyArr = array(\n 'id' => $py['id'],\n 'therapy_name' => $py['therapy_name'],\n 'therapy_date' => $py['therapy_date'],\n 'type' => $py['type'],\n 'images' => $phy_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n\t\t \t$PhyArr = array();\n\t\t }\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'physical detail seen successfully.','editdetail' => $PhyArr];\n\t\t echo json_encode($response);die; \n }\n }\n else\n {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'token mismatch ...Please logOut.';\n \n\n echo json_encode($response);\n }\n \n }\n else\n {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'This method is not allowed.';\n echo json_encode($response);die; \n } \n\n }", "public function index()\n {\n $is_current_month = !request()->get('next');\n $days_in_month = date('t', strtotime($is_current_month ? 'now' : '+1 month'));\n $month_number = date('n', strtotime($is_current_month ? 'now' : '+1 month'));\n $year_number = date('y', strtotime($is_current_month ? 'now' : '+1 month'));\n\n $shifts = [];\n\n foreach (range(1,$days_in_month) as $day_number) {\n $date = mktime(0, 0, 0, $month_number, $day_number, $year_number);\n\n $shifts[date('j.n.y', $date)] = [\n 'date_without_year' => date('j.n', $date),\n 'date' => date('j.n.y', $date),\n 'day_of_week' => str_replace(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'], date('l', $date)),\n 'shift1' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift2' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift3' => [\n 'saturday' => date('w', $date) == 5 || date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n ];\n }\n\n $registered = Shift::with('user')\n ->where('date_str', 'LIKE', \"%.$month_number.$year_number\")\n ->get();\n\n foreach ($registered as $register) {\n $shifts[$register['date_str']]['shift'.$register['shift_id']]['users'][] = [\n 'user_id' => $register['user_id'],\n 'status' => $register['status'],\n 'name' => array_get($register, 'user.name', 'משתמש נמחק'),\n ];\n }\n\n $is_admin = request()->get('admin') && Auth::user()->is_admin;\n\n return view('home')\n ->with('shifts', array_values($shifts))\n ->with('current_user_id', Auth::user()->id)\n ->with('is_current_month', $is_current_month)\n ->with('can_admin', Auth::user()->is_admin)\n ->with('users', $is_admin ? User::orderBy('name')->get() : [])\n ->with('is_admin', $is_admin);\n }", "public function displayHistory()\n\t\t\t{\n\t\t\t\t$data_arr = array();\n\t\t\t\t$inc = 0;\n\n\t\t\t\twhile($row = $this->fetchResultRecord())\n\t\t\t\t\t{\n\t\t\t\t\t\t$uDetails = $this->isMemberJoined($row['email']);\n\t\t\t\t\t\t$statusClass = '';\n\t\t\t\t\t\t$status = $this->LANG['invitation_history_email_status_not_joined'];\n\t\t\t\t\t\tif ($uDetails)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t$status = $this->LANG['invitation_history_email_status_joined'];\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t$data_arr[$inc]['date_added'] = $row['date_added'];\n\t\t\t\t\t\t$data_arr[$inc]['attempts'] = $row['attempts'];\n\t\t\t\t\t\t$data_arr[$inc]['email'] = $row['email'];\n\t\t\t\t\t\t$data_arr[$inc]['class'] = ($uDetails)?'clsJoined':'clsNotJoined';;\n\t\t\t\t\t\t$data_arr[$inc]['status'] = $status;\n\t\t\t\t\t\t$data_arr[$inc]['remind_url'] = getUrl('invitationhistory', '?action=remind&id='.$row['invitation_id'].'&start='.$this->fields_arr['start'], '?action=remind&id='.$row['invitation_id'].'&start='.$this->fields_arr['start']);\n\t\t\t\t\t\t$data_arr[$inc]['delete_url'] = getUrl('invitationhistory', '?action=delete&id='.$row['invitation_id'].'&start'.$this->fields_arr['start'], '?action=delete&id='.$row['invitation_id'].'&start'.$this->fields_arr['start']);\n\t\t\t\t\t\t$data_arr[$inc]['check_box_value'] = $row['invitation_id'];\n\t\t\t\t\t\t$inc++;\n\t\t\t\t\t}\n\t\t\t\treturn $data_arr;\n\t\t\t}", "public function history()\n {\n $tittle['tittle'] = 'History Penjualan';\n\n $data = array(\n 'data_penjualan' => $this->penjualan->ambil_data_penjualan()->result_array(),\n 'data_detail_penjualan' => $this->penjualan->ambil_detail_penjualan(),\n 'user' => $this->db->get_where('user', ['username' =>\n $this->session->userdata('username')])->row_array()\n );\n\n //View dari Controller akuntansi/index\n $this->load->view('template/header', $tittle);\n $this->load->view('template/topbar', $data);\n $this->load->view('template/sidebar', $data);\n $this->load->view('transaksi/history', $data);\n $this->load->view('template/footer');\n }", "public function setEmployeeHistory()\n {\n \ttry {\n \n $this->employeeHistory->setEmployeeHistory($this->request->ipaddress, $this->request->url, $this->request->date);\n\n return json_encode(['status' => true, 'message' => 'Added a new Employee visited URL']);\n } catch(Exception $e) {\n // dd($e);\n return json_encode(['status' => false, 'message' => $e->getMessage()]);\n }\n }", "public function BuildDailySpoil()\n {\n\n }", "public function getBuyerHistory($query)\n {\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orders.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n DB::enableQueryLog();\n // execute\n $buyer = DB::connection('virtual_market')\n ->table('orders')\n ->select(DB::raw($dateQuery.',count(distinct customer_id)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data = array();\n $data['granularity'] = $granularity;\n $data['buyer'] = $buyer;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "public function getItemHistory(Request $request) {\n $this->validate($request, [\n 'list_id' => 'required|integer|exists:dx_lists,id',\n 'item_id' => 'required|integer'\n ]);\n\n // Must have parameters for form loading\n $item_id = $request->input('item_id', 0); // if 0 then new item creation form will be provided otherwise editing form\n $list_id = $request->input('list_id', 0);\n \n $result = view('elements.form_history', [\n\t\t\t'events' => Models\\Event::where('list_id', '=', $list_id)->where('item_id', '=', $item_id)->orderBy('id', 'desc')->get(),\n 'is_profile' => (Config::get('dx.employee_profile_page_url')),\n 'events_list_id' => \\App\\Libraries\\DBHelper::getListByTable('dx_db_events')->id\n\t])->render();\n\n return response()->json(['success' => 1, 'html' => $result]);\n }", "function lecturesInNextDays($survey, $daysInFuture=1,$kritter=0) {\n\t\tif ($daysInFuture>0) {\n\t\t\t$dateLimit = time() + $daysInFuture*24*60*60;\n\t\t\t$dateLimitWhere = ' AND eval_date_fixed<'.$dateLimit.' ';\n\t\t}\n\t\telse $dateLimitWhere = '';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->sql_query('SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\tFROM tx_fsmivkrit_lecture\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE deleted=0 AND hidden=0\n\t\t\t\t\t\t\t\t\t\t\t\t AND survey='.$survey.\n\t\t\t\t\t\t\t\t\t\t\t\t $dateLimitWhere.'\n\t\t\t\t\t\t\t\t\t\t\t\t AND eval_date_fixed > '.time().'\n\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY eval_date_fixed');\n\n\t\t$lectures = array ();\n\t\twhile ($res && $row = mysql_fetch_assoc($res))\n\t\t\t$lectures[] = $row['uid'];\n\n\t\treturn $lectures;\n\t}", "public function userBuyCoinHistory()\n {\n $response = ['success' => false, 'message'=> __('Something went wrong.')];\n $items = Sell::where(['user_id'=> Auth::user()->id])->get();\n $datas = [];\n if (isset($items[0])) {\n $datas = [];\n foreach ($items as $item) {\n $datas[] = [\n 'user_name' => $item->user->name,\n 'coin_name' => $item->coin->name,\n 'payment_method' => $item->payment->name,\n 'amount' => $item->amount,\n 'price_rate' => $item->price,\n 'date' => date('d M y', strtotime($item->created_at)),\n ];\n }\n $response = [\n 'success' => true,\n 'buy_history' => $datas,\n 'message'=> __('Data get successfully.')];\n } else {\n $response = ['success' => false,'buy_history' => [], 'message'=> __('No data found.')];\n }\n\n return $response;\n }", "public function searchbydate() {\n $star = $this->input->get('starred');\n //Get the checkin and chekout dates\n $checkin = '';\n $checkout = '';\n $stack = array();\n $room_types = array();\n $checkin = $this->input->post('checkin');\n $checkout = $this->input->post('checkout');\n $nof_guest = $this->input->post('number_of_guests');\n $room_types = $this->input->post('room_types');\n $min = $this->input->post('min');\n $max = $this->input->post('max');\n\n $array_items = array(\n 'Vcheckin' => '',\n 'Vcheckout' => '',\n 'Vcheckout' => '',\n );\n $this->session->unset_userdata($array_items);\n\n if ($this->input->post('checkin') != '' || $this->input->post('checkin') != 'mm/dd/yy') {\n $freshdata = array(\n 'Vcheckin' => $this->input->post('checkin'),\n 'Vcheckout' => $this->input->post('checkout'),\n 'Vnumber_of_guests' => $this->input->post('number_of_guests'),\n );\n $this->session->set_userdata($freshdata);\n }\n\n\n\n if ($checkin != '--' && $checkout != '--' && $checkin != \"yy-mm-dd\" && $checkout != \"yy-mm-dd\") {\n $ans = $this->db->query(\"SELECT id,list_id FROM `calendar` WHERE `booked_days` = '\" . $checkin . \"' OR `booked_days` = '\" . $checkout . \"' GROUP BY `list_id`\");\n $this->db->flush_cache();\n // Now after the checkin is completed\n if (!empty($a)) {\n foreach ($a as $a1) {\n array_push($stack, $a1->list_id);\n }\n }\n }\n\n $this->load->model('Gallery');\n $data['message_element'] = 'view_search_result';\n $data['title'] = \"Search Elements\";\n $query = $this->input->post('location');\n $pieces = explode(\",\", $query);\n $data['pieces'] = $pieces;\n $print = \"\";\n $len = count($pieces);\n $count = 0;\n $sno = 1;\n foreach ($pieces as $test) {\n $this->db->flush_cache();\n $test = $this->db->escape_like_str($test);\n $this->db->like('address', $test);\n\n for ($i = 0; $i < $count; $i++) {\n $this->db->not_like('address', $pieces[$i]);\n }\n\n if (!empty($stack)) {\n $this->db->where_not_in('id', $stack);\n }\n\n if ($nof_guest > 1) {\n $this->db->where('capacity', $nof_guest);\n }\n\n if (!empty($star)) {\n $this->db->where('starred', $star);\n }\n\n if (is_array($room_types)) {\n if (count($room_types) > 0) {\n foreach ($room_types as $r) {\n $this->db->where('room_type', $r);\n }\n }\n }\n\n if (isset($min)) {\n if ($min > 0) {\n $this->db->where('price >=', $min);\n }\n } else {\n if (isset($max)) {\n $min = 0;\n }\n }\n\n if (isset($max)) {\n if ($max > $min) {\n $this->db->where('price <=', $max);\n }\n }\n\n $this->db->where('status !=', 0);\n\n //Exececute the query\n $data['query'] = $this->db->get('list');\n foreach ($data['query']->result() as $row) {\n $images = $this->Gallery->get_images($row->id);\n if (count($images) == 0)\n $url = base_url() . 'images/no_image.jpg';\n else\n $url = $images[0]['url'];\n\n $print .= '<div style=\"height:105px;overflow:visible;display:inline;\"><li style=\"margin-top:10px;display:block;min-height:105px;_height:150px;\" class=\"search_result\" id=\"' . $row->id . '\">';\n $print .= '<div class=\"pop_image_small\">\n <div class=\"map_number\">' . $sno . '</div>\n <a class=\"image_link\" href=\"' . base_url() . 'rooms/' . $row->id . '\" linkindex=\"98\"><img width=\"639\" height=\"426\" title=\"ZEN TAO\" src=\"' . $url . '\" class=\"search_thumbnail\"></a> \n \t</div>';\n $print .= '<div class=\"room_details\">\n <h2 class=\"room_title\"> \n\t\t\t</p><a href=\"' . base_url() . 'rooms/' . $row->id . '\" class=\"name\" linkindex=\"100\">' . $row->title . '</a> \n </h2> <!--<a href=\"' . base_url() . 'func/starred/?star=' . $row->id . '\"><img src=\"' . base_url() . 'images/star.png\" height=25 width=25></a>--></p>';\n $print .='<p class=\"address\">' . $row->address . '</p>';\n $print .='<ul class=\"reputation\"></ul> \n\t\t\t</div> \n\t\t\t\t\t<div class=\"price\"> \n\t\t\t\t\t \t\n\t\t\t\t\t<div class=\"price_data\">\n\t\t\t\t\t\t\t<!--<sup class=\"currency_if_required\"></sup>-->\n \t\t\t<div class=\"currency_with_sup\"><sup>$</sup>' . $row->price . '</div>\n \t\t\t\n \t\t\t\t</div> \n \t\t\t\t<div lass=\"price_modifier\">Per night</div> \n\t\t\t\t\t\t \n\t\t\t\t\t</div> \n\t\t\t</li></div>';\n $sno++;\n }\n $count++;\n }\n $data['print'] = $print;\n $data['query'] = $query;\n $data['checkin'] = $this->input->post('checkin');\n $data['checkout'] = $this->input->post('checkout');\n $data['number_of_guests'] = $this->input->post('number_of_guests');\n $data['room_types'] = $room_types;\n $data['min'] = $min;\n $data['max'] = $max;\n\n $this->load->view('template', $data);\n }", "public function getMarketHistory() {\n\n\t\t$response = $this->noCfCURLQuery( \"https://bittrex.com/api/v1.1/public/getmarkethistory?market={$this->pair}\" );\n\t\t$response = json_decode( $response, true );\n\t\tif ( $response['success'] ) {\n\t\t\treturn $response['result'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function getRecentBetInfo() {\n $query = \"SELECT BETID, p.HORSEID, NICKNAME, ACCOUNTID, AMOUNT, BET_DATE, BET_TYPE FROM \" . \n $this->table_name_1 . \" p, \" . $this->table_name_2 . \" h\" . \n \" WHERE p.ACCOUNTID = \" . $this->accountID . \" AND \" . \n \"p.HORSEID=h.HORSEID AND BET_DATE > (SYSDATE - 7)\";\n $stmt = $this->database->executePlainSQL($query);\n return $stmt;\n }", "function listar_historial(){\n\t\tif (isset($_POST['buscar']))\n\t\t\t$_SESSION['buscar']=$_POST['buscar'];\n\t\t\n\t\t$sql=\"SELECT * FROM historial ORDER BY id_his\";\n\t\t\n\t\t$consulta=mysql_query($sql);\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function getHistory($datetime)\n {\n $h_table = Engine_Api::_()->getDbTable('sellingHistorys', 'mp3music');\n $h_name = $h_table->info('name');\n $select = $h_table->select()\n ->from($h_table);\n $select->where('selling_datetime = ?',$datetime); \n $results = $h_table->fetchAll($select)->toArray(); \n return $results;\n }", "public function getQuoteHistoryAction($symbol)\n {\n # Retrieve company.\n $company = $this->getDoctrine()->getRepository('AppBundle:Company')\n ->findOneBySymbol($symbol);\n if (!$company) {\n throw $this->createNotFoundException();\n }\n\n # Get current quote.\n $current_quote = $this->getQuoteAction($symbol);\n\n # Retrieve 5 previous quotes.\n $quotes = $this->getDoctrine()\n ->getRepository('AppBundle:Quote')->findBy(\n array('companyId' => $company->getId()),\n array('datetime' => 'DESC'),\n 5,\n 0);\n\n return $quotes;\n }", "public function indexAction(){\n \t$logger \t= new Frogg_Log('/home2/bleachse/public_html/seriando/log/new_series.log');\n \t$control = new Application_Model_NewSeriesControl(1);\n \t$series_control = $control->nextSeries();\n \tif(!$series_control){ $logger->warn('No new series'); $logger->close(); die();}\n \t\n \t$xml = new XMLReader();\n\t if(!$xml->open('http://services.tvrage.com/feeds/full_show_info.php?sid='.$series_control->rage_id)){\n\t \t$logger->err('Failed to open input file : '.$series_control->rage_id);\n\t \t\t$logger->close();\n\t die();\n\t }\n\t $logger->info('Starting to log new_series_id : '.$series_control->rage_id);\n\t $series = new Application_Model_Series();\n\t while ($xml->read()){\n\t \twhile($xml->read() && $xml->name != 'name');\n\t \tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'name'){\n\t\t\t\t$series->name = $xml->readString();\n\t \t}\n \t\twhile($xml->read() && $xml->name != 'showid');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'showid'){\n \t\t\t$series->rage_id = $xml->readString();\n \t\t\t$double_check = new Application_Model_Series();\n \t\t\t$logger->info('Double check [my_id]:[rage_id] '.$series_control->rage_id.':'.$series->rage_id);\n \t\t\tif($double_check->loadField('rage_id', $series->rage_id)){\n \t\t\t\t//This piece of code will probably NEVER run.\n \t\t\t\t//Why? NewSeriesControl only fetches UNREAD series AND 'newseries.rage_id' MUST be unique.\n \t\t\t\t//If this ever happen: Either you forgot to set 'rage_id' as unique or the DB crapped itself\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::ERROR;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->err('Series already registered rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'origin_country');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'origin_country'){\n \t\t\tif(!$this->allowedCountry($xml->readString())){\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::INVALID;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->warn('Series country not allowed rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'status');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'status'){\n \t\t\t$series->status = $this->parseStatus($xml->readString());\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'classification');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'classification'){\n \t\t\tif($this->avoidedClassification($xml->readString())){\n \t\t\t\t$series_control->flag = Application_Model_NewSeries::INVALID;\n \t\t\t\t$series_control->update();\n \t\t\t\t$logger->warn('Series classification invalid rage_id:'.$series->rage_id);\n \t\t\t\t$logger->close();\n \t\t\t\tdie;\n \t\t\t}\n \t\t}\n \t\twhile($xml->read() && $xml->name != 'runtime');\n \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'runtime'){\n \t\t\t$series->runtime = $xml->readString();\n \t\t}\n \t\t$series->image\t = 'default.png';\n \t\t$series->timestamp = time();\n \t\t$series->permalink = $series->permalinkFor('name');\n \t\t$series->order\t = NEW_SERIES;\n\t \tif(!$series->rage_id){\n\t \t\t$series_control->flag = Application_Model_NewSeries::ERROR;\n\t \t\t$series_control->update();\n\t \t\t$logger->err('Empty XML');\n\t \t\t$logger->close();\n\t \t\tdie;\n\t \t}\n \t\t$series_id = $series->save();\n \t\t$logger->ok('Saved');\n \t\t\n \t\t$series_bucket = new Application_Model_SeriesBucket($series->name,$series->permalink);\n \t\t$series_bucket->save();\n \t\t\n\t \t$has_episodes = $xml->next('Episodelist');\n \t\tif($has_episodes){\n \t\t\twhile($xml->read() && !($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'Episodelist')){\n \t\t\t\twhile($xml->read() && $xml->name != 'Season');//Goes to next <Season>\n \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'Season'){\n\t\t \t\t\t$season_num = $xml->getAttribute('no');\n\t\t \t\t\t$season = new Application_Model_Series();\n\t\t \t\t\t$season->series_id \t= $series_id;\n\t\t \t\t\t$season->name \t \t= $season_num.'ª Temporada';\n\t\t \t\t\t$season->order\t\t= $season_num * 1000; //According to format XXX.000 for seasons \n\t\t \t\t\tif($season_num < 10){ $season_num = '0'.$season_num; }\n\t\t \t\t\t$season->release \t= $series->name.' Season '.$season_num;\n\t\t \t\t\t$season->timestamp \t= time();\n\t\t \t\t\t$season_id \t\t\t= $season->save();\n\t\t \t\t\t$release\t\t\t= new Application_Model_Release($season_id,$season->release,time());\n\t\t \t\t\t$release->save();\n \t\t\t\t}\n \t\t\t\twhile($xml->read()){ //Season episodes reading\n\t \t\t\t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'episode'){ //Found new episode\n\t\t \t\t\t\t$episode = new Application_Model_Series();\n\t\t \t\t\t\t$episode->season_id = $season_id;\n\t\t \t\t\t\t$episode->series_id = $series_id;\n\t\t \t\t\t\t$episode->timestamp = time();\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'seasonnum');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'seasonnum'){\n\t\t\t\t \t\t\t$episode_num = $xml->readString();\n\t\t\t\t \t\t\t$episode->release = $series->name.' S'.$season_num.'E'.$episode_num;\n\t\t\t\t \t\t\t$episode->order = $season->order + ($episode_num*1); //According to format XXX.yyy for episodes\n\t\t\t \t\t\t}\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'airdate');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'airdate'){\n\t\t\t\t \t\t\t$date = new Frogg_Time_Time($xml->readString());\n \t\t\t\t\t\t\t$episode->airdate = $date->getUnixTstamp();\n\t\t\t \t\t\t}\n\t\t\t \t\t\twhile($xml->read() && $xml->name != 'title');\n\t\t\t\t \t\tif($xml->nodeType == XMLReader::ELEMENT && $xml->name == 'title'){\n\t\t\t\t \t\t\t$episode->name = $xml->readString();\n\t\t\t \t\t\t}\n\t\t\t \t\t\t$episode_id = $episode->save();\n\t\t\t \t\t\t$release\t= new Application_Model_Release($episode_id,$episode->release,$episode->airdate);\n\t\t \t\t\t\t$release->save();\n\t\t \t\t\t\t$xml->next('episode');\n\t\t\t\t\t\t} else if($xml->nodeType == XMLReader::END_ELEMENT && $xml->name == 'Season'){ //Found season finale\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n \t\t\t\t}//END - Season episodes reading\n \t\t\t}\n \t\t}\n \t\t$series_control->flag = Application_Model_NewSeries::READ;\n \t\t$series_control->update();\n\t\t\t$logger->ok('Great Success !!');\n \t\t$logger->close(); \t\t\n\t\t\tdie;\n\t }\n }", "function getHistoryAppointment($username)\n {\n\n$query = $this->db->query(\"SELECT booking_status,concat(b.first_name,' ',b.last_name) as mua_id, a.appointment_id,DATE_FORMAT(date_appointment,'%d %b %Y') as date_appointment FROM g_appointment a left join g_mua b on a.mua_id=b.mua_id WHERE a.username='\".$username.\"' ORDER BY a.date_appointment DESC\");\n\n\n \n return $query->result();\n\t\t \n\t\t \n \n }", "public function histories_rented_car($date) {\n $d = \"'$date', 'yyyy-mm-dd'\";\n $query = $this->db->query('select cars.brand, cars.type, cars.plate \n from rentals \n left join cars on cars.id=rentals.\"car-id\" \n where rentals.\"date-from\" <= to_date('.$d.') AND rentals.\"date-to\" >= to_date('.$d.')');\n\n return $query->result();\n }", "public function addHistory($date, $history_id) {\n if ( $_SESSION['addHistory'] = true ) {\n $file = fopen( \"loginHistory.txt\", \"a\");\n if($file) {\n $output = ++$history_id . \"~\" . $_POST['username'] . \"~\" . $date . \"\\n\";\n fwrite($file, $output);\n fclose($file); \n } else {\n echo \"Could not save history!\";\n } \n }\n }", "public function doQueryHis(){\n \n $this->db_connection = new mysqli(\"localhost\", \"queenoflibra_ruixia2\", \"Aptx4869\", \"queenoflibra_CS411Database\");\n // change character set to utf8 and check it \n if (!$this->db_connection->set_charset(\"utf8\")) {\n $this->errors[] = $this->db_connection->error;\n } \n \n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n // print \"connect database sucessfully\";\n //SELECT * FROM `have_histroy` WHERE `user_name`='ruixia0819'\n $sql_prefix = \"SELECT * FROM `have_histroy`\n WHERE `user_name`='\";\n \n $sql_suffix=\"';\";\n $sql_final =$sql_prefix .''. $_SESSION['user_name'] .''.$sql_suffix;\n //print $sql_final;\n \n $result_of_query = $this->db_connection->query($sql_final);\n \n \n $_SESSION[\"his_date\"]=array();\n $_SESSION[\"his_rn\"]=array();\n \n for ($x = 0; $x < $result_of_query->num_rows; $x++){\n $row = $result_of_query->fetch_object();\n \n \n list($month, $day, $year,$hour) = split ('[/.-]', $row->date);\n $hours = ($year-2000)*365*24+$month*30*24+$day*24+$hour;\n \n \n $_SESSION[\"his_date\"][$row->his_id]=$row->date;\n $_SESSION[\"his_rn\"][$row->his_id]=$row->restaurant_name;\n \n // print $hours;\n // print $row->restaurant_name; \n \n }\n \n krsort($_SESSION[\"his_date\"]);\n krsort($_SESSION[\"his_rn\"]);\n \n \n \n // foreach ($_SESSION[\"his_date\"] as $key => $val) {\n // echo \"$key = $val ;\";\n // }\n \n \n } else {\n $this->errors[] = \"Database connection problem.\";\n }\n }", "protected function getDatastreamHistory() {\n return $this->repository->api->m->getDatastreamHistory($this->parent->id, $this->id);\n }", "public function traderHistory (Trader $trader)\n {\n // get days we pended on\n $historyCount = DB::table(static function ($query) use ($trader) {\n $query->selectRaw(\"SUBSTR(`voucher_states`.`created_at`, 1, 10) as pendedOn\")\n ->from('vouchers')\n // use inner join\n ->join('voucher_states', 'vouchers.id', 'voucher_states.voucher_id')\n ->where('voucher_states.to', 'payment_pending')\n ->where('vouchers.trader_id', $trader->id)\n // cut down the recorded\n ->where('vouchers.currentstate', '!=', 'recorded')\n ->groupBy('pendedOn')\n ->orderByDesc('pendedOn');\n }, 'daysFromQuery')\n ->select('pendedOn')\n ->paginate()\n ->toArray();\n\n // if there are any, make a query\n if ($historyCount[\"total\"] === 0) {\n $history = [];\n } else {\n // get the first and last dates from that.\n $toDate = Arr::first($historyCount[\"data\"])->pendedOn . ' 23:59:59';\n $fromDate = Arr::last($historyCount[\"data\"])->pendedOn . ' 00:00:00';\n// $toDate = $historyCount->items()->first()->pendedOn . ' 23:59:59';\n// $fromDate = $historyCount->lastItem()->pendedOn . ' 00:00:00';\n\n // get histories between those dates.\n $histories = TraderController::paymentHistoryBetweenDateTimes($trader, $fromDate, $toDate)->all();\n\n // process the data into an array\n $history = TraderController::historyGroupByDate($histories);\n \n }\n\n $paginate = function($items, $perPage = 25, $page = null){\n $page = $page ?: (Paginator::resolveCurrentPage() ?: 1);\n $total = count($items);\n $currentpage = $page;\n $offset = ($currentpage * $perPage) - $perPage ;\n $itemstoshow = array_slice($items , $offset , $perPage);\n return new LengthAwarePaginator($itemstoshow ,$total ,$perPage);\n };\n\n $history = $paginate($history,25,null,$trader)->withPath(route('admin.trader-payment-history.show', ['trader' => $trader->id ]) );\n\n return view('service.payments.paymentHistory', compact( 'history'));\n }", "public function getHistory($fsym, $limit = 29)\n {\n $filtered_data = [];\n\n $response = $this->client->get('data/v2/histoday', [\n 'query' => [\n 'fsym' => $fsym, // Cryptocurrency whose data we want\n 'tsym' => $this->conversion_currency, // Real currency to convert the price to\n 'limit' => $limit // Number of past days to retrieve\n ]\n ]);\n\n $data = json_decode($response->getBody())->Data->Data; // Get data from JSON\n\n // Filter API data to keep only relevent data\n foreach ($data as $index => $day) {\n $date = new Carbon($day->time);\n $filtered_data[$index]['date'] = $date->format('d/m'); // Format the date\n $filtered_data[$index]['rate'] = $day->open; // Price at the date\n }\n\n return $filtered_data;\n }", "private function getDateHistory($type, $date)\n {\n if(!isset($this->temp['getDateHistory'.$date]))\n {\n $this->temp['getDateHistory'.$date] = $this->dateHistory()->orderBy('date', 'desc')\n ->where('date', '<=', $date)->get();\n }\n\n $items = $this->temp['getDateHistory'.$date]->filter(function($item) use ($type){\n return $item->type == $type;\n });\n\n return $items ? $items->first() : null;\n }", "public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }", "public function getUsersByClicks() {\n\t\ttry {\n\t\t\t$station = \\Auth::User()->station;\n\t\t\t$timezone = $station->getStationTimezone();\n\t\t\t$now = Carbon::now($timezone);\n\t\t\t$date = $now->copy()->subWeeks(11);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n//\t\t\tif(\\Auth::User()->station->id == 8 && $date->lt(Carbon::parse('2016-03-11'))) {\n//\t\t\t\t$date = Carbon::parse('2016-03-11');\n//\t\t\t}\n\n\t\t\t$start = $date->copy()->startOfWeek();\n\t\t\t$end = $start->copy()->endOfWeek();\n\t\t\t$single_clicks = array(0,0,0,0,0,0,0,0,0,0,0,0);\n\t\t\t$double_clicks = array(0,0,0,0,0,0,0,0,0,0,0,0);\n\t\t\t$more_clicks = array(0,0,0,0,0,0,0,0,0,0,0,0);\n\t\t\t$week_labels = array();\n\n//\t\t\t$time = microtime(true);\n\t\t\tfor($i = 0; $i < 12; $i++) {\n\t\t\t\t$week_labels[] = $start->format('d M') . ' - ' . $end->format('d M');\n\n\t\t\t\t//Check if we stored in cache\n\t\t\t\t$cached = \\DB::table('airshr_analytics')\n\t\t\t\t\t->where('type', '=', Analytics::LISTENER_ENGAGEMENT)\n\t\t\t\t\t->where('end_time', '>=', $end->timestamp)\n\t\t\t\t\t->where('start_time', '<=', $start->timestamp)\n\t\t\t\t\t->first();\n\t\t\t\tif($cached && $now->gt($end)) {\n\t\t\t\t\t$result = unserialize($cached->data);\n\t\t\t\t\t$single_clicks[$i] = $result['single_clicks'];\n\t\t\t\t\t$double_clicks[$i] = $result['double_clicks'];\n\t\t\t\t\t$more_clicks[$i] = $result['more_clicks'];\n\t\t\t\t}\n\n\t\t\t\t//If there isn't the result in cache, run the query\n\t\t\t\telse {\n\t\t\t\t\t$users = \\DB::select(\\DB::raw('SELECT COUNT(*) as count FROM airshr_events\n\t\t\t\t\t\t\t\t\t\tWHERE record_timestamp >= :start\n\t\t\t\t\t\t\t\t\t\tAND record_timestamp <= :end\n\t\t\t\t\t\t\t\t\t\tAND station_id = :station\n\t\t\t\t\t\t\t\t\t\tGROUP BY record_device_id'),\n\t\t\t\t\t\tarray('start' => $start->timestamp,\n\t\t\t\t\t\t\t'end' => $end->timestamp,\n\t\t\t\t\t\t\t'station' => $station->id));\n\n\t\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t\tif ($user->count == 1) {\n\t\t\t\t\t\t\t$single_clicks[$i]++;\n\t\t\t\t\t\t} else if ($user->count == 2) {\n\t\t\t\t\t\t\t$double_clicks[$i]++;\n\t\t\t\t\t\t} else if ($user->count >= 3) {\n\t\t\t\t\t\t\t$more_clicks[$i]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif($now->gt($end)) {\n\t\t\t\t\t\tAnalytics::create(['type' => Analytics::LISTENER_ENGAGEMENT,\n\t\t\t\t\t\t\t'start_time' => $start->timestamp,\n\t\t\t\t\t\t\t'end_time' => $end->timestamp,\n\t\t\t\t\t\t\t'data' => serialize(array('single_clicks' => $single_clicks[$i],\n\t\t\t\t\t\t\t\t'double_clicks' => $double_clicks[$i],\n\t\t\t\t\t\t\t\t'more_clicks' => $more_clicks[$i]))\n\t\t\t\t\t\t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$start->addWeek();\n\t\t\t\t$end = $start->copy()->endOfWeek();\n\t\t\t}\n//\t\t\t$elapsed = microtime(true) - $time;\n//\t\t\t\\Log::info('Time: '. $elapsed);\n\n\n\t\t\t$result = array();\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'single_clicks' => $single_clicks,\n\t\t\t\t'double_clicks' => $double_clicks,\n\t\t\t\t'more_clicks' => $more_clicks,\n\t\t\t\t'labels' => $week_labels));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "function get_customersaleshistoryinvoicedate($custID, $shiptoID = '', $limit = 10, $page = 1, $sortrule, $filter = false, $filterable = false, $loginID= '', $useclass = false, $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$q = (new QueryBuilder())->table('saleshist');\n\t\t$q->field('saleshist.*');\n\t\t$q->field($q->expr(\"STR_TO_DATE(invdate, '%Y%m%d') as dateofinvoice\"));\n\t\t$q->where('custid', $custID);\n\n\t\tif (!empty($shiptoID)) {\n\t\t\t$q->where('shiptoid', $shiptoID);\n\t\t}\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep']) {\n\t\t\t$q->where('salesperson_1', DplusWire::wire('user')->salespersonid);\n\t\t}\n\t\tif (!empty($filter)) {\n\t\t\t$q->generate_filters($filter, $filterable);\n\t\t}\n\t\t$q->order('dateofinvoice ' . $sortrule);\n\t\t$q->limit($limit, $q->generate_offset($page, $limit));\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\tif ($useclass) {\n\t\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'SalesOrderHistory');\n\t\t\t\treturn $sql->fetchAll();\n\t\t\t}\n\t\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t}", "public function showPacienteHistoryMedic(Request $request)\n { \n $teleconsultasPendientes = Teleconsulta::where('idPaciente','=', $request->idPaciente)->where('estadoConsulta','=',2)->where('estadoPago','=',1)->get();\n\n $listTeleconsultasPendientes = array();\n foreach($teleconsultasPendientes as $teleconsultaPendiente){\n $medico = Medico::with(['especialidad'])->where('idMedico', '=', $teleconsultaPendiente->idMedico)->first();\n $date = date_create($teleconsultaPendiente->fechaHora);\n array_push($listTeleconsultasPendientes,[\n 'idTeleconsulta'=>$teleconsultaPendiente->idTeleconsulta,\n 'idPaciente'=>$teleconsultaPendiente->idPaciente,\n 'idMedico'=>$teleconsultaPendiente->idMedico,\n 'diagnostico'=>$teleconsultaPendiente->diagnostico,\n 'receta'=>$teleconsultaPendiente->receta,\n 'estadoConsulta'=>$teleconsultaPendiente->estadoConsulta,\n 'estadoPago'=>$teleconsultaPendiente->estadoPago,\n 'fecha'=> date_format($date, 'd/m/Y'),\n 'hora'=> date_format($date, 'H:i'),\n 'especialidad'=>$medico->especialidad->descripcion,\n 'idEspecialidad'=>$medico->especialidad->idEspecialidad,\n 'foto'=>$medico->foto,\n 'nombresMedico'=>$medico->nombres,\n 'apellidosMedico'=>$medico->apellidos\n \n ]);\n }\n \n return response()->json($listTeleconsultasPendientes);\n \n }", "function statistics_extended_logins_timeline($zoom=\"%y-%U\",$start_date=\"\",$finish_date=\"\"){\r\n\tglobal $CONFIG;\r\n\t$query= \"SELECT date_format(from_unixtime(time_created),'{$zoom}')as zoom, time_created, count(*) total,event \";\r\n\t$query.=\"FROM {$CONFIG->dbprefix}system_log \";\r\n\t$query.=\"WHERE event IN ('login') \";\r\n\t$query.=\"AND object_type='user' \";\r\n\t$query.=\"GROUP BY zoom,event\";\r\n\treturn get_data($query);\r\n}", "public function getStepHistory();", "function get_usersaleshistory($limit = 10, $page = 1, $filter = false, $filterable = false, $loginID = '', $useclass = false, $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$q = (new QueryBuilder())->table('saleshist');\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep']) {\n\t\t\t$q->where('salesperson_1', DplusWire::wire('user')->salespersonid);\n\t\t}\n\t\tif (!empty($filter)) {\n\t\t\t$q->generate_filters($filter, $filterable);\n\t\t}\n\t\t$q->limit($limit, $q->generate_offset($page, $limit));\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\tif ($useclass) {\n\t\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'SalesOrderHistory');\n\t\t\t\treturn $sql->fetchAll();\n\t\t\t}\n\t\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t}", "public function getHistoryAdmin() {\r\n if (Session::has('adminSession')) {\r\n $objadmin = Session::get('adminSession');\r\n //var_dump($objadmin);\r\n $id = $objadmin[0]->id;\r\n //echo $id;\r\n $tblAdminModel = new tblAdminModel();\r\n $data = $tblAdminModel->selectHistoryAdmin($id, 5);\r\n //echo $data[0]->historyContent;\r\n //var_dump($data);\r\n $link = $data->links();\r\n return View::make('backend.admin.adminHistory')->with('arrHistory', $data)->with('link', $link);\r\n } else {\r\n return View::make('fontend.404')->with('thongbao', 'Ko co lich su');\r\n }\r\n }", "public function salesList(Request $request){\n return Replishment::branch_replishmentWithDate($request->shop_id,$request->start_time,$request->end_time);\n }", "function get_usersaleshistoryorderdate($limit = 10, $page = 1, $sortrule, $filter = false, $filterable = false, $loginID = '', $useclass = false, $debug = false) {\n\t\t$loginID = (!empty($loginID)) ? $loginID : DplusWire::wire('user')->loginid;\n\t\t$user = LogmUser::load($loginID);\n\t\t$q = (new QueryBuilder())->table('saleshist');\n\t\t$q->field('saleshist.*');\n\t\t$q->field($q->expr(\"STR_TO_DATE(orderdate, '%Y%m%d') as dateoforder\"));\n\n\t\tif ($user->get_dplusrole() == DplusWire::wire('config')->roles['sales-rep']) {\n\t\t\t$q->where('salesperson_1', DplusWire::wire('user')->salespersonid);\n\t\t}\n\t\tif (!empty($filter)) {\n\t\t\t$q->generate_filters($filter, $filterable);\n\t\t}\n\t\t$q->order('dateoforder ' . $sortrule);\n\t\t$q->limit($limit, $q->generate_offset($page, $limit));\n\t\t$sql = DplusWire::wire('database')->prepare($q->render());\n\n\t\tif ($debug) {\n\t\t\treturn $q->generate_sqlquery($q->params);\n\t\t} else {\n\t\t\t$sql->execute($q->params);\n\t\t\tif ($useclass) {\n\t\t\t\t$sql->setFetchMode(PDO::FETCH_CLASS, 'SalesOrderHistory');\n\t\t\t\treturn $sql->fetchAll();\n\t\t\t}\n\t\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t\t}\n\t}" ]
[ "0.7128585", "0.54625285", "0.5440927", "0.53904057", "0.5361306", "0.5350883", "0.53204596", "0.5281722", "0.5246985", "0.5200864", "0.5193523", "0.5180792", "0.5177715", "0.51736695", "0.51697814", "0.5160064", "0.5132088", "0.50831985", "0.50828654", "0.5070254", "0.50563824", "0.50523067", "0.5041197", "0.50379384", "0.5016974", "0.49901327", "0.49828333", "0.4975461", "0.49535215", "0.49488196", "0.49420288", "0.49377507", "0.4934904", "0.49245793", "0.49143425", "0.49123877", "0.49122846", "0.49111274", "0.4908659", "0.49059185", "0.49004245", "0.48901626", "0.48842284", "0.48790362", "0.4871896", "0.48715124", "0.4860978", "0.4853185", "0.48511827", "0.48478603", "0.4845456", "0.48452374", "0.48376685", "0.4829652", "0.48256496", "0.4813205", "0.48124182", "0.48103106", "0.48057595", "0.48056996", "0.4804875", "0.4803844", "0.47925973", "0.47865668", "0.47859514", "0.47840172", "0.47794172", "0.47596237", "0.4757055", "0.47560441", "0.47436646", "0.47367275", "0.4734405", "0.4731854", "0.47313616", "0.47241554", "0.47228283", "0.47197354", "0.47190717", "0.47060996", "0.4702449", "0.47018462", "0.47001708", "0.4698093", "0.4693849", "0.46925962", "0.46922702", "0.4686444", "0.4685243", "0.46824074", "0.46801996", "0.46793693", "0.4677865", "0.46768215", "0.46709552", "0.46683636", "0.4664106", "0.46621117", "0.46612462", "0.46573406" ]
0.75899434
0
this method allows user to report mood mood is mandatory field
public function reportMoodAction(){ /** @var Object_User $user */ $data = $this->getRequestData(); if(isset($data['mood']) && in_array($data['mood'], range(1,3))){ $user = Object_User::getById($this->getDeviceSession()->getUserId()); $moodArr = $user->getMoodmeter()?$user->getMoodmeter():array(array('Date', 'Text', 'Mood')); $mood = array(); $mood[] = date('Y-m-d'); $mood[] = isset($data['text'])?$data['text']:""; $mood[] = $data['mood']; $moodArr[] = $mood; $user->setMoodmeter($moodArr); if(!$user->save()){ $this->setErrorResponse('Cannot update User object'); } } else { $this->setErrorResponse('Please, report your mood. mood is mandatory field! Mood should be between 1 and 3'); } $this->_helper->json(array('added' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMandatory();", "public function isMandatory() {\n\t\t$this->getMandatory();\n\t}", "public function isRequired() {}", "public function isRequired() {}", "public function isRequired() {}", "public function isRequired() {}", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "public function isRequired();", "private function checkRequired()\n {\n if ($this->fld->is_required == 1 && !$this->is_val_set) {\n throw new Exceptions\\DXCustomException(sprintf(trans('errors.required_field'), $this->fld->title_list));\n }\n }", "public function required();", "public function required();", "public function required();", "function testRequired(){\n\t\t#mdx:required\n\t\tParam::get('name')\n\t\t\t->context(['name'=>''])\n\t\t\t->filters()\n\t\t\t\t->required(\"Cannot be empty\");\n\n\t\t$error = Param::get('name')->process()->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Cannot be empty\", $error);\n\t}", "public function setRequired($required = true) {}", "public function setRequired($required = true) {}", "function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n }\n\n if (array_key_exists('IS_INT', $this->condition)) \n {\n if (!field_is_int($this->value))\n {\n $this->errors->add_msj(IS_INT_PRE.$this->name.IS_INT_POS);\n }\n }\n\n }\n }", "function wp_required_field_indicator()\n {\n }", "public function isMandatory_correct() {\n\t\t$this->getMandatory_correct();\n\t}", "public function getIsRequired(): bool;", "public function getRequired(): bool;", "public function setRequired($required = true);", "public function messages()\n {\n return [\n 'moods.required' => '☝️ You need to pick at least one mood to track.',\n ];\n }", "public function setRequired($required=true);", "public function asMandatory()\n {\n $this->mandatory = true;\n\n // update the cache that Datastore_MetaRecord holds\n $oDef = DataModel_Definitions::getIfExists($this->modelName);\n $oDef->setMandatoryField($this);\n }", "public function isRequired()\n {\n return true;\n }", "public function isMandatory()\n {\n if ($this->value == 'yes') {\n return true;\n } else {\n return false;\n }\n }", "public function isRequired() : bool;", "protected static function _required() {\n if (self::$_ruleValue) {\n if (trim(self::$_elementValue) == NULL &&\n strlen(self::$_elementValue) == 0) {\n self::setErrorMessage(\"Field Required\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }", "abstract protected function getMandatoryModelsFields();", "public function dispense()\n {\n $this->addValidator('model', new Validator_HasValue());\n }", "function testRequiredDefaultMessage(){\n\t\t#mdx:required2\n\t\tFlSouto\\ParamFilters::$errmsg_required = 'Cannot be empty';\n\n\t\tParam::get('name')\n\t\t\t->context(['name'=>''])\n\t\t\t->filters()\n\t\t\t\t->required();\n\n\t\t$error = Param::get('name')->process()->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Cannot be empty\", $error);\n\t}", "public function is_required(){\n\t\treturn $this->field->required;\n\t}", "private function addRestrictionToMedInfo(){\n if (LoginHelper::isACurrentPatient() || !LoginHelper::isLoggedIn()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized........!!</p>');\n }\n }", "function set_required() \n {\n $this->error_state = FORMEX_FIELD_REQUIRED;\n }", "function wp_required_field_message()\n {\n }", "public function testFieldIsRequiredAndHasDefault()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'gender';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isRequired());\n $this->assertFalse($field->isPrimaryKey());\n $this->assertFalse($field->isAutoIncremented());\n $this->assertSame('Unknown', $field->getDefault());\n // User does not have to provide this value; default will serve.\n $this->assertFalse($field->valueNecessaryForAdd());\n }", "public function testFieldIsRequiredAndHasNoDefault()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'status';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isRequired());\n $this->assertFalse($field->isPrimaryKey());\n $this->assertFalse($field->isAutoIncremented());\n $this->assertNull($field->getDefault());\n // User must provide this value.\n $this->assertTrue($field->valueNecessaryForAdd());\n }", "function req($field)\n{\n\t$ret = \"\";\n\tif ($field == 2)\n\t{\n\t\t$ret = \"<span class='required'> *</span>\";\n\t}\n\treturn $ret;\n}", "function required($fieldname, $value = true)\n\t{\n\t\t$this->setValidationOption($fieldname, 'required', $value);\n\t}", "public function getMandatoryValidationMessages() {}", "function validateRequired($required, $value, $type) {\n\tif($required == \"required\") {\n\n\t\t// Check if we got an empty value\n\t\tif($value == \"\") {\n\t\t\techo \"false\";\n\t\t\texit();\n\t\t}\n\t} else {\n\t\tif($value == \"\") {\n\t\t\techo \"none\";\n\t\t\texit();\n\t\t}\n\t}\n}", "public function validateAttributes($request, $action){\n // Todos los nuevos monstruos empiezan en nivel 1\n if ($action === \"new\") {\n if ($request['level'] !== 1) {\n return \"El nivel de Monstruo debe ser 1\";\n }\n }\n\n if ($request['name'] == '') {\n return \"El nombre no puede estar vacio.\";\n }\n\n if ($request['strength'] < 0 || $request['strength'] > 100) {\n return \"El atributo Strength no puede ser menor a 0 ni mayor a 100\";\n }\n\n if ($request['intelligence'] < 0 || $request['intelligence'] > 100) {\n return \"El atributo Intelligence no puede ser menor a 0 ni mayor a 100\";\n }\n\n if ($request['dexterity'] < 0 || $request['dexterity'] > 100) {\n return \"El atributo Dexterity no puede ser menor a 0 ni mayor a 100\";\n }\n\n return true;\n }", "public function validate()\n {\n if ($this->getOptions('required') == 1 && $this->getValue() == '') {\n $this->setLibelle('<div class=\"error_message\">Le champ est requis et ne doit pas être vide.</div>');\n return false;\n } else {\n return true;\n }\n }", "public function requiredIfUrgent($attribute, $params)\n\t{\n\t\t$side = $params['side'];\n\t\tif (($side == 'left' && $this->eye_id != Eye::RIGHT) || ($side == 'right' && $this->eye_id != Eye::LEFT)) {\n\t\t\tif ($this->$attribute == null && ($this->{$side . '_start_period'} && $this->{$side . '_start_period'}->urgent) ) {\n\t\t\t\t$this->addError($attribute, ucfirst($params['side']).\" \".$this->getAttributeLabel($attribute).\" cannot be blank.\");\n\t\t\t}\n\t\t}\n\t}", "function isRequired()\n {\n return $this->required;\n }", "function validate(){\r\n\t\t$missing_fields = Array ();\r\n\t\tforeach ( $this->required_fields as $field ) {\r\n\t\t\t$true_field = $this->fields[$field]['name'];\r\n\t\t\tif ( $this->$true_field == \"\") {\r\n\t\t\t\t$missing_fields[] = $field;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( count($missing_fields) > 0){\r\n\t\t\t// TODO Create friendly equivelant names for missing fields notice in validation \r\n\t\t\t$this->errors[] = __ ( 'Missing fields: ' ) . implode ( \", \", $missing_fields ) . \". \";\r\n\t\t}\r\n\t\treturn apply_filters('em_event_validate', count($this->errors) == 0, $this );\r\n\t}", "public function is_met();", "public function validarProfesion() {\n if (!$this->hasErrors()) {\n if (empty($this->profesion) && empty($this->ocupacion)) {\n $this->addError('profesion', 'Profesi&oacute;n/ocupaci&oacute;n no puede estar vac&iacute;o');\n $this->addError('ocupacion', 'Profesi&oacute;n/ocupaci&oacute;n no puede estar vac&iacute;o');\n }\n }\n }", "public function required($data,$space);", "public function setRequired($required);", "function CheckRequired($reqd,$vars,&$missing)\n{\n $bad = false;\n $list = explode(\",\",$reqd);\n for ($ii = 0 ; $ii < count($list) ; $ii++)\n {\n $name = $list[$ii];\n if ($name)\n {\n //\n // field names can be just straight names, or in this\n // format:\n // fieldname:Nice printable name for displaying\n //\n if (($nice_name_pos = strpos($name,\":\")) > 0)\n {\n $nice_name = substr($name,$nice_name_pos + 1);\n $name = substr($name,0,$nice_name_pos);\n }\n else\n $nice_name = $name;\n if (!isset($vars[$name]) || empty($vars[$name]))\n {\n $bad = true;\n $missing .= \"$nice_name\\n\";\n }\n }\n }\n return (!$bad);\n}", "public function getMandatory() {\n return $this->__isMandatory;\n }", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "public function rules()\n {\n return [\n 'mars.*.medication_id' => 'required|integer|exists:medications,medication_id',\n 'mars.*.medical_record_number' => 'required|integer|exists:patients,medical_record_number',\n 'mars.*.stat' => 'boolean|nullable', \n 'mars.*.instructions' => 'required|string',\n 'mars.*.given_at.*' => 'boolean|nullable',\n ];\n }", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "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 }", "private function required ($param)\n {\n $v = trim($this->value);\n if ($v === '')\n {\n $this->SetError('required', 'The '.$this->SpacedKey.' field is required');\n return false;\n }\n return true;\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public static function getMandatoryField() {\n\t\t$mandatory['AU'] = array('bsb' => 'required','account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'routing_number' => 'required');\n\t\t$mandatory['CA'] = array('transit_number' => 'required','account_number' => 'required','institution_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'routing_number' => 'required');\n\t\t$mandatory['GB'] = array('sort_code' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['HK'] = array('clearing_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['JP'] = array('bank_code' => 'required','bank_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'bank_name' => 'required', 'branch_name' => 'required', 'account_owner_name' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['NZ'] = array('routing_number' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['SG'] = array('bank_code' => 'required', 'account_number' => 'required', 'branch_code' => 'required', 'account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['US'] = array('routing_number' => 'required', 'account_number' => 'required', 'account_holder_name' => 'required', 'currency' => 'required', 'ssn_last_4' => 'required');\n\t\t$mandatory['AT'] = array('iban' => 'required','account_number'=>'required','account_holder_name' => 'required', 'currency' => 'required');\n\t\t$mandatory['BE'] = array('iban' => 'required','account_holder_name' => 'required','currency' => 'required','account_number'=>'required');\n\t\t$mandatory['CH'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['DE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['DK'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['ES'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['FI'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['FR'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number' => 'required');\n\t\t$mandatory['IE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['IT'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['LU'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['NL'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['NO'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['PT'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['SE'] = array('iban' => 'required', 'account_holder_name' => 'required', 'currency' => 'required','account_number'=>'required');\n\t\t$mandatory['OT'] = array('account_number' => 'required', 'bank_name' => 'required', 'account_holder_name' => 'required','branch_name' => 'required');\n\n\t\treturn $mandatory;\n\t}", "public function isMandatory(): bool\n {\n return $this->isMandatory;\n }", "function displayRequired($fieldName) {\r\n\t\t\techo \"The field \\\"$fieldName\\\" is required.<br/>\";\r\n\t\t}", "function getIsMandatory() {\n\t\treturn $this->bIsMandatory;\n\t}", "public function setRequired($blnValue) {\n\t\t$this->__required = !!$blnValue;\n\t}", "public function testDefaultRequired()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $required = $view->get('required');\n \n $this->assertFalse($required);\n }", "public function validate_required($name)\n\t{\n\t\treturn array_key_exists($name, $this->datas) && $this->datas[$name] != '';\n\t}", "public function rules()\n {\n return [\n 'expense' => 'required',\n ];\n }", "public function validatePerms(){ \n\t\treturn TRUE;\n\t}", "public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }", "public function required()\n {\n return (true == @$this->data[\"required\"]);\n }", "public function isRequired() {\n\t\t\tif ($this->info->type == 'string') {\n\t\t\t\tif (Core\\Data\\ToolKit::isEmpty($this->value)) {\n\t\t\t\t\t// TODO add logging\n\t\t\t\t}\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\telse if (Core\\Data\\ToolKit::isUnset($this->value)) {\n\t\t\t\t// TODO add logging\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "function form1()\r\n {\r\n global $f3;\r\n $isValid= true;\r\n if (!validString($f3->get('animal'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['animal']\", \"Please enter an animal \");\r\n }\r\n if (!validQty($f3->get('qty'))) {\r\n $isValid = false;\r\n $f3->set(\"errors['qty']\", \"Please enter quantity\");\r\n }\r\n return $isValid;\r\n }", "public function isRequired()\n {\n $attributeMetadata = $this->_getAttribute('dob');\n return $attributeMetadata ? (bool)$attributeMetadata->isRequired() : false;\n }", "public function isRequired()\n {\n return $this->required;\n }", "public function isRequired() {\n return $this->is_required;\n }", "function isOmitted()\n\t{\n\t\treturn TRUE;\n\t}", "public function testDefaultRequired()\n {\n $form = $this->factory->create('ckeditor');\n $view = $form->createView();\n $required = $view->get('required');\n\n $this->assertFalse($required);\n }", "public function isRequired() {\n return $this->required;\n }", "abstract public function getValidateDesc();", "public function isRequired() {\n return $this->requirement->required;\n }", "public function is_required() {\n\t\treturn isset( $this->data['required'] ) && $this->data['required'];\n\t}", "function form_validation_rules()\n\t{\n\t\t$this->form_validation->set_message('required', '%s tidak boleh kosong');\n\t}", "function mandatory() {\n\t\t$aMandatories = array();\n\t\t$this->load->model('estate/cart_model');\n\t\t$this->load->model('estate/plans_model');\n\t\t\n\t\t$cart_gadget_details = $this->cart_model->get_gadget_oncart();\n\t\t\n\t\t$bundlesMandatory = $this->input->post('data');\n\n\t\t$mandatoryTypeId = $this->input->post('typeid');\n\t\t\n\t\tswitch ($bundlesMandatory) {\n\t\t\tcase \"combos\" : $aMandatories = $this->plans_model->get_mandatory_per_bundle_type(\"2\",$cart_gadget_details['plan_bundle_service_type'],$mandatoryTypeId);\n\t\t\t\tbreak;\n\t\t\tcase \"boosters\" : $aMandatories = $this->plans_model->get_mandatory_per_bundle_type(\"1\",$cart_gadget_details['plan_bundle_service_type'],$mandatoryTypeId);\n\t\t\t\tbreak;\n\t\t}\n\t\t$bRetCheckbox = '<p>How much mobile data will you need?</p>\n\t\t\t\t<form id=\"checkboxMandatory\"><input type=\"hidden\" name=\"data\" value=\"'.$bundlesMandatory.'\"><ul style=\"list-style:none;\">';\n\t\t$bRet = '<ul style=\"list-style:none;\" id=\"listMandatory\">';\n\t\tforeach($aMandatories as $bundleId => $vMandatories) {\n\t\t\t$bRetCheckbox .= '<li style=\"margin-right:10px;\">\n\t\t\t\t\t\t<input type=\"checkbox\" value=\"'.$vMandatories['mandtype'].'\" name=\"viewMandatoryByType[]\" id=\"viewMandatoryByType\" class=\"fl b-c-checkbox1\" style=\"margin-right:10px;\" checked/>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<label for=\"Light\" class=\"fl\" style=\"color:#000;\">'.$bundleId.'</label>\n\t\t\t\t\t\t<div class=\"clr\"></div>\n\t\t\t\t\t</li>';\n\t\t\t\n\t\t\t$bRet .= '<li class=\"span3 b-c-checkChoice1\" style=\"margin-bottom:10px\" id=\"'.$bundlesMandatory.'_mandatory\" data-type=\"'.$bundleId.'\">'.\n\t\t\t\t\t\t'<a class=\"create_add_this_mandatory\" data-product-type=\"'.$bundlesMandatory.'\" data-id=\"'.$vMandatories['id'].'\" data-amount=\"'.$vMandatories['amount'].'\" data-pv=\"'.$vMandatories['peso_value'].'\" data-name=\"'.$vMandatories['name'].'\">'.'<i class=\"icon icon-peso\"></i><br />'.\n\t\t\t\t\t\t\t$vMandatories['name'].\n\t\t\t\t\t\t\t'<br><p>'.$vMandatories['desc'].'</p>'.\n\t\t\t\t\t\t'</a>'.\n\t\t\t\t\t'</li>';\n\t\t}\n\t\t$bRetCheckbox .= '</ul></form><div class=\"clr\"></div><br />';\n\t\t$bRet .= '</ul>\n\t\t\t<div class=\"clr\"></div>\n\t\t\t\n\t\t\t<br style=\"clear:both\"> \n\t\t\t<button class=\"blue-btn\" id=\"mandatoryPrev\">Previous</button>\n\t\t\t<div class=\"clr\"></div>';\n\t\techo $bRetCheckbox;\n\t\techo $bRet;\n\t}", "function format_required_indicator($p_field_name, $p_required_fields){\n\tif(in_array($p_field_name, $p_required_fields))\n\t\treturn '<span class=\"required\">*</span>';\n\treturn '';\n}", "protected function validation(){\t\t\n\t\t$this->validate(\"InclusionIn\", array(\n\t\t\t\"field\" => \"mandoc\",\n\t\t\t\"domain\" => array('S', 'N'),\n\t\t\t\"required\" => true\n\t\t));\n\t\tif($this->validationHasFailed()==true){\n\t\t\treturn false;\n\t\t}\n\t}", "public function getRequiredNice()\n {\n return $this->dbObject('Required')->Nice();\n }", "public function getFrontEndRequiredFields();", "public function rules()\n {\n return array(\n array('dari, sampai', 'required', 'message' => '{attribute} tidak boleh kosong'),\n array('profilId, userId, kategoriId', 'safe')\n );\n }", "public function testNoAriaRequired()\n {\n $field = new OptionsetField('RequiredField', 'myRequiredField');\n\n $form = new Form(\n Controller::curr(),\n \"form\",\n new FieldList($field),\n new FieldList(),\n new RequiredFields([\"RequiredField\"])\n );\n $this->assertTrue($field->Required());\n\n $attributes = $field->getAttributes();\n $this->assertFalse(array_key_exists(\"name\", $attributes ?? []));\n $this->assertFalse(array_key_exists(\"required\", $attributes ?? []));\n $this->assertTrue(array_key_exists(\"role\", $attributes ?? []));\n }", "public function validated();", "public function rules()\n {\n return [\n \"cupom\" => \"required\"\n ];\n }", "public function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray('tgl_awal,tgl_akhir', 'required'),\r\n\t\t);\r\n\t}", "public function check () {\n $modelName = $this->field->model->name;\n $fieldName = $this->field->name;\n $bean = $this->field->model->bean;\n $ctx = @$this->field->constraints['context'];\n $update = $ctx ? strpos(\",,{$ctx->value},\", ',update,') : true;\n return $this->dispatch(\n (!$this->value) || ($this->field && $this->field->value) || ($bean->id && !$update),\n \"{$this->field->title} is required\"\n );\n }", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('competition', 'required'),\n\t\t);\n\t}" ]
[ "0.6216599", "0.6050632", "0.59296757", "0.59296757", "0.59294224", "0.5928736", "0.58822936", "0.58822936", "0.58822936", "0.58822936", "0.58822936", "0.58822936", "0.58822936", "0.58822936", "0.58804005", "0.5835324", "0.5835324", "0.5835324", "0.57050234", "0.57035434", "0.57027286", "0.5688314", "0.56847495", "0.56821823", "0.5679121", "0.56765145", "0.5660944", "0.5655618", "0.56374097", "0.5624465", "0.5618823", "0.55828404", "0.55380744", "0.5526115", "0.55132025", "0.5511191", "0.5504457", "0.54729915", "0.5448888", "0.54487693", "0.5408872", "0.53999734", "0.5337407", "0.5314465", "0.5288321", "0.527446", "0.52733564", "0.5268053", "0.52679265", "0.52655715", "0.52477926", "0.5239783", "0.5234389", "0.5228717", "0.5213078", "0.5189246", "0.51711917", "0.5164736", "0.5164663", "0.51632696", "0.5153609", "0.5141972", "0.5135639", "0.51274145", "0.51274145", "0.51252", "0.5120513", "0.5089295", "0.507988", "0.5079302", "0.5070771", "0.50627995", "0.5061292", "0.50608253", "0.5059258", "0.50589496", "0.50462687", "0.50410426", "0.50335103", "0.5031096", "0.50286734", "0.5028525", "0.5023532", "0.5019406", "0.5015647", "0.50008667", "0.4996153", "0.49878958", "0.4983447", "0.49830025", "0.49672353", "0.496479", "0.4947427", "0.49456856", "0.494306", "0.4934831", "0.49339134", "0.49310142", "0.4928254", "0.4927267" ]
0.5930218
2
this method allows user to get mood history, or mood for each day date is optional field for this request
public function getMoodAction(){ $data = $this->getRequestData(); $user = Object_User::getById($this->getDeviceSession()->getUserId()); $moodArr = $user->getMoodmeter(); if(isset($moodArr[0])){ unset($moodArr[0]); } if(isset($data['date'])){ foreach($moodArr as $mood){ if($mood[0] == $data['date']){ $this->_helper->json($mood); } else { $this->setErrorResponse('No mood for this day!'); } } } $this->_helper->json($moodArr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_recommendations($cur_hour, $cur_day, $mood) {\n\n\t\t\n\t\tswitch ($cur_hour) {\n\t\t\tcase $cur_hour >= 1 && $cur_hour <= 3:\n\t\t\t\t$where = \"DATE_FORMAT(interactions.date_listened, '%H') BETWEEN 01 AND 03 AND DATE_FORMAT(interactions.date_listened, '%d') <> '$cur_day' AND interactions.mood = '$mood'\";\n\t\t\t\tbreak;\n\t\t\tcase $cur_hour >= 4 && $cur_hour <= 6:\n\t\t\t\t$where = \"DATE_FORMAT(interactions.date_listened, '%H') BETWEEN 04 AND 06 AND DATE_FORMAT(interactions.date_listened, '%d') <> '$cur_day' AND interactions.mood = '$mood'\";\n\t\t\t\tbreak;\n\t\t\tcase $cur_hour >= 07 && $cur_hour <= 11:\n\t\t\t\t$where = \"DATE_FORMAT(interactions.date_listened, '%H') BETWEEN 07 AND 11 AND DATE_FORMAT(interactions.date_listened, '%d') <> '$cur_day' AND interactions.mood = '$mood'\";\n\t\t\t\tbreak;\n\t\t\tcase $cur_hour >= 12 && $cur_hour <= 13:\n\t\t\t\t$where = \"DATE_FORMAT(interactions.date_listened, '%H') BETWEEN 12 AND 13 AND DATE_FORMAT(interactions.date_listened, '%d') <> '$cur_day' AND interactions.mood = '$mood'\";\n\t\t\t\tbreak;\n\t\t\tcase $cur_hour >= 14 && $cur_hour <= 17:\n\t\t\t\t$where = \"DATE_FORMAT(interactions.date_listened, '%H') BETWEEN 14 AND 17 AND DATE_FORMAT(interactions.date_listened, '%d') <> '$cur_day' AND interactions.mood = '$mood'\";\n\t\t\t\tbreak;\n\t\t\tcase $cur_hour >= 18 && $cur_hour <= 23:\n\t\t\t\t$where = \"DATE_FORMAT(interactions.date_listened, '%H') BETWEEN 18 AND 23 AND DATE_FORMAT(interactions.date_listened, '%d') <> '$cur_day' AND interactions.mood = '$mood'\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->db->select('songs.song_id, songs.title, songs.artist, songs.album_art, songs.year, count(interactions.song_id) as play_count')->from('songs');\n\t\t$this->db->join('interactions', 'songs.song_id = interactions.song_id');\n\t\t$this->db->where($where);\n\t\t$this->db->group_by('songs.song_id');\n\t\t$recommended_songs = $this->db->get();\n\t\treturn $recommended_songs->result();\n\t}", "public function reportMoodAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n if(isset($data['mood']) && in_array($data['mood'], range(1,3))){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $moodArr = $user->getMoodmeter()?$user->getMoodmeter():array(array('Date', 'Text', 'Mood'));\n $mood = array();\n $mood[] = date('Y-m-d');\n $mood[] = isset($data['text'])?$data['text']:\"\";\n $mood[] = $data['mood'];\n $moodArr[] = $mood;\n $user->setMoodmeter($moodArr);\n if(!$user->save()){\n $this->setErrorResponse('Cannot update User object');\n }\n } else {\n $this->setErrorResponse('Please, report your mood. mood is mandatory field! Mood should be between 1 and 3');\n }\n\n $this->_helper->json(array('added' => true));\n }", "private function __getMedicationDataOnDate($date) {\n\t\t$userId = $this->Auth->user('id');\n\t\t$timezone = $this->Auth->user('timezone');\n\t\t$result = $this->MedicationSchedule->getUserMedicationDataOnDate($userId, $date, $timezone);\n\t\treturn $result;\n\t}", "public function mooduplistAction()\n {\n $uid = $this->_USER_ID;\n $floorId = $this->getParam('CF_floorId');\n $storeType = $this->getParam(\"CF_storeType\");\n //chairId,oidMood from giveservice page\n $chairId = $this->getParam(\"CF_chairid\");\n $oldMood = $this->getParam(\"CF_oldMood\");\n\n $mbllApi = new Mbll_Tower_ServiceApi($uid);\n $aryRst = $mbllApi->getMoodUpList($floorId);\n $moodUpList = $aryRst['result'];\n\n if (!$aryRst) {\n $errParam = '-1';\n if (!empty($aryRst['errno'])) {\n $errParam = $aryRst['errno'];\n }\n return $this->_redirectErrorMsg($errParam);\n }\n\n\n if (!isset($moodUpList[22])) {\n $moodUpList[22]['id'] = 22;\n $moodUpList[22]['nm'] = 0;\n }\n if (!isset($moodUpList[23])) {\n $moodUpList[23]['id'] = 23;\n $moodUpList[23]['nm'] = 0;\n }\n if (!isset($moodUpList[24])) {\n $moodUpList[24]['id'] = 24;\n $moodUpList[24]['nm'] = 0;\n }\n\n if (!empty($moodUpList)) {\n foreach ($moodUpList as $key => $value) {\n $item = Mbll_Tower_ItemTpl::getItemDescription($value['id']);\n $moodUpList[$key]['name'] = $item['name'];\n $moodUpList[$key]['des'] = $item['desc'];\n\n if ($item['buy_mb'] > 0) {\n $moodUpList[$key]['money_type'] = 'm';\n }\n else if ($item['buy_gb'] > 0) {\n $moodUpList[$key]['money_type'] = 'g';\n }\n }\n }\n $this->view->moodUpList = $moodUpList;\n $this->view->floorId = $floorId;\n $this->view->chairId = $chairId;\n $this->view->storeType = $storeType;\n $this->view->oldMood = $oldMood;\n $this->render();\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 static function get_like_all($today) {\n\t\t$today = date_create($today);\n\t\t$year = date_format($today, 'Y');\n\t\t$month = date_format($today, 'm');\n\t\t$date = date_format($today, 'd');\n\t\t// get week\n\t\t$book_like = BooksLikeStatisticQModel::get_book_like_all($date, $month, $year);\n\t\tif ($book_like == null) {\n\t\t\t$week = null;\n\t\t} else {\n\t\t\t$week = $book_like->week;\n\t\t}\n\t\t// dd($week);\n\t\t$data['day']\t= [];\n\t\t$data['week']\t= [];\n\t\t$data['month']\t= [];\n\t\t$data['season']\t= [];\n\t\t$data['year']\t= [];\n\t\t// get view day all\n\t\tfor ($i = 0; $i < 7; $i++) { \n\t\t\t$data['day'][$i] = BooksLikeStatisticQModel::get_book_like_day_all($i, $week, $month, $year);\n\t\t\tif ($data['day'][$i] == null)\n\t\t\t\t$data['day'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['day'][$i] = (int)$data['day'][$i]->_like;\n\t\t}\n\t\t// get view week all\n\t\tfor ($i = 0; $i < 5; $i++) { \n\t\t\t$data['week'][$i] = BooksLikeStatisticQModel::get_book_like_week_all($i, $month, $year);\n\t\t\tif ($data['week'][$i] == null)\n\t\t\t\t$data['week'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['week'][$i] = (int)$data['week'][$i]->_like;\n\t\t}\n\t\t// get view month all\n\t\tfor ($i = 1; $i <= 12; $i++) { \n\t\t\t$data['month'][$i] = BooksLikeStatisticQModel::get_book_like_month_all($i, $year);\n\t\t\tif ($data['month'][$i] == null)\n\t\t\t\t$data['month'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['month'][$i] = (int)$data['month'][$i]->_like;\n\t\t}\n\t\t// get view season all\n\t\tfor ($i = 1; $i <= 4; $i++) { \n\t\t\t$data['season'][$i] = BooksLikeStatisticQModel::get_book_like_season_all($i, $year);\n\t\t\tif ($data['season'][$i] == null)\n\t\t\t\t$data['season'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['season'][$i] = (int)$data['season'][$i]->_like;\n\t\t}\n\t\t// get view year all\n\t\tfor ($i = 2012; $i <= 2019; $i++) { \n\t\t\t$data['year'][$i] = BooksLikeStatisticQModel::get_book_like_year_all($i);\n\t\t\tif ($data['year'][$i] == null)\n\t\t\t\t$data['year'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['year'][$i] = (int)$data['year'][$i]->_like;\n\t\t}\n\t\treturn $data;\n\t}", "public function index()\n {\n $startDate = Carbon::now()->addWeek(-1);\n $endDate = Carbon::now();\n $mood = MoodManager::getMoodCalculateByEmployeeId($startDate, $endDate);\n\n return response()->json($mood);\n }", "public function getMomentsByDate($start_date = 0, $end_date = 0) {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\tif($start_date == 0) {\n\t\t\t\t$start = Carbon::now($timezone)->startOfDay();\n\t\t\t} else {\n\t\t\t\t$start = Carbon::createFromFormat('Y-m-d', $start_date, $timezone)->startOfDay();\n\t\t\t}\n\n\t\t\tif($end_date == 0) {\n\t\t\t\t$end = Carbon::now($timezone)->endOfDay();\n\t\t\t} else {\n\t\t\t\t$end = Carbon::createFromFormat('Y-m-d', $end_date, $timezone)->endOfDay();\n\t\t\t}\n\n\t\t\t$competition_tag_ids = $this->getCompetitionTags($start, $end);\n\t\t\t$vote_tag_ids = $this->getVoteTags($start, $end);\n\n\t\t\t$data = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw(\"FLOOR(MOD(airshr_events.record_timestamp + {$offset}, 86400)/3600) AS hour,\n\t\t\tCOUNT(*) as count, airshr_events.content_type_id\"))\n\t\t\t\t->whereNotIn('airshr_events.tag_id', array_merge($competition_tag_ids, $vote_tag_ids))\n\t\t\t\t->where('airshr_events.station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t->where('airshr_events.record_timestamp', '>=', $start->timestamp)\n\t\t\t\t->where('airshr_events.record_timestamp', '<=', $end->timestamp)\n\t\t\t\t->groupBy('airshr_events.content_type_id')\n\t\t\t\t->groupBy('hour')\n\t\t\t\t->orderBy('airshr_events.content_type_id')\n\t\t\t\t->get();\n\n\t\t\t$music_raw = [];\n\t\t\t$talk_raw = [];\n\t\t\t$ad_raw = [];\n\t\t\t$news_raw = [];\n\t\t\t$traffic_raw = [];\n\t\t\t$promo_raw = [];\n\t\t\tforeach($data as $data_point) {\n\t\t\t\tswitch($data_point->content_type_id) {\n\t\t\t\t\tcase ContentType::GetMusicContentTypeID() :\n\t\t\t\t\t\t$music_raw[$data_point->hour] = $data_point->count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ContentType::GetTalkContentTypeID() :\n\t\t\t\t\t\t$talk_raw[$data_point->hour] = $data_point->count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ContentType::GetAdContentTypeID() :\n\t\t\t\t\t\t$ad_raw[$data_point->hour] = $data_point->count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ContentType::GetNewsContentTypeID() :\n\t\t\t\t\t\t$news_raw[$data_point->hour] = $data_point->count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ContentType::GetTrafficContentTypeID() :\n\t\t\t\t\t\t$traffic_raw[$data_point->hour] = $data_point->count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ContentType::GetPromoContentTypeID() :\n\t\t\t\t\t\t$promo_raw[$data_point->hour] = $data_point->count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$music = [];\n\t\t\t$talk = [];\n\t\t\t$ad = [];\n\t\t\t$news = [];\n\t\t\t$traffic = [];\n\t\t\t$promo = [];\n\n\t\t\t$i = 0;\n\t\t\tfor($hour = 6; $hour <= 22; $hour++) {\n\t\t\t\tif(array_key_exists($hour, $music_raw)) {\n\t\t\t\t\t$music[$i] = $music_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$music[$i] = 0;\n\t\t\t\t}\n\t\t\t\tif(array_key_exists($hour, $talk_raw)) {\n\t\t\t\t\t$talk[$i] = $talk_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$talk[$i] = 0;\n\t\t\t\t}\n\t\t\t\tif(array_key_exists($hour, $ad_raw)) {\n\t\t\t\t\t$ad[$i] = $ad_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$ad[$i] = 0;\n\t\t\t\t}\n\t\t\t\tif(array_key_exists($hour, $news_raw)) {\n\t\t\t\t\t$news[$i] = $news_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$news[$i] = 0;\n\t\t\t\t}\n\t\t\t\tif(array_key_exists($hour, $traffic_raw)) {\n\t\t\t\t\t$traffic[$i] = $traffic_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$traffic[$i] = 0;\n\t\t\t\t}\n\t\t\t\tif(array_key_exists($hour, $promo_raw)) {\n\t\t\t\t\t$promo[$i] = $promo_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$promo[$i] = 0;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'music' => $music,\n\t\t\t\t'talk' => $talk,\n\t\t\t\t'ad' => $ad,\n\t\t\t\t'news' => $news,\n\t\t\t\t'traffic' => $traffic,\n\t\t\t\t'promo' => $promo));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "public function index()\n {\n $startDate = Carbon::now()->addWeek(-4);\n $endDate = Carbon::now();\n\n $mood = MoodManager::getMoodCalculateByCompanyId($startDate, $endDate);\n\n return response()->json($mood);\n }", "public static function get_follow_all($today) {\n\t\t$today = date_create($today);\n\t\t$year = date_format($today, 'Y');\n\t\t$month = date_format($today, 'm');\n\t\t$date = date_format($today, 'd');\n\t\t// get week\n\t\t$book_follow = BooksFollowStatisticQModel::get_book_follow_all($date, $month, $year);\n\t\tif ($book_follow == null) {\n\t\t\t$week = null;\n\t\t} else {\n\t\t\t$week = $book_follow->week;\n\t\t}\n\t\t// dd($week);\n\t\t$data['day']\t= [];\n\t\t$data['week']\t= [];\n\t\t$data['month']\t= [];\n\t\t$data['season']\t= [];\n\t\t$data['year']\t= [];\n\t\t// get view day all\n\t\tfor ($i = 0; $i < 7; $i++) { \n\t\t\t$data['day'][$i] = BooksFollowStatisticQModel::get_book_follow_day_all($i, $week, $month, $year);\n\t\t\tif ($data['day'][$i] == null)\n\t\t\t\t$data['day'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['day'][$i] = (int)$data['day'][$i]->follow;\n\t\t}\n\t\t// get view week all\n\t\tfor ($i = 0; $i < 5; $i++) { \n\t\t\t$data['week'][$i] = BooksFollowStatisticQModel::get_book_follow_week_all($i, $month, $year);\n\t\t\tif ($data['week'][$i] == null)\n\t\t\t\t$data['week'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['week'][$i] = (int)$data['week'][$i]->follow;\n\t\t}\n\t\t// get view month all\n\t\tfor ($i = 1; $i <= 12; $i++) { \n\t\t\t$data['month'][$i] = BooksFollowStatisticQModel::get_book_follow_month_all($i, $year);\n\t\t\tif ($data['month'][$i] == null)\n\t\t\t\t$data['month'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['month'][$i] = (int)$data['month'][$i]->follow;\n\t\t}\n\t\t// get view season all\n\t\tfor ($i = 1; $i <= 4; $i++) { \n\t\t\t$data['season'][$i] = BooksFollowStatisticQModel::get_book_follow_season_all($i, $year);\n\t\t\tif ($data['season'][$i] == null)\n\t\t\t\t$data['season'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['season'][$i] = (int)$data['season'][$i]->follow;\n\t\t}\n\t\t// get view year all\n\t\tfor ($i = 2012; $i <= 2019; $i++) { \n\t\t\t$data['year'][$i] = BooksFollowStatisticQModel::get_book_follow_year_all($i);\n\t\t\tif ($data['year'][$i] == null)\n\t\t\t\t$data['year'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['year'][$i] = (int)$data['year'][$i]->follow;\n\t\t}\n\t\treturn $data;\n\t}", "public function getMedicineRestockingHistory(Request $request){\n\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n $data['histories'] = $this->medicine_inventory->getMedicineInventory($request);\n $data['sort'] = 'desc';\n \n return view('hact.reports.medicine.history', $data);\n }", "public function showPacienteHistoryMedic(Request $request)\n { \n $teleconsultasPendientes = Teleconsulta::where('idPaciente','=', $request->idPaciente)->where('estadoConsulta','=',2)->where('estadoPago','=',1)->get();\n\n $listTeleconsultasPendientes = array();\n foreach($teleconsultasPendientes as $teleconsultaPendiente){\n $medico = Medico::with(['especialidad'])->where('idMedico', '=', $teleconsultaPendiente->idMedico)->first();\n $date = date_create($teleconsultaPendiente->fechaHora);\n array_push($listTeleconsultasPendientes,[\n 'idTeleconsulta'=>$teleconsultaPendiente->idTeleconsulta,\n 'idPaciente'=>$teleconsultaPendiente->idPaciente,\n 'idMedico'=>$teleconsultaPendiente->idMedico,\n 'diagnostico'=>$teleconsultaPendiente->diagnostico,\n 'receta'=>$teleconsultaPendiente->receta,\n 'estadoConsulta'=>$teleconsultaPendiente->estadoConsulta,\n 'estadoPago'=>$teleconsultaPendiente->estadoPago,\n 'fecha'=> date_format($date, 'd/m/Y'),\n 'hora'=> date_format($date, 'H:i'),\n 'especialidad'=>$medico->especialidad->descripcion,\n 'idEspecialidad'=>$medico->especialidad->idEspecialidad,\n 'foto'=>$medico->foto,\n 'nombresMedico'=>$medico->nombres,\n 'apellidosMedico'=>$medico->apellidos\n \n ]);\n }\n \n return response()->json($listTeleconsultasPendientes);\n \n }", "public function mooduptootherlistAction()\n {\n $uid = $this->_USER_ID;\n $floorId = $this->getParam('CF_floorId');\n $storeType = $this->getParam(\"CF_storeType\");\n $chairId = $this->getParam(\"CF_chairid\");\n $oldMood = $this->getParam(\"CF_oldMood\");\n\n //get user item list\n $mbllApi = new Mbll_Tower_ServiceApi($uid);\n $aryRst = $mbllApi->getUserItemList(0, 100, 1);\n\n if (!$aryRst || !$aryRst['result']) {\n $errParam = '-1';\n if (!empty($aryRst['errno'])) {\n $errParam = $aryRst['errno'];\n }\n return $this->_redirectErrorMsg($errParam);\n }\n\n //mood up item list\n $moodUpList = $aryRst['result']['list'];\n\n //get item can mood to other\n $moodItem = array();\n foreach ($moodUpList as $key => $value) {\n if (25 == $value['id'] || 26 == $value['id']) {\n $moodItem[$value['id']]['id'] = $value['id'];\n $moodItem[$value['id']]['nm'] = $value['num'];\n }\n }\n\n if (!isset($moodItem[25])) {\n $moodItem[25]['id'] = 25;\n $moodItem[25]['nm'] = 0;\n }\n if (!isset($moodItem[26])) {\n $moodItem[26]['id'] = 26;\n $moodItem[26]['nm'] = 0;\n }\n\n foreach ($moodItem as $key => $value) {\n $item = Mbll_Tower_ItemTpl::getItemDescription($value['id']);\n $moodItem[$key]['name'] = $item['name'];\n $moodItem[$key]['des'] = $item['desc'];\n }\n\n $this->view->moodUpList = $moodItem;\n $this->view->floorId = $floorId;\n $this->view->storeType = $storeType;\n $this->view->chairId = $chairId;\n $this->view->oldMood = $oldMood;\n $this->render();\n }", "public function index()\n {\n\t\t$user = Auth::user();\n\n // Check if setup is completed\n\n\n if(!$user->settings('setupIsDone')) {\n $setupStep = $user->settings('setupStep');\n return redirect(route('you.setup', ['step' => $setupStep]));\n }\n\n $trackable_types_id = json_decode($user->settings('mood_type_id'));\n\n\n\n foreach ($trackable_types_id as $type_id) {\n\n $type = MoodType::where('id', \"=\", $type_id)->first();\n\n $data = array();\n $labels = array();\n\n\t\t\t\\Debugbar::info($type, $type->label);\n\n foreach ($type->moods as $mood) {\n\n\n\n $data[] = $mood->value;\n $labels[] = $mood->created_at->timestamp;\n }\n\n\n\n $moods[] = [\n \"type\" => $type,\n \"data\" => json_encode($data),\n \"labels\" => json_encode($labels)\n ];\n }\n\n return view('you.start', [\n 'user' => $user,\n 'moods' => $moods,\n ]);\n\n\n }", "function gethistorytimetreatment_get(){\n $courseID = $this->get('courseID');\n $lecturerID = $this->get('lecturerID');\n $result = $this->lecturers_model->historystudentabycoursesmodel($courseID);\n $this->response($result); \n }", "public function getDailyMoe($day)\n {\n $memberData = $this->getMembershipData($day);\n $moe = new Moe($this->school);\n $teacherMoe = $moe->getTeacherMoe($memberData, $school->getSchoolTypeId());\n// $taMoe = $moe->getAssistantMoe($memberData, $school->getSchoolTypeId());\n\n $dataSet = array(\n 'membership' => $this->backwardCompatibleMembershipFormat($memberData),\n 'teacherMoe' => $moe->backwardCompatibleMoeFormat($teacherMoe),\n 'taMoe' => $moe->getAssistantMoe($day)\n );\n\n return $dataSet;\n }", "function get_dishes_of_meals_from($date, $number_of_days)\n {\n $date_from = new DateTime($date);\n $date_to = new DateTime($date);\n $date_to->add(new DateInterval('P'.$number_of_days.'D'));\n $this->db->select('dishes.*, pictures.image, pictures.dish_id, meals.meal_date');\n $this->db->from('meals');\n $this->db->join('menus', 'meals.menu_id = menus.id');\n $this->db->join('dishes_menus', 'dishes_menus.menu_id = menus.id');\n $this->db->join('dishes', 'dishes_menus.dish_id = dishes.id');\n $this->db->join('pictures', 'dishes.id = pictures.dish_id');\n $this->db->where('meal_date >=', $date_from->format('Y-m-d'));\n $this->db->where('meal_date <=', $date_to->format('Y-m-d'));\n $this->db->order_by('meal_date', 'asc');\n $dishes_grouped_by_date = array();\n $dishes = $this->db->get()->result();\n if ($dishes != NULL)\n {\n foreach ($dishes as $key1 => $dish1)\n {\n $date = $dish1->meal_date;\n $dishes_grouped_by_date[$date] = array();\n foreach ($dishes as $key2 => $dish2)\n {\n if ($dish2->meal_date == $date)\n {\n array_push($dishes_grouped_by_date[$date], $dish2);\n }\n }\n }\n }\n return $dishes_grouped_by_date;\n }", "public function getMedicationsOnDate() {\n\t\t$this->autoRender = false;\n\t\t$date = $this->request->data['date'];\n\t\t$data = $this->__getMedicationDataOnDate($date);\n\t\t$View = new View($this, false);\n\t\t$content = $View->element('User.Scheduler/medication_schedules', $data);\n\t\techo $content;\n\t\texit();\n\t}", "public function historyable()\n {\n return $this->morphTo('histories', 'histories_type', 'histories_id')->orderBy('date');\n }", "public function histories_rented_car($date) {\n $d = \"'$date', 'yyyy-mm-dd'\";\n $query = $this->db->query('select cars.brand, cars.type, cars.plate \n from rentals \n left join cars on cars.id=rentals.\"car-id\" \n where rentals.\"date-from\" <= to_date('.$d.') AND rentals.\"date-to\" >= to_date('.$d.')');\n\n return $query->result();\n }", "function pull_weather_for_day( \n $y = 2014,\n $m = 01,\n $d = 01,\n &$error = false )\n {\n // Build the URL to fetch\n //\n $date = date( 'Y', mktime( 0, 0, 0, $m, $d, $y ) )\n .date( 'm', mktime( 0, 0, 0, $m, $d, $y ) )\n .date( 'd', mktime( 0, 0, 0, $m, $d, $y ) );\n $url = sprintf( $this->_api, WU_KEY, $date );\n\n // Get the url and create a json object\n //\n if ( ! $contents = @file_get_contents( $url ) ) {\n $error = \"Error getting the file contents\";\n return false;\n }\n $json = json_decode( $contents );\n\n // Run through the array and build out the hours\n //\n $observations = $json->history->observations;\n $conditions = array();\n if ( is_array( $observations ) && count( $observations ) > 0 ) {\n foreach ( $observations as $key => $data ) {\n $hour = $data->date->hour;\n $conditions[$hour][ 'temp' ] = $data->tempi;\n $conditions[$hour][ 'cond' ] = $data->conds;\n }\n } else {\n $error = \"The observations json object was empty\";\n return false;\n }\n\n // Now get the daily summary and make it key 24\n //\n $summary = $json->history->dailysummary;\n if ( is_array( $summary ) && count( $summary ) > 0 ) {\n foreach ( $summary as $data ) {\n $conditions[ 'day' ][ 'mint' ] = $data->mintempi;\n $conditions[ 'day' ][ 'maxt' ] = $data->maxtempi;\n $conditions[ 'day' ][ 'noon' ] = $conditions[12][ 'cond' ];\n $conditions[ 'day' ][ 'rain' ] = $data->rain;\n $conditions[ 'day' ][ 'fog' ] = $data->fog;\n $conditions[ 'day' ][ 'snow' ] = $data->snow;\n $conditions[ 'day' ][ 'hail' ] = $data->hail;\n $conditions[ 'day' ][ 'thunder' ] = $data->thunder;\n $conditions[ 'day' ][ 'tornado' ] = $data->tornado;\n }\n } else {\n $error = \"The daily summary json object was empty\";\n return false;\n }\n\n return $conditions;\n }", "public function moodDetection($data) {\n $parameters=array(\n 'data'=>$data \n );\n $content = json_encode($parameters);\n \n $jsonreply=$this->CallWebService('getMood',$content);\n \n return $this->ParseReply($jsonreply);\n }", "public function getPatientHistory(Request $request)\n { \n if($request->number){\n // Get particular patient's medical history\n $categorizedArray = array();\n $patientHistory = Prescription::where('patient_id', $request->patient_id)->orderBy('date', 'desc')->get()->groupBy('date');\n foreach ($patientHistory as $oneDay) {\n array_push($categorizedArray, $oneDay);\n }\n \n // Get relevant panel number using session id of logged doctor\n $panel = DoctorSession::where('session', Session::getId())->get()->first()->panel;\n // dd($panel);\n \n // Update queue_summary table \n DB::table('queue_summary')->where('status', 1)->update(['current'=> $request->number, $panel=> $request->number]);\n \n // Get current number of overall progress\n $currentNumber = QueueSummary::where('status', 1)->select('current')->get()->first();\n \n event(new NumberCalled($currentNumber->current+1, $panel)); // update each doctor next number using pusher\n \n return ['patient_history'=>$categorizedArray, 'next_number'=> $currentNumber->current+1];\n }else{\n $categorizedArray = array();\n $patientHistory = Prescription::where('patient_id', $request->patient_id)->orderBy('date', 'desc')->get()->groupBy('date');\n foreach ($patientHistory as $oneDay) {\n array_push($categorizedArray, $oneDay);\n }\n // return $categorizedArray;\n dd($request->patient_id);\n }\n }", "public function medicine_history_dispense()\n {\n return view('hact.reports.medicine.medicine_dispense');\n }", "public function getMedics()\n {\n $search['q'] = request('q');\n $search['clinic'] = request('clinic');\n \n \n $medics = $this->medicRepo->findAllWithoutPaginate($search);\n\n \n \n return $medics;\n \n }", "public function getHistories(Request $request)\n {\n //takes trip ended, user cancelled, driver cancelled ride requests\n $rideRequests = $this->rideRequest->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::COMPLETED, Ride::TRIP_ENDED, Ride::USER_CANCELED, Ride::DRIVER_CANCELED])\n ->with(['user', 'invoice'])\n ->orderBy('updated_at', 'desc')\n ->paginate(500);\n\n $rideRequests->map(function($rideRequest){\n \n if($rideRequest->invoice) {\n $rideRequest->invoice['map_url'] = $rideRequest->invoice->getStaticMapUrl();\n }\n \n });\n\n return $this->api->json(true, 'RIDE_REQUEST_HISTORIES', 'Ride request histories', [\n 'ride_requests'=> $rideRequests->items(),\n 'paging' => [\n 'total' => $rideRequests->total(),\n 'has_more' => $rideRequests->hasMorePages(),\n 'next_page_url' => $rideRequests->nextPageUrl()?:'',\n 'count' => $rideRequests->count(),\n ]\n ]);\n\n\n }", "public function getDistribusiHistory($date)\n {\n $distribusi = PenyimpananDistribusi::whereMonth('created_at', Carbon::now()->format('m'))\n ->whereYear('created_at', Carbon::now()->format('Y'))\n ->get();\n\n \n if($date !== \"\")\n {\n $distribusi = PenyimpananDistribusi::whereMonth('created_at', Carbon::parse($date)->format('m'))\n ->whereYear('created_at', Carbon::parse($date)->format('Y'))\n ->get();\n }\n return $distribusi;\n }", "public function getMonitoringHistory(Request $request){\n $columns = array(\n 0 =>'created_at',\n // 1 =>'address',\n // 2 =>'date_of_onset_of_illness',\n // 3 =>'date_of_admission_consultation'\n );\n\n $totalData = MonitoringOfInvestigator::where('investigator_id', '=', $request['investigator_id'])->count();\n\n $totalFiltered = $totalData;\n\n $limit = ($request->input('length') == -1)? $totalData:$request->input('length');\n $start = $request->input('start');\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n\n $query = MonitoringOfInvestigator::where('investigator_id', '=', $request['investigator_id']);\n \n if(empty($request->input('search.value')))\n {\n $results = $query->offset($start)\n ->limit($limit)\n ->orderBy($order, $dir)\n ->get();\n \n }\n // else {\n // $search = $request->input('search.value');\n\n // $results = $query->orWhere('last_name', 'LIKE',\"%{$search}%\")->orWhere('first_name', 'LIKE',\"%{$search}%\")->orWhere('middle_name', 'LIKE',\"%{$search}%\")\n // ->offset($start)\n // ->limit($limit)\n // ->orderBy($order, $dir)\n // ->get();\n\n // $totalFiltered = $query->orWhere('last_name', 'LIKE',\"%{$search}%\")->orWhere('first_name', 'LIKE',\"%{$search}%\")->orWhere('middle_name', 'LIKE',\"%{$search}%\")->count();\n // }\n\n $data = array();\n if(!empty($results))\n {\n foreach ($results as $result)\n {\n $nestedData['date'] = $result->date;\n $nestedData['time'] = date( 'g:i A', strtotime($result->time));\n $nestedData['place_of_engagement'] = $result->places_of_engagement;\n $nestedData['mode_of_transpo'] = $result->mode_of_transportation;\n $nestedData['remarks'] = $result->remarks;\n $data[] = $nestedData;\n }\n }\n\n $json_data = array(\n \"draw\" => intval($request->input('draw')),\n \"recordsTotal\" => intval($totalData),\n \"recordsFiltered\" => intval($totalFiltered),\n \"data\" => $data\n );\n\n echo json_encode($json_data);\n }", "function medicalHistory()\n{\n\t $token = $this->input->post('token');\n \n\n if (empty($token)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Token is empty';\n echo json_encode($response);die;\n }\n $checkToken = $this->user_model->getCondResultArray(USER,'id',array('token'=>$token));\n if($checkToken)\n {\n \t //hospital\n\t\t $hostpital = $this->user_model->getCondResultArray('user_hospital_records','id,hospital_name,provider_name,provider_specility,service_date,type',array('user_id'=>$checkToken[0]['id']));\n\n\t\t \n\t\t \n //print_r($hos_img);die;\n\t\t \n if(!empty($hostpital))\n {\n\n\n\t\t \n\n\t\t \n foreach($hostpital as $hos)\n {\n \t\n $hos_img = $this->user_model->getCondResult('medical_record_image','image',array('record_id'=>$hos['id'],'type'=>'hospital'));\n\n if(empty($hos_img))\n\t\t \t $hos_img = array();\n\n \t $HospitalArr[] = array(\n\t\t \t 'id' => $hos['id'],\n\t\t \t 'hospital_name' => $hos['hospital_name'],\n\t\t \t 'provider_name' => $hos['provider_name'],\n\t\t \t 'provider_specility' => $hos['provider_specility'],\n\t\t \t 'service_date' => $hos['service_date'],\n\t\t \t 'type' => $hos['type'],\n\t\t \t 'images' => $hos_img,\n\n\t\t );\n }\n }else\n {\n \t$HospitalArr = array();\n }\n\t\t \n\t\t \n\t\t // $HospitalArr = array_merge($hostpital,$img);\n\n\t\t //end hospital\n //specialty\n\t\t $specialty = $this->user_model->getCondResultArray('user_specialty_records','id,specialty,specialty_type,service_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\t\t if(!empty($specialty))\n\t\t \t{\n\n\t\t \n\t\t foreach($specialty as $spe)\n\t\t {\n\t\t \t $spe_img = $this->user_model->getCondResult('medical_record_image','image',array('record_id'=>$spe['id'],'type'=>'specialty'));\n\t\t \t if(empty($spe_img))\n\t\t \t$spe_img = array();\n\t\t \t $SpecialtyArr[] = array(\n 'id' => $spe['id'],\n 'specialty' => $spe['specialty'],\n 'specialty_type' => $spe['specialty_type'],\n 'service_date' => $spe['service_date'],\n 'type' => $spe['type'],\n 'images' => $spe_img,\n\t\t );\n\t\t }\n\n\t\t }else\n\t\t {\n\t\t \t$SpecialtyArr = array();\n\t\t }\n\t\t \n\t\t //end specialty\n\n\t\t //lab \n\t\t $lab = $this->user_model->getCondResultArray('user_lab_records','id,lab_name,prescription_name,lab_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t if(!empty($lab))\n\t\t {\n\t\t \t\n\t\t \n\t\t \n\t\t \n\t\t \n foreach($lab as $lb)\n\t\t {\n\t\t \t$lab_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$lb['id'],'type'=>'lab'));\n\n\t\t \tif(empty($lab_img))\n\t\t \t $lab_img = array();\n\n\t\t \t $LabArr[] = array(\n 'id' => $lb['id'],\n 'lab_name' => $lb['lab_name'],\n 'prescription_name' => $lb['prescription_name'],\n 'lab_date' => $lb['lab_date'],\n 'type' => $lb['type'],\n 'images' => $lab_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n $LabArr =array();\n\t\t }\n\t\t //end lab\n\n\t\t //physical\n\n\t\t $physical = $this->user_model->getCondResultArray('user_physical_therapist_records','id,therapy_name,therapy_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\t\t if(!empty($physical))\n\t\t {\n\t\t \t\n\n\t\t \n\t\t foreach($physical as $py)\n\t\t {\n\t\t \t $phy_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$py['id'],'type'=>'physical'));\n\n\t\t \t if(empty($phy_img))\n\t\t \t $phy_img = array();\n\n\n\t\t \t $PhyArr[] = array(\n 'id' => $py['id'],\n 'therapy_name' => $py['therapy_name'],\n 'therapy_date' => $py['therapy_date'],\n 'type' => $py['type'],\n 'images' => $phy_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n\t\t \t$PhyArr = array();\n\t\t }\n\n\t\t //end physical\n //other\n\t\t $other = $this->user_model->getCondResultArray('user_other_records','id,description,date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\t\t if(!empty($other))\n\t\t {\n\n \n\t\t foreach($other as $othr)\n\t\t {\n\n\t\t \t $other_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$othr['id'],'type'=>'other'));\n\t\t \t if(empty($other_img))\n\t\t \t $other_img = array();\n\t\t \t $OtherArr[] = array(\n 'id' => $othr['id'],\n 'description' => $othr['description'],\n 'date' => $othr['date'],\n 'type' => $othr['type'],\n 'images' => $other_img,\n\t\t );\n\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t \t$OtherArr =array();\n\t\t }\n\n\t\t //end other\n\n\t\t $pharmacy = $this->user_model->getCondResultArray('user_pharmacy_script','id,pharmacy_name,pharmacy_provider_name,service_date,type',array('user_id'=>$checkToken[0]['id']));\n\t\t \n\n\t\t if(!empty($pharmacy))\n\t\t {\n\t\t \t\n\n\t\t \tforeach($pharmacy as $ph)\n\t\t {\n\t\t \t $ph_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$ph['id'],'type'=>'pharmacy'));\n\n\t\t \t if(empty($ph_img))\n\t\t \t $ph_img = array();\n\n\t\t $PharmacyArr[] = array(\n\t\t 'id' => $ph['id'],\n\t\t 'pharmacy_name' => $ph['pharmacy_name'],\n\t\t 'pharmacy_provider_name' => $ph['pharmacy_provider_name'],\n\t\t 'service_date' => $ph['service_date'],\n\t\t 'type' => $ph['type'],\n\t\t 'images' => $ph_img,\n\t\t\t\t );\n\t\t\t }\n\n\t\t \t}\n\n\t\t else\n\t\t {\n\t\t \t$PharmacyArr =array();\n\t\t }\n \n \t\t$response = [ 'status' => \"SUCCESS\",'message'=>'medical detail seen successfully.','hospitalDetail' => $HospitalArr,'specialtyDetail'=>$SpecialtyArr,'labDetail'=>$LabArr,'physicalDetails'=>$PhyArr,'otherDetail'=>$OtherArr,'pharmacyDetail'=>$PharmacyArr];\n \t\t\techo json_encode($response);die;\n//\n}else\n{\n\t \t $response['status'] = \"FAILURE\";\n $response['message'] = 'token mismatch ...Please logOut.';\n echo json_encode($response);\n}\n\n}", "public function historiesCreate(Request $request)\n {\n $user = Auth::user();\n\n $emotion = $request->input('emotion_id');\n\n $h = $user->histories()->create([\n 'description' => $request->input('description'),\n 'history_date' => $request->input('history_date'),\n 'city_id' => $request->input('city'),\n 'emotion_id' => $emotion,\n 'active' => true\n ]);\n\n $histories_to_connect = \\App\\History::whereHas('emotion', function ($query) use($emotion, $user) {\n return $query->where('id', '=', $emotion)->where('user_id', '!=', $user->id);\n })->inRandomOrder()->limit(3)->get();\n\n $h->histories()->saveMany($histories_to_connect);\n\n $histories_to_connect->each(function ($item, $key) use($h) {\n $item->histories()->save($h);\n $item->refresh();\n $item->load('histories');\n });\n\n $h->refresh();\n\n $h->load('histories');\n\n return $h;\n }", "public function cmn_history()\r\n\t{\r\n $content = $this->input->get(\"content\") ? trim($this->input->get(\"content\", TRUE)) : \"\";\r\n $start = $this->input->get(\"start\") ? trim($this->input->get(\"start\", TRUE)) : \"\";\r\n $end = $this->input->get(\"end\") ? trim($this->input->get(\"end\", TRUE)) : \"\";\r\n $date_arr = \"\";\r\n if (! empty($start) || ! empty($end))\r\n {\r\n $this->load->helper(\"common\");\r\n $date_arr = make_date_start_before_end($start, $end);\r\n }\r\n\r\n\t\t$limit = $this->_get_limit();\r\n\t\t$history = $this->model->get_cmn_history($limit, $content, $date_arr);\r\n\r\n\t\tif ( empty($history))\r\n\t\t\t$this->meret(NULL, MERET_EMPTY);\r\n\t\telse\r\n\t\t\t$this->meret($history);\r\n\t}", "private function __dailyHealthIndicator() {\n\t\t\t\t\n\t\t$userTimezone = $this->Auth->user('timezone');\n\t\t\n\t\tif ($this->_requestedUser['id'] != $this->Auth->user('id')) {\n $userId = $this->_requestedUser['id']; \n\t\t} else {\n\t\t\t$userId = $this->Auth->user('id');\t\t\t\n\t\t}\n\t\t //set date as today\n\n $todayInUserTimeZone = CakeTime::convert(time(), new DateTimeZone($userTimezone));\n $date_today = CakeTime::format($todayInUserTimeZone, '%m/%d/%Y');\n\t\t\n $dailyHealthIndicator = array();\n // it contains symptoms with latest_record_value null\n $userSymptoms = $this->UserSymptom->getSymptomIdsWithLatestValue($userId);\n\n /*\n * Fetch symptom details \n */\n foreach ($userSymptoms as $userSymptom) {\n $symptomId = $userSymptom ['UserSymptom'] ['symptom_id']; // symptom id\n $symptomName = $this->Symptom->getSymptomNameFromId($symptomId); // symptom name\n $symptomRecordValueJSON = $userSymptom ['UserSymptom'] ['latest_record_value']; // recorded value\n $symptomSeverityValue = 0;\n $lastUpdatedDate = NULL;\n if (!empty($symptomRecordValueJSON)) {\n $symptomLatestRecordValue = json_decode($symptomRecordValueJSON, TRUE); // Decode the json value\n $userTodayDate = date('Y-m-d', $todayInUserTimeZone);\n $lastUpdatedDateInTime = key($symptomLatestRecordValue);\n\n if (!is_null($lastUpdatedDateInTime)) {\n $symptomSeverityValue = $symptomLatestRecordValue [$lastUpdatedDateInTime];\n $lastUpdatedDate = date('m/d/Y', $lastUpdatedDateInTime);\n }\n// debug($lastUpdatedDate);\n // check todays severity added\n// if ( array_key_exists ( strtotime ( $userTodayDate ) , $symptomLatestRecordValue )) {\n// $symptomSeverityValue = $symptomLatestRecordValue[ strtotime ( $userTodayDate ) ];\n// }\n// foreach ($symptomRecordValue as $key => $value) {\n// //$record_date = date('Y-m-d', $key);\n// //debug($symptomName.\" \".date('Y-m-d H:i:s', $key) . \" \". strtotime($userTodayDate));\n// //check if there is record for user's today\n// if ($record_date == $userTodayDate) { //debug($key. \" \".strtotime($userTodayDate)); // debug($record_date. \" \".$userTodayDate); \n// //fetch todays reading\n// $symptomSeverityValue = $symptomRecordValue [$key];\n// }\n//// else {\n////\t\t\t\t\t$symptomSeverityValue = 0;\n////\t\t\t\t}\n// }\n }\n\n switch ($symptomSeverityValue) {\n case 1: $symptomSeverity = 'None';\n break;\n case 2: $symptomSeverity = 'Mild';\n break;\n case 3: $symptomSeverity = 'Moderate';\n break;\n case 4: $symptomSeverity = 'Severe';\n break;\n default:$symptomSeverity = 'No Data';\n }\n /*\n * save details to an array\n */\n $dailyHealthIndicator[] = array('id' => $symptomId, 'name' => $symptomName,\n 'severity' => $symptomSeverity, 'lastUpdated' => $lastUpdatedDate);\n }\n\t\t\n\t\treturn $dailyHealthIndicator; \n\n\t}", "function list_history_medication()\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['patient_id'] = $this->uri->segment(3);\r\n $data['patient_info'] = $this->memr_rdb->get_patient_details($data['patient_id']);\r\n $data['patient_info']['name'] = $data['patient_info']['patient_name'];\r\n \t\t$data['title'] = \"PR-\".$data['patient_info']['name'];\r\n $data['medication_list']= $this->memr_rdb->get_recent_medication($data['patient_id'],99,0);\r\n $data['diagnoses_list'] = $this->memr_rdb->get_recent_diagnoses($data['patient_id']);\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_wap\";\r\n //$new_body = \"ehr/ehr_indv_list_history_vitals_wap\";\r\n $new_body = \"ehr/ehr_indv_list_history_medication_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_html\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_html\";\r\n $new_body = \"ehr/ehr_indv_list_history_medication_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\r\n\t\t\r\n }", "public function getHistory()\n {\n \treturn QuizResult::where('user_id', '=', Auth::user()->id)->orderBy('id', 'DESC')->limit(5)->get();\n }", "function getallMounth()\n {\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 prendere tutti gli ordini dei ristoranti dell'utente loggato dove i pagamenti sono andati a buon fine in ordine di delivery time\n $orders_list = Order::orderBy('delivery_time')->whereIn('restaurant_id' , Restaurant::select('id')->where('user_id', $id_user))->whereIn('id' , Payment::select('order_id')->where('status', 'Accepted'))->get();\n\n $delivery_time = Order::select('delivery_time')->orderBy('delivery_time')->whereIn('restaurant_id' , Restaurant::select('id')->where('user_id', $id_user))->whereIn('id' , Payment::select('order_id')->where('status', 'Accepted'))->get();\n\n // Creo un array di appoggio per salvarmi tutti i delivery time\n $array_date = [];\n\n // Ciclo la collection di delivery time per estrapolarmi tutte le date e pusharle in array_date\n foreach ($delivery_time as $date) {\n array_push($array_date, $date->delivery_time);\n }\n\n // Creo un array vuoto per i mesi\n $array_mounth =[];\n\n // Se l'array delle date non è vuoto\n if (!empty($array_date)) {\n // Ciclo l'array delle date e ad ogni ciclo formatto il mese sia in modo numerico sia in caratteri\n foreach ($array_date as $unfomatted_date) {\n // Salvo la data che sto ciclando in una variabile\n $date = new \\DateTime($unfomatted_date);\n // Salvo il mese nel formato numero\n $mounth_number = $date->format('m');\n // Sakvo il mese in formato caratteri\n $mounth_name = $date->format('M');\n // Faccio push nell'array dei mesi come chiave il numero del mese e come valore il nome del mese\n $array_mounth[$mounth_number] = $mounth_name;\n }\n }\n\n // Faccio return dell'array con tutti i mesi (chiave-valore)\n return $array_mounth;\n }", "public function index()\n {\n $userId = auth()->user()->id;\n $donations = Histories::where('user_id','=',$userId)->where('activity_id','=',Lookup::DONATE)->get();\n $takes = Histories::where('user_id','=',$userId)->where('activity_id','=',Lookup::REQUEST)->get();\n\n return view('users.history',compact('donations','takes'));\n\n }", "public function profesional($date)\n {\n \t$profesionals = Datetime::where('date', $date)->get();\n\n \treturn $profesionals;\n }", "public function getDayHistory(\\DateTime $date, Restaurant $restaurant) {\r\n $repo = $this->em->getRepository('IOOrderBundle:OrderData');\r\n $qb = $repo->createQueryBuilder('order_item');\r\n $qb->where('order_item.restaurant = :restaurant')\r\n ->andWhere('DAY(order_item.orderDate) = :day')\r\n ->andWhere('MONTH(order_item.orderDate) = :month')\r\n ->andWhere('YEAR(order_item.orderDate) = :year')\r\n ->setParameter('restaurant', $restaurant)\r\n ->setParameter('day', $date->format('d'))\r\n ->setParameter('month', $date->format('m'))\r\n ->setParameter('year', $date->format('Y'));\r\n \r\n $orders = $qb->getQuery()->getResult();\r\n return $orders;\r\n }", "function showMedicalHistory()\n {\n if ($_SERVER['REQUEST_METHOD'] === 'POST') \n {\n $token = $this->input->post('token');\n $id = $this->input->post('id');\n $type = $this->input->post('type');\n \n\n if (empty($token)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Token is empty';\n echo json_encode($response);die;\n }\n\n if (empty($id)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Id is empty';\n echo json_encode($response);die;\n }\n\n if (empty($type)) {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'Type is empty';\n echo json_encode($response);die;\n }\n\n \n \n\n $checkToken = $this->user_model->getCondResultArray(USER,'id',array('token'=>$token));\n if($checkToken)\n {\n if($type=='hospital')\n {\n \t//echo \"gg\";die;\n\n \t $hostpital = $this->user_model->getCondResultArray('user_hospital_records','id,hospital_name,provider_name,provider_specility,service_date,type',array('id'=>$id));\n\n\t\t $hos_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$hostpital[0]['id'],'type'=>'hospital'));\n\t\t \n // print_r($img);die;\n\t\t \n if(!empty($hostpital))\n {\n\n\n\t\t if(empty($hos_img))\n\t\t \t$hos_img = array();\n\n\t\t \n foreach($hostpital as $hos)\n {\n \t\n \n \t $HospitalArr = array(\n\t\t \t 'id' => $hos['id'],\n\t\t \t 'hospital_name' => $hos['hospital_name'],\n\t\t \t 'provider_name' => $hos['provider_name'],\n\t\t \t 'provider_specility' => $hos['provider_specility'],\n\t\t \t 'service_date' => $hos['service_date'],\n\t\t \t 'type' => $hos['type'],\n\t\t \t 'images' => $hos_img,\n\n\t\t );\n }\n }else\n {\n \t$HospitalArr = array();\n }\n \n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'medical detail seen successfully.','editdetail' => $HospitalArr];\n\t\t echo json_encode($response);die;\n }\n if($type=='specialty')\n {\n \t $specialty = $this->user_model->getCondResultArray('user_specialty_records','id,specialty,specialty_type,service_date,type',array('id'=>$id));\n \t $spe_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$id,'type'=>'specialty'));\n\n\t\t \t if(empty($spe_img))\n\t\t \t $spe_img = array();\n\t\t \n\t\t if(!empty($specialty))\n\t\t \t{\n\n\t\t foreach($specialty as $spe)\n\t\t {\n \n\t\t \n\n\t\t \t\n\n\t\t \t $SpecialtyArr = array(\n 'id' => $spe['id'],\n 'specialty' => $spe['specialty'],\n 'specialty_type' => $spe['specialty_type'],\n 'service_date' => $spe['service_date'],\n 'type' => $spe['type'],\n 'images' => $spe_img,\n\t\t );\n\t\t }\n\n\t\t }else\n\t\t {\n\t\t \t$SpecialtyArr = array();\n\t\t }\n\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'specialty detail seen successfully.','editdetail' => $SpecialtyArr];\n\t\t echo json_encode($response);die;\n\n }\n if($type=='lab')\n {\n $lab = $this->user_model->getCondResultArray('user_lab_records','id,lab_name,prescription_name,lab_date,type',array('id'=>$id));\n\t\t if(!empty($lab))\n\t\t {\n\t\t \t\n\t\t \n\t\t $lab_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$lab[0]['id'],'type'=>'lab'));\n\t\t \n\t\t if(empty($lab_img))\n\t\t \t$lab_img = array();\n foreach($lab as $lb)\n\t\t {\n\t\t \t $LabArr = array(\n 'id' => $lb['id'],\n 'lab_name' => $lb['lab_name'],\n 'prescription_name' => $lb['prescription_name'],\n 'lab_date' => $lb['lab_date'],\n 'type' => $lb['type'],\n 'images' => $lab_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n $LabArr =array();\n\t\t }\n\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'Lab detail seen successfully.','editdetail' => $LabArr];\n\t\t echo json_encode($response);die;\n }\n if($type=='other')\n {\n\n $other = $this->user_model->getCondResultArray('user_other_records','id,description,date,type',array('id'=>$id));\n\t\t $other_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$other[0]['id'],'type'=>'other'));\n\t\t if(!empty($other))\n\t\t {\n\n if(empty($other_img))\n\t\t \t$other_img = array();\n\t\t foreach($other as $othr)\n\t\t {\n\t\t \t $OtherArr = array(\n 'id' => $othr['id'],\n 'description' => $othr['description'],\n 'date' => $othr['date'],\n 'type' => $othr['type'],\n 'images' => $other_img,\n\t\t );\n\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t \t$OtherArr =array();\n\t\t }\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'other detail seen successfully.','editdetail' => $OtherArr];\n\t\t echo json_encode($response);die;\n }\n\n if($type=='pharmacy')\n {\n $pharmacy = $this->user_model->getCondResultArray('user_pharmacy_script','id,pharmacy_name,pharmacy_provider_name,service_date,type',array('id'=>$id));\n\t\t $ph_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$pharmacy[0]['id'],'type'=>'pharmacy'));\n\n\t\t if(!empty($pharmacy))\n\t\t {\n\t\t \t if(empty($ph_img))\n\t\t \t $ph_img = array();\n\n\t\t \tforeach($pharmacy as $ph)\n\t\t {\n\t\t $PharmacyArr = array(\n\t\t 'id' => $ph['id'],\n\t\t 'pharmacy_name' => $ph['pharmacy_name'],\n\t\t 'pharmacy_provider_name' => $ph['pharmacy_provider_name'],\n\t\t 'service_date' => $ph['service_date'],\n\t\t 'type' => $ph['type'],\n\t\t 'images' => $ph_img,\n\t\t\t\t );\n\t\t\t }\n\n\t\t \t}\n\n\t\t else\n\t\t {\n\t\t \t$PharmacyArr =array();\n\t\t }\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'pharmacy detail seen successfully.','editdetail' => $PharmacyArr];\n\t\t echo json_encode($response);die; \n }\n if($type=='physical')\n {\n $physical = $this->user_model->getCondResultArray('user_physical_therapist_records','id,therapy_name,therapy_date,type',array('id'=>$id));\n\t\t $phy_img = $this->user_model->getCondResultArray('medical_record_image','image',array('record_id'=>$physical[0]['id'],'type'=>'physical'));\n\t\t if(!empty($physical))\n\t\t {\n\t\t \t\n\n\t\t if(empty($phy_img))\n\t\t \t$phy_img = array();\n\n\t\t foreach($physical as $py)\n\t\t {\n\t\t \t $PhyArr = array(\n 'id' => $py['id'],\n 'therapy_name' => $py['therapy_name'],\n 'therapy_date' => $py['therapy_date'],\n 'type' => $py['type'],\n 'images' => $phy_img,\n\t\t );\n\t\t }\n\t\t }else\n\t\t {\n\t\t \t$PhyArr = array();\n\t\t }\n\t\t $response = [ 'status' => \"SUCCESS\",'message'=>'physical detail seen successfully.','editdetail' => $PhyArr];\n\t\t echo json_encode($response);die; \n }\n }\n else\n {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'token mismatch ...Please logOut.';\n \n\n echo json_encode($response);\n }\n \n }\n else\n {\n $response['status'] = \"FAILURE\";\n $response['message'] = 'This method is not allowed.';\n echo json_encode($response);die; \n } \n\n }", "private function getMedicalHistory($id) \n {\n $this->db->select('has_cancer, has_heart_disease, has_stroke, has_other');\n $this->db->where('userid', $id);\n $query = $this->db->get('medical_history');\n\n return $query;\n }", "public function tweets_history(){\n\t\t$histories = History::select(array('keyword','count'))->orderBy('id', 'DESC')->get();\n\t\techo json_encode($histories);\n\t}", "function getStories()\n {\n # one chatty \"story\".\n $feed = array();\n \n # Add the latest chatty to the top of the list.\n $feed[] = array(\n 'title' => 'Latest Chatty',\n 'story_id' => 0);\n \n return $feed;\n }", "public function getSickAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $sickArr = $user->getSick_history();\n if(isset($sickArr[0])){\n unset($sickArr[0]);\n }\n if(isset($data['date'])){\n foreach($sickArr as $sick){\n if($sick[0] == $data['date']){\n $this->_helper->json($sick);\n } else {\n $this->setErrorResponse('No sick for this day!');\n }\n }\n }\n $this->_helper->json($sickArr);\n }", "public function fetchHistory(): array;", "public function getMedicaments(){\n\t\t$req = \"select * from medicament order by MED_NOMCOMMERCIAL\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetchAll();\n\t\treturn $ligne;\n\t}", "public function index()\n {\n return MedicalObservation::with('vet')->orderBy('date','desc')->get();\n }", "public function actionHistoriPresensiByNimAndDate($nim, $date){\n Yii::$app->response->format = Response::FORMAT_JSON;\n $response = null;\n\n if(Yii::$app->request->isGet){\n $sql = \"SELECT tb_presensi_detail.id_presensi, tb_presensi_detail.nim, DATE_FORMAT(tb_presensi_detail.waktu, '%d %b %Y %T') as waktu, tb_presensi_detail.status, \n tb_presensi.pertemuan, tb_ruangan.nama as nama_ruangan, tb_kelas.nama as nama_kelas, tb_matakuliah.nama as nama_matakuliah,\n tb_dosen.nama as nama_dosen FROM tb_presensi_detail \n INNER JOIN tb_presensi, tb_mengajar, tb_matakuliah, tb_dosen, tb_ruangan, tb_kelas \n WHERE tb_presensi_detail.id_presensi = tb_presensi.id_presensi \n AND tb_presensi.id_mengajar = tb_mengajar.id_mengajar \n AND tb_mengajar.id_matakuliah = tb_matakuliah.id_matakuliah \n AND tb_mengajar.nip = tb_dosen.nip \n AND tb_presensi.id_ruangan = tb_ruangan.id_ruangan\n AND tb_mengajar.id_kelas = tb_kelas.id_kelas\n AND tb_presensi_detail.nim = '$nim' \n AND date(tb_presensi_detail.waktu) = '$date'\";\n\n $response['master'] = Yii::$app->db->createCommand($sql)->queryAll();\n }\n\n return $response;\n }", "public function get($date) {\n return Availability::whereDate('date',$date)\n ->get(['doctor_id','clinic_id','date','time','duration']);\n }", "public function queryRmsAlarmhistorytype($request)\n {\n $runtime = new RuntimeOptions([]);\n $headers = [];\n\n return $this->queryRmsAlarmhistorytypeEx($request, $headers, $runtime);\n }", "public function actionFacebookMilongas(){\n\t\t$startDate = new \\Datetime();\n\t\t$endDate = clone $startDate;\n\t\t$endDate->modify('next sunday');\n\t\t$events = $this->getEvents( 6 , 'milonga:,practica:,millonga:,concert:,show:,practilonga:' , $startDate );\n\n\t\t$events_by_days = array();\n\n\t\tforeach ($events as $event) {\n\t\t\tif( !(isset($event['extendedProperties']['shared']['cancelled']) && !empty($event['extendedProperties']['shared']['cancelled'])) ){\n\t\t\t\t$events_by_weekdays[substr($event['start']['dateTime'],0, 10)][] = $event;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->render('facebook-milongas', ['events' => $events_by_weekdays, 'startDate' => $startDate, 'endDate' => $endDate]);\n\t}", "public function getMh(Request $request)\n\t\t{\n\t\t\t$data['request'] = $request;\n\n\t\t\t$usermininghistories = Usermininghistory::where('user_id', '=', Auth::user()->id)->where('is_active', '=', true)->take(24)->get();\n\t\t\t$data['usermininghistories'] = $usermininghistories;\n\n\t\t\t$mininghistories = Mininghistory::orderBy('id', 'desc')->get();\n\t\t\t$data['mininghistories'] = $mininghistories;\n\n\t return view('front.dashboard.mh', $data);\n\t\t}", "public function get_past_history($doctor_id, $patient_id, $date) {\n $doctor_query = \"\n SELECT\n user_id,\n appointment_doctor_user_id as doctor_user_id,\n appointment_clinic_id as clinic_id,\n appointment_id,\n appointment_date\n FROM \n \" . TBL_USERS . \" \n JOIN \" . TBL_APPOINTMENTS . \"\n ON appointment_doctor_user_id=user_id AND appointment_status=1 \n \";\n $doctor_query.=\"\n WHERE\n user_id='\" . $doctor_id . \"' AND \n appointment_user_id='\" . $patient_id . \"' AND\n appointment_date <='\" . $date . \"' \n \";\n\n $doctor_data = $this->get_all_rows_by_query($doctor_query);\n return $doctor_data;\n }", "public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }", "public function queryRmsAlarmhistorylevel($request)\n {\n $runtime = new RuntimeOptions([]);\n $headers = [];\n\n return $this->queryRmsAlarmhistorylevelEx($request, $headers, $runtime);\n }", "public function getTimesheetRecent(){\n $emp_id = Auth::user()->id;\n $data['response'] = $this->timesheet->getInformRecent($emp_id);\n $data = $this->formatDate($data);\n return $data;\n }", "function sondMHA(){\n $_SESSION['connect'] == true;\n return $allSondageMHA = $this->query(\" SELECT question_id, `question`, `image_question`, `date_fin`, `point` FROM `sondage_question` WHERE `type` = 1 AND date_fin >= NOW() ORDER BY date_fin ASC\");\n }", "public function getMyState()\n {\n\t\t$user_id = Session::get('id');\n\t\t$user \t = User::find($user_id);\n\t\t$locality = $user->address['city'];\n\n\t\tInput::merge(array_map('trim', Input::all()));\n\t\t$input = filter_var_array(Input::all(), FILTER_SANITIZE_STRIPPED);\n\n\t\tif (isset($input['params'])) {\n\t\t\t$type = $input['type'];\n\t\t\t$params = $input['params'];\n\t\t\tif ($type == \"age\") {\n\t\t\t\tdd($params);\n\t\t\t\t$users = User::where('user_type', 'artist')\n\t\t\t\t\t->where('address.city', $locality)\n\t\t\t\t\t->where('ages', 'LIKE', '%'.$params.'%')->get();\n\t\t\t\t$age_filter = $params;\n\t\t\t}\n\t\t\tif ($type == \"distance\") {\n\n\t\t\t\t$users = User::where('user_type', 'artist')->where('address.city', $locality)->get();\n\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t$lat = $user->latlon['lat'];\n\t\t\t\t\t$lon = $user->latlon['lng'];\n\t\t\t\t\t$distance = $this->distanceAsMile((double)$centerLat, (double)$centerLon, (double)$lat, (double)$lon);\n\t\t\t\t\t$user ->distance = $distance;\n\t\t\t\t\t$user->save();\n\t\t\t\t}\n\t\t\t\t$users = User::where('user_type', 'artist')->where('address.city', $locality)\n\t\t\t\t\t->where('distance', '<', (double)$params)->get();\n\t\t\t\t$distance_filter = $params;\n\t\t\t}\n\t\t}\n\n\t\t$type_filter = null;\n\t\t$age_filter = null;\n\t\t$distance_filter = null;\n\n\t\t$books = array();\n\t\t$curYear = date('Y'); \n\t\tfor ($i = 1; $i < 13; $i++) {\n\n\t\t\t$start_datetime = $i.'/1/'.$curYear.'00:00';\n\t\t\t$end_datetime = $i.'/31/'.$curYear.'23:59';\n\n\t\t\t$start_datetime = new MongoDate(strtotime($start_datetime));\n\t\t\t$end_datetime = new MongoDate(strtotime($end_datetime));\n\n\n\t\t\t$confirmed_events1 = Service::servicesByReceiverId($user_id)\n\t\t\t\t->whereBetween('confirmation_date',[$start_datetime, $end_datetime])->confirmed()->count();\n\n\t\t\t$pending_events1 = Service::servicesByReceiverId($user_id)\n\t\t\t\t->whereBetween('request_date',[$start_datetime, $end_datetime])->pending()->count();\n\t\t\t$rejected_events1 = Service::servicesByReceiverId($user_id)\n\t\t\t\t->whereBetween('rejection_date',[$start_datetime, $end_datetime])->rejected()->count();\n\n\t\t\t$confirmed_events2 = Service::servicesBySenderId($user_id)\n\t\t\t\t->whereBetween('confirmation_date',[$start_datetime, $end_datetime])->confirmed()->count();\n\n\t\t\t$pending_events2 = Service::servicesBySenderId($user_id)\n\t\t\t\t->whereBetween('request_date',[$start_datetime, $end_datetime])->pending()->count();\n\t\t\t$rejected_events2 = Service::servicesBySenderId($user_id)\n\t\t\t\t->whereBetween('rejection_date',[$start_datetime, $end_datetime])->rejected()->count();\n\n\t\t\t$confirmed_events = $confirmed_events1 + $confirmed_events2;\n\t\t\t$pending_events = $pending_events1 + $pending_events2;\n\t\t\t$rejected_events = $rejected_events1 + $rejected_events2;\n\t\t\t$month = \"\";\n\t\t\tswitch ($i) {\n\t\t\t case 1:\n\t\t\t $month = \"January\";\n\t\t\t break;\n\t\t\t case 2:\n\t\t\t $month = \"February\";\n\t\t\t break;\n\t\t\t case 3:\n\t\t\t $month = \"March\";\n\t\t\t break;\n\t\t\t case 4:\n\t\t\t $month = \"April\";\n\t\t\t break;\n\t\t\t case 5:\n\t\t\t $month = \"May\";\n\t\t\t break;\n\t\t\t case 6:\n\t\t\t $month = \"June\";\n\t\t\t break;\n\t\t\t case 7:\n\t\t\t $month = \"July\";\n\t\t\t break;\n\t\t\t case 8:\n\t\t\t $month = \"August\";\n\t\t\t break;\n\t\t\t case 9:\n\t\t\t $month = \"September\";\n\t\t\t break;\n\t\t\t case 10:\n\t\t\t $month = \"October\";\n\t\t\t break;\n\t\t\t case 11:\n\t\t\t $month = \"November\";\n\t\t\t break;\n\t\t\t case 12:\n\t\t\t $month = \"December\";\n\t\t\t break;\n\t\t\t}\n\n\t\t\t$book = array(\"id\" => $user_id, \"name\" => $month, \"confirmed\" => $confirmed_events, \n\t\t\t\t\"pending\" => $pending_events, \"rejected\" => $rejected_events);\n\t\t\tarray_push($books, $book);\n\t\t}\n\t\n\t$books = collect($books);\n\treturn View::make('ourscene.my-dashboard', compact('books', 'curYear', 'age_filter', 'distance_filter'));\n\n \t\n }", "private function getDateHistory($type, $date)\n {\n if(!isset($this->temp['getDateHistory'.$date]))\n {\n $this->temp['getDateHistory'.$date] = $this->dateHistory()->orderBy('date', 'desc')\n ->where('date', '<=', $date)->get();\n }\n\n $items = $this->temp['getDateHistory'.$date]->filter(function($item) use ($type){\n return $item->type == $type;\n });\n\n return $items ? $items->first() : null;\n }", "private function getHistory()\n {\n $history = [];\n\n foreach ($this->getResponse()->data as $k => $v) {\n $history[$k]['tanggal'] = Utils::setDate($v->Tanggal);\n\n switch ($v->StatusInternal) {\n case 'Baru':\n $history[$k]['posisi'] = preg_replace('/Diterima di Sales Counter (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Manifest Pickup':\n $posisi = preg_replace('/Di pickup oleh petugas (.*)/', '$1', $v->TrackStatusNama);\n $history[$k]['posisi'] = $posisi;\n $this->kotaPengirim = strtoupper($posisi);\n break;\n\n case 'Serah Terima Pickup':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Moda Angkutan':\n $history[$k]['posisi'] = preg_replace('/Pengiriman dari (.*) ke (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Serah Terima Surat Muatan':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Serah Terima Manifest':\n $history[$k]['posisi'] = preg_replace('/Diterima di fasilitas (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Surat Jalan Kurir':\n $history[$k]['posisi'] = preg_replace('/Proses pengantaran oleh kurir (.*), (.*)/', '$1', $v->TrackStatusNama);\n break;\n\n case 'Terkirim/Diterima':\n $history[$k]['posisi'] = 'Diterima';\n $this->tanggalTerima = $v->Tanggal;\n $this->namaPenerima = preg_replace('/Diterima oleh (.*)\\((.*)/', '$1', $v->TrackStatusNama);\n break;\n\n default:\n $history[$k]['posisi'] = null;\n break;\n }\n\n $history[$k]['message'] = $v->TrackStatusNama;\n }\n\n return $history;\n }", "function getHistoric($PDO){\n $req = $PDO->prepare(\"SELECT type, date, value FROM sensor INNER JOIN data ON sensor.idSensor = data.idSensor WHERE idRoom = ? ORDER BY data.date ASC \");\n $req->execute([$_SESSION['idRoom']]);\n $sensorName = [];\n $sensorHistoric =[];\n while($data = $req->fetch()){\n if(!in_array($data['type'],$sensorName)) {\n $sensorName[count($sensorName)] = $data['type'];\n }\n $sensorHistoric[$data['type']]['value'][count($sensorHistoric[$data['type']]['value'])] = $data['value'];\n $sensorHistoric[$data['type']]['day'][count($sensorHistoric[$data['type']]['day'])] = explode(\" \",$data['date'])[0];\n }\n $req->closeCursor();\n return [$sensorName, $sensorHistoric];\n}", "public function getQueryHistory(): array;", "public function getAllInfoActivity()\n {\n return QcOverTimeRequest::where('action', $this->getDefaultHasAction())->get();\n }", "public function getFutureMeals(): array\n {\n $queryBuilder = $this->createQueryBuilder('m');\n $queryBuilder->where('m.dateTime >= :now');\n $queryBuilder->setParameter(':now', new DateTime('now'), Types::DATETIME_MUTABLE);\n\n return $queryBuilder->getQuery()->getResult();\n }", "public static function getAllComplete()\n {\n // e2.id as event_id,e2.title ,e2.title_en ,e2.description ,e2.`date`as dateevent,e2.city,e2.diary_id ,e2.type_id ,\n // p4.name as typemeet,\n // es.id as speaker_id ,p2.name as speaker,p2.photo as photospeaker,\n // em.id as moderator_id ,p3.name as moderator,p3.photo as photomoderator\n // FROM diary d\n // inner join events e2 on d.id = e2.diary_id \n // inner join events_speakers es on e2.id =es.event_id \n // inner join participants p2 on p2.id =es.participant_id \n // inner join events_moderators em on e2.id =em.event_id\n // inner join participants p3 on p3.id =em.participant_id\n // inner join parameters p4 on e2.type_id =p4.value and p4.`group` ='TYPE_MEET'\n // ORDER by d.id ,e2.id\";\n $sql = \"SELECT d.id,d.date,d.date_string ,d.date_string_en ,date_string_large,date_string_large_en,\n e2.id as event_id,e2.title ,e2.title_en ,e2.description ,e2.`date`as dateevent,e2.city,e2.diary_id ,e2.type_id ,\n p4.name as type\n FROM diary d\n inner join events e2 on d.id = e2.diary_id \n inner join parameters p4 on e2.type_id =p4.value and p4.`group` ='TYPE_MEET'\n ORDER by d.id ,e2.id\";\n return Yii::$app->db->createCommand($sql)->queryAll();\n }", "public function rewardHistories()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = reward_id, localKey = reward_id)\n return $this->hasMany('App\\RewardHistory','reward_id','reward_id');\n }", "function getEntriesForDate(DateTime $date);", "public function getHistory($datetime)\n {\n $h_table = Engine_Api::_()->getDbTable('sellingHistorys', 'mp3music');\n $h_name = $h_table->info('name');\n $select = $h_table->select()\n ->from($h_table);\n $select->where('selling_datetime = ?',$datetime); \n $results = $h_table->fetchAll($select)->toArray(); \n return $results;\n }", "public function history( Agent $agent){\n //agents revenue\n //$pending = $agent->revenue()\n //not in remittance\n // ->sum('amount');\n\n $history = Remittance::where('agent_id',$agent->id)->get();\n\n return response()->json([\n 'status' => 'success',\n 'data' => [\n 'amount' => $history\n ]\n ]);\n }", "public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "function getHistoryAppointment($username)\n {\n\n$query = $this->db->query(\"SELECT booking_status,concat(b.first_name,' ',b.last_name) as mua_id, a.appointment_id,DATE_FORMAT(date_appointment,'%d %b %Y') as date_appointment FROM g_appointment a left join g_mua b on a.mua_id=b.mua_id WHERE a.username='\".$username.\"' ORDER BY a.date_appointment DESC\");\n\n\n \n return $query->result();\n\t\t \n\t\t \n \n }", "public function addChatHistory(Request $request) {\n echo $request->history;\n echo $request->time;\n }", "Public function getTableInfo($date){\n\t\t$tableModel = new \\Admin\\Model\\TableModel();\n\t\t$tableInfo = $tableModel ->GetDegree();\n\t\tfor ($i=0; $i <count($tableInfo); $i++) { \n\t\t\tfor ($j=0; $j <count($tableInfo[$i][\"table\"]) ; $j++) { \n\t\t\t\t$id=$tableInfo[$i][\"table\"][$j][\"id\"];\n\t\t\t\t//查询检测该桌号是否被预定\n\t\t\t\t$conBook = array(\"book_table\"=>$id,\"book_status\"=>0,\"book_day\"=>$date);\n\t\t\t\t$book=M(\"book\")->where($conBook)->field(\"book_day,book_time,book_name\")->select();\n\t\t\t\t//获得预订信息\n\t\t\t\tif($book!=null){\n\t\t\t\t\t$tableInfo[$i][\"table\"][$j][\"type\"]=\"book\";\n\t\t\t\t\tforeach ($book as $key => $value) {\n\t\t\t\t\t\t$bookInfo = $value[\"book_day\"].\"-\".$value[\"book_name\"].\"预定\".$value[\"book_time\"];\n\t\t\t\t\t\t$tableInfo[$i][\"table\"][$j][\"info\"].=\" \".$bookInfo;\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t//查询检测是否被锁定\n\t\t\t\t$conTable = array(\"id\"=>$id,\"is_lock\"=>\"1\");\n\t\t\t\tif(M(\"table\")->where($conTable)->count()) {\n\t\t\t\t\t// if($date==date(\"Y-m-d\"))\n\t\t\t\t\t// 这里为什么要加日期判断???\n\t\t\t\t\t$tableInfo[$i][\"table\"][$j][\"type\"]=\"lock\";\n\t\t\t\t}\n\t\t\t\tif($tableInfo[$i][\"table\"][$j][\"type\"]==null) $tableInfo[$i][\"table\"][$j][\"type\"]=\"nomal\";\n\t\t\t}\n\t\t}\n\t\treturn($tableInfo);\n\t}", "private function getMClist()\n {\n return DB::table('absence')->join('teacher', 'absence.short_name', '=', 'teacher.short_name')\n ->get();\n// return Teacher::whereIn('short_name',Absence::where('date','=',new DateTime('today'))->lists('short_name'))->has('absence')->get();\n }", "public function get_readings_for_day (\n $y,\n $m,\n $d )\n {\n $start = date( 'Y-m-d H:i:s', mktime( 0, 0, 0, $m, $d, $y ) );\n $end = date( 'Y-m-d H:i:s', mktime( 23, 59, 59, $m, $d, $y ) );\n $results = $this->_db->select(\n \"SELECT *\n FROM energy\n WHERE used >= '\".$start.\"' && used <= '\".$end.\"'\" );\n if ( is_array( $results ) ) {\n return $results;\n }\n return false;\n }", "public function getRandomMealLastMadeBefore($date){\n $database = new Database();\n $allMeals = $database->getAllBeforeDate($date);\n if (empty($allMeals->toArray())) {\n return ['title' => \"You get NOTHING\"];\n }\n $meal = $allMeals[array_rand($allMeals->toArray())];\n\n return $meal;\n }", "private function access_keyword_event_list(){\n\t\t//$where_place = '(place = \\'tokyo\\' or k_desc2 like \\'%tokyo%\\') ';\n\t\t$where_place = $this->_get_where_place('tokyo');\n\t\tif (!empty($this->_place_name)) {\n\t\t\t$where_place = $this->_get_where_place($this->_place_name);\n\t\t}\n\t\t/*\n\t\tif (!empty($this->_config['calendar']['country_default']) && is_array($this->_config['calendar']['country_default'])) {\n\t\t\t$this->_checked_countryname = implode(',', $this->_config['calendar']['country_default']);\n\t\t}\n\t\tif (!empty($this->_config['calendar']['know_default']) && is_array($this->_config['calendar']['know_default'])) {\n\t\t\t$this->_checked_know = implode(',', $this->_config['calendar']['know_default']);\n\t\t}\n\t\t*/\n\t\t$index = 0;\n\t\t$country_defaults = array();\n\t\tforeach ($this->_config['calendar']['country_list'] as $one) {\n\t\t\tif ($one['default'] == 'on') {\n\t\t\t\t$country_defaults[] = $index;\n\t\t\t}\n\t\t\t$index++;\n\t\t}\n\t\t$this->_checked_countryname = implode(',', $country_defaults);\n\n\t\t$index = 0;\n\t\t$know_defaults = array();\n\t\tforeach ($this->_config['calendar']['know_list'] as $one) {\n\t\t\tif ($one['default'] == 'on') {\n\t\t\t\t$know_defaults[] = $index;\n\t\t\t}\n\t\t\t$index++;\n\t\t}\n\t\t$this->_checked_know = implode(',', $know_defaults);\n\n\t\t//$yy = date('Y');\n\t\t//$mm = date('n');\n\n\t\tif (isset($_GET['checked_countryname']))\n\t\t{\n\t\t\t$this->_checked_countryname = secure($_GET['checked_countryname']);\n\t\t\t$this->_checked_know = secure($_GET['checked_know']);\n\t\t}\n\n\t\tif (isset($this->_cookies) && $this->_cookies['place_name'] == $this->_place_name) {\n\t\t\t$where_place = $this->_get_where_place($this->_cookies['place_name']);\n\t\t}\n\n\t\t// USE ID/NUM DATE when we come from calendar module or banner id\n\t\tif (!empty($this->_num)) {\n\t\t\t$where_place = $this->_get_where_place($this->_selected_event_info['place']);\n\t\t}\n\n\t\t$where_country = ' ( 1=0';\n\t\t$where_know = ' ( 1=0';\n\n\t\tif (isset($_POST['place-name'])) {\n\t\t\t$this->_selected_day = $_POST['selected_day'];\n\t\t\t$this->_checked_countryname = $this->_checked_know = \"\";\n\n\t\t\t$num = 0;\n\t\t\tforeach ($_POST as $key => $val) {\n\t\t\t\tif (isset($_POST['country-' . $num])) {\n\t\t\t\t\t$this->_checked_countryname .= ',' . $num;\n\t\t\t\t}\n\n\t\t\t\tif (!empty($_POST['know-' . $num])) {\n\t\t\t\t\t$this->_checked_know .= ',' . $num;\n\t\t\t\t}\n\t\t\t\t$num++;\n\n\t\t\t\tif (mb_substr($key, 0, 5) == 'place') {\n\t\t\t\t\t$where_place = $this->_get_where_place($val);\n\t\t\t\t}\n\n\t\t\t\tif (mb_substr($key, 0, 7) == 'country') {\n\t\t\t\t\t//$where_country .= where_country($val);\n\t\t\t\t\t$where_country .= where_multiple($this->_config['calendar']['country_list'], $val);\n\t\t\t\t}\n\n\t\t\t\tif (mb_substr($key, 0, 4) == 'know') {\n\t\t\t\t\t//$where_know .= where_know($val);\n\t\t\t\t\t$where_know .= where_multiple($this->_config['calendar']['know_list'], $val);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//$yy = $_POST['year_date'];\n\t\t\t//$mm = $_POST['month_date'];\n\t\t} else {\n\t\t\t//$where_country .= where_country($this->_checked_countryname);\n\t\t\t//$where_know .= where_know($this->_checked_know);\n\t\t\t$where_country .= where_multiple($this->_config['calendar']['country_list'], $this->_checked_countryname);\n\t\t\t$where_know .= where_multiple($this->_config['calendar']['know_list'], $this->_checked_know);\n\t\t}\n\n\t\tif (isset($this->_cookies)) {\n\t\t\t$number_of_days_forward = 30;\n\t\t\t$cookie_date_days_added = date('Y-n-j', mktime(0, 0, 0, date('n'), (date('j')+$number_of_days_forward), date('Y')));\n\t\t\t//if use cookie at first\n\t\t\tif(empty($_POST['place-name']) && empty($_GET['navigation']))\n\t\t\t{\n\t\t\t\t//keep the same data for cookie when use cookie to display\n\t\t\t\t$array_cookie = array (\n\t\t\t\t\t'place_name' \t\t\t=> $this->_cookies['place_name'],\n\t\t\t\t\t'checked_countryname' \t=> $this->_cookies['checked_countryname'],\n\t\t\t\t\t'checked_know'\t\t\t=> $this->_cookies['checked_know'],\n\t\t\t\t\t'date'\t\t\t\t\t=> $cookie_date_days_added\n\t\t\t\t);\n\t\t\t\t//$this->_place_name = $this->_cookies['place_name'];\n\t\t\t} else {\n\t\t\t\t//set new data for cookie\n\t\t\t\t$array_cookie = array (\n\t\t\t\t\t'place_name' \t\t\t=> $this->_place_name,\n\t\t\t\t\t'checked_countryname' \t=> $this->_checked_countryname,\n\t\t\t\t\t'checked_know'\t\t\t=> $this->_checked_know,\n\t\t\t\t\t'date'\t\t\t\t\t=> $cookie_date_days_added\n\t\t\t\t);\n\t\t\t}\n\t\t\t$data_cookie = base64_encode(serialize($array_cookie));\n\t\t\tsetcookie(\"seminar_choice\", $data_cookie, time()+3600*24*30, \"/\"); //set cookie for 30 hours\n\t\t} else {\n\t\t\t$array_cookie = array (\n\t\t\t\t'place_name' \t\t\t=> $this->_place_name,\n\t\t\t\t'checked_countryname' \t=> $this->_checked_countryname,\n\t\t\t\t'checked_know'\t\t\t=> $this->_checked_know,\n\t\t\t\t'date'\t\t\t\t\t=> date('Y-n-j')\n\t\t\t);\n\t\t\t$data_cookie = base64_encode(serialize($array_cookie));\n\t\t\tsetcookie(\"seminar_choice\", $data_cookie, time()+60*60*24*30, \"/\"); //set cookie for 30 jours\n\t\t\t$this->_cookies = unserialize(base64_decode($_COOKIE['seminar_choice']));\n\t\t}\n\n\t\tif (isset($_GET['navigation'])) {\n\t\t\t$this->_selected_day = secure($_GET['day']);\n\t\t\t$where_place = $this->_get_where_place($this->_place_name);\n\t\t}\n\t\t$where_know .= ' ) ';\n\t\t$where_country .= ' ) ';\n\n\t\t$this->_keyword = \"\";\n\n\t\tif ($where_place != '') {\n\t\t\t$this->_keyword .= ' and ' . $where_place;\n\t\t}\n\t\tif ($where_country != ' ( 1=0 ) ') {\n\t\t\t$this->_keyword .= ' and ' . $where_country;\n\t\t}\n\t\tif ($where_know != ' ( 1=0 ) ') {\n\t\t\t$this->_keyword .= ' and ' . $where_know;\n\t\t}\n\n\t\tif (!empty($this->_config['calendar']['title'])) {\n\t\t\tif (is_array($this->_config['calendar']['title']))\t{\n\t\t\t\tforeach($this->_config['calendar']['title'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' and (k_title1 like \\'%' . $val . '%\\' or k_title2 like \\'%' . $val . '%\\' or k_desc1 like \\'%' . $val . '%\\' or k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_title1 like \\'%' . $this->_config['calendar']['title'] . '%\\' or k_title2 like \\'%' . $this->_config['calendar']['title'] . '%\\' or k_desc1 like \\'%' . $this->_config['calendar']['title'] . '%\\' or k_desc2 like \\'%' . $this->_config['calendar']['title'] . '%\\')';\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->_config['calendar']['title2'])) {\n\t\t\tif (is_array($this->_config['calendar']['title2']))\t{\n\t\t\t\t$this->_keyword .= ' and ( 1 = 0 ';\n\t\t\t\tforeach($this->_config['calendar']['title2'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' or (k_title1 like \\'%' . $val . '%\\' or k_title2 like \\'%' . $val . '%\\' or k_desc1 like \\'%' . $val . '%\\' or k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->_keyword .= ' ) ';\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_title1 like \\'%' . $this->_config['calendar']['title2'] . '%\\' or k_title2 like \\'%' . $this->_config['calendar']['title2'] . '%\\' or k_desc1 like \\'%' . $this->_config['calendar']['title2'] . '%\\' or k_desc2 like \\'%' . $this->_config['calendar']['title2'] . '%\\')';\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->_config['calendar']['keyword'])) {\n\t\t\tif (is_array($this->_config['calendar']['keyword']))\t{\n\t\t\t\tforeach($this->_config['calendar']['keyword'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' and (k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_desc2 like \\'%' . $this->_config['calendar']['keyword'] . '%\\')';\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->_config['calendar']['keyword2'])) {\n\t\t\tif (is_array($this->_config['calendar']['keyword2']))\t{\n\t\t\t\t$this->_keyword .= 'and ( 1 = 0 ';\n\t\t\t\tforeach($this->_config['calendar']['keyword2'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' or (k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->_keyword .= ' ) ';\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_desc2 like \\'%' . $this->_config['calendar']['keyword'] . '%\\')';\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($this->_config['start_date'])) {\n\t\t\t$this->_keyword .= ' and \\'' . $this->_config['start_date'] . '\\' <= hiduke ';\n\t\t}\n\t\tif (!empty($this->_config['end_date'])) {\n\t\t\t$this->_keyword .= ' and hiduke <= \\'' . $this->_config['end_date'] . '\\' ';\n\t\t}\n\t\treturn $this->_keyword;\n\t}", "public function listAlarms($date, $fullevent = false)\n {\n throw new Kronolith_Exception($this->_errormsg);\n }", "public function postQuestionLog($question_id, Request $request) {\n $question = Question::findOrFail($question_id);\n\n // get necessary param\n $page = $request->get('page');\n $itemInPage = $request->get('itemInPage') ? $request->get('itemInPage') : $this->itemInPage;\n\n $pages = ceil($question->histories()->count() / $itemInPage);\n $histories = $question->histories()\n ->orderBy('created_at', 'desc')->get()->forPage($page, $itemInPage);\n\n $topics = [];\n // for topics\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 3 || $value->type == 4;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n $topic = Topic::findOrFail($history->text);\n array_push($topics, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'topic' => [\n 'name' => $topic->name,\n 'url' => '/topic/' . $topic->id\n ],\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(9),\n 'canReport' => true,\n ]);\n }\n\n // title\n $titles = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 1;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($titles, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'text' => $history->text,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(9),\n 'canReport' => true,\n ]);\n }\n array_unshift($titles, [\n 'text' => $question->title\n ]);\n\n // content\n $contents = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 2;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($contents, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'text' => $history->text,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(9),\n 'canReport' => true,\n ]);\n }\n array_unshift($contents, [\n 'text' => $question->content\n ]);\n\n // rewards\n $rewards = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 7;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($rewards, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'text' => $history->text,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(9),\n 'canReport' => true,\n ]);\n }\n array_unshift($rewards, [\n 'text' => (string)$question->reward\n ]);\n\n // operations\n $operations = [];\n foreach ($histories->filter(function ($value, $key) {\n return $value->type == 5 || $value->type == 6;\n }) as $history) {\n $user = User::findOrFail($history->user_id);\n $user_arr = [\n 'id' => $user->id,\n 'name' => $user->name,\n 'url' => action('PeopleController@show', $user->url_name)\n ];\n array_push($operations, [\n 'id' => $history->id,\n 'type' => $history->type,\n 'user' => $user_arr,\n 'text' => $history->text,\n 'time' => Carbon::parse($history->created_at)->diffForHumans(),\n 'timestamp' => Carbon::parse($history->created_at)->timestamp,\n 'canRollback' => Auth::user()->operation(9),\n 'canReport' => true,\n ]);\n }\n\n return [\n 'pages' => $pages,\n 'data' => [\n 'titles' => $titles,\n 'contents' => $contents,\n 'topics' => $topics,\n 'rewards' => $rewards,\n 'operations' => $operations\n ]\n ];\n\n }", "public static function get_view_all($today) {\n\t\t$today = date_create($today);\n\t\t$year = date_format($today, 'Y');\n\t\t$month = date_format($today, 'm');\n\t\t$date = date_format($today, 'd');\n\t\t// get week\n\t\t$book_view = BooksViewQModel::get_book_view_all($date, $month, $year);\n\t\tif ($book_view == null) {\n\t\t\t$week = null;\n\t\t} else {\n\t\t\t$week = $book_view->week;\n\t\t}\n\t\t// dd($week);\n\t\t$data['day']\t= [];\n\t\t$data['week']\t= [];\n\t\t$data['month']\t= [];\n\t\t$data['season']\t= [];\n\t\t$data['year']\t= [];\n\t\t// get view day all\n\t\tfor ($i = 0; $i < 7; $i++) { \n\t\t\t$data['day'][$i] = BooksViewQModel::get_book_view_day_all($i, $week, $month, $year);\n\t\t\tif ($data['day'][$i] == null)\n\t\t\t\t$data['day'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['day'][$i] = (int)$data['day'][$i]->view;\n\t\t}\n\t\t// get view week all\n\t\tfor ($i = 0; $i < 5; $i++) { \n\t\t\t$data['week'][$i] = BooksViewQModel::get_book_view_week_all($i, $month, $year);\n\t\t\tif ($data['week'][$i] == null)\n\t\t\t\t$data['week'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['week'][$i] = (int)$data['week'][$i]->view;\n\t\t}\n\t\t// get view month all\n\t\tfor ($i = 1; $i <= 12; $i++) { \n\t\t\t$data['month'][$i] = BooksViewQModel::get_book_view_month_all($i, $year);\n\t\t\tif ($data['month'][$i] == null)\n\t\t\t\t$data['month'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['month'][$i] = (int)$data['month'][$i]->view;\n\t\t}\n\t\t// get view season all\n\t\tfor ($i = 1; $i <= 4; $i++) { \n\t\t\t$data['season'][$i] = BooksViewQModel::get_book_view_season_all($i, $year);\n\t\t\tif ($data['season'][$i] == null)\n\t\t\t\t$data['season'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['season'][$i] = (int)$data['season'][$i]->view;\n\t\t}\n\t\t// get view year all\n\t\tfor ($i = 2012; $i <= 2019; $i++) { \n\t\t\t$data['year'][$i] = BooksViewQModel::get_book_view_year_all($i);\n\t\t\tif ($data['year'][$i] == null)\n\t\t\t\t$data['year'][$i] = 0;\n\t\t\telse\n\t\t\t\t$data['year'][$i] = (int)$data['year'][$i]->view;\n\t\t}\n\t\treturn $data;\n\t}", "function nex_day_stats()\n{\n\t\t\tdate_default_timezone_set(\"GMT\");// gmt as defult\n\t\t\t$today = date('Y-m-d');// simply get time in gmt \n\t\t\t\n\t\t\t$query=$this->db->get('person');\n\t\t\t\t\n\t\t\t\tforeach($query-> result() as $row):\n\t\t\t\t\t \n\t\t\t\t\t $id=$row->id;\n\t\t\t\t\t\t// testing if the date exist already before just to provide more security \n\t\t\t\t\t\t$testexist=$this->db->get_where('stats',array('personid' => $id, 'date' => $today));\n\t\t\t\t\t \n\t\t\t\t\t if(!$testexist->result())\n\t\t\t\t\t {\n\t\t\t\t\t $array = array(\n\t\t\t\t\t\t\t 'personid' => $id,\n\t\t\t\t\t\t\t 'inlike' => 0, \n\t\t\t\t\t\t\t 'outlike' => 0, \n\t\t\t\t\t\t\t 'inhate' => 0, \n\t\t\t\t\t\t\t 'outhate' => 0, \n\t\t\t\t\t\t\t 'date' =>$today // insert gmt time in table\n\t\t\t\t\t\t\t );\t\n\t\t\t\t\t $this->db->set($array);\t\t \n\t\t\t\t\t $this->db->insert('stats'); \n\t\t\t\t\t } \n\t\t\telse { \n\t\t\techo \"this person:\" .$row->name.\" ID:\".$row->id.\" already has an entry in stat table for today:\".$today.'<br><br>' ; \n\t\t\t}\n\t\t\t\tendforeach;\n\t\t\t\t$this->db->limit(1);\n\t\t\t\t$this->db->set('today',$today);\n\t\t\t\t$this->db->update('site');\n}", "public function excelMedicineRestockingHistory(Request $request)\n {\n if(Auth::user()->access != 1 )\n {\n abort(403);\n }\n return $this->report->excelMedicineRestockingHistory($request); \n }", "public function getCompetitionAndVoteMomentsByDate($start_date = 0, $end_date = 0) {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\tif($start_date == 0) {\n\t\t\t\t$start = Carbon::now($timezone)->startOfDay();\n\t\t\t} else {\n\t\t\t\t$start = Carbon::createFromFormat('Y-m-d', $start_date, $timezone)->startOfDay();\n\t\t\t}\n\n\t\t\tif($end_date == 0) {\n\t\t\t\t$end = Carbon::now($timezone)->endOfDay();\n\t\t\t} else {\n\t\t\t\t$end = Carbon::createFromFormat('Y-m-d', $end_date, $timezone)->endOfDay();\n\t\t\t}\n\n\t\t\t$competition_tag_ids = $this->getCompetitionTags($start, $end);\n\n\t\t\t$vote_tag_ids = $this->getVoteTags($start, $end);\n\n\t\t\t$competition_data = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw(\"FLOOR(MOD(airshr_events.record_timestamp + {$offset}, 86400)/3600) AS hour,\n\t\t\tCOUNT(*) as count\"))\n\t\t\t\t->whereIn('airshr_events.tag_id', $competition_tag_ids)\n\t\t\t\t->where('airshr_events.station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t->where('airshr_events.record_timestamp', '>=', $start->timestamp)\n\t\t\t\t->where('airshr_events.record_timestamp', '<=', $end->timestamp)\n\t\t\t\t->groupBy('hour')\n\t\t\t\t->get();\n\n\t\t\t$vote_data = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw(\"FLOOR(MOD(airshr_events.record_timestamp + {$offset}, 86400)/3600) AS hour,\n\t\t\tCOUNT(*) as count\"))\n\t\t\t\t->whereIn('airshr_events.tag_id', $vote_tag_ids)\n\t\t\t\t->where('airshr_events.station_id', '=', \\Auth::User()->station->id)\n\t\t\t\t->where('airshr_events.record_timestamp', '>=', $start->timestamp)\n\t\t\t\t->where('airshr_events.record_timestamp', '<=', $end->timestamp)\n\t\t\t\t->groupBy('hour')\n\t\t\t\t->get();\n\n\t\t\t$vote_raw = [];\n\t\t\tforeach ($vote_data as $data_point) {\n\t\t\t\t$vote_raw[$data_point->hour] = $data_point->count;\n\t\t\t}\n\n\t\t\t$vote = [];\n\n\t\t\t$i = 0;\n\t\t\tfor ($hour = 6; $hour <= 22; $hour++) {\n\t\t\t\tif (array_key_exists($hour, $vote_raw)) {\n\t\t\t\t\t$vote[$i] = $vote_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$vote[$i] = 0;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$competition_raw = [];\n\t\t\tforeach ($competition_data as $data_point) {\n\t\t\t\t$competition_raw[$data_point->hour] = $data_point->count;\n\t\t\t}\n\n\t\t\t$competition = [];\n\n\t\t\t$i = 0;\n\t\t\tfor ($hour = 6; $hour <= 22; $hour++) {\n\t\t\t\tif (array_key_exists($hour, $competition_raw)) {\n\t\t\t\t\t$competition[$i] = $competition_raw[$hour];\n\t\t\t\t} else {\n\t\t\t\t\t$competition[$i] = 0;\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\treturn response()->json(array('code' => 0, 'vote' => $vote, 'competition' => $competition ));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}", "function get_food_menu()\n\t {\n\t\t$today_date = date(\"d-m-Y\");\n\t\t$today_day = date('l', strtotime($today_date));\n\t\t$week_days = array('Monday', 'Tuesday', 'Wednesday','Thursday','Friday','Saturday','Sunday');\n\t\t$temp_array = array_search($today_day,$week_days);\n\t\t\n\t\t$start_date = strtotime(date(\"d-m-Y\", strtotime($today_date)) . '-'.$temp_array.'day');\n\t\t$end_date = strtotime(date(\"d-m-Y\",$start_date) . \" +5 day\");\n\t\t\n\t\t$food_list \t= $this ->ObjM->food_list($start_date,$end_date);\n\t\t//echo $this->db->last_query(); exit;\n\t\t\n\t\tif(count($food_list)<1){\n\t\t\t$json_arr[]=array('validation'=>'false');\t\n\t\t\techo json_encode($json_arr);\n\t\t\texit;\t \n\t\t}\n\t\t\n\t\tfor($i=0;$i<count($food_list);$i++){\n\t\t $food_date = date('d-m-Y',$food_list[$i]['date']);\t\n\t\t\t\n\t\t $json_arr[]=array(\n\t\t\t\t\t'date'\t\t\t\t=>\t$food_date,\n\t\t\t\t\t'day'\t\t\t\t=>\t$food_list[$i]['day'],\n\t\t\t\t\t'food_name'\t\t\t=>\t$food_list[$i]['food_name'],\n\t\t\t\t\t'validation'\t \t=>\t'true' );\n\t\t }\n\t\t echo json_encode($json_arr);\n\t\t\texit;\n\t }", "function retrieveTrendingPosts();", "public function nsdDgdpNsdTenders($date=null){\n\n $zone = \\Request::segment(3);\n $organization = \\Request::segment(4);\n $lastUpldatedDateTime = $date;\n\n $zoneInfo = Zone::where('alise','=',$zone)->first();\n $navalLocation = NsdName::where('alise','=',$organization)->orderBy('id')->first();\n\n \n $data['zone'] = $zone;\n $data['organization'] = $organization;\n $data['date'] = $date;\n\n $data['tenders'] = DB::table($zoneInfo->alise.'_tenders')\n // ->where('status_id','=',1)\n ->where('nsd_id','=',$navalLocation->id)\n ->where(function($query) use ($lastUpldatedDateTime){\n $query->whereDate('created_at','>',$lastUpldatedDateTime);\n $query->orWhereDate('updated_at', '>', $lastUpldatedDateTime);\n })->get();\n\n return $data;\n\n }", "public function nsdDhakaNsdTenders($date=null){\n\n $zone = \\Request::segment(3);\n $organization = \\Request::segment(4);\n $lastUpldatedDateTime = $date;\n\n $zoneInfo = Zone::where('alise','=',$zone)->first();\n $navalLocation = NsdName::where('alise','=',$organization)->orderBy('id')->first();\n\n \n $data['zone'] = $zone;\n $data['organization'] = $organization;\n $data['date'] = $date;\n\n $data['tenders'] = DB::table($zoneInfo->alise.'_tenders')\n // ->where('status_id','=',1)\n ->where('nsd_id','=',$navalLocation->id)\n ->where(function($query) use ($lastUpldatedDateTime){\n $query->whereDate('created_at','>',$lastUpldatedDateTime);\n $query->orWhereDate('updated_at', '>', $lastUpldatedDateTime);\n })->get();\n\n return $data;\n\n }", "public function getHistory($type, $role_id) {\n syslog(LOG_DEBUG, \"battle get history($type, $role_id)\");\n $records = array();\n $battle_model = $this->_di->getShared('battle_history_model');\n switch ($type) {\n case BattleLib::$BATTLE_TYPE_PVP_RANK:\n $battle_model->settable('battle_history_rank');\n break;\n case BattleLib::$BATTLE_TYPE_PVP_ROB:\n $battle_model->settable('battle_history_rob');\n break;\n default:\n syslog(LOG_ERR, \"battle get history unsupported type $type\");\n return $records;\n }\n $rs = $battle_model->findByAttacker($role_id);\n foreach ($rs as $row) {\n $info = array();\n $info['attacker'] = $row['attacker'];\n $info['target'] = $row['target'];\n $info['result'] = $row['result'];\n $info['battle_id'] = $row['battle_id'];\n if ($row['gain'] != null) {\n $info['gain'] = json_decode($row['gain']);\n }\n $info['time'] = strtotime($row['created_at']);\n $records[]= $info;\n }\n // defence\n $rs = $battle_model->findByTarget($role_id);\n foreach ($rs as $row) {\n $info = array();\n $info['attacker'] = $row['attacker'];\n $info['target'] = $row['target'];\n $info['result'] = $row['result'];\n $info['battle_id'] = $row['battle_id'];\n if ($row['gain'] != null) {\n $info['gain'] = json_decode($row['gain']);\n }\n $info['gain'] = $row['gain'];\n $info['time'] = strtotime($row['created_at']);\n $records[]= $info;\n }\n return $records;\n }", "public function index_should_return_single_record()\r\n {\r\n // Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Palm Sunday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-25',\r\n 'public'=> 0\r\n ]\r\n ]\r\n ] );\r\n\r\n // previous Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25&previous=1')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Saint Patrick\\'s Day',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-17',\r\n 'public'=> 0\r\n ],\r\n ]\r\n ] );\r\n\r\n // upcoming Single day\r\n $this->get('/holidays/us/2018/?month=3&day=25&upcoming=1')\r\n ->seeJson( [\r\n 'status'=> 200,\r\n 'message'=>'succeeded with content',\r\n 'holidays'=>[\r\n [\r\n 'name'=>'Good Friday',\r\n 'country'=> 'us',\r\n 'date'=>'2018-03-30',\r\n 'public'=> 1\r\n ],\r\n ]\r\n ] );\r\n }", "public function getStatusHistories();", "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}", "public function actionApiJackpotRecentList()\n {\n $this->layout = false;\n $model = new JackpotDetails();\n header('Content-type: application/json'); \n $json = file_get_contents('php://input');\n \n //convert the string of data to an array\n $data['Jackpot'] = json_decode($json, true);\n\t\t//$data['Jackpot'] = Yii::$app->request->post();\n\t\t$limit = (empty($data['Jackpot']['limit'])) ? '20' : $data['Jackpot']['limit'];\n\t\t$start = (empty($data['Jackpot']['offset'])) ? '0' : $data['Jackpot']['offset'];\n\t\tif($start>0)\n\t\t{\n\t\t$start = $start * $limit;\n\t\t}\n\t\t$lastMonth = time() - (3600*24*30);\n\t\t$last_month = date(\"Y-m-d H:i:s\",$lastMonth);\n\t\t$jackpotListCount= JackpotDetails::find()->where(['<', 'end_date', date(\"Y-m-d H:i:s\",time() + 3600)])\n ->andWhere(['>=', 'end_date', $last_month])->asArray()->all();\n\t\t\n $jackpotList= JackpotDetails::find()->where(['<', 'end_date', date(\"Y-m-d H:i:s\",time() + 3600)])\n ->andWhere(['>=', 'end_date', $last_month])->limit($limit)->offset($start)->asArray()->all();\n\t\tif(!empty($jackpotList))\n\t\t{\n\t\t\t$index = 0;\n\t\t\tforeach($jackpotList as $list)\n\t\t\t{\n\t\t\t$time = strtotime($list['end_date']) + 3600; // Add 1 hour\n\t\t\t$jackpotListNew[$index]['lotteryName'] = $list['name'];\n\t\t\t$jackpotListNew[$index]['lotteryDate'] = date(\"Y-m-d H:i:s\",$time);\n\t\t\t$jackpotListNew[$index]['lotteryImage'] = $list['jackpot_section_image'];\n\t\t\t$jackpotListNew[$index]['countryIcon'] = $list['countryid'].'.png';\n\t\t\t$index++;\n\t\t\t}\n\t\t\t$return['status'] = 1;\n $return['data'] = $jackpotListNew;\n\t\t\t$return['totalRecords'] = count($jackpotListCount);\n $return['message'] = \"Data Retrieved Successfully.\";\n return json_encode($return); \n\t\t}\n\t\t else\n {\n $return['status'] = 0;\n $return['message'] = \"There is no Recent Jackpot.\";\n return json_encode($return);\n }\n\t\t\n\t}", "public function filteredByDate(Request $request){\n return response(Expense::where('user_id', $request->user()->id)\n ->whereBetween('created_at',[Date(\"Y-m-d\", $request->start/1000).\" 00:00:00\", Date(\"Y-m-d\", $request->end/1000).\" 23:59:59\"])\n ->with('category')\n ->orderBy('created_at', 'desc')\n ->paginate(4), 200);\n }", "public function tweets(Request $request)\n\t{\n\n\t\t$hour = date('Y-m-d H:i:s', strtotime('-1 hour'));\n\t\t$city = strtoupper($request->input('city'));\n\t\t$lng = $request->input('lng');\n\t\t$lat = $request->input('lat');\n\t\t\n\t\t$record = History::where('keyword', $city)->where('updated_at', '>', $hour)->first();\n\t\t\n\t\tif ($record) {\n\t\t\t$twitter_data = $record->description;\n\t\t\t$record->increment('count',1);\n\n\t\t} else {\n\n\t\t\t$twitter_data = $this->getTweets($lat,$lng);\n\t\t\tif (empty($twitter_data)) {\n\t\t\t\tdie('testing record not found');\n\t\t\t\t$twitter_data = [];\n\t\t\t} else {\n\t\t\t\t$record = History::where('keyword', $city)->first();\n\t\t\t\tif ($record) {\n\t\t\t\t\t$record->update(['description' => $twitter_data]);\n\t\t\t\t\t$record->increment('count',1);\n\t\t\t\t} else {\n\t\t\t\t\t$history = new History;\n\t\t\t\t\t$history->keyword = $city;\n\t\t\t\t\t$history->description = $twitter_data;\n\t\t\t\t\t$history->latitude = $lat;\n\t\t\t\t\t$history->longitude = $lng;\n\t\t\t\t\t$history->image_url = 'something';\n\t\t\t\t\t$history->count = 1;\n\t\t\t\t\t$history->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo $twitter_data;\n\t}", "public function index()\n {\n $historys = History::with('getApiKeys')\n ->with('getWorkflow')\n ->with('getStateFrom')\n ->with('getStateTo')\n ->with('getUserName')\n ->paginate(10);\n $now = Carbon::now();\n $dates = [];\n foreach($historys as $history)\n {\n $end = Carbon::parse($history->created_at);\n array_push($dates,$end->diffForHumans($now));\n }\n return view('workflow.history.index',compact('historys', 'dates'));\n }", "public function getReadingsOfTheDay(\\DateTime $day): array\n {\n if ($this->isLogged === false) {\n $this->login();\n }\n\n $url = str_replace(\n '{date}',\n $day->format('d-m-YH:i:s'),\n self::URI_READINGS_OF_THE_DAY\n );\n\n $response = $this->client->get($url);\n if ($response->getStatusCode() !== 200) {\n $this->isLogged = false;\n return false;\n }\n\n return $this->normalizeMeasurements($response->getBody()->getContents());\n }", "function history() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($id, $auth)) {\n $this->response('', 400);\n }\n\n if ($id > 0) {\n $query = \"select * from videos where id in (select video_id from history where user_id=$id group by video_id order by view_date desc);\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function actionAmmonia() {\r\n \t$currentTs = time();\r\n \t$request = Yii::$app->request;\r\n \t$identity = \\Yii::$app->user->getIdentity();\r\n \t$arrPond = [];\r\n \r\n \t$q = trim($request->post('q', $request->get('q', '')));\r\n \r\n \t$query = Ammonia::find();\r\n \t$query->orderBy(['id'=>SORT_ASC]);\r\n \r\n \t$op = $request->post('op', $request->get('opss', ''));\r\n \tif ($op == \"search\") {\r\n \t \t if (!empty($_REQUEST['type'])){\r\n \t\t\t$type = $_REQUEST['type'];\r\n \t\t\tif($type != 0){\r\n \t\t\t\t$queryf = pond::find();\r\n \t\t\t\t$queryf->andWhere(['type'=> $type]);\r\n \t\t\t\t$pondf = $queryf->all();\r\n \t\t\t\tforeach ($pondf as $obj){\r\n \t\t\t\t\t$arrId[] = $obj->id;\r\n \t\t\t\t}\r\n \t\t\t\t \r\n \t\t\t\tif($arrId){\r\n \t\t\t\t\t$query->andWhere(['pondId'=> $arrId]);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\t \r\n \t\tif (!empty($_REQUEST['q'])){\r\n \t\t\t$item = $_REQUEST['q'];\r\n \t\t\t$query->andWhere(['LIKE' ,'title','%'.$item.'%', false]);\r\n \t\t}\r\n \t}\r\n\r\n \t\t\tif ($q)\r\n \t\t\t\t$query->andWhere(['LIKE' ,'name','%'.$q.'%', false]);\r\n \t\t\t\t\t\r\n \t\t\t\t\t\r\n \t\t\t\t//actions\r\n \t\t\t\tswitch ($request->post('op')){\r\n \t\t\t\t\tcase 'delete':\r\n \t\t\t\t\t\t$this->ammoniaDelete();\r\n \t\t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t//paging\r\n \t\t\t\t$pagination = new Pagination([\r\n \t\t\t\t\t\t'defaultPageSize' => \\Yii::$app->params['ui']['defaultPageSize'],\r\n \t\t\t\t\t\t'totalCount' => $query->count(),\r\n \t\t\t\t]);\r\n \t\t\t\t$pagination->params = [\r\n \t\t\t\t\t\t'q'=>$q,\r\n \t\t\t\t\t\t'page'=>$pagination->page,\r\n \t\t\t\t];\r\n \t\t\t\t$query->offset($pagination->offset);\r\n \t\t\t\t$query->limit($pagination->limit);\r\n \t\t\t\t\t\r\n \t\t\t\t$list = $query->all();\r\n \t\t\t\t\t\r\n \t\t\t\t//get users\r\n \t\t\t\t$arrId = [];\r\n \t\t\t\t$arrUser = [];\r\n \t\t\t\t$arrPond = [];\r\n \t\t\t\tif (!empty($list)){\r\n \t\t\t\t\tforeach ($list as $obj){\r\n \t\t\t\t\t\t$arrId[] = $obj->createBy;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t$modelsUser = User::find()->where(['id'=>$arrId])->all();\r\n \t\t\t\t\tif(!empty($modelsUser)){\r\n \t\t\t\t\t\tforeach ($modelsUser as $obj){\r\n \t\t\t\t\t\t\t$arrUser[$obj->id] = $obj->firstName.' '.$obj->lastName;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t\t$objPond = Pond::find()->orderBy(['id'=>SORT_ASC])->all();\r\n \t\t\t\t\tforeach ($objPond as $dataPond){\r\n \t\t\t\t\t\t$objTypelist = Typelist::find()->where(['id'=>$dataPond->type])->all();\r\n \t\t\t\t\t\tforeach ($objTypelist as $obj){\r\n \t\t\t\t\t\t\t$arrPond[$dataPond->id] = $obj->name.' '.$dataPond->title;\r\n \t\t\t\t\t\t}\r\n \t\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$query = Typelist::find();\r\n \t\t\t\t$query->orderBy(['id'=>SORT_ASC]);\r\n \t\t\t\t$objTypelist = $query->all();\r\n \t\t\t\t$arrTypelist = [];\r\n \t\t\t\tforeach ($objTypelist as $dataTypelist){\r\n \t\t\t\t\t$arrTypelist[$dataTypelist->id] = $dataTypelist->name;\r\n \t\t\t\t}\r\n \r\n \t\t\t\t\t\r\n \t\t\t\techo $this->render('ammonia', [\r\n \t\t\t\t\t\t'lst' => $list,\r\n \t\t\t\t\t\t'arrPond' => $arrPond,\r\n \t\t\t\t\t\t'arrTypelist'=>$arrTypelist,\r\n \t\t\t\t\t\t'arrTypelist'=>$arrTypelist,\r\n \t\t\t\t\t\t'pagination' => $pagination,\r\n \t\t\t\t\t\t'arrUser' =>$arrUser,\r\n \t\t\t\t\t\t'q'=>$q,\r\n \t\t\t\t]);\r\n }", "public function getBorrowReminderLost() {\n $dataReminder = DB::table('settings')->where('name', 'daylost')->select('content')->get()[0];\n $fromDate = new Carbon('now');\n\n\n $data = Borrow::where('status', '=', '20')->where( 'ngaydaohan', '<=', $fromDate->toDateTimeString())->orderBy('ngaydaohan', 'asc')->get();\n if (count($data)) {\n foreach ($data as $record) {\n $toDate = Carbon::parse($record['ngaydaohan'])->addDays($dataReminder->content);\n $dataAdd['dateLost'] = $toDate->toDateTimeString();\n $userObj = User::where('id', $record->uid)->first();\n\n emailSend($record, $userObj['email'], 'Email Reminder ' .$userObj['username'] .' - '.$toDate->toDateTimeString(), 'REMINDER_LOST', $dataAdd);\n\n // update - neu da send email reminder => cap nhat trang thai cua khoan vay la da reminder lan 1 => status = 20\n Borrow::where('id', $record->id)->update(array('status'=> '30'));\n }\n } else {\n echo 'No data';\n }\n }", "public function trendAction()\n\t{\t$result = $this->db->getTrend();\n\t\t$trend = array();\n\t\tforeach( $result as $row )\n\t\t{\t$trend = array_merge( $trend, array_values($row) );\n\t\t}\n\t\t\n\t\t$this->view->trend = $trend;\n\t}", "public function houseAuction($request)\r\n { \r\n // GET \r\n $filters = $request->get('_filter');\r\n \r\n $selectedDate = $this->selectedDate($request);\r\n \r\n $em = $this->getDoctrine()->getManager();\r\n $house = $em->getRepository('AppBundle:HouseAuction')->createQueryBuilder('ha');\r\n $house->select('ha.id, ha.city, ha.image, ha.addDate, ha.startDate, ha.approved, ha.status')\r\n ->join('ha.langs', 'hal')->addSelect('hal.title, hal.description')\r\n ->join('hal.lang', 'lang')->addSelect('lang.shortcut, lang.enabled')\r\n ->andWhere('ha.approved = :approved')\r\n ->andWhere('lang.shortcut= :shortcut')\r\n ->andWhere('ha.status IN(0,1)')\r\n ->setParameter(':approved', 1)\r\n ->setParameter(':shortcut', $request->getLocale()); \r\n \r\n if(empty($filters['type']) and empty($filters['city']) and empty($filters['time'])) {\r\n $house ->getQuery()->getResult(); \r\n \r\n return $house->getQuery()->getResult();\r\n } elseif(!empty($filters['type']) and empty($filters['city']) and empty($filters['time'])) {\r\n if($filters['type'] == 16 || $filters['type'] == 17) {\r\n $house ->getQuery()->getResult(); \r\n \r\n return $house->getQuery()->getResult();\r\n } else {\r\n return false;\r\n } \r\n\r\n } elseif(empty($filters['type']) and !empty($filters['city']) and empty($filters['time']) ) {\r\n $house->andWhere('ha.city = :city')\r\n ->setParameter(':city', $filters['city']);\r\n $house ->getQuery()->getResult(); \r\n \r\n return $house->getQuery()->getResult();\r\n \r\n } elseif(empty($filters['type']) and empty($filters['city']) and !empty($filters['time']) ) {\r\n $house ->getQuery()->getResult(); \r\n \r\n return $house->getQuery()->getResult();\r\n } elseif(!empty($filters['type']) and !empty($filters['city']) and empty($filters['time']) ) {\r\n if($filters['type'] == 16 || $filters['type'] == 17) {\r\n $house->andWhere('ha.city = :city')\r\n ->setParameter(':city', $filters['city']);\r\n $house ->getQuery()->getResult(); \r\n return $house->getQuery()->getResult(); \r\n } else {\r\n return false;\r\n } \r\n \r\n } elseif(!empty($filters['type']) and empty($filters['city']) and !empty($filters['time']) ) {\r\n if($filters['type'] == 16 || $filters['type'] == 17) {\r\n $house ->getQuery()->getResult(); \r\n return $house->getQuery()->getResult(); \r\n } else {\r\n return false;\r\n } \r\n } elseif(empty($filters['type']) and !empty($filters['city']) and !empty($filters['time']) ) { \r\n $house->andWhere('ha.city = :city')\r\n ->setParameter(':city', $filters['city']);\r\n $house ->getQuery()->getResult(); \r\n return $house->getQuery()->getResult(); \r\n \r\n } elseif(!empty($filters['type']) and !empty($filters['city']) and !empty($filters['time']) ) {\r\n if($filters['type'] == 16 || $filters['type'] == 17) {\r\n $house->andWhere('ha.city = :city')\r\n ->setParameter(':city', $filters['city']);\r\n $house ->getQuery()->getResult(); \r\n return $house->getQuery()->getResult(); \r\n } else {\r\n return false;\r\n } \r\n }\r\n \r\n return false; \r\n \r\n \r\n \r\n// if(empty($filters['type']) and empty($filters['city']) and empty($filters['time'])) {\r\n// \r\n// } elseif(!empty($filters['type']) and empty($filters['city']) and empty($filters['time']) ) {\r\n// \r\n// } elseif(empty($filters['type']) and !empty($filters['city']) and empty($filters['time']) ) {\r\n// \r\n// } elseif(empty($filters['type']) and empty($filters['city']) and !empty($filters['time']) ) {\r\n// \r\n// } elseif(!empty($filters['type']) and !empty($filters['city']) and empty($filters['time']) ) {\r\n// \r\n// } elseif(!empty($filters['type']) and empty($filters['city']) and !empty($filters['time']) ) {\r\n// \r\n// } elseif(empty($filters['type']) and !empty($filters['city']) and !empty($filters['time']) ) {\r\n// \r\n// } elseif(!empty($filters['type']) and !empty($filters['city']) and !empty($filters['time']) ) {\r\n// \r\n// }\r\n \r\n }" ]
[ "0.61993796", "0.59928375", "0.5377133", "0.5349312", "0.52711874", "0.5228813", "0.5223987", "0.518543", "0.5183215", "0.51422334", "0.5129633", "0.51056576", "0.50806737", "0.5067465", "0.505496", "0.505325", "0.50402874", "0.50272834", "0.5024065", "0.49749744", "0.49508262", "0.4934771", "0.48940533", "0.4878837", "0.48629466", "0.48171744", "0.48142448", "0.4808702", "0.4806548", "0.4806407", "0.47875103", "0.47802475", "0.4775263", "0.4768316", "0.47631323", "0.4731664", "0.47312886", "0.4726798", "0.47240993", "0.47204962", "0.4713466", "0.47078103", "0.4707512", "0.46874958", "0.46678466", "0.46655914", "0.46428284", "0.46293947", "0.4626096", "0.46177018", "0.46092474", "0.46036598", "0.45977256", "0.45872456", "0.4577836", "0.45703873", "0.4566087", "0.45644322", "0.45577696", "0.4549419", "0.45492348", "0.45394728", "0.45235047", "0.45162016", "0.45120367", "0.4508568", "0.45037383", "0.44889075", "0.4483253", "0.44815496", "0.44813675", "0.4481186", "0.44574034", "0.44573408", "0.44556227", "0.44501677", "0.4445831", "0.44433737", "0.44426936", "0.4440796", "0.4439267", "0.44325483", "0.44280595", "0.4422429", "0.44218093", "0.44070953", "0.44038525", "0.43988553", "0.43925786", "0.43917048", "0.43855855", "0.4383093", "0.43810657", "0.43787795", "0.43779087", "0.4377514", "0.4376364", "0.43745798", "0.43716723", "0.43715635" ]
0.73968565
0
this method allows user to get his profile or update phone, email, workphone, workemail is optional fields
public function profileAction(){ /** @var Object_User $user */ $data = $this->getRequestData(); $user = Object_User::getById($this->getDeviceSession()->getUserId()); if(isset($data['phone'])){ $user->setPhone($data['phone']); } if(isset($data['email'])){ $user->setPhone($data['email']); } if(isset($data['workphone'])){ $user->setWorkPhone($data['workphone']); } if(isset($data['workemail'])){ $user->setWorkEmail($data['workemail']); } if(!$user->save()){ $this->setErrorResponse('Cannot update user profile'); } $this->_helper->json($user); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function p_edit() { if(!$this->user) {\n Router::redirect('/');\n }\n \n $this->user->user_id = DB::instance(DB_NAME)->sanitize($this->user->user_id);\n $q = 'SELECT first_name, last_name, email\n FROM users\n WHERE user_id = \"'.$this->user->user_id.'\"';\n $user = DB::instance(DB_NAME)->select_row($q);\n \n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n \n $_POST['first_name'] = htmlspecialchars($_POST['first_name'], ENT_QUOTES, 'UTF-8');\n $_POST['last_name'] = htmlspecialchars($_POST['last_name'], ENT_QUOTES, 'UTF-8');\n \n $q = 'SELECT count(*)\n FROM users\n WHERE email = \"'.$_POST['email'].'\"'; \n $count = DB::instance(DB_NAME)->select_rows($q); \n //if the user enters an email which already exists in the data base kick them back\n if(intval($count[0]['count(*)']) >= 1) {\n Router::redirect('/users/edit/error');\n } else {\n \n if($_POST['first_name'] != NULL)\n {\n $user['first_name'] = $_POST['first_name'];\n }\n if($_POST['last_name'] != NULL )\n {\n $user['last_name'] = $_POST['last_name'];\n }\n if($_POST['email'] != NULL )\n {\n $user['email'] = $_POST['email'];\n }\n \n \n \n DB::instance(DB_NAME)->update(\"users\", $user, \"WHERE user_id =\".$this->user->user_id);\n Router::redirect('/users/profile/'.$this->user->user_id);\n }\n \n \n }", "public function update_profile_info() {\n\t\t$data = array(\n\t\t\t'first_name' => html_escape($this->input->post('first_name')),\n\t\t\t'last_name' => html_escape($this->input->post('last_name')),\n\t\t\t'biography' => html_escape($this->input->post('biography')),\n\t\t\t'phone' => html_escape($this->input->post('phone')),\n\t\t\t'social_links' => '{\"twitter\":\"' . html_escape($this->input->post('twitter')) . '\",\"facebook\":\"' . html_escape($this->input->post('facebook')) . '\",\"linkedin\":\"' . html_escape($this->input->post('linkedin')) . '\"}',\n\t\t);\n\t\t$this->session->set_userdata('phone', $this->input->post('phone'));\n\t\t$result = $this->user_model->update_user_info($this->session->userdata('user_id'), $data);\n\n\t\tif ($result) {\n\t\t\t$this->session->set_flashdata('profile_info_update_successful', \"Information updated successfully.\");\n\t\t} else {\n\t\t\t$this->session->set_flashdata('failed_to_update_profile_info', \"Failed to update profile info!! Please contact support.\");\n\t\t}\n\n\t\tredirect(site_url('user/profile/info'), 'refresh');\n\t}", "public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }", "public function updateUserinfo()\n\t{\n\t\t$user_array = Session::all();\n\n \t$userID = Session::get('id');\n\t\t$data = $this->request->all();\n\t\t$data['user'] = Auth::user();\n\t\t\t$rules = array(\n \t\t'full_name' => 'required',\n\t\t\t\t'zip_code' => 'required',\n\t\t\t\t'aniversary_date' => 'required',\n\t\t\t\t'phone_number' => 'required',\n\t\t\t\t'dob' => 'required',\n\t\t\t\t'gender' => 'required',\n\t\t\t\t'location_id' => 'required'\t\t\t\t\n\t\t\t);\n\n\t\t\t$message = array(\n\t\t\t\t'required' => 'The :attribute is required', \n\t\t\t);\n\n\t\t\t$validation = Validator::make($data, $rules, $message);\n\n\t\t\tif($validation->fails())\n\t\t\t{\n\t\t\t\treturn Redirect::to('/users/updateinfo')->withErrors($validation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t$arrResponse=Profile::updateProfileWeb($data, $userID);\n \treturn Redirect::to('/users/myaccount')\n\t\t ->with('flash_notice', '');\n\t\t }\n\t}", "public function updateProfile()\n {\n $fname=Input::get(\"fname\");\n $lname=Input::get(\"lname\");\n $dob=Input::get(\"dob\");\n $contact=Input::get(\"contact\");\n $user=Auth::user();\n if($fname!=NULL && !empty($fname))\n {\n $user->fname=$fname;\n }\n\n if($lname!=NULL && !empty($lname))\n {\n $user->lname=$lname;\n\n }\n if($contact!=NULL && !empty($contact))\n {\n $user->contact=$contact;\n }\n\n\n\n if($dob!=NULL && !empty($dob))\n {\n $user->dob=$dob;\n }\n\n $user->save();\n echo '0';\n \n\n\n\n //\n }", "public static function editProfile( $address, $phone, $mail){\n\t}", "public function profile()\n {\n if (isset($_REQUEST['submit'])) {\n\n $fullname = $_POST['fullname'];\n\n $phone = $_POST['phone'];\n\n $username = $_POST['username'];\n\n $des = $_POST['des'];\n\n $user = $_POST['user'];\n\n\n //Checking for User login or not\n $change = $this->getChange($username, $fullname, $phone ,$des, $user);\n\n if ($change) {\n $success = 'Change profile successful!';\n echo \"<p><span class='error' style='color: green'>\" . $success . \"</span></p><br>\";\n } else {\n // Registration Failed\n $fail = 'Change profile failed. Account already not exits, please try again.';\n echo \"<p><span class='error' style='color: red;'>\" . $fail . \"</span></p><br>\";\n };\n }\n }", "public function updateProfile()\n {\n try {\n $email = Crypt::decryptString(request()->hash);\n $user = Customer::whereEmail($email)->first();\n if ($user) {\n $user->fname = request()->fname;\n $user->lname = request()->lname;\n $user->phone = request()->phone;\n $user->address = request()->address;\n if (request()->image)\n $user->image = $this->uploadBase64Image(request()->image);\n\n $user->save();\n\n $user->access_token = Crypt::encryptString($user->email);\n\n return ['status' => true, 'message' => 'Profile updated successfully.', 'data' => $user];\n }//..... end if() .....//\n\n return ['status' => false, 'message' => 'User details not found!.'];\n } catch (\\Exception $exception) {\n return $exception->getMessage();\n return ['status' => false, 'message' => 'Internal server error occurred, please try later.'];\n }\n }", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "public function p_profile_edit() {\n $duplicate = DB::instance(DB_NAME)->select_field(\"SELECT email FROM users WHERE email = '\" . $_POST['email'] . \"' AND email != '\" . $this->user->email . \"'\");\n\n //If email already exists \n if($duplicate){ \n \n //Redirect to error page \n Router::redirect('/users/profile/?duplicate=true');\n }\n\n\n // Encrypt the password \n $_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']); \n\n // Create an encrypted token via their email address and a random string\n $_POST['token'] = sha1(TOKEN_SALT.$_POST['email'].Utils::generate_random_string()); \n\n $q = \"UPDATE users\n SET first_name = '\".$_REQUEST['first_name'].\"',\n last_name = '\".$_REQUEST['last_name'].\"',\n email = '\".$_REQUEST['email'].\"'\n WHERE id = '\".$this->user->id.\"'\";\n\n DB::instance(DB_NAME)->query($q);\n Router::redirect(\"/users/profile\");\n\n \n }", "function changeUserDetail($userEmail, $firstname, $lastname, $phone){\n\n\t\tglobal $conn;\n\n\t\t$query = \"UPDATE User \n\t\tSET firstname='$firstname', lastname='$lastname', phone='$phone' \n\t\tWHERE email='\" . $userEmail . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result != TRUE){\n\t\t\techo \"Error updating \" . $userEmail . \" details\";\n\t\t}\n\n\t}", "public function editprofile_action()\n {\n Auth::checkAuthentication();\n \n \n $postname = Request::post('user_name');\n $postemail = Request::post('user_email');\n $postbio = Request::post('user_bio');\n\n\n if(Session::get('user_name') != $postname && $postname != null)\n {\n UserModel::editUserName($postname);\n }\n \n if(Session::get('user_email') != $postemail && $postemail != null)\n {\n UserModel::editUserEmail($postemail);\n }\n \n //null is checked in this method\n AvatarModel::createAvatar();\n \n if(Session::get('user_bio') != $postbio && $postbio != null)\n {\n UserModel::editBio($postbio);\n }\n\n return true;\n }", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "public function update_profile(){\n\t\t\t$data = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'zipcode' => $this->input->post('zipcode'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'username' => $this->input->post('username')\n\t\t\t);\n\n\t\t\t$this->db->where('id', $this->input->post('id'));\n \n return $this->db->update('users', $data);\n\t\t}", "public function profile()\n {\n $id = $this->Auth->user('id');\n $user = $this->Users->get($id, [\n 'contain' => []\n ]);\n\n if ($this->request->is(['patch', 'post', 'put'])) {\n //avoid mass-assignment attack\n $options = [\n 'fieldList' => [\n 'email',\n 'username',\n 'password',\n 'first_name',\n 'last_name',\n 'address_1',\n 'address_2',\n 'suburb',\n 'state',\n 'post_code',\n 'mobile',\n 'phone',\n ]\n ];\n\n $user = $this->Users->patchEntity($user, $this->request->getData(), $options);\n if ($this->Users->save($user)) {\n\n $this->Flash->success(__('Your profile has been updated.'));\n return $this->redirect(\"/\");\n } else {\n $this->Flash->error(__('Your profile could not be updated. Please, try again.'));\n }\n }\n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n\n return null;\n }", "function updateProfile($name, $phone, $email, $username, $userid) {\n $query = \"UPDATE users_account SET fullname = ?,mobileno = ?,email = ?,username WHERE userid = ?\";\n $paramType = \"ssssi\";\n $paramValue = array(\n $name,\n $phone,\n $email,\n $username,\n $userid\n );\n \n $this->db_handle->update($query, $paramType, $paramValue);\n }", "function updateProfile()\n\t\t{\n\t \t$pass = \"\";\n\t\t \tif(strlen($this->updProfile['password'])){\n\t\t\t\t$pass=\", password ='\".$this->updProfile['password'].\"'\";\n\t\t \t} \n\t\t \n\t\t\t$query = \"UPDATE tbl_member SET first_name='\".$this->updProfile['firstName'].\"',\n\t\t last_name = '\".$this->updProfile['lastName'].\"',\n\t\t email = '\".$this->updProfile['email'].\"',\n\t\t user_name = '\".$this->updProfile['UserName'].\"'{$pass}\n\t\t WHERE member_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t\t$this->Execute($query);\n\t\t \n\t\t\t$query = \"UPDATE tbl_subscriber \n\t\t\tSET mail_street_address ='\".$this->updProfile['streetAddress'].\"',\n\t\t mail_city='\".$this->updProfile['City'].\"',\n\t\t bill_street_address ='\".$this->updProfile['billingAddress'].\"' ,\n\t\t bill_city ='\".$this->updProfile['billCity'].\"',\n\t\t mail_state ='\".$this->updProfile['state'].\"',\n\t\t mail_zip_code ='\".$this->updProfile['zipCode'].\"',\n\t\t bill_state ='\".$this->updProfile['billState'].\"',\n\t\t bill_zip_code ='\".$this->updProfile['billZipCode'].\"',\n\t\t is_address_changed ='\".$this->updProfile['is_address_changed'].\"',\n\t\t secondary_affiliates ='\".$this->updProfile['secondary_afflliates'].\"'\n\t\t \n\t\t WHERE subscriber_id = '\".$this->updProfile['ID'].\"'\";\n\t\t \n\t\t return $this->Execute($query);\n\t\t //return $this->_getPageArray($rs, 'Subscriber');*/\n\t\t}", "public function adminEditUserProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n {\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"', level_access = '\" . $level_access . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n $res = $this->processSql($sql);\n if(!$res) return 4;\n return 99;\n }", "public function adminEditProfile($id,$title,$full_name,$dob,$gender,$address,$phone)\n\t{\n $title = $this->secureInput($title);\n $full_name = $this->secureInput($full_name);\n $dob = $this->secureInput($dob);\n $gender = $this->secureInput($gender);\n $address = $this->secureInput($address);\n //$city = $this->secureInput($city);\n //$state = $this->secureInput($state);\n //$country = $this->secureInput($country);\n $phone = $this->secureInput($phone);\n\n//$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', city = '\" . $city . \"', state = '\" . $state . \"', country = '\" . $country . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n$sql = \"UPDATE users SET title = '\" . $title . \"', full_name = '\" . $full_name . \"', dob = '\" . $dob . \"', gender = '\" . $gender . \"', address = '\" . $address . \"', phone = '\" . $phone . \"' WHERE id = '\" . $id . \"'\";\n\n \t$res = $this->processSql($sql);\n\t\t\tif(!$res) return 4;\n\t\t\treturn 99;\n\t}", "public function edit()\n {\n\n\n $user = Auth::user();\n $id = Input::get('user_id');\n\n // $Helper = new CustomHelper;\n // $StoragePath = $Helper->getStorageDirectory();\n\n // $id = Input::get('user_id');\n // $user = User::find($id);\n // $profile = Profiles::whereuser_id($id)->first();\n\n // mettre a jour le statut de l user \n \n if ($user->hasRole('Admin'))\n {\n\n $status = 'Activated';\n\n if (Input::get('account-status') == 'Заблокированный'){\n $status = 'Banned';\n }\n\n $user_upd = User::where('id', $id)->update(['status' => $status]);\n\n return redirect()->back();\n\n }\n\n\n \n $name = explode(\" \", trim(Input::get('fio')));\n\n // dd($name[0]);\n\n //=========== TODO : bug sur l edit\n\n \n\n if ($this->isCurrent($id) ) {\n\n // TODO : A refactoriser\n\n $name = explode(\" \", trim(Input::get('fio')));\n switch (count($name)) {\n case 1:\n\n $user->familia = $name[0];\n $user->save();\n break;\n\n case 2:\n\n\n $user->familia = $name[0];\n $user->imia = $name[1];\n $user->save();\n break;\n\n default:\n\n // dd($name);\n\n $user->update(['familia' => $name[0], 'imia' => $name[1], \n 'otchestvo' => $name[2]]);\n // $user->familia = ;\n // $user->imia = $name[1];\n // $user->otchestvo = $name[2];\n $user->save();\n break;\n }\n\n $phonenumber = Input::get('form-account-phone');\n $email = Input::get('form-account-email');\n\n if (!empty($phonenumber)) {\n $user->phonenumber = $phonenumber;\n $user->save();\n }\n\n if (!empty($email)) {\n $user->email = $email;\n $user->save();\n }\n\n return Redirect('me/account/');\n\n }\n\n\n\n }", "public function update_profile() {\n\t\tloggedOnly();\n\n\t\t// Busca o usuario\n\t\t$user = auth();\n\n\t\t// Pega o email\n\t\t$email = $this->input->post( 'email' ) ? \n\t\t\t\t $this->input->post( 'email' ) :\n\t\t\t\t $user->email;\n\n\t\t// Verifica se o email foi alterado\n\t\tif( $email !== $user->email ) {\n\n\t\t\t// Verifica se o email é unico\n\t\t\tif( $this->User->email( $email ) ) {\n\t\t\t\treturn reject( 'E-mail ja cadastrado no sistema' );\n\t\t\t}\n\t\t\t\n\t\t\t// Seta o email\n\t\t\t$user->email = $email;\n\t\t}\n\n\t\t// Verifica se a senha foi alterada\n\t\tif( $password = $this->input->post( 'password' ) ) {\n\t\t\t$user->setPassword( $password );\n\t\t}\n\n\t\t// seta o nome\n\t\t$user->name = $this->input->post( 'name' ) ? \n\t\t\t\t\t $this->input->post( 'name' ) : \n\t\t\t\t\t $user->name;\n\n\t\t// Verifica se a foto foi alterada\n\t\tif( $base64 = $this->input->post( 'image' ) ) {\n\n\t\t\t// Guarda a imagem\n\t\t\tif( $midia_id = $this->__saveUserImage( $base64 ) ) {\n\t\t\t\t$user->midia_id = $midia_id;\n\t\t\t} else return reject( 'Erro ao salvar a imagem do usuário' );\n\t\t}\n\n\t\t// salvar a alteração\n\t\tif( $user->save() ) {\n\t\t\treturn resolve( $user->authData() );\n\t\t} else return reject( 'Erro ao realizar a ação' );\n\t}", "public function profile_update(Request $request)\n {\n if($request->email != $request->email1){\n if(User::where('email', $request->email)->first()){\n return response()->json([\n 'status' => 'exist',\n 'message' => 'Email Address Already Exist.'\n ]);\n } else {\n User::updateOrCreate([\n 'id' => $request->user_id\n ],[\n 'fname' => $request->fname,\n 'mname' => $request->mname,\n 'lname' => $request->lname,\n 'address' => $request->address,\n 'contact_num' => $request->contact_num,\n 'email' => $request->email\n ]);\n }\n } else if($request->contact_num != $request->contact_num1) { \n if(User::where('contact_num', $request->contact_num)->first()){\n return response()->json([\n 'status' => 'exist',\n 'message' => 'Phone Number Already Exist.'\n ]);\n } else {\n User::updateOrCreate([\n 'id' => $request->user_id\n ],[\n 'fname' => $request->fname,\n 'mname' => $request->mname,\n 'lname' => $request->lname,\n 'address' => $request->address,\n 'contact_num' => $request->contact_num,\n 'email' => $request->email\n ]);\n }\n } else {\n User::updateOrCreate([\n 'id' => $request->user_id\n ],[\n 'fname' => $request->fname,\n 'mname' => $request->mname,\n 'lname' => $request->lname,\n 'address' => $request->address,\n 'contact_num' => $request->contact_num,\n 'email' => $request->email\n ]);\n }\n \n return response()->json([\n 'status' => 'success',\n 'message' => 'Profile Successfully Updated!',\n 'fname' => $request->fname,\n 'mname' => $request->mname,\n 'lname' => $request->lname,\n 'address' => $request->address,\n 'contact_num' => $request->contact_num,\n 'email' => $request->email\n ]);\n }", "public function update()\n\t{\n\t\t// check whether there is user who has logged in\n\t\tif (!Auth::check())\n\t\t\treturn 'fail';\n\n\t\t//get profile model\n\t\t$user = Auth::user();\n\t\t$profile = Profile::find($user->id);\n\t\t$profile->firstname = Input::get('firstname');\n\t\t$profile->lastname = Input::get('lastname');\n\t\t$profile->number = Input::get('number');\n\t\t$profile->country = Input::get('country');\n\t\t$profile->language = Input::get('language');\n\t\t$profile->city = Input::get('city');\n\t\t$profile->location = Input::get('location');\n\t\t$profile->availability = Input::get('availability');\n\t\t$profile->currency = Input::get('currency');\n\t\t$profile->price = Input::get('price');\n\t\t$profile->about = Input::get('about');\n\n\t\t// update profile and user\n\t\tif ($profile->save() && $user->save())\n\t\t\treturn 'success';\n\t}", "public function profile()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n $gender = '';\n\n if (!empty($this->input->post('sex'))) {\n $gender = $this->input->post('sex');\n }\n\n if(mb_strlen($this->input->post('nickname')) <= 10) {\n // Call API to register for parent\n $res = $this->_api('user')->update_profile([\n 'id' => $this->current_user->id,\n 'nickname' => $this->input->post('nickname'),\n 'sex' => $gender,\n ]);\n } else {\n $view_data['form_errors'] = ['nickname' => 'ニックネーム欄は10文字以内で入力してください'];\n }\n\n if (isset($res['result'])) {\n $this->session->set_flashdata('get_trophy', $res['result']['trophy']);\n $this->session->set_flashdata('get_point', $res['result']['point']);\n redirect('setting');\n return;\n } elseif (isset($res)) {\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n }\n $view_data['post'] = $this->input->post();\n\n }\n\n $user_res = $this->get_current_user_detail();\n\n $view_data['user'] = $user_res['result'];\n\n $this->_render($view_data);\n }", "function update_user_phone()\n\t{\n\t\tlog_message('debug', 'Account/update_user_phone');\n\t\tcheck_access($this,'__redirect'); #redirect away from this function if user is not logged in\n\n\t\t$data = filter_forwarded_data($this);\n\t\t$result = FALSE;\n\t\t$data['msg'] = '';\n\t\tlog_message('debug', 'Account/update_user_phone:: [1] post='.json_encode($_POST));\n\t\tlog_message('debug', 'Account/update_user_phone:: [2] data='.json_encode($data));\n\t\t# a) The user is updating the telephone number\n\t\tif(!empty($_POST['telephone'])){\n\t\t\t$data['hasPosted'] = 'Y';\n\t\t\t$response = $this->_api->post('user/telephone', array(\n\t\t\t\t\t'telephone'=>$_POST['telephone'],\n\t\t\t\t\t'provider'=>$_POST['provider__provider'],\n\t\t\t\t\t'isPrimary'=>'Y'\n\t\t\t\t));\n\n\t\t\t# Update the user telephone and provider if sucessful\n\t\t\tif(!empty($response['result']) && $response['result']=='SUCCESS'){\n\t\t\t\t$this->native_session->set('__telephone', $_POST['telephone']);\n\t\t\t\t$this->native_session->set('__provider', $response['provider']);\n\t\t\t\t$this->native_session->set('__provider_id', $_POST['provider__provider']);\n\t\t\t\t$data['msg'] = 'Your phone number has been updated and verification code sent.';\n\t\t\t\t$result = TRUE;\n\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data['msg'] = 'ERROR: Your phone number could not be updated';\n\t\t\t\t$data['area'] = 'user_phone_details';\n\t\t\t}\n\t\t}\n\n\n\t\t# b) Verify telephone code\n\t\telse if(!empty($_POST['usercode'])){\n\t\t\t$data['hasPosted'] = 'Y';\n\t\t\t$response = $this->_api->post('account/verify', array(\n\t\t\t\t'code'=>$_POST['usercode'],\n\t\t\t\t'telephone'=>$this->native_session->get('__telephone'),\n\t\t\t\t'baseLink'=>base_url()\n\t\t\t));\n\n\t\t\tif(!empty($response['verified']) && $response['verified']=='Y'){\n\t\t\t\t$this->native_session->set('__telephone_verified', 'Y');\n\t\t\t\t$data['msg'] = '20 Points have been added to your Clout Score';\n\t\t\t\t$data['area'] = 'verify_code_results';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$data['msg'] = 'ERROR: Your phone could not be verified.<br>Please try again.';\n\t\t\t\t$data['area'] = 'verify_code_form';\n\t\t\t}\n\t\t}\n\n\n\t\t# c) the user has already verified their phone.\n\t\telse if($this->native_session->get('__telephone_verified') && $this->native_session->get('__telephone_verified') == 'Y'){\n\t\t\t# if this is a user with more privileges to view the network page take them to the network home instead\n\t\t\tif($this->native_session->get('__direct_invitation_count')\n\t\t\t\t&& $this->native_session->get('__direct_invitation_count') >= MINIMUM_INVITE_COUNT\n\t\t\t){\n\t\t\t\t$view = check_access($this,'can_view_invite_tools')? 'network/home': 'account/thank_you';\n\t\t\t}\n\t\t\telse $view = 'network/invite';\n\n\t\t\t# take to appropriate view\n\t\t\tredirect(base_url().$view);\n\t\t}\n\n\n\t\t# c) the user is coming to this page for first time OR they havent verified their phone yet\n\t\telse if(!(!empty($data['edit']) && $data['edit'] == 'Y') && $this->native_session->get('__telephone') && $this->native_session->get('__provider_id')\n\t\t\t&& (!$this->native_session->get('__telephone_verified') || ($this->native_session->get('__telephone_verified') && $this->native_session->get('__telephone_verified') == 'N'))\n\t\t){\n\t\t\t$response = $this->_api->post('user/telephone', array(\n\t\t\t\t\t'telephone'=>$this->native_session->get('__telephone'),\n\t\t\t\t\t'provider'=>$this->native_session->get('__provider_id'),\n\t\t\t\t\t'isPrimary'=>'Y'\n\t\t\t));\n\n\t\t\t# Prepare appropriate message\n\t\t\t$data['msg'] = (!empty($response['result']) && $response['result']=='SUCCESS')? 'A verification message has been sent to your phone. Enter the code here to confirm your phone number.': 'ERROR: A verification message could not be sent to your phone. <br>Click Resend to attempt sending it again, or Edit to change your phone details.';\n\t\t\t$result = TRUE;\n\t\t\t$data['area'] = 'verify_code_form';\n\t\t}\n\n\n\t\t# d) The user has to enter their phone details from scratch\n\t\telse $data['area'] = 'user_phone_details';\n\n\t\t$data = load_page_labels('link_card', $data);\n\t\t$this->load->view('account/verify_phone', $data);\n\t}", "public function update_profile_get($email=null,$name=null){\n\t\tif(!empty($name) && !empty($email)){\n\t\t\t$q = $this->db->where('email',$email)->update('users',array('name' => $name));\n\t\t\tif($this->db->affected_rows() > 0){\n\t\t\t\t$this->response(['updated'], REST_Controller::HTTP_OK);\n\t\t\t}else{\n\t\t\t\t$this->response(['Error.'], '500');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->response(['Too few arguments'], '500');\n\t\t}\n\t}", "public function edit_user_details() {\n $this->check_auth();\n $update_data = array(\n 'email' => $this->input->post('email'),\n 'first_name' => $this->input->post('first_name'),\n 'prefix' => $this->input->post('prefix'),\n 'last_name' => $this->input->post('last_name'),\n );\n $this->load->helper('image_upload_helper');\n $cover_pic = do_image_upload(config_item('src_path_cover_images'), 10000, 500, 'image');\n $profile_pic = do_image_upload(config_item('src_path_profile_pictures'), 10000, 500, 'cover_image');\n if ($cover_pic) {\n if (isset($cover_pic['error'])) {\n return $this->send_error($cover_pic['error']);\n }\n $update_data['cover_image'] = $cover_pic[0];\n $update_data['image'] = $cover_pic[0];\n }\n if ($profile_pic) {\n if (isset($profile_pic['error'])) {\n return $this->send_error($profile_pic['error']);\n }\n $update_data['cover_image'] = $profile_pic[0];\n $update_data['image'] = $profile_pic[0];\n }\n if (!$this->db->where('id', $this->user_id)->update('users', $update_data)) {\n return $this->send_error('ERROR');\n }\n return $this->send_success();\n }", "public function profileEdit($username, $withPassword = false,Request $request){\n\n $userManager = new UserManager();\n $securityHelper = new SH();\n\n $profileUser = $userManager->findByUsername($username);\n $loggedUser = $securityHelper->getUser($request);\n \n if (!$profileUser){\n route('fourofour','This user does not exist');\n }\n elseif (!$loggedUser){\n SH::forbid();\n }\n elseif($loggedUser->getUsername() != $profileUser->getUsername()){\n SH::forbid();\n }\n\n $skillManager = new SkillManager();\n $latestActivity = $skillManager->getLatestActivity($profileUser);\n\n $uploadErrors = false; \n $errors = false;\n //profile form submitted\n if (!empty($_POST) && $loggedUser){\n\n $newUsername = $_POST['username'];\n $newEmail = $_POST['email'];\n $bio = $_POST['bio'];\n $interests = $_POST['interests'];\n $languages = $_POST['languages'];\n $country = $_POST['country'];\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validateUsername($newUsername);\n //changing username ?\n if ($newUsername != $loggedUser->getUsername()){\n $validator->validateUniqueUsername($newUsername);\n }\n $validator->validateEmail($newEmail);\n //changing email ?\n if ($newEmail != $loggedUser->getEmail()){\n $validator->validateUniqueEmail($newEmail);\n }\n\n if ($validator->isValid()){\n\n //hydrate user obj\n $user = $securityHelper->getUser($request);\n\n $user->setUsername( $newUsername );\n $user->setEmail( $newEmail );\n $user->setInterests( $interests );\n $user->setLanguages( $languages );\n $user->setCountry( $country );\n $user->setBio( $bio );\n\n\n /*\n * @TODO: Add profile picture\n */\n// if (!empty($_FILES['picture']['tmp_name'])){\n//\n// $errCode = $_FILES['picture']['error'];\n//\n// if ($errCode != 4){\n// if ($errCode == 1 || $errCode == 2){\n// $uploadErrors[] = _(\"Your picture is too large!\");\n// }\n// else if ($errCode == 3){\n// $uploadErrors[] = _(\"An error occured while uploading your picture!\");\n// }\n//\n// //HANDLE UPLOAD\n// $tmp_name = $_FILES['picture']['tmp_name'];\n//\n// $finfo = finfo_open(FILEINFO_MIME_TYPE);\n// $mime = finfo_file($finfo, $tmp_name);\n//\n// if (substr($mime, 0, 5) != \"image\"){\n// $uploadErrors[] = _(\"Your picture is invalid!\");\n// }\n// else {\n// $img = new \\abeautifulsite\\SimpleImage($tmp_name);\n// if ($img->get_width() < 180 || $img->get_height() < 180){\n// $uploadErrors[] = _(\"Your picture is too small!\");\n// }\n// }\n//\n// if (empty($uploadErrors)){\n// $filename = uniqid() . \".jpg\";\n// $img->thumbnail(180,180)->save(\"img/uploads/\" . $filename, 100); //quality as second param\n// $user->setPicture( $filename );\n// }\n// }\n// }\n\n $userManager->update($user);\n $securityHelper->putUserDataInSession($request, $user);\n return view('profile',['username'=> $user->getUsername()]);\n// Router::redirect( Router::url('viewProfile', array('username' => $user->getUsername())) );\n }\n else {\n $errors = $validator->getErrors();\n }\n }\n\n $params = array();\n $params['errors'] = $errors;\n $params['uploadErrors'] = $uploadErrors;\n $params['latestActivity'] = $latestActivity;\n\n if ($withPassword){ $params['showPasswordResetForm'] = true; }\n $params['profileUser'] = $profileUser;\n\n $usernameEncoded = SH::encode($username);\n $params['title'] = sprintf(_(\"%s's Profile\"), $usernameEncoded);\n\n //csrf token for delete account link\n// $params['csrfToken'] = SH::setNewCsrfToken();\n\n return view('pages.profile', ['params'=> $params]);\n// $view = new View(\"profile.php\", $params);\n//\n// $view->send();\n\n }", "private function editAccount()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n //country\n if(!isset($request['country']) || $request['country']==\"\")\n throw_error_msg(\"provide country\");\n\n //sex\n if(!isset($request['sex']) || $request['sex']==\"\")\n throw_error_msg(\"provide sex\");\n\n if(!in_array($request['sex'], array('male','female')))\n throw_error_msg(\"sex must be male/female\");\n\n //dob\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n $is_valid_date = DateTime::createFromFormat('Y-m-d', $request['dob']);\n\n if(!$is_valid_date)\n throw_error_msg(\"dob must be in Y-m-d like 1990-11-18 format\");\n\n if(!isset($request['category']) || $request['category']==\"\")\n throw_error_msg(\"provide category\");\n\n $request['userid'] = userid();\n $userquery->update_user($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($request['userid']);\n \n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $user_info);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function save_profile() {\n global $wpdb;\n\n // Get the current subscriber, fail if not found\n $user = $this->get_user_from_request(true);\n\n // Conatains the cleaned up user data to be saved\n $data = array();\n $data['id'] = $user->id;\n\n $options_profile = get_option('newsletter_profile', array());\n $options_main = get_option('newsletter_main', array());\n\n // Not an elegant interaction between modules but...\n $subscription_module = NewsletterSubscription::instance();\n\n if (!$this->is_email($_REQUEST['ne'])) {\n $user->alert = $this->options['profile_error'];\n return $user;\n }\n\n $email = $this->normalize_email(stripslashes($_REQUEST['ne']));\n $email_changed = ($email != $user->email);\n\n // If the email has been changed, check if it is available\n if ($email_changed) {\n $tmp = $this->get_user($email);\n if ($tmp != null && $tmp->id != $user->id) {\n // TODO: Move the label on profile setting panel\n $user->alert = $this->options['error'];\n return $user;\n }\n $data['status'] = Newsletter::STATUS_NOT_CONFIRMED;\n }\n\n // General data\n $data['email'] = $email;\n if (isset($_REQUEST['nn'])) {\n $data['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));\n if ($subscription_module->is_spam_text($data['name'])) {\n die();\n }\n }\n if (isset($_REQUEST['ns'])) {\n $data['surname'] = $this->normalize_name(stripslashes($_REQUEST['ns']));\n if ($subscription_module->is_spam_text($data['surname'])) {\n die();\n }\n }\n if ($options_profile['sex_status'] >= 1) {\n $data['sex'] = $_REQUEST['nx'][0];\n // Wrong data injection check\n if ($data['sex'] != 'm' && $data['sex'] != 'f' && $data['sex'] != 'n') {\n die('Wrong sex field');\n }\n }\n\n // Lists. If not list is present or there is no list to choose or all are unchecked.\n $nl = array();\n if (isset($_REQUEST['nl']) && is_array($_REQUEST['nl'])) {\n $nl = $_REQUEST['nl'];\n }\n\n // Every possible list shown in the profile must be processed\n $lists = $this->get_lists_for_profile();\n foreach ($lists as $list) {\n $field_name = 'list_' . $list->id;\n $data[$field_name] = in_array($list->id, $nl) ? 1 : 0;\n }\n\n // Profile\n for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {\n // Private fields cannot be changed by the subscriber\n if ($options_profile['profile_' . $i . '_status'] == 0) {\n continue;\n }\n $data['profile_' . $i] = stripslashes($_REQUEST['np' . $i]);\n }\n\n\n // Feed by Mail service is saved here\n $data = apply_filters('newsletter_profile_save', $data);\n\n if ($user->status == TNP_User::STATUS_NOT_CONFIRMED) {\n $data['status'] = TNP_User::STATUS_CONFIRMED;\n }\n\n $user = $this->save_user($data);\n $this->add_user_log($user, 'profile');\n\n // Send the activation again only if we use double opt-in, otherwise it has no meaning\n // TODO: Maybe define a specific email for that and not the activation email\n if ($email_changed && $subscription_module->is_double_optin()) {\n $subscription_module->send_activation_email($user);\n // TODO: Move this option on new profile configuration panel\n $alert = $this->options['profile_email_changed'];\n }\n\n if (isset($alert)) {\n $user->alert = $alert;\n } else {\n // TODO: Move this label on profile settings panel\n $user->alert = $this->options['saved'];\n }\n return $user;\n }", "public function updateprofileAction()\n\t{\n\t\t$this->view->headTitle(\"Update Your Profile\");\n\t\t\n\t\t//if not logged in, user can't edit profile\n\t\tif(!$this->loggedEmail){\n\t\t\t$this->_redirect('/'); \n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\tif($this->getRequest()->isPost()){\n\t\t\t\n\t\t\t$resultRow->email = $this->getRequest()->getPost('email');\n\t\t\t$resultRow->first_name = $this->getRequest()->getPost('first_name');\n\t\t\t$resultRow->last_name = $this->getRequest()->getPost('last_name');\n\t\t\t$resultRow->gender = $this->getRequest()->getPost('gender');\n\t\t\t$resultRow->address = $this->getRequest()->getPost('address');\n\t\t\t\n\t\t\tif(strlen($this->getRequest()->getPost('password'))){\n\t\t\t\t$resultRow->password = $this->getRequest()->getPost('password');\n\t\t\t}\n\t\t\t$resultRow->updated_at = date('Y-m-d H:i:s');\n\t\t\t$resultRow->save();\n\t\t\t\n\t\t} \n\t\t\t\n\t\t$this->view->email = $resultRow->email;\n\t\t$this->view->first_name = $resultRow->first_name;\n\t\t$this->view->last_name = $resultRow->last_name;\n\t\t$this->view->gender = $resultRow->gender;\n\t\t$this->view->address = $resultRow->address;\n\t\t$this->view->handle = $resultRow->handle;\n\t\n\t}", "public function Update( )\n {\n\t\t\t$password = \"\";\n\t\t\tif( $this->password!=\"\" )\n\t\t\t{\n\t\t\t\t$password = $this->password;\n\t\t\t}\n\t\t\t\n $dataArray = array( \"userInfo\" =>array( \"email\"=>$this->email,\n\t\t\t\t\t\t\t\t\t\t\t\t \"username\"=>$this->username,\n \"firstname\"=>$this->firstname,\n \"lastname\"=>$this->lastname,\n \"password\"=>$password,\n \"gender\"=>$this->gender,\n \"yearOfBirth\"=>$this->yearOfBirth,\n \"phone\"=>$this->phone,\n \"mobile\"=>$this->mobile,\n \"addressLine1\"=>$this->addressLine1,\n \"addressLine2\"=>$this->addressLine2,\n \"addressCity\"=>$this->addressCity,\n \"addressState\"=>$this->addressState,\n \"addressCountry\"=>$this->addressCountry,\n \"addressZipCode\"=>$this->addressZipCode,\n \"interests\"=>$this->interests,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"newsletters\"=>intval($this->newsletters)\n )\n );\n\t\t\t//Check if isAdmin exists\n\t\t\tif( isset($this->isAdmin) )\n\t\t\t{\n\t\t\t\t$tempArray = array(\"isAdmin\"=>intval($this->isAdmin));\t\t\t\t\n\t\t\t\t$dataArray = array_merge($dataArray,$tempArray);\n\t\t\t}\n\t\t\t\n\t\t\t//Check if recordStatus exists\n\t\t\tif( isset( $this->recordStatus ) )\n\t\t\t{\n\t\t\t\t$tempArray = array(\"recordStatus\"=>intval($this->recordStatus));\n\t\t\t\t$dataArray = array_merge($dataArray,$tempArray);\n\t\t\t}\n\t\t\t//Check if facebook details are provided for update\n\t\t\tif( isset( $this->facebookDetails ) )\n\t\t\t{\n\t\t\t\t$tempArray = array(\"facebookDetails\"=>$this->facebookDetails);\n\t\t\t\t$dataArray = array_merge($dataArray,$tempArray);\n\t\t\t}\n\t\t\t//Check if twitter details are provided for update\n\t\t\tif( isset( $this->twitterDetails ) )\n\t\t\t{\n\t\t\t\t$tempArray = array(\"twitterDetails\"=>$this->twitterDetails);\n\t\t\t\t$dataArray = array_merge($dataArray,$tempArray);\n\t\t\t}\n\t\t\t\n\t\t\t//Check if isDataAdmin field is set\n\t\t\tif( isset( $this->isDataAdmin ) )\n\t\t\t{\n\t\t\t\t$tempArray = array(\"isDataAdmin\"=> $this->isDataAdmin );\t\t\t\t\n\t\t\t\t$dataArray = array_merge( $dataArray, $tempArray );\n\t\t\t}\n\t\t\t\n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/Update/\".$this->id, \"json\" );\n \n return $response;\n }", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "function editProfile() {\r\n if (!$this->common_model->isLoggedIn()) {\r\n redirect('signin');\r\n }\r\n $data['user_session'] = $this->session->userdata('user_account');\r\n\r\n $user_id = $data['user_session']['user_id'];\r\n $arr_user_detail = $this->common_model->getRecords(\"mst_users\", \"\", array(\"user_id\" => intval($user_id)));\r\n $arr_user_detail = end($arr_user_detail);\r\n $data = $this->common_model->commonFunction();\r\n\r\n if ($this->input->post('user_email') != '') {\r\n $table_name = 'mst_users';\r\n $first_name = $this->input->post('first_name');\r\n $last_name = $this->input->post('last_name');\r\n $user_email = $this->input->post('user_email');\r\n $user_name = $this->input->post('user_name');\r\n\r\n $gender = $this->input->post('gender');\r\n\r\n $user_password = base64_decode($arr_user_detail['user_password']);\r\n if ($this->input->post('user_email') == $this->input->post('user_email_old')) {\r\n $email_verified = '1';\r\n $activation_code = $arr_user_detail['activation_code'];\r\n $user_session = $this->session->userdata('user_account');\r\n $user_session['user_name'] = $user_name;\r\n $user_session['user_email'] = $user_email;\r\n $user_session['first_name'] = $first_name;\r\n $user_session['last_name'] = $last_name;\r\n $this->session->set_userdata('user_account', $user_session);\r\n } else {\r\n $email_verified = '0';\r\n $activation_code = time();\r\n }\r\n\r\n $update_data = array(\r\n 'first_name' => $first_name,\r\n 'last_name' => $last_name,\r\n 'user_email' => $user_email,\r\n 'user_name' => $user_name,\r\n 'gender' => $gender,\r\n 'email_verified' => $email_verified,\r\n 'activation_code' => $activation_code\r\n );\r\n $condition = array(\"user_id\" => $user_id);\r\n $cnf_profile = $this->common_model->updateRow($table_name, $update_data, $condition);\r\n if ($this->input->post('user_email') == $this->input->post('user_email_old')) {\r\n\r\n $this->session->set_userdata('edit_profile_success', \"Your profile has been updated successfully.\");\r\n redirect(base_url() . 'profile');\r\n } else {\r\n\r\n /*\r\n * sending account verification link mail to user \r\n */\r\n $lang_id = 17;\r\n $activation_link = '<a href=\"' . base_url() . 'user-activation/' . $activation_code . '\">Activate Account</a>';\r\n $reserved_words = array\r\n (\"||SITE_TITLE||\" => $data['global']['site_title'],\r\n \"||SITE_PATH||\" => base_url(),\r\n \"||USER_NAME||\" => $this->input->post('user_name'),\r\n \"||ADMIN_NAME||\" => $this->input->post('first_name') . ' ' . $this->input->post('last_name'),\r\n \"||ADMIN_EMAIL||\" => $this->input->post('user_email'),\r\n \"||PASSWORD||\" => $user_password,\r\n \"||ADMIN_ACTIVATION_LINK||\" => $activation_link\r\n );\r\n /*\r\n * getting mail subect and mail message using email template title and lang_id and reserved works \r\n */\r\n $email_content = $this->common_model->getEmailTemplateInfo('admin-email-updated', 17, $reserved_words);\r\n /*\r\n * sending the mail to deleting user \r\n */\r\n /*\r\n * 1.recipient array. 2.From array containing email and name, 3.Mail subject 4.Mail Body \r\n */\r\n\r\n $mail = $this->common_model->sendEmail(array($this->input->post('user_email')), array(\"email\" => $data['global']['site_email'], \"name\" => $data['global']['site_title']), $email_content['subject'], $email_content['content']);\r\n\r\n if ($mail) {\r\n $this->session->set_userdata('edit_profile_success_with_email', \"Your account is deactivated now due to changed email address. Please check your email and activate account from <strong>\" . $user_email . \"</strong>\");\r\n $this->session->unset_userdata('user_account');\r\n redirect(base_url());\r\n } else {\r\n $this->session->set_userdata('edit_profile_success', \"Your profile has been updated successfully.\");\r\n redirect(base_url() . 'profile');\r\n }\r\n }\r\n }\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = 'user_id,first_name,last_name,user_email,user_name,user_type,user_status,profile_picture,gender';\r\n $condition_to_pass = array(\"user_id\" => $user_id);\r\n $arr_user_data = array();\r\n $arr_user_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n $data['arr_user_data'] = $arr_user_data[0];\r\n\r\n $data['site_title'] = \"Edit Profile\";\r\n $this->load->view('front/includes/header', $data);\r\n $this->load->view('front/user-account/edit-user-profile', $data);\r\n $this->load->view('front/includes/footer');\r\n }", "public function editProfile()\n {\n $user = Auth::user();\n $data['employer'] = $user;\n $data['company'] = Company::where('user_id', $user->id)->first();\n\n return $this->sendResponse($data, 'Employer retrieved successfully.');\n }", "private function __saveBasicInfo() {\n\t\t$postData = $this->request->data['User'];\n\n\t\t$fields = array('username', 'first_name', 'last_name', 'email', 'gender', 'timezone');\n\t\t$data = array();\n\t\tforeach ($fields as $field) {\n\t\t\t$data[$field] = $postData[$field];\n\t\t}\n\n\t\t// convert dob\n\t\t$dob = $postData['date_of_birth'];\n\t\tlist($dobMonth, $dobDay, $dobYear) = explode('-', $dob);\n\t\t$formattedDob = sprintf('%s-%s-%s', $dobYear, $dobMonth, $dobDay);\n\t\t$data['date_of_birth'] = $formattedDob;\n\n\t\t$data['id'] = $userId = $this->Auth->user('id');\n\t\tif ($this->User->save($data)) {\n\t\t\t// save user photo\n\t\t\t$this->__saveUserPhoto($userId, $this->request->data['cropfileName']);\n\n\t\t\t// send email change notification if email is changed\n\t\t\t$sendEmailChangeNotification = ($postData['email'] !== $postData['old_email']) ? true : false;\n\t\t\tif ($sendEmailChangeNotification === true) {\n\t\t\t\t$this->__sendEmailChangeNotification($postData);\n\t\t\t}\n\n\t\t\t// set new data on session\n\t\t\t$this->Session->write('Auth', $this->User->read(null, $userId));\n\n\t\t\t// redirect with success message\n\t\t\t$this->Session->setFlash(__('Successfully updated the details.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t// redirect with error message\n\t\t\t$this->Session->setFlash(__('Failed to update the details.'), 'error');\n\t\t}\n\t}", "public function setting(){\n if (!isset($_SESSION['user_id']))\n redirects('users/login');\n\n //check if the post method is set\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n \n // Sanitize POST data\n // $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n // edit only personal information\n if (isset($_POST['update_personal_information'])){\n // Init data\n $data =[\n 'name' => trim($_POST['name']),\n 'username' => trim($_POST['username']),\n 'email' => trim($_POST['email']),\n 'name_error' => '',\n 'username_error' => '',\n 'email_error' => '',\n 'success_personal' => '',\n 'email_hash' => '',\n 'message' => '',\n 'title' => ''\n ];\n\n // set this varialble to 1 if some information has been updated to display success message\n $sign = 0;\n $email_sign = 0;\n\n // Validate Email\n if ($data['email'] != $_SESSION['email']) {\n if(empty($data['email'])){\n $data['email_error'] = 'Pleae enter email';\n } else {\n // check if valid email\n if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL))\n $data['email_error'] = \"Please enter a valid email\";\n // Check email if exists\n if($this->userModel->findUserByEmail($data['email']))\n $data['email_error'] = 'Email is already taken';\n }\n }\n //valid username\n if ($data['username'] != $_SESSION['username']){\n if (preg_match('/\\s/',$data['username']) || !ctype_alnum($data['username'])){\n $data['username_error'] = 'Please enter a valid username';\n } else {\n // check the lenght of the username\n if (strlen($data['username']) < 6)\n $data['username_error'] = 'Username should be at least 6 characters';\n // check if the username is already taken\n if ($this->userModel->findUserByUsername($data['username']))\n $data['username_error'] = 'Username is already taken';\n }\n }\n // Validate Name\n if ($data['name'] != $_SESSION['name']){\n if(empty($data['name'])){\n $data['name_error'] = 'Pleae enter name';\n } else {\n if (!ctype_alnum($data['name']))\n $data['name_error'] = 'Please enter a valid name';\n }\n }\n // update the information \n if ($data['name'] != $_SESSION['name'] && empty($data['name_error']) && empty($data['username_error']) && empty($data['email_error'])){\n $this->userModel->updateName($data);\n $_SESSION['name'] = $data['name'];\n $sign = 1;\n }\n if ($data['username'] != $_SESSION['username'] && empty($data['name_error']) && empty($data['username_error']) && empty($data['email_error'])){\n $this->userModel->updateUsername($data);\n $_SESSION['username'] = $data['username'];\n $sign = 1;\n }\n if ($data['email'] != $_SESSION['email'] && empty($data['name_error']) && empty($data['username_error']) && empty($data['email_error'])){\n $hash = md5( rand(0,1000) );\n $data['email_hash'] = $hash;\n if ($this->userModel->updateEmail($data)){\n $link = URLROOT . '/users/emailVerification/' . $hash;\n $data['message'] = 'Please click on the link to verify your new email : ' . $link;\n $data['title'] = '[Camagru] Please verify your new email';\n $this->sendEmailnotification($data);\n $_SESSION['email'] = $data['email'];\n $sign = 1;\n $email_sign = 1;\n }\n }\n // if information has been updated and there is no error load the view with success\n if ($sign > 0){\n if ($email_sign > 0){\n $data['success_personal'] = '<h3>Your information has been updated</h3> <br>\n Please note that when you changed your email next time you will need to verify your email before login';\n $this->view('users/setting', $data);\n } else {\n $data['success_personal'] = '<h3>Your information has been updated</h3>';\n $this->view('users/setting', $data);\n }\n } else {\n // load the view with errors\n $this->view('users/setting', $data);\n }\n }\n\n // edit only password part\n elseif (isset($_POST['update_password'])){\n // Init data\n $data =[\n 'current_password' => trim($_POST['current_password']),\n 'password' => trim($_POST['new_password']),\n 'confirm_password' => trim($_POST['confirm_password']),\n 'email' => $_SESSION['email'],\n 'current_password_error' => '',\n 'new_password_error' => '',\n 'confirm_password_error' => '',\n 'success_password' => '',\n 'message' => 'title',\n 'title' => ''\n ];\n \n // Validate current password\n if(empty($data['current_password'])){\n $data['current_password_error'] = 'Please enter a password';\n }\n\n // check if the current password is correct\n if(empty($data['current_password_error'])){\n $loggedInUser = $this->userModel->login($_SESSION['username'], $data['current_password']);\n if ($loggedInUser == false){\n $data['current_password_error'] = 'Incorrect password';\n }\n }\n\n // Validate new password\n if(empty($data['password'])){\n $data['new_password_error'] = 'Please enter a password';\n } else {\n // Validate new password strength\n $uppercase = preg_match('@[A-Z]@', $data['password']);\n $lowercase = preg_match('@[a-z]@', $data['password']);\n $number = preg_match('@[0-9]@', $data['password']);\n if(!$uppercase || !$lowercase || !$number || strlen($data['password']) < 8)\n $data['new_password_error'] = 'Password should be at least 8 characters in length and should include at least one upper case letter, one number.';\n }\n\n // validate confirm_password\n if ($data['password'] != $data['confirm_password'])\n $data['confirm_password_error'] = 'Password does not match!';\n\n // check if the is no error \n if (empty($data['current_password_error']) && empty($data['new_password_error']) && empty($data['confirm_password_error'])){\n // update the password and print success message\n $this->userModel->updatePassword($data);\n // send email notification\n $data['message'] = 'We wanted to let you know that your Camagru password was reset. ';\n $data['title'] = '[Camagru] Your password was reset';\n $this->sendEmailnotification($data);\n $data['success_password'] = 'Your password has been updated';\n $this->view('users/setting', $data);\n } else {\n // load the view with the errors\n $this->view('users/setting', $data);\n }\n }\n\n // edit email notification\n elseif(isset($_POST['email_notification'])){\n // Init data\n $data =[\n 'success_notification' => '',\n ];\n \n if ($_POST['option'] == 1){\n if ($this->userModel->checkEmailNotificationStat($_SESSION['email']))\n $this->userModel->desactivateEmailNotification($_SESSION['email']);\n else\n $this->userModel->activateEmailNotification($_SESSION['email']);\n //update the current session\n $_SESSION['email_notif'] = ($this->userModel->checkEmailNotificationStat($_SESSION['email'])) ? 1 : 0;\n // load the view with success\n $data['success_notification'] = 'Your choice is updated thank you';\n $this->view('users/setting', $data);\n } else {\n // load the normal view\n $this->view('users/setting', $data);\n }\n }\n\n // load the simple view\n } else {\n $this->view('users/setting');\n }\n }", "public function update(){\n $data = new Validation();\n if(empty($data->image))\n $sql = \"UPDATE {$this->table} SET `tel` = '$data->phone', `email` = '$data->email',`description` = '$data->description' WHERE {$this->id} = '$data->id'\";\n else\n $sql = \"UPDATE {$this->table} SET `tel` = '$data->phone', `email` = '$data->email',`description` = '$data->description', `profile_pic` = '$data->image' WHERE {$this->id} = '$data->id'\";\n \n // echo $sql;exit;\n return Parent::$conn->query($sql);\n }", "public function updateMyInfo()\n {\n // validate the info, create rules for the inputs\n $rules = array(\n 'user_firstname' => 'required',\n 'user_gender' => 'required',\n 'user_civil_status' => 'required',\n 'user_birth_date' => 'required|date_format:\"'.DATE_FORMAT_1,\n 'user_joined_date' => 'required|date_format:\"'.DATE_FORMAT_2,\n 'user_email' => 'required|email|unique:user,user_email,' . Auth::user()->user_key . ',user_key,deleted_at,NULL',\n 'country_key1' => 'required',\n 'user_contact_phone_number1' => 'required',\n 'user_hometown_address' => 'required',\n );\n\n // run the validation rules on the inputs from the form\n $validator = Validator::make(Input::all(), $rules);\n\n // if the validator fails, redirect back to the form\n if ($validator->fails()) {\n // redirect to list page\n Session::flash('danger', UNABLE_TO_SAVE);\n return Redirect::back()\n ->withErrors($validator)\n ->withInput();\n\n } else {\n // where condition\n $user = Auth::user();\n \n // check if the record can be updated\n if (empty($user->id)) {\n // redirect to list page\n Session::flash('danger', SOMETHING_WENT_WRONG);\n return Redirect::to(strtolower(USER_TITLE));\n }\n\t\t\t\n // fields to be updated\n $user->user_firstname = $this->getInput('user_firstname', '');\n $user->user_middlename = $this->getInput('user_middlename', '');\n $user->user_lastname = $this->getInput('user_lastname', '');\n $user->user_alias = $this->getInput('user_alias', '');\n $user->user_gender = $this->getInput('user_gender', '');\n $user->user_civil_status = $this->getInput('user_civil_status', '');\n $user->user_birth_date = \\Carbon\\Carbon::createFromFormat(DATE_FORMAT_1, $this->getInput('user_birth_date', DEFAULT_DATE))->format(DB_DATE_FORMAT);\n $user->user_joined_date = $this->getInput('user_joined_date', '');\n $user->user_email = $this->getInput('user_email', '');\n $user->user_hometown_address = $this->getInput('user_hometown_address', '');\n $user->user_overseas_address = $this->getInput('user_overseas_address', '');\n if (Session::has('user_photo')) {\n $user->user_photo = Session::get('user_photo');\n Session::forget('user_photo');\n }\n $user->updated_by = Auth::user()->id;\n \n // update record\n $user->save();\n \n for ($cnt = 1; $cnt <= $this->getInput('hdn_increment', ''); $cnt++) {\n if ($this->getInput('hdn_index' . $cnt, '') == YES && $this->getInput('country_key' . $cnt, '') != EMPTY_STRING && $this->getInput('user_contact_phone_number' . $cnt, '') != EMPTY_STRING) {\n if ($this->getInput('user_contact_key' . $cnt, '') == EMPTY_STRING) {\n $data = array();\n $data['user_contact_key'] = generateRandomID();\n $data['user_id'] = $user->id;\n $data['country_id'] = Country::countryKey($this->getInput('country_key' . $cnt, ''))->pluck('id');\n $data['user_contact_phone_number'] = $this->getInput('user_contact_phone_number' . $cnt, '');\n $data['created_by'] = Auth::user()->id;\n \n // create record\n UserContact::create($data);\n } else {\n // where condition\n $user_contact = UserContact::UserContactKey($this->getInput('user_contact_key' . $cnt, ''))->first();\n \n // check if the record can be updated\n if (isset($user_contact->id)) {\n $user_contact->country_id = Country::countryKey($this->getInput('country_key' . $cnt, ''))->pluck('id');\n $user_contact->user_contact_phone_number = $this->getInput('user_contact_phone_number' . $cnt, '');\n $user_contact->updated_by = Auth::user()->id;\n \n // update record\n $user_contact->save();\n }\n }\n }\n }\n \n // where condition\n $user_emergency = UserEmergency::userId($user->id)->first();\n \n // check if the record can be updated\n if (!empty($user_emergency->id)) {\n // fields to be updated\n $user_emergency->user_emergency_name = $this->getInput('user_emergency_name', '');\n $user_emergency->user_emergency_relation = $this->getInput('user_emergency_relation', '');\n $user_emergency->user_emergency_address = $this->getInput('user_emergency_address', '');\n $user_emergency->country_id = Country::countryKey($this->getInput('emergency_country_key', ''))->pluck('id');\n $user_emergency->user_emergency_phone = $this->getInput('user_emergency_phone', '');\n $user_emergency->updated_by = Auth::user()->id;\n \n // update record\n $user_emergency->save();\n }\n \n // redirect to list page\n Session::flash('success', SUCCESS_UPDATE);\n return Redirect::to('my_account/info');\n }\n }", "function profile()\n\t\t{\n\t\t\tif ( ! $this->data['user'])\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('You must login first.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t$this->load->model('users_model');\n\t\t\t$this->load->library(array('ion_auth', 'form_validation'));\n\n\t\t\t$this->data['user'] = $this->users_model->get_details($this->data['user']->id);\n\n\t\t\t// validate form input\n\t\t\t$this->form_validation->set_rules('username', 'Username', 'required');\n\t\t\t$this->form_validation->set_rules('first_name', 'first name', 'required');\n\t\t\t$this->form_validation->set_rules('last_name', 'last name', 'required');\n\t\t\t$this->form_validation->set_rules('email', 'Email Address', 'required|valid_email');\n\t\t\t$this->form_validation->set_rules('phone', 'Phone Number', 'required');\n\t\t\t$this->form_validation->set_rules('old_password', 'Old password', 'required|callback_password_check');\n\n\t\t\tif ($this->input->post('edit_user'))\n\t\t\t{\n\t\t\t\t// Additional rules.\n\t\t\t\t// Rules for the password if it was posted\n\t\t\t\tif ($this->input->post('password'))\n\t\t\t\t{\n\t\t\t\t\t$this->form_validation->set_rules('password', $this->lang->line('edit_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t\t\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('edit_user_validation_password_confirm_label'), 'required');\n\t\t\t\t}\n\n\n\t\t\t\tif ($this->form_validation->run() === TRUE)\n\t\t\t\t{\n\t\t\t\t\t// Set the user profile data.\n\t\t\t\t\t$user_data = array(\n\t\t\t\t\t\t'username' => $this->input->post('username'),\n\t\t\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t\t\t'email'\t=> $this->input->post('email'),\n\t\t\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t\t\t\t'postal' => $this->input->post('postal'),\n\t\t\t\t\t\t'address' => $this->input->post('address'),\n\t\t\t\t\t);\n\n\t\t\t\t\t// Handle uploaded image(avatar).\n\t\t\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Get the image name.\n\t\t\t\t\t\t$filename = $this->data['user']->avatar;\n\t\t\t\t\t\t$avatar = $this->upload_image($filename);\n\n\t\t\t\t\t\tif ( ! $avatar['error'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$user_data['avatar'] = $avatar['path'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set appropriate messages following user update\n\t\t\t\t if($this->ion_auth->update($this->data['user']->id, $user_data))\n\t\t\t\t {\n\t\t\t\t\t\t$this->flexi_cart->set_status_message($this->ion_auth->messages(), 'public', TRUE);\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t\t$this->flexi_cart->set_error_message($this->ion_auth->errors(), 'public', TRUE);\n\n\t\t\t\t }\n\t\t\t\t\tredirect('profile', 'refresh');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('public/dashboard/user_profile_view', $this->data);\n\t\t}", "public function updateprofile()\n\t\t{\n\t\t\t$validator = Validator::make(Input::all(), User::$editrules);\n\t\t\tif(Auth::check()) {\n\t\t\t\t$usertoupdate = Auth::user();\n\t\t\t\t$usertoupdate->firstname = Input::get('firstname');\n\t\t\t\t$usertoupdate->lastname = Input::get('lastname');\n\t\t\t\t$usertoupdate->phone = Input::get('phone');\n\t\t\t\t$checkdbforusername = DB::table('users')->where('username', Input::get('username'))->pluck('username');\n\t\t\t\t$checkdbforemail = DB::table('users')->where('email', Input::get('email'))->pluck('email');\n\n\t\t\t\tif($validator->fails()) {\n\t\t\t\t\tSession::flash('errormessage', 'Sorry, some of your inputs are incorrect');\n\t\t\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t\t\t} else {\n\t\t\t\t\tif($checkdbforusername == null || $checkdbforusername == Auth::user()->username) {\n\t\t\t\t\t\tif($checkdbforemail == null || $checkdbforemail == Auth::user()->email) {\n\t\t\t\t\t\t\tif($checkdbforusername != Auth::user()->username) {\n\t\t\t\t\t\t\t\t$usertoupdate->username = Input::get('username');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif($checkdbforemail != Auth::user()->email) {\n\t\t\t\t\t\t\t\t$usertoupdate->email = Input::get('email');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$usertoupdate->save();\n\t\t\t\t\t\t\tSession::forget('loggedinuser');\n\t\t\t\t\t\t\tSession::put('loggedinuser', $usertoupdate->username);\n\t\t\t\t\t\t\tSession::flash('successMessage', 'Profile successfully updated!');\n\t\t\t\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tSession::flash('errorMessage', 'This email address is already taken');\n\t\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSession::flash('errorMessage', 'This username is already taken');\n\t\t\t\t\t\treturn Redirect::back()->withInput();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function edit_user()\n {\n //make sure user logged in or pending\n if (Session::has('user') || Session::has('pending_user'))\n {\n //check to make sure phone number in correct format\n $number = Input::get('phone_number');\n\n //took pattern from http://www.w3resource.com/javascript/form/phone-no-validation.php\n $pattern = \"/^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/\";\n\n //if phone entered correctly\n if (preg_match ($pattern, $number))\n {\n\n // Input doesn't return zero for unchecked boxes, so change these to zero\n $hours_notification = (Input::get('hours_notification') ? 1 : 0);\n $deals_notification = (Input::get('deals_notification') ? 1 : 0);\n\n //strip any punctuation from phone number, if exists\n $phone = str_replace(array(\"-\",\".\",\"(\",\")\",\" \"), \"\", Input::get('phone_number'));\n\n //if user already logged in\n if (Session::has('user'))\n {\n $user_session = Session::get('user');\n $user = User::find($user_session->id);\n $user->preferred_name = Input::get('preferred_name');\n $user->phone_number = $phone;\n $user->hours_notification = $hours_notification;\n $user->deals_notification = $deals_notification;\n $user->save();\n\n //put updated user on to session\n\n Session::put('user', $user);\n\n }\n //else create new user\n else\n {\n //create user based on session data and input\n $pending = Session::get('pending_user');\n\n $user = new User();\n $user->cs50_id = $pending[\"cs50_id\"];\n $user->name = $pending[\"fullname\"];\n $user->preferred_name = Input::get('preferred_name');\n $user->email = $pending[\"email\"];\n $user->phone_number = $phone;\n $user->hours_notification = $hours_notification;\n $user->deals_notification = $deals_notification;\n $user->save();\n\n //remove pending user from session\n Session::forget('pending_user');\n\n //log user in\n Session::put('user', $user);\n Auth::loginUsingId($user->id);\n\n //send user text message about signing up\n\n $grille_name = Grille::where('id', $this->grille_id)->pluck('name');\n $message = \"Thanks for signing up for \" . $grille_name . \"'s online ordering!\n If you received this message by accident, reply 'STOP'\";\n\n Sms::send_sms($phone, $message);\n }\n\n //redirect to most recent page\n $url = Session::get('redirect');\n Session::forget('redirect');\n return Redirect::to($url);\n }\n //else alert user to enter correct phone number\n else\n {\n $failure = 'Please enter a 10-digit phone number';\n\n //if user already has account\n if (Session::has('user'))\n {\n $user = Session::get('user');\n $user->new = 0;\n $user->grille_number = Grille::where('id', $this->grille_id)->pluck('phone_number');\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n\n //if user is logging in for first time\n else\n {\n $user = Session::get('pending_user');\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n\n }\n }\n\n //if not user or pending user, redirect\n else\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n }\n\n }", "function user_edit($user_info)\n {\n }", "public function editProfile($email, Request $request){\n if ($user = \\DB::table('users')->where('email', $email)->first()) {\n// check if the new email doesn't already exist in the database except in 1 record which is current logged in user\n if ( \\DB::table('users')->where('email', $request->email)->where('email', '<>', $email)->count() == 0) {\n\n $this->validate(request(), [\n 'adresse' => 'required',\n 'email' => 'required|email',\n 'post' => 'required',\n 'telephone' => 'required'\n\n ]);\n\n\n\n \\DB::table('users')\n ->where('email', $email)\n ->update(['email' => $request->email, 'post'=>$request->post, 'telephone'=>$request->telephone, 'adresse'=>$request->adresse]);\n //$collab->save();\n return response()->json([\n 'status'=>'success',\n 'email'=>$request->email,\n 'adresse'=> $request->adresse,\n 'post'=>$request->post,\n 'telephone'=>$request->telephone\n ]);\n } else {\n return response()->json([\n 'status' => 'failed, new email exists',\n\n ]);\n }\n\n } else {\n return response()->json([\n 'status' => 'failed',\n\n ]);\n }\n\n }", "function updatePersonalInfo($user_id,$userData)\n\t\t{\n\t\t\t//getting id of given user id\n\t\t\t$idRow = $this->manageContent->getValue_where(\"user_info\",\"*\",\"user_id\",$user_id);\n\t\t\t$id = $idRow[0]['id'];\n\t\t\t//updating the values\n\t\t\tif(isset($userData['name']) && !empty($userData['name']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"name\",$userData['name'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['gender']) && !empty($userData['gender']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"gender\",$userData['gender'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['dob']) && !empty($userData['dob']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"dob\",$userData['dob'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['contact']) && !empty($userData['contact']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"contact_no\",$userData['contact'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add1']) && !empty($userData['add1']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line1\",$userData['add1'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['add2']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"addr_line2\",$userData['add2'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['pin']) && !empty($userData['pin']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"pincode\",$userData['pin'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['city']) && !empty($userData['city']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"city\",$userData['city'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['state']) && !empty($userData['state']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"state\",$userData['state'],\"id\",$id);\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($userData['country']) && !empty($userData['country']))\n\t\t\t{\n\t\t\t\t$upd = $this->manageContent->updateValueWhere(\"user_info\",\"country\",$userData['country'],\"id\",$id);\n\t\t\t}\n\t\t}", "public function profile (request $request) {\n\t\t$userInfo = resolve('userInfo');\n\n\t\tif ($request->isMethod('post') && $request->tab == \"profile\") {\n\n\t\t\tif ($userInfo->usr_role == 'AD') {\n\t\t\t\t$usr_role = $request->usr_role;\n\t\t\t} else {\n\t\t\t\t$usr_role = 'CP';\n\t\t\t}\n\n\t\t\tif ($userInfo->usr_role == 'AD') {\n\t\t\t\t$dataProfile = array(\n\t\t\t\t\t'usr_employment_id' => $request->usr_employment_id,\n\t\t\t\t\t'usr_role' \t\t\t\t\t=> $usr_role,\n\t\t\t\t\t'usr_firstname' \t\t=> $request->usr_firstname,\n\t\t\t\t\t'usr_lastname' \t\t\t=> $request->usr_lastname,\n\t\t\t\t\t'usr_nric' \t\t\t\t\t=> $request->usr_nric,\n\t\t\t\t\t'usr_dob' \t\t\t\t\t=> $request->usr_dob,\n\t\t\t\t\t'usr_citizen' \t\t\t=> $request->usr_citizen,\n\t\t\t\t\t'usr_add1' \t\t\t\t\t=> $request->usr_add1,\n\t\t\t\t\t'usr_add2' \t\t\t\t\t=> $request->usr_add2,\n\t\t\t\t\t'usr_postcode' \t\t\t=> $request->usr_postcode,\n\t\t\t\t\t'usr_state' \t\t\t\t=> $request->usr_state,\n\t\t\t\t\t'usr_country' \t\t\t=> $request->usr_country,\n\t\t\t\t\t'usr_education' \t\t=> $request->usr_education,\n\t\t\t\t\t'usr_qualification' => $request->usr_qualification,\n\t\t\t\t\t'usr_jobtitle' \t\t\t=> $request->usr_jobtitle,\n\t\t\t\t\t'usr_division' \t\t\t=> $request->usr_division,\n\t\t\t\t\t'usr_employment' \t\t=> $request->usr_employment,\n\t\t\t\t\t'usr_mobile' \t\t\t\t=> $request->usr_mobile,\n\t\t\t\t\t'usr_email' \t\t\t\t=> $request->usr_email,\n\t\t\t\t\t'usr_bank_name' \t\t=> $request->usr_bank_name,\n\t\t\t\t\t'usr_bank_acc_no' \t=> $request->usr_bank_acc_no,\n\t\t\t\t\t'usr_kwsp_no' \t\t\t=> $request->usr_kwsp_no,\n\t\t\t\t\t'usr_updated' \t\t\t=> Carbon::now()\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$dataProfile = array(\n\t\t\t\t\t'usr_firstname' \t\t=> $request->usr_firstname,\n\t\t\t\t\t'usr_lastname' \t\t\t=> $request->usr_lastname,\n\t\t\t\t\t'usr_nric' \t\t\t\t\t=> $request->usr_nric,\n\t\t\t\t\t'usr_dob' \t\t\t\t\t=> $request->usr_dob,\n\t\t\t\t\t'usr_citizen' \t\t\t=> $request->usr_citizen,\n\t\t\t\t\t'usr_add1' \t\t\t\t\t=> $request->usr_add1,\n\t\t\t\t\t'usr_add2' \t\t\t\t\t=> $request->usr_add2,\n\t\t\t\t\t'usr_postcode' \t\t\t=> $request->usr_postcode,\n\t\t\t\t\t'usr_state' \t\t\t\t=> $request->usr_state,\n\t\t\t\t\t'usr_country' \t\t\t=> $request->usr_country,\n\t\t\t\t\t'usr_education' \t\t=> $request->usr_education,\n\t\t\t\t\t'usr_qualification' => $request->usr_qualification,\n\t\t\t\t\t'usr_jobtitle' \t\t\t=> $request->usr_jobtitle,\n\t\t\t\t\t'usr_mobile' \t\t\t\t=> $request->usr_mobile,\n\t\t\t\t\t'usr_email' \t\t\t\t=> $request->usr_email,\n\t\t\t\t\t'usr_bank_name' \t\t=> $request->usr_bank_name,\n\t\t\t\t\t'usr_bank_acc_no' \t=> $request->usr_bank_acc_no,\n\t\t\t\t\t'usr_kwsp_no' \t\t\t=> $request->usr_kwsp_no,\n\t\t\t\t\t'usr_updated' \t\t\t=> Carbon::now()\n\t\t\t\t);\n\t\t\t}\n\t\t\t// echo '<pre>'; print_r($request->usr_role); die();\n\t\t\t$updateProfile = DB::table('users')->where('usr_id', $request->usr_id)->update($dataProfile);\n\n\t\t\tLog::doAddLog (\"Update profile\", $request->usr_id, $request->usr_firstname.' '.$request->usr_lastname);\n\n\t\t\tif ($userInfo->usr_role == 'AD') {\n\t\t\t\treturn redirect('view-profile/'.$request->usr_id)->with('success', \"Successfully update user profile.\");\n\t\t\t} else {\n\t\t\t\treturn redirect('profile')->with('success', \"Successfully update user profile.\");\n\t\t\t}\n\n\n\t\t} else if ($request->isMethod('post') && $request->tab == \"password\"){\n\n\t\t\t// echo $request->password2; die();\n\t\t\tif($request->password1 != $request->password2){\n\t\t\t\treturn redirect('profile')->with('error', \"Password confirmation didnt match. Please try again.\");\n\t\t\t} else {\n\t\t\t\t$pass = hash('sha256', $request->password1);\n\n\t\t\t\t$dataPassword = array (\n\t\t\t\t\t'usr_pword' => $pass\n\t\t\t\t);\n\t\t\t\t$updatePassword = DB::table('users')->where('usr_id', $request->usr_id)->update($dataPassword);\n\t\t\t\tLog::doAddLog (\"Update password\", $request->usr_id);\n\t\t\t\treturn redirect('profile#t02')->with('success', \"Successfully update new password.\");\n\t\t\t}\n\t\t} else if ($request->isMethod('post') && $request->tab == \"bank\"){\n\n\t\t\t$dataBank = array (\n\t\t\t\t'usr_bank_name' \t=> $request->usr_bank_name,\n\t\t\t\t'usr_bank_acc_no' => $request->usr_bank_acc_no,\n\t\t\t\t'usr_kwsp_no' \t\t=> $request->usr_kwsp_no\n\t\t\t);\n\n\t\t\t$updateBank = DB::table('users')->where('usr_id', $request->usr_id)->update($dataBank);\n\t\t\treturn redirect('profile#t04')->with('success', \"Successfully update Bank & KWSP info.\");\n\t\t}\n\n return view('profile')->with('user',$userInfo);\n }", "final static public function EditProfile(){\n\n\t\t$wr = static::validation();\n\t\t$record = new static::$modelNM();\t//instantiate new object\n\t\t$record->id = $_SESSION[\"UserID\"];\n\t\t$record->username = $_POST[\"username\"];\n\t\t$record->fname = $_POST[\"fname\"];\n\t\t$record->lname = $_POST[\"lname\"];\n\t\t$record->gender = $_POST[\"gender\"];\n\t\t$record->phone = $_POST[\"phone\"];\n\t\t$record->birthday = $_POST[\"birthday\"];\n\t\t$record->email = $_POST[\"email\"];\n\t\t$record->addhashpassword($_POST[\"password\"]);\n\n\n\t\tif($wr != \"\") {\n\t\t\techo $wr;\n\t\t\t$_SESSION[\"Temprecord\"] = $record;\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\t//$_SESSION[\"Temprecord\"] = NULL;\n\t\t}\n\t\t\n\t\n\t\t$record->GoFunction(\"Update\");\t//Run Insert() in modol class and echo success or not\n\t\tsetcookie(\"Username\", $_POST[\"username\"], time() + (86400 * 30), \"/\");\n\t\treturn 1;\t//return display html table code from ShowData\n\n\t}", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "function updateMyProfile($data){\r\n global $pdo;\r\n\t\t$update = $pdo->prepare(\"UPDATE users SET `email`= ? WHERE id= ?\");\r\n $update->execute(array($data['email'], $this->user_id));\r\n\t\t$preparedProfileParam = prepareProfileParams($data);\r\n\t\tupdateProfileParameters($this->user_id,$preparedProfileParam);\r\n\t\t$log = debug_backtrace();\r\n\t\t$this->createActionLog($log);\r\n\t\treturn true;\r\n\t}", "function updateInfoUser($data){\n $username = $this->session->userdata('username');\n $phone = addslashes( $data['phone'] ); $cmnd = addslashes( $data['cmnd'] );\n if(substr($phone,0,2) == '84') $phone = substr_replace($phone,'0',0,2);\n if(substr($phone,0,3) == '084') $phone = substr_replace($phone,'0',0,3);\n if($cmnd && !$this->validateNumberic($cmnd)){\n $this->retval['msg'] = \"Định dạng số chứng minh không chính xác\";\n return json_encode($this->retval);\n }\n if($phone && !$this->validateNumberic($phone)){\n $this->retval['msg'] = \"Định dạng số điện thoại không chính xác\";\n return json_encode($this->retval);\n }\n $data['phone'] = $phone;\n $uid = $this->getUser($username)->id;\n $this->db->where('uid',$uid)->limit(1);\n $query = $this->db->get('cli_user_profiles');\n $row = $query->num_rows();\n if($row){\n if(!empty($query->row()->cmnd) || $query->row()->cmnd != \"\"){\n unset($data['cmnd']); unset($data['ngaycap_cmnd']);\n unset($data['noicap_cmnd']);\n }\n $this->db->where('uid', $uid);\n $this->db->update('cli_user_profiles', $data);\n $this->retval['status'] = 1;\n $this->retval['msg'] = \"Cập nhật tài khoản thành công\";\n }\n else{\n $data['uid'] = $uid;\n if($this->db->insert('cli_user_profiles', $data)){\n $this->retval['status'] = 1;\n $this->retval['msg'] = \"Cập nhật tài khoản thành công\";\n }\n }\n return json_encode($this->retval);\n }", "public function editEmailProfil()\n {\n $this->form_validation->set_rules('email', '\"Email adress\"', 'required|valid_email|min_length[1]');\n\n if ($this->form_validation->run()) {\n //-----Get my adress mail of my input-----//\n $this->email = $this->input->post('email');\n //---------------------------------------//\n\n //-------------Create my objet--------------//\n $this->modelMembers->setId($this->id_member);\n $this->modelMembers->setEmail($this->email);\n //-----------------------------------------//\n\n $membersModel = $this->modelMembers;\n $this->modelMembers->updateEmailMembers($membersModel);\n\n $this->index();\n\n } else {\n $this->index();\n }\n }", "public function editProfile($param = null)\n\t{\n $this->loadModel('user');\n\n // si aucun champ n'est renseigné\n if($_POST['nom'] == '' && $_POST['prenom'] == '' && $_POST['mdp'] == '') {\n header('Location: '.BASE_URL.'/user/profile/?erreur=1');\n }\n // si le nom est renseigné\n\t\tif(isset($_POST['nom']) && $_POST['nom'] != '')\n\t\t{\n $pseudo = $this->getUserInfo(\"pseudo\");\n $nom = strtolower($_POST['nom']);\n\n if($this->getModel()->infoAlreadyExist($pseudo, 'familyName'))\n {\n $oldNom = $this->getModel()->getUserInfo($pseudo, 'familyName');\n $this->getModel()->deleteInfo($pseudo, $oldNom, 'familyName');\n $this->getModel()->insertInfo($pseudo, $nom, 'familyName');\n header('Location: '.BASE_URL.'/user/profile/?info=1');\n\n } else {\n $this->getModel()->insertInfo($pseudo, $nom, 'familyName');\n header('Location: '.BASE_URL.'/user/profile/?newinfo=1');\n }\n\t\t}\n // si le prénom est renseigné\n if(isset($_POST['prenom']) && $_POST['prenom'] != '')\n {\n $pseudo = $this->getUserInfo(\"pseudo\");\n $prenom = strtolower($_POST['prenom']);\n\n if($this->getModel()->infoAlreadyExist($pseudo, 'givenName'))\n {\n $oldPrenom = $this->getModel()->getUserInfo($pseudo, 'givenName');\n $this->getModel()->deleteInfo($pseudo, $oldPrenom, 'givenName');\n $this->getModel()->insertInfo($pseudo, $prenom, 'givenName');\n header('Location: '.BASE_URL.'/user/profile/?info=1');\n\n } else {\n $this->getModel()->insertInfo($pseudo, $prenom, 'givenName');\n header('Location: '.BASE_URL.'/user/profile/?newinfo=1');\n }\n }\n // si le mdp est renseigné\n if(isset($_POST['mdp']) && $_POST['mdp'] != '')\n {\n $pseudo = $this->getUserInfo(\"pseudo\");\n $mdp = sha1($_POST['mdp']);\n\n if( strlen($_POST['mdp']) >= 6 )\n {\n $oldMdp = $this->getModel()->getUserInfo($pseudo, 'sha1');\n\n $this->getModel()->deleteInfo($pseudo, $oldMdp, 'sha1');\n $this->getModel()->insertInfo($pseudo, $mdp, 'sha1');\n header('Location: ' . BASE_URL . '/user/profile/?info=1');\n }\n else {\n header('Location: '.BASE_URL.'/user/profile/?mdp=1');\n }\n\n }\n\t}", "public function userinfo()\n {\n if($user = $this->Session->read('user')){\n if(!empty($this->request->data)){\n //update thong tin\n }\n $this->set('user', $user);\n }else{\n $this->redirect(array('action' => 'login', ''));\n }\n }", "public function updateInformation() {\n $response = null;\n try {\n // Returns a `FacebookFacebookResponse` object\n $response = Facebook::get(\n $this->app_scoped_id . '?fields=first_name,last_name,profile_pic&access_token=' . $this->restaurant->fb_page_access_token,\n null,\n $this->restaurant->fb_page_access_token\n );\n } catch(Exception $e) {\n return;\n }\n $result = $response->getGraphObject()->asArray();\n if ($result) {\n if(array_key_exists(\"first_name\", $result)) {\n $this->attributes['first_name'] = $result[\"first_name\"];\n }\n if(array_key_exists(\"last_name\", $result)) {\n $this->attributes['last_name'] = $result[\"last_name\"];\n }\n if(array_key_exists(\"profile_pic\", $result)) {\n $this->attributes['profile_pic'] = $result[\"profile_pic\"];\n }\n $this->save();\n }\n }", "public function setDetails(){\n $this->user_id=$this->clearInputs($_POST['user_id']);\n $this->user_type=$this->clearInputs(substr($_POST['user_id'],0,3));\n $this->name=$this->clearInputs($_POST['name']);\n $this->office_id=$this->clearInputs($_POST['office_id']);\n $this->designation=$this->clearInputs($_POST['designation']);\n $this->nic=$this->clearInputs($_POST['nic']);\n $this->contact_no=$this->clearInputs($_POST['contact_no']);\n $this->email=$this->clearInputs($_POST['email']);\n $this->hashed_password=password_hash($this->generateRandomPassword(8),PASSWORD_DEFAULT);\n \n }", "public function updateuserdetails($email,$txtFirstName,$txtLastName,$txtAddress1,$txtAddress2,$txtAddress3,$txtAddress4,$txtCity,$txtPin,$txtState,$txtPhone){\n\t\t$this->db->where('email', $email);\n\t\t$object= array(\n\t\t\t'address1' => $txtAddress1,\n\t\t\t'address2' => $txtAddress2,\n\t\t\t'address3' => $txtAddress3,\n\t\t\t'address4' => $txtAddress4,\n\t\t\t'city' => $txtCity,\n\t\t\t'pin' => $txtPin,\n\t\t\t'state' => $txtState\n\t\t);\n\t\t$this->db->update('tbl_useraddress', $object);\n\n\n\t\t$this->db->where('Email', $email);\n\n\t\t$obj=array(\n\t\t\t'FirstName' => $txtFirstName,\n\t\t\t'LastName' => $txtLastName,\n\t\t\t'Phonenumber' => $txtPhone\n\t\t);\n\t\t$this->db->update('tbl_userdetails', $obj);\n\n\t\treturn true;\n\t}", "function updateProfile(){\n\t\t\t\t$this->__dataDecode();\n\t\t\t\t//pr($this->data);die;\n\t\t\t\t\n\t\t\t\tif(!empty($this->data)){\n\t\t\t\t\t$data['User']['firstname'] = $this->data['User']['firstName'];\n\t\t\t\t\t$data['User']['wieght'] = $this->data['User']['wieght'];\n\t\t\t\t\t$data['User']['school'] = $this->data['User']['school'];\n\t\t\t\t\t$data['User']['id'] = $this->data['User']['playerId'];\n\t\t\t\t\t$data['User']['secToken'] = $this->data['User']['secToken'];\n\t\t\t$details = $this->User->find('first', array('conditions' => array('User.id' => $data['User']['id'],'User.secToken' => $data['User']['secToken'])));//pr($details);die;\n\t\t\t\tif(!empty($details)){\n\t\t\t\t\t\tif($this->User->save($data)){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\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\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile does not updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\telse\n{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'UnAuthorized User';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n}\n}\n\t\t\t}", "public function updateOwnProfile(User $user)\n {\n //Se obtiene el id del usuario en sesion\n $user_id = Auth::user()->id;\n $user = User::find(Auth::user()->id);\n\n if(Auth::user()->type==1 || Auth::user()->type==6){\n //Validaciones a los datos de entrada\n $data = request()->validate([\n 'email' => 'required|max:70',\n 'first_name' => 'required|max:60',\n 'last_name' => 'required|max:60',\n 'username' => 'required|max:128',\n ], [\n 'first_name.required' => ' * Este campo es obligatorio.',\n 'first_name.max' => ' * Este campo debe contener sólo 60 caracteres.',\n 'last_name.required' => ' * Este campo es obligatorio.',\n 'last_name.max' => ' * Este campo debe contener sólo 60 caracteres.',\n 'email.required' => ' * Este campo es obligatorio.',\n 'email.max' => ' * Este campo debe contener sólo 70 caracteres.',\n 'username.required' => ' * Este campo es obligatorio.',\n 'username.max' => ' * Este campo debe contener sólo 128 caracteres.',\n ]);\n\n $user->first_name = filter_var(Input::get('first_name'), FILTER_SANITIZE_STRING);\n $user->last_name = filter_var(Input::get('last_name'), FILTER_SANITIZE_STRING);\n $user->second_last_name = filter_var(Input::get('second_last_name'), FILTER_SANITIZE_STRING);\n $user->username = filter_var(Input::get('username'), FILTER_SANITIZE_STRING);\n $user->address = filter_var(Input::get('address'), FILTER_SANITIZE_STRING);\n $user->phone = filter_var(Input::get('phone'), FILTER_SANITIZE_STRING);\n $user->email = filter_var(Input::get('email'), FILTER_SANITIZE_STRING);\n }else{\n //Validaciones a los datos de entrada\n $data = request()->validate([\n 'email' => 'required|max:70',\n 'username' => 'required|max:128',\n ], [\n 'email.required' => ' * Este campo es obligatorio.',\n 'email.max' => ' * Este campo debe contener sólo 70 caracteres.',\n 'username.required' => ' * Este campo es obligatorio.',\n 'username.max' => ' * Este campo debe contener sólo 128 caracteres.',\n ]);\n $user->username = filter_var(Input::get('username'), FILTER_SANITIZE_STRING);\n $user->email = filter_var(Input::get('email'), FILTER_SANITIZE_STRING);\n }\n\n if(Auth::user()->type==1 || Auth::user()->type==6 || Auth::user()->type==3){\n //Imagen nueva(mandada atraves del file input)\n $image = Input::file('image');\n //Imagen actual(registrada en la base de datos)\n $image2 = Input::get('image_2');\n }\n\n //Se actualiza el usuario\n $user->update();\n\n if(Auth::user()->type==1 || Auth::user()->type==6 || Auth::user()->type==3){\n //Actualizar imagen, eliminando la anterior\n if ($image!=null) {\n if ($image2!=null) {\n //Se realiza el eliminado de la imagen de la direccion fisica de\n //la imagen en el disco duro\n unlink(public_path().\"/storage/\".$image2);\n }\n //Se realiza el almacenado de la nueva imagen(cargada en el file input)\n $path=Input::file('image')->store('/public/images/user-signature/');\n //Se obtiene el nombre de la imagen\n $image_url = '/images/user-signature/'.Input::file('image')->hashName();\n //Se realiza la nueva actualizacion al registro del usuario actual con el\n //nombre de la nueva imagen\n DB::update('UPDATE users SET signature_url = ? WHERE id = ?', [$image_url, $user_id]);\n }\n }\n\n //Si el usuario cambia la contraseña, se actualiza, es caso contrario se queda como estaba guardada\n if (Input::get('password') != null) {\n $password = bcrypt(filter_var(Input::get('password'), FILTER_SANITIZE_STRING));\n DB::update('UPDATE users SET password = ? WHERE id = ?', [$password, $user_id]);\n }\n\n Alert::success('Exitosamente', 'Perfil Modificado');\n return redirect()->route('profile.show_own_profile');\n }", "function itstar_extra_user_profile_fields( $user ) {\n?>\n <h3><?php _e(\"Extra profile information\", \"itstar\"); ?></h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"birthday\"><?php echo __(\"birthday\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthday\" id=\"Birth Day\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthday' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birthday.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthmonth\"><?php echo __(\"Birth Month\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthmonth\" id=\"birthmonth\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthmonth' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Month.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthyear\"><?php echo __(\"Birth Year\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthyear\" id=\"birthyear\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthyear' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Year.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"phone\"><?php echo __(\"Phone\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"phone\" id=\"phone\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'phone',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your phone.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"job\"><?php echo __(\"Job\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"job\" id=\"job\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'job',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Job.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"viraclub\"><?php __(\"Vira club ID\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" disabled name=\"viraclub\" id=\"viraclub\" class=\"regular-text\" \n value=\"<?php echo 'V'.esc_attr( get_user_meta( $user->ID,'viraclub' ,true) ); ?>\" /><br />\n \n </td>\n </tr>\n </table>\n<?php\n}", "function update_user_profile() {\n global $DB,$CFG;\n require_once($CFG->dirroot . '/local/elggsync/classes/curl.php');\n $config = get_config('local_elggsync');\n $elggdomainname = $CFG->wwwroot.$config->elggpath;\n $elggmethod = 'get.user.info';\n $elgg_api_key = $config->elggapikey;\n $curl = new local_elggsync\\easycurl;\n\n $results = $DB->get_records_sql(\"SELECT u.id,u.username,u.city, u.description FROM {user} AS u WHERE u.suspended = 0\");\n foreach($results as $result) {\n $url = $elggdomainname.'/services/api/rest/json/?method='.$elggmethod.'&api_key='.$elgg_api_key;\n $fetched = $curl->post($url,array('username'=>$result->username));\n $fetched = json_decode($fetched);\n if(isset($fetched) && $fetched->status == 0) {\n if(isset($fetched->result) && $fetched->result->success == true) {\n $dataobject = new stdClass;\n $dataobject->id = $result->id;\n if($fetched->result->firstname || $fetched->result->firstname !== null) {\n $dataobject->firstname = $fetched->result->firstname;\n }\n if($fetched->result->lastname || $fetched->result->lastname !== null) {\n $dataobject->lastname = $fetched->result->lastname;\n }\n if($fetched->result->email || $fetched->result->email !== null) {\n $dataobject->email = $fetched->result->email;\n }\n if($fetched->result->phone || $fetched->result->phone !== null) {\n $dataobject->phone1 = $fetched->result->phone;\n }\n if($fetched->result->mobile || $fetched->result->mobile !== null) {\n $dataobject->phone2 = $fetched->result->mobile;\n }\n if($fetched->result->city || $fetched->result->city !== null) {\n $dataobject->city = $fetched->result->city;\n $dataobject->country = 'BR';\n }\n if($fetched->result->description || $fetched->result->description !== null) {\n $dataobject->description = $fetched->result->description;\n }\n $DB->update_record('user',$dataobject);\n unset($dataobject);\n if($fetched->result->company || $fetched->result->company !== null) {\n $companyfieldid =[];\n try {\n $companyfieldid = $DB->get_record_sql(\"SELECT uid.id,uid.data\n FROM {user_info_data} AS uid\n JOIN {user_info_field} AS uif ON (uif.id = uid.fieldid)\n WHERE uid.userid = :userid\n AND uif.shortname = 'empresa'\",array('userid'=>$result->id),MUST_EXIST);\n if(strcmp($companyfieldid->data,$fetched->result->company) !== 0) {\n $DB->update_record('user_info_data',array('id'=>$companyfieldid->id,'data'=>$fetched->result->company));\n }\n }\n catch(Exception $e) {\n echo $e;\n }\n }\n }\n }\n }\n return true;\n}", "public function MerchantEditProfile(Request $request) {\n \n $input = $request->all();\n \n $mobileNumber = $input['mobile_number'];\n \n if( isset( $mobileNumber ) && !empty( $mobileNumber ) ) {\n \n $mobileNoExists = CustomHelper::isCheckMobileNoExists( $mobileNumber );\n \n if( isset( $mobileNoExists ) && !empty( $mobileNoExists ) ) {\n \n $merchantDetail = new MerchantDetail();\n $merchant = $merchantDetail->ischeckMobileverified( Input::get('mobile_number') );\n \n if(!empty( $input['tag_name1'] ) ) {\n $merchantDetails = new MerchantDetail();\n $merchantDetails->updateDescription( $input );\n }\n if(!empty( $input['tag_name1'] ) || !empty( $input['tag_name2'] ) || !empty( $input['tag_name3'] ) || !empty( $input['tag_name4'] ) ) {\n $removeTag = new TagMerchants();\n $removeTag->removeTags( $merchant['vendor_id'] );\n } \n if(!empty( $input['tag_name1'] ) ) {\n CustomHelper::checkMerchantTags( $input['tag_name1'] ,$merchant['vendor_id'] );\n }\n if(!empty( $input['tag_name2'] ) ) {\n CustomHelper::checkMerchantTags( $input['tag_name2'] ,$merchant['vendor_id'] );\n }\n if(!empty( $input['tag_name3'] ) ) {\n CustomHelper::checkMerchantTags( $input['tag_name3'] ,$merchant['vendor_id'] );\n }\n if(!empty( $input['tag_name4'] ) ) {\n CustomHelper::checkMerchantTags( $input['tag_name4'] ,$merchant['vendor_id'] );\n }\n\n $notifiDetailSave = new Notification();\n $notifiDetailSave->saveEditProfileNotification( $merchant );\n \n /* $MerchantDetailSave = new MerchantDetail();\n $addressId = $MerchantDetailSave->updateMerchants( $input );\n \n $addressDetailSave = new Address();\n $addressId = $addressDetailSave->updateAddress( $input, $addressId );\n\n $MerchantDetail = new MerchantDetail();\n $records = $MerchantDetail->getMobileNoBasedVendorId( $mobileNumber );\n \n $getbankDetail = new MerchantBankDetail();\n $data = $getbankDetail->getMerchantBankDetails( $records['vendor_id'] );\n\n if( isset( $data ) && !empty( $data ) ) {\n $updatebankDetailSave = new MerchantBankDetail();\n $updatebankDetailSave->updateMerchantBankDetails( $input, $records['vendor_id'] );\n } else {\n $bankDetailSave = new MerchantBankDetail();\n $bankDetailSave->saveMerchantBankDetails( $input, $records['vendor_id'] );\n } */ \n \n return response()->json(['success' => $this->successStatus, 'message' => $this->printProfileUpdated() ], $this->successStatusCode );\n \n } else { \n \n return response()->json(['success' => $this->failureStatus, 'message' => $this->printCorrectMobileNumber() ], $this->failureStatusCode );\n } \n \n } else {\n \n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMobileNoMissing() ], $this->failureStatusCode );\n } \n\n }", "public function update_profile($username = \"\"){\n\t\t$userMapper = new App\\Mapper\\UserMapper();\n\t\t$applicantMapper = new App\\Mapper\\ApplicantMapper();\n\t\t$basicContactMapper = new App\\Mapper\\BasicContactMapper();\n\t\t$educAttainmentMapper = new App\\Mapper\\EducAttainmentMapper();\n\t\t$addressMapper = new App\\Mapper\\AddressMapper();\n\t\t$educationMapper = new App\\Mapper\\EducationMapper();\n\t\t$workExperienceMapper = new App\\Mapper\\WorkExperienceMapper();\n\t\t$applicantSkillMapper = new App\\Mapper\\ApplicantSkillMapper();\n\t\t$user = null;\n\t\t$applicant = null;\n\t\t// if($this->sess->isLogin()){\n\t\tif(!empty($username)){\n\t\t\t$user = $userMapper->getByFilter(array(\n\t\t\t\tarray(\n\t\t\t\t\t'column'=>'user_name'\n\t\t\t\t,\t'value'\t=>$username\n\t\t\t\t)\n\t\t\t), true);\n\t\t}\n\t\telse{\n\t\t\tif($this->sess->isLogin()){\n\t\t\t\t$user = $userMapper->getByFilter(array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'column'=>'user_id'\n\t\t\t\t\t,\t'value'\t=>$_SESSION['current_user']['id']\n\t\t\t\t\t)\n\t\t\t\t), true);\n\t\t\t}\n\t\t}\n\n\n\t\tif(!$user){\n\t\t\t$this->redirect($route['404_override']);\n\t\t}//Show 404;\n\n\t\t$applicant = $applicantMapper->getByFilter(\"applicant_user_id = '\". $user['user_id'].\"' \", true);\n\t\t$basicContact = $basicContactMapper->getByFilter(\"bc_id = '\".$applicant['applicant_bc_id'].\"'\", true);\n\t\t$educAttainment = $educAttainmentMapper->getByFilter(\"ea_id = '\".$applicant['applicant_ea_id'].\"'\", true);\n\t\t$presentAddress = $addressMapper->getCompleteAddressByID($applicant['applicant_present_id']);\n\t\t$permanentAddress = $addressMapper->getCompleteAddressByID($applicant['applicant_permanent_add_id']);\n\t\t$education = $educationMapper->getEducationTable($applicant['applicant_id']);\n\t\t$work = $workExperienceMapper->getWorkTable($applicant['applicant_id']);\n\t\t$applicantSkill = $applicantSkillMapper->getSkill($applicant['applicant_id']);\n\n\t\t$form_data = array(\n\t\t\t\t'applicant_username'\t=> $user['user_name']\n\t\t\t,\t'applicant_first_name' => $basicContact['bc_first_name']\n\t\t\t,\t'applicant_middle_name' => $basicContact['bc_middle_name']\n\t\t\t,\t'applicant_last_name' => $basicContact['bc_last_name']\n\t\t\t,\t'applicant_name_ext' => $basicContact['bc_name_ext']\n\t\t\t,\t'applicant_summary'\t=>\t$applicant['applicant_summary']\n\t\t\t,\t'present_add_desc' => $presentAddress['address_desc']\n\t\t\t,\t'present_add_country' => array(\n\t\t\t\t\t'country_id'\t=> $presentAddress['country_id']\n\t\t\t\t,\t'country_name'=> $presentAddress['country_name']\n\t\t\t\t)\n\t\t\t,\t'present_add_region' => array(\n\t\t\t\t\t'region_id'\t=> $presentAddress['region_id']\n\t\t\t\t,\t'region_code'=> $presentAddress['region_code']\n\t\t\t\t,\t'region_desc'=> $presentAddress['region_desc']\n\t\t\t\t)\n\t\t\t,\t'present_add_province' => array(\n\t\t\t\t\t'province_id'\t=> $presentAddress['province_id']\n\t\t\t\t,\t'province_name'=> $presentAddress['province_name']\n\t\t\t\t)\n\t\t\t,\t'present_add_city' => array(\n\t\t\t\t\t'city_id'\t=> $presentAddress['city_id']\n\t\t\t\t,\t'city_name'=> $presentAddress['city_name']\n\t\t\t\t)\n\t\t\t,\t'permanent_add_desc' => $permanentAddress['address_desc']\n\t\t\t,\t'permanent_add_country' => array(\n\t\t\t\t'country_id'\t=> $permanentAddress['country_id']\n\t\t\t,\t'country_name'=> $permanentAddress['country_name']\n\t\t\t)\n\t\t\t,\t'permanent_add_region' => array(\n\t\t\t\t\t'region_id'\t=> $permanentAddress['region_id']\n\t\t\t\t,\t'region_code'=> $permanentAddress['region_code']\n\t\t\t\t,\t'region_desc'=> $permanentAddress['region_desc']\n\t\t\t\t)\n\t\t\t,\t'permanent_add_province' => array(\n\t\t\t\t\t'province_id'\t=> $permanentAddress['province_id']\n\t\t\t\t,\t'province_name'=> $permanentAddress['province_name']\n\t\t\t\t)\n\t\t\t,\t'permanent_add_city' => array(\n\t\t\t\t\t'city_id'\t=> $permanentAddress['city_id']\n\t\t\t\t,\t'city_name'=> $permanentAddress['city_name']\n\t\t\t\t)\n\t\t\t,\t'applicant_gender' => $basicContact['bc_gender']\n\t\t\t,\t'applicant_birthday' => $applicant['applicant_birthday']? date(\"m/d/Y\", strtotime($applicant['applicant_birthday'])) : ''\n\t\t\t,\t'applicant_civil_status' => $applicant['applicant_civil_status']\n\t\t\t,\t'applicant_nationality' => $applicant['applicant_nationality']\n\t\t\t,\t'applicant_religion' => $applicant['applicant_religion']\n\t\t\t,\t'applicant_weight' => $applicant['applicant_weight']\n\t\t\t,\t'applicant_height' => $applicant['applicant_height']\n\t\t\t,\t'applicant_emp_status' => $applicant['applicant_emp_status']\n\t\t\t,\t'applicant_preferred_occupation'=> $applicant['applicant_preferred_occupation']\n\t\t\t,\t'applicant_citizenship' => $applicant['applicant_citizenship']\n\t\t\t,\t'applicant_summary' => $applicant['applicant_summary']\n\t\t\t,\t'applicant_educ_attainment' => array(\n\t\t\t\t\t'ea_id'\t=> $educAttainment['ea_id']\n\t\t\t\t,\t'ea_name'=> $educAttainment['ea_name']\n\t\t\t\t)\n\t\t\t,\t'phone_number_1' => $basicContact['bc_phone_num1']\n\t\t\t,\t'phone_number_2' => $basicContact['bc_phone_num2']\n\t\t\t,\t'phone_number_3' => $basicContact['bc_phone_num3']\n\t\t\t,\t'education_table'=> $education\n\t\t\t,\t'work_table'=> $work\n\t\t\t,\t'skill_tag'=>$applicantSkill\n\t\t);\n\t\t$this->_data['form_data'] = $form_data;\n\n\t\t$this->is_secure = true;\n $this->view('applicant/update_profile');\n }", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "function profile_update($user_id = null) {\n\t\t\tglobal $wpdb, $Db, $Subscriber;\n\t\t\t\n\t\t\tif (!empty($user_id)) {\t\t\t\n\t\t\t\tif ($newuserdata = $this -> userdata($user_id)) {\n\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\n\t\t\t\t\tif ($subscriber = $Db -> find(array('user_id' => $user_id))) {\n\t\t\t\t\t\t$Db -> model = $Subscriber -> model;\n\t\t\t\t\t\t$Db -> save_field('email', $newuserdata -> user_email, array('id' => $subscriber -> id));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "public function update_profile_info($attributes) \n {\n $user_data = $this->user->get_user_by_id($attributes['user_id']);\n $message = \"\";\n try {\n \n $action = $attributes['action'];\n \n if($action == \"basic-info\") {\n $first_name = $this->_helper->nohtml($attributes['first_name']);\n $middle_name = $this->_helper->nohtml($attributes['middle_name']);\n $last_name = $this->_helper->nohtml($attributes['last_name']);\n \n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'first_name' => $first_name, \n 'last_name' => $middle_name\n ]);\n \n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'middlename' => $last_name\n ]);\n \n $message = $first_name.' '.$middle_name.' '.$last_name;\n } else if($action == \"update-bio\") {\n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'bio_info' => $this->_helper->breaklines_checkpoint($attributes['bio'], \"addbreaks\"), \n ]);\n \n $message = $this->_helper->breaklines_checkpoint($attributes['bio'], \"striped\");\n \n } else if($action == \"birthdate\") {\n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'birthyear' => $attributes['year'] \n ]);\n \n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'birthmonth' => $attributes['month'],\n 'birthday' => $attributes['day']\n ]);\n \n $message = config('helper.months')[$attributes['month']].' '.$attributes['day'].', '.$attributes['year'];\n \n } else if($action == \"location-info\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], [\n 'address' => $attributes['location'],\n ]);\n \n $message = $attributes['location'];\n \n } else if($action == \"gender-info\") {\n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'gender' => $attributes['gender'],\n 'gender_custom' => isset($attributes['custom-gender']) ? $attributes['custom-gender'] : \"\",\n ]);\n \n $message = $attributes['gender'] == \"N\" ? \"Others, {$attributes['custom-gender']}\" : ($attributes['gender'] == \"M\" ? \"Male\" : \"Female\");\n \n } else if($action == \"religion\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'religion' => $attributes['my-religion']\n ]);\n $message = $attributes['my-religion'];\n \n } else if($action == \"politics\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'politics' => $attributes['politics-view']\n ]);\n \n $message = $attributes['politics-view'];\n } else if($action == \"contact\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], [\n 'contact1' => $attributes['contact1']\n ]);\n \n $message = $attributes['contact1'];\n } else if($action == \"bloodtype\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'bloodtype' => $attributes['my-bloodtype']\n ]);\n \n $message = \"Bloodtype \".$attributes['my-bloodtype'];\n } else if($action == \"links\") {\n if($attributes['type'] == \"link1\") {\n $update = [\n 'webtitle1' => $attributes['linktitle'],\n 'weblink1' => $attributes['linkurl'],\n ];\n } else if($attributes['type'] == \"link2\") {\n $update = [\n 'webtitle2' => $attributes['linktitle'],\n 'weblink2' => $attributes['linkurl'],\n ];\n } else {\n $update = [\n 'webtitle3' => $attributes['linktitle'],\n 'weblink3' => $attributes['linkurl'],\n ];\n }\n \n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], $update);\n \n } else if($action == \"credentials\") {\n if($attributes['status'] == \"delete\") {\n if($attributes['type'] == \"work\") {\n $this->user->delete_user_info('userworkhistory', ['id' => $attributes['id']]);\n } else if($attributes['type'] == \"education\") {\n $this->user->delete_user_info('usereduccollege', ['id' => $attributes['id']]);\n } else {\n $this->user->delete_user_info('usergeneralinfo', ['id' => $attributes['id']]);\n }\n } else {\n if($attributes['type'] == \"work\") {\n $current = isset($attributes['is_current']) ? 0 : $attributes['yearended'];\n $this->user->update_user_info('userworkhistory', [\n 'user_id' => $attributes['user_id'],\n 'id' => $attributes['id']\n ],[\n 'user_id' => $attributes['user_id'],\n 'companyname' => $attributes['companyname'],\n 'position' => $attributes['position'],\n 'location' => $attributes['location'],\n 'yearstarted' => $attributes['yearstarted'],\n 'yearended' => $current\n ]);\n \n $message = !empty($attributes['position']) ? $attributes['position'] . \", \" : \"\"; \n $message .= $attributes['companyname'];\n $message .= !empty($attributes['position']) ? \", \".$attributes['location'] : \"\";\n \n } else if($attributes['type'] == \"education\") {\n $current = isset($attributes['is_graduated']) ? 0 : $attributes['yearended'];\n $this->user->update_user_info('usereduccollege', [\n 'user_id' => $attributes['user_id'],\n 'id' => $attributes['id']\n ],[\n 'user_id' => $attributes['user_id'],\n 'schoolname' => $attributes['schoolname'],\n 'course' => $attributes['course'],\n 'location' => \"\",\n 'yearstarted' => $attributes['yearstarted'],\n 'yearended' => $current\n ]);\n \n $message = !empty($attributes['course']) ? $attributes['course'] . \", \" : \"\"; \n $message .= $attributes['schoolname'];\n } else {\n $this->user->update_user_info('usergeneralinfo', [\n 'user_id' => $attributes['user_id'],\n 'id' => $attributes['id']\n ],[\n 'user_id' => $attributes['user_id'],\n 'general_info' => $attributes['general_info']\n ]);\n \n $message = $attributes['general_info'];\n }\n }\n } else if($action == \"contacts\") {\n if($attributes['status'] == \"delete\") {\n if($attributes['type'] == \"contact2\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], ['contact2' => '']);\n } else if($attributes['type'] == \"contact3\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], ['contact3' => '']);\n }\n } else {\n $contacts['contact1'] = $attributes['contact1'];\n if(isset($attributes['contact2']) && !empty($attributes['contact2'])) {\n $contacts['contact2'] = $attributes['contact2'];\n }\n if(isset($attributes['contact3']) && !empty($attributes['contact3'])) {\n $contacts['contact3'] = $attributes['contact3'];\n }\n \n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], $contacts);\n }\n \n $set = $this->user->get_user_by_where('usercontactinfo', ['user_id' => $attributes['user_id']]);\n if($set->count() > 0) {\n $_data = $set->first();\n $message = !empty($_data->contact1) ? $_data->contact1 .\" <br>\" : \"\";\n $message .= !empty($_data->contact2) ? $_data->contact2 .\" <br>\" : \"\";\n $message .= !empty($_data->contact3) ? $_data->contact3 .\" <br>\" : \"\";\n }\n } else if($action == \"set-credential-active\") {\n $this->user->update_user_info('usersettings', [\n 'user_id' => $attributes['user_id']\n ],[\n 'credential_type' => $attributes['type'],\n 'credential_refid' => $attributes['id']\n ]);\n }\n \n \n return [\n 'status' => true,\n 'message' => $message\n ];\n } catch (Exception $ex) {\n return [\n 'status' => false,\n 'message' => $ex->getMessage()\n ];\n }\n }", "public function handleProfile()\n\t{\n\t\t$profile = $this->profile;\n\t\t$data = Input::only(array('email', 'location', 'website', 'quote'));\n\n\t\tif($profile->program->type->name == 'vmbo')\n\t\t{\n\t\t\t// if(Input::has('quote'))\n\t\t\t// {\n\t\t\t// \t$data['quote'] = Input::get('quote');\n\t\t\t// }\n\t\t\tif(Input::has('next_program'))\n\t\t\t{\n\t\t\t\t$data['next_program'] = Input::get('next_program');\n\t\t\t}\n\t\t}\n\n\t\t$profileData = $data;\n\t\t$socialMediaData = Input::get('social_media');\n\n\t\t$this->profileService->updateProfile($profile, $profileData);\n\t\t$this->profileService->syncSocialMedia($profile, $socialMediaData);\n\n\t\treturn Redirect::action('datacollector.controller@index');\n\t}", "function update($name, $email, $phone) {\n $name = $this->sanitizeMySQL($this->conn, $name);\n $email = $this->sanitizeMySQL($this->conn, $email);\n $phone = $this->sanitizeMySQL($this->conn, $phone);\n\n $this->start_session();\n $id = $_SESSION['id'];\n\n if ($name!=NULL) {\n $query = \"UPDATE users SET name='$name' WHERE id='$id'\";\n $result = $this->conn->query($query);\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n }\n\n if ($email!=NULL) {\n $query = \"UPDATE users SET email='$email' WHERE id='$id'\";\n $result = $this->conn->query($query);\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n }\n\n if ($phone!=NULL) {\n $query = \"UPDATE users SET phone='$phone' WHERE id='$id'\";\n $result = $this->conn->query($query);\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n }\n }", "public function mtii_utilities_show_extra_profile_fields($user) {\n $gender = get_the_author_meta('gender', $user->ID);\n $gender_label = $gender=='' ? 'Pick a Gender' : $gender;\n $phone_number = get_the_author_meta('phone_number', $user->ID);\n $state_city = get_the_author_meta('state_city', $user->ID);\n ?>\n <h3><?php esc_html_e('Personal Information (for Mtii Utilities User)', 'mtii-utilities-josbiz'); ?></h3>\n\n <table class=\"form-table\">\n <tr>\n <th>\n <label for=\"gender\"><?php _e( 'Gender', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <select name=\"gender\" id=\"gender\" class=\"input\">\n <option disabled value=\"<?php _e($gender, 'mtii-utilities-josbiz'); ?>\"><?php echo $gender_label; ?></option>\n <option value=\"<?php _e('Male', 'mtii-utilities-josbiz'); ?>\">Male</option>\n <option value=\"<?php _e('Female', 'mtii-utilities-josbiz'); ?>\">Female</option>\n </select>\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"phone_number\"><?php _e( 'Phone Number', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"number\" name=\"phone_number\" id=\"phone_number\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($phone_number)); ?>\" size=\"25\" />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"state_city\"><?php _e( 'State/City', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"text\" name=\"state_city\" id=\"state_city\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($state_city)); ?>\" size=\"25\" />\n </td>\n </tr>\n </table>\n <?php\n }", "function user_info(){\n\t\t \n\t\t$this->form_validation->set_rules('company', 'Company', 'required');\n\t\t$this->form_validation->set_rules('address_line_1', 'Address', 'required');\n\t\t$this->form_validation->set_rules('city', 'City', 'required');\n\t\t$this->form_validation->set_rules('state', 'State', 'required');\n\t\t$this->form_validation->set_rules('zipcode', 'Zip code', 'required');\n\t\t$this->form_validation->set_rules('country', 'Country', 'required');\n\t\t\t\n\t\t// To check form is validated\n\t\tif($this->form_validation->run()==true){\n\t\t\t$fname = trim($this->input->post('first_name'));\n\t\t\t$lname = trim($this->input->post('last_name'));\n\t\t\t$company = trim($this->input->post('company'));\n\t\t\t$add_1 = trim($this->input->post('address_line_1'));\n\t\t\t$city = trim($this->input->post('city'));\n\t\t\t$state = trim($this->input->post('state'));\n\t\t\t$zipcode = trim($this->input->post('zipcode'));\n\t\t\t$country = trim($this->input->post('country'));\n\t\t\t$country_custom = trim($this->input->post('country_custom'));\n\t\t\t$tzone = trim($this->input->post('member_time_zone'));\n\t\t\t\n\t\t\t// update user info\n\t\t\t$this->UserModel->update_user(\n\t\t\t\t\tarray('company'=>$company,'address_line_1'=>$add_1,'city'=>$city,'state'=>$state,'zipcode'=>$zipcode,'country'=>$country,'country_custom'=>$country_custom),\n\t\t\t\t\tarray('member_id'=>$this->session->userdata('member_id'))\n\t\t\t\t\t);\n\t\t\t// Assign success message by message class\n\t\t\techo 'success:User updated successfully';\n\t\t}\n\t\t// If validation errors in submitted values by user then print validation errors\n\t\tif(validation_errors()){\n\t\t\techo 'error:'.validation_errors();\n\t\t}\n\t}", "public function load_profile() { \n\n $this->form_validation->set_rules('firstName', 'First Name', 'required|trim|max_length[30]|xss_clean');\n $this->form_validation->set_rules('lastName', 'Last Name', 'required|trim|max_length[30]|xss_clean');\n $this->form_validation->set_rules('mobile', 'Mobile', 'required|trim|min_length[10]|max_length[10]|numeric|xss_clean');\n\n if($this->form_validation->run() == false) {\n $data['title']= \"User Profile\";\n $this->load->view('template/header');\n $this->load->view('profile');\n $this->load->view('template/footer');\n }\n else \n {\n $data = array(\n\t\t\t\t'firstName'\t\t\t=>\t$this->input->post('firstName', TRUE),\n\t\t\t\t'lastName'\t\t\t=>\t$this->input->post('lastName', TRUE),\n\t\t\t\t'mobile'\t\t\t=> \t$this->input->post('mobile', TRUE)\n );\n $result = $this->user_model->update_profile($this->session->userdata('id'), $data);\n if($result > 0)\n {\n $this->session->set_userdata($data);\n $this->session->set_flashdata('success', 'Your profile has been updated');\n return redirect('profile');\n }\n else\n {\n $this->session->set_flashdata('error', 'Your profile update was unsuccessful');\n return redirect('profile');\n \n }\n }\n \n }", "function editUserName($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$fname = $this->modify(mysqli_real_escape_string($conn, $data['fname']));\n\t\t\t$lname = $this->modify(mysqli_real_escape_string($conn, $data['lname']));\n\t\t\tif(empty($fname) || empty($lname)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z]+(\\.)?( )?[a-z]*$/i\", $fname) && preg_match(\"/^[a-z]+$/i\", $lname)) {\n\t\t\t\t\tif($this->length($fname, 25, 4) && $this->length($lname, 25, 4)) {\n\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_fname\", $fname , $_SESSION['userid']);\n\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_lname\", $lname , $_SESSION['userid']);\n\t\t\t\t\t\tif($result == false || $result1 == false) {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"Error=toobigOrtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=name\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function updateProfile(){\n\n\t\t$user_id = Auth::user()->get()->id;\n\t\t$user = User::with('consultant')->find($user_id);\n\t\t\n\t\t$consultant = Consultant::find(Auth::user()->get()->id);\n\t\t$website_url = $consultant['website_url'];\n\n\t\t$user_name = $consultant['other_names'];\n\t\t$user_surname = $consultant['surname'];\n\t\n\t\t$post_data = Input::all();\n\n\t\t$nationalities = Input::get('nationality');\n\t\t\n\t\t$skills = Input::get('skill', array());\n\t\t$specializations = Input::get('specialization',array());\n\t\t$worked_countries = Input::get('country_worked',array());\n\t\t$consultant_agencies = Input::get('consultant_agencies',array());\n\t\t$languages = $post_data['languages']['languages'];\n\n\t\t$rules = Consultant::editRules();\n\n\t\tif ($consultant->resume == null) {\n\t\t\tif (!Input::hasFile('resume')) {\n\t\t\t\t$rules['linkedin_url'] = 'url|required_without_all:resume,website_url';\n\t\t\t\t$rules['website_url'] = 'url|required_without_all:resume,linkedin_url';\n\t\t\t}\n\t\t\t$rules['resume'] = 'mimes:doc,docx,txt,pdf|max:1024|extension:txt,doc,docx,pdf|required_without_all:linkedin_url,website_url';\n\t\t}\n\n\t\t$validation = Validator::make($post_data, $rules,Consultant::$messages);\n\n\t\tif ($validation->passes()){\n\n\t\t\t$old_resume = $consultant->resume;\n\n\t\t\t$consultant->fill(Input::except('resume','terms_conditions','email'));\n\t\t\t\n\t\t\tif(Input::hasFile('resume')){\n\n\t \t$destinationPath = public_path().'/upload/resume/';\n\n\t \tif($old_resume != \"\"){\n\t \t\t$resume_to_delete = $destinationPath . $old_resume;\n\t \t\t@unlink($resume_to_delete);\n\t \t}\n\n\t $file = Input::file('resume');\n\t \n\t $extension = $file->getClientOriginalExtension();\n\t $user_fullname = $user_name.\" \".$user_surname;\n\t \t$user_fullname = $user_name.\" \".$user_surname;\n\t\t\t\t$file_name = Str::slug($user_fullname,'_');\n\t $doc_name = $file_name.'.'.$extension;\n\n\t $file->move($destinationPath,$doc_name);\n\t \n\t $consultant->resume = $doc_name;\n\t\t\t}\n\t\t\t$consultant->save();\n\n\t\t\tif($languages)\n\t\t\t{\n\n\t\t\t\tConsultantLanguage::where('consultant_id', $user_id)->delete();\n\t\t\t\tforeach ($languages as $key => $language) \n\t\t\t\t{\n\t\t\t\t\tif($language['language'] != \"\"){\n\n\t\t\t\t\t\t$consultant_language = new ConsultantLanguage();\n\t\t\t\t\t\t$consultant_language->consultant_id = $user->id;\n\t\t\t\t\t\t$consultant_language->language_id = $language['language'];\n\t\t\t\t\t\t// $consultant_language->language_level = $language['lang_level'];\n\t\t\t\t\t\t$consultant_language->speaking_level = $language['speaking_level'];\n\t\t\t\t\t\t$consultant_language->reading_level = $language['reading_level'];\n\t\t\t\t\t\t$consultant_language->writing_level = $language['writing_level'];\n\t\t\t\t\t\t$consultant_language->understanding_level = $language['understanding_level'];\n\t\t\t\t\t\t$consultant_language->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$nationality_list = array();\n\t\t\t\n\t\t\tif( count($nationalities) > 0 ){\n\n\t\t\t\tforeach ($nationalities as $nationality_id) {\n\t\t\t\t\t$nationality['country_id'] = $nationality_id;\n\t\t\t\t\tarray_push($nationality_list, $nationality);\n\t\t\t\t}\n\n\t\t\t\tConsultantNationality::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantNationality()->createMany($nationality_list);\n\t\n\t\t\t}\n\t\t\t\n\t\t\t$skill_list = array();\n\t\t\t\n\t\t\tif( count($skills) > 0 ){\n\n\t\t\t\tforeach ($skills as $skill_id) {\n\t\t\t\t\t$skill['skill_id'] = $skill_id;\n\t\t\t\t\tarray_push($skill_list, $skill);\n\t\t\t\t}\n\n\t\t\t\tConsultantSkill::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantSkill()->createMany($skill_list);\n\t\t\t}\n\t\t\t\n\n\t\t\t$specialization_list = array();\n\t\t\t\n\t\t\tif( count($specializations) > 0 ){\n\n\t\t\t\tforeach ($specializations as $specialization_id) {\n\t\t\t\t\t$specialization['specialization_id'] = $specialization_id;\n\t\t\t\t\tarray_push($specialization_list, $specialization);\n\t\t\t\t}\n\n\t\t\t\tConsultantSpecialization::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantSpecialization()->createMany($specialization_list);\n\t\t\t}\n\t\t\t\n\n\t\t\t$worked_country_list = array();\n\t\t\t\n\t\t\tif( count($worked_countries) > 0 ){\n\n\t\t\t\tforeach ($worked_countries as $worked_country_id) {\n\t\t\t\t\t$worked_country['country_id'] = $worked_country_id;\n\t\t\t\t\tarray_push($worked_country_list, $worked_country);\n\t\t\t\t}\n\t\t\t\tConsultantWorkedCountry::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantWorkedCountry()->createMany($worked_country_list);\n\t\t\t}\n\n\t\t\t$consultant_agency_list = array();\n\t\t\t\n\t\t\tif( count($consultant_agencies) > 0 ){\n\n\t\t\t\tforeach ($consultant_agencies as $consultant_agency_id) {\n\t\t\t\t\t$consultant_agency['agency_id'] = $consultant_agency_id;\n\t\t\t\t\tarray_push($consultant_agency_list, $consultant_agency);\n\t\t\t\t}\n\t\t\t\tConsultantAgency::where('consultant_id', $user_id)->delete();\n\t\t\t\t$user->consultantAgencies()->createMany($consultant_agency_list);\n\t\t\t}\n\n\t\t\treturn Redirect::route('user.profile')->with('message', 'You have successfully updated your profile')\n\t\t\t\t\t\t\t\t ->with('message_type', 'success');\n\t\t }else{\n\n\t\t\t\t$errors = $validation->errors()->toArray();\n\t\t\t\t// echo \"<pre>\";\n\t\t\t\t// print_r($errors);exit;\n\t\t\t\treturn Redirect::back()\n\t\t\t\t->withInput(Input::all())\n\t\t\t\t->withErrors($validation)\n\t\t\t\t->with('message', 'Some required field(s) have been left blank. Please correct the error(s)!')\n\t\t\t\t->with('message_type', 'danger');\n\t\t}\n\t}", "function profile() {\r\n\t\t# INIT\r\n\t\t$this->middleware ( 'googlemaps', 'googlemaps' );\r\n\t\t$this->middleware ( 'verotimage', 'upload' );\r\n\t\t$this->model ( 'users' );\r\n\t\t$data ['user'] = $this->model->users->getData ( $this->sessions->get ( 'uid' ) );\r\n\t\t\r\n\t\tif (! empty ( $data ['user'] ['address'] )) {\r\n\t\t\t$this->googlemaps->init ( array ('size' => '220x220', 'address' => $data ['user'] ['address'], 'language' => 'Disini', 'path' => STORAGE ) );\r\n\t\t}\r\n\t\t\r\n\t\tif (is_post ( 'edit' )) {\r\n\t\t\t\r\n\t\t\t#GET DATA\r\n\t\t\t$e ['address'] = $this->validation->safe ( $_POST ['address'] );\r\n\t\t\t$e ['phone'] = $_POST ['phone'];\r\n\t\t\t$e ['email'] = $_POST ['email'];\r\n\t\t\t$e ['uid'] = $this->sessions->get ( 'uid' );\r\n\t\t\t\r\n\t\t\t# VALIDATION\r\n\t\t\t$this->validation->required ( $e ['address'], l ( 'edit_address_error' ) );\r\n\t\t\t$this->validation->regex ( $e ['phone'], '/^[0]([0-9]{2}|[0-9]{3})[-][0-9]{6,8}|[0][8]([0-9]{8,12})$/', l ( 'register_phone_error' ) );\r\n\t\t\t$this->validation->regex ( $e ['email'], '/^[a-zA-Z0-9-_.]+@([a-zA-Z0-9-_]{1,67}\\.){1,5}[a-zA-Z]{2,4}$/', l ( 'edit_email_error' ) );\r\n\t\t\t\r\n\t\t\tif (! sizeof ( $this->validation->errors )) {\r\n\t\t\t\t\r\n\t\t\t\t# DEL IMAGE ( SHOULD BE WHEN CHANGE ADDRESS )\r\n\t\t\t\tif ($e ['address'] !== $data ['user'] ['address']) {\r\n\t\t\t\t\t$image = STORAGE . DS . $this->sessions->get ( 'uid' ) . DS . 'staticmap.png';\r\n\t\t\t\t\tif (file_exists ( $image )) {\r\n\t\t\t\t\t\tunlink ( $image );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# IF IMAGE EXIST\r\n\t\t\t\tif (! empty ( $_FILES ['logo'] ['size'] )) {\r\n\t\t\t\t\t$this->validation->image ( $_FILES ['logo'], l ( 'edit_logo_error' ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t# START PLUGIN\r\n\t\t\t\t\t$savepath = STORAGE . DS . $e ['uid'];\r\n\t\t\t\t\t$randomid = md5 ( $e ['uid'] . 'redlogo' );\r\n\t\t\t\t\t$this->upload->vupload ( $_FILES ['logo'] );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($this->upload->uploaded) {\r\n\t\t\t\t\t\t$this->upload->file_auto_rename = false;\r\n\t\t\t\t\t\t$this->upload->image_resize = true;\r\n\t\t\t\t\t\t$this->upload->file_overwrite = true;\r\n\t\t\t\t\t\t$this->upload->image_x = 220;\r\n\t\t\t\t\t\t$this->upload->image_ratio_y = true;\r\n\t\t\t\t\t\t$this->upload->file_new_name_body = 'logo' . $randomid;\r\n\t\t\t\t\t\t$this->upload->allowed = array ('image/*' );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$this->upload->Process ( $savepath );\r\n\t\t\t\t\t\tif ($this->upload->processed) {\r\n\t\t\t\t\t\t\t/* give another edit variable for update */\r\n\t\t\t\t\t\t\t$e ['logo'] = $this->upload->file_dst_name;\r\n\t\t\t\t\t\t\tchmod ( $savepath . '/' . $e ['logo'], 0644 );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->upload->clean ();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->model->users->updateData ( $e );\r\n\t\t\t\t\tredirect ( '/edit/profile' );\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/* IMAGE TIDAK */\r\n\t\t\t\tif (empty ( $_FILES ['logo'] ['size'] )) {\r\n\t\t\t\t\t$this->model->users->updateData ( $e );\r\n\t\t\t\t\tredirect ( '/edit/profile' );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->view ( 'users/header' );\r\n\t\t$this->active->menu ( $this->sessions->get ( 'uid' ), $this );\r\n\t\t$this->view ( 'users/profile', $data );\r\n\t\t$this->view ( 'users/footer' );\r\n\t}", "public function profile_update(Request $request)\n {\n if(Setting::get('demo_mode', 0) == 1) {\n return back()->with('flash_error', 'Disabled for demo purposes! Please contact us at [email protected]');\n }\n\n $this->validate($request,[\n 'name' => 'required|max:255',\n 'mobile' => 'required|digits_between:6,13',\n ]);\n\n try{\n $account = Auth::guard('account')->user();\n $account->name = $request->name;\n $account->mobile = $request->mobile;\n $account->save();\n\n return redirect()->back()->with('flash_success','Profile Updated');\n }\n\n catch (Exception $e) {\n return back()->with('flash_error','Something Went Wrong!');\n }\n \n }", "public function updateprofile($data){\n\n \t\t$id = $_SESSION['id'];\n\n \t\t$language= $_REQUEST['language'];\n\n \t\t/*$q = \"SELECT * FROM user_table WHERE id='$id' \";\n\t\t$result = $this->connection->query($q);*/\n\n\n\t\t$q = \"UPDATE user_table SET fname= '$data[fname]' , lname='$data[lname]', email='$data[email]', lang_id='$language' WHERE id=$id\";\n\n\t\t$result = $this->connection->query($q);\n\n\t\t\t\t$_SESSION['message'] = \"Updated Successfully\";\n\t\t\t\t$_SESSION['msg_type'] = \"success\";\n\n \t}", "public function update_basic_info(){\n\n // user user-id from session\n $encodedkey = $this->session->userdata('PariKey_session');\n $user_id='';\n $key=base64_decode($encodedkey);\n $keyarr=explode('|', $key);\n //session key format is $keyarr[0]=PARInaayKEY|$keyarr[1]=email_id|$keyarr[2]=user_id\n // print_r($_POST);die();\n extract($_POST);\n // validation\n if(empty($full_name)){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Full name field is required!',\n 'field' => 'full_name'\n );\n echo json_encode($response);\n die();\n }\n if($profile_created_by=='0'){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Select Profile created by option!',\n 'field' => 'profile_created_by'\n );\n echo json_encode($response);\n die();\n }\n if(empty($dob)){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Date of Birth field is required!',\n 'field' => 'dob'\n );\n echo json_encode($response);\n die();\n }\n if($marital_status=='0'){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Select Marital Status option!',\n 'field' => 'marital_status'\n );\n echo json_encode($response);\n die();\n }\n elseif($marital_status!='Never Married' && $no_of_children=='0'){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Select Number of Children option!',\n 'field' => 'no_of_children'\n );\n echo json_encode($response);\n die();\n }\n if($mother_tongue=='0'){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Select Mother Tongue option!',\n 'field' => 'mother_tongue'\n );\n echo json_encode($response);\n die();\n }\n if($blood_group=='0'){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Select Blood Group option!',\n 'field' => 'blood_group'\n );\n echo json_encode($response);\n die();\n }\n if($body_type=='0'){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Select Body Type option!',\n 'field' => 'body_type'\n );\n echo json_encode($response);\n die();\n }\n if($body_complexion=='0'){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Select Body Complexion option!',\n 'field' => 'body_complexion'\n );\n echo json_encode($response);\n die();\n }\n if(empty($weight)){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Weight field is required!',\n 'field' => 'weight'\n );\n echo json_encode($response);\n die();\n }\n if(empty($height)){\n $response=array(\n 'status' => 'validation',\n 'message' => '<b>Warning:</b> Height field is required!',\n 'field' => 'height'\n );\n echo json_encode($response);\n die();\n }\n\n $result = $this->user_model->update_basic_info($_POST,$keyarr[2]);\n\n if($result){\n $response=array(\n 'status' => 'success',\n 'message' => '<b>Success:</b> You Have Successfully Edited <b>Basic Information</b>!'\n );\n }\n else{\n $response=array(\n 'status' => 'error',\n 'message' => '<b>Error:</b> Perhaps you didn\\'t make any change. <b>Basic Information</b> was not updated Successfully!'\n );\n } \n echo json_encode($response);\n}", "public function update(Request $request, $id)\n {\n\n\n $user = User::find($id);\n // var_dump($request->sitecode);\n // var_dump($request->sitecodesg);\n $this->validate($request, [\n 'name' => 'required',\n 'username' => 'required',\n 'pincode' => 'nullable|digits:4'\n ]);\n\n $sameusername = User::where('Id','!=',$id)->where('UserName','=',$request->username)->get();\n\n if(count($sameusername) != 0) {\n $this->validate($request, [\n 'username' => 'required|unique:users',\n ]);\n }\n\n //if same id = edit profile \n if(Auth::user()->Id == $id)\n { \n //update password\n if($request->password && $request->oldPass && $request->confirmPassword )\n {\n if (!Hash::check($request->input('oldPass'), $user->Password)) \n { \n Session::flash('error_message', 'Incorrect Old Password.');\n\n return redirect()->back();\n }\n\n $this->validatePassword($request);\n $this->fillPassword($user, $request);\n }\n\n $this->fillUserDetails($user, $request, $id, false);\n\n //flash a notification\n Session::flash('flash_message', 'Profile updated successfully.');\n\n return redirect()->back();\n }\n //if not, then admin or owner is editing user\n else\n {\n if($request->password && $request->confirmPassword )\n {\n $this->validatePassword($request);\n $this->fillPassword($user, $request);\n }\n\n $this->fillUserDetails($user, $request, $id, false);\n\n //flash a notification\n Session::flash('flash_message', 'User updated successfully.');\n\n return redirect()->route('user.index');\n } \n }", "public function updateGetCurrentData ($id,&$name,&$email,&$mobile) {\r\n\t\t// This is for filling the Update page with the\r\n\t\t// existing data, before new data is posted\r\n\t\t$pdo = Database::connect();\r\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t$sql = \"SELECT * FROM tdg_users where id = ?\";\r\n\t\t$q = $pdo->prepare($sql);\r\n\t\t$q->execute(array($id));\r\n\t\t$data = $q->fetch(PDO::FETCH_ASSOC);\r\n\t\t$name = $data['name'];\r\n\t\t$email = $data['email'];\r\n\t\t$mobile = $data['mobile'];\r\n\t\tDatabase::disconnect();\r\n\t}", "function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }", "function chage_personal_details() {\n $result['status'] = FALSE;\n\n if ($this->input->is_ajax_request()) {\n\n //Validate data\n $this->form_validation->set_rules('first_name', 'First Name', 'trim|required|alpha');\n $this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|alpha');\n $this->form_validation->set_rules('mobile_num', 'Mobile Number', 'trim|integer');\n\n if ($this->form_validation->run() === FALSE) {\n $result['message'] = validation_errors();\n } else {\n $post_data = $this->input->post();\n $member_detail = $this->get_member_profile();\n\n //Date Object\n $date_of_birth = null;\n if ($this->input->post('date_of_birth') !== \"\") {\n $date = new DateTime();\n $date_of_birth = $date->setTimestamp(strtotime($this->input->post('date_of_birth')));\n }\n $post_data['date_of_birth'] = $date_of_birth;\n\n //load Model\n $this->load->model('member_model');\n $mod_res = $this->member_model->update_personal_details($member_detail['userId'], $post_data);\n $result['status'] = TRUE;\n $result['message'] = 'Personal details updated successfully.';\n }\n } else {\n $result['message'] = 'No direct accees allowed.';\n }\n\n $this->output->set_content_type('applcation/json')\n ->set_output(json_encode($result));\n }", "function edituserPaddress($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$paddress = mysqli_real_escape_string($conn, $data['paddress']);\n\t\t\t$parea = mysqli_real_escape_string($conn, $data['parea']);\n\t\t\t$pthana = mysqli_real_escape_string($conn, $data['pthana']);\n\t\t\t$pdistrict = mysqli_real_escape_string($conn, $data['pdistrict']);\n\t\t\t$pzip = mysqli_real_escape_string($conn, $data['pzip']);\n\t\t\tif(empty($paddress) || empty($parea) || empty($pthana) || empty($pdistrict) || empty($pzip)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $pdistrict)) {\n\t\t\t\t\tif($this->length($pdistrict,25,3)){\n\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $pthana)) {\n\t\t\t\t\t\t\tif($this->length($pthana,25,3)) {\n\t\t\t\t\t\t\t\tif(preg_match(\"/^[a-zA-Z]+$/\", $parea)) {\n\t\t\t\t\t\t\t\t\tif($this->length($parea,25,3)) {\n\t\t\t\t\t\t\t\t\t\tif($this->length($paddress,50,3)) {\n\t\t\t\t\t\t\t\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $pzip)) {\n\t\t\t\t\t\t\t\t\t\t\t\tif($this->length($pzip,4,4)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_paddress\", $paddress , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_parea\", $parea , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result2 = $this->change(\"user_login\", \"user_pthana\", $pthana , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result3 = $this->change(\"user_login\", \"user_pdistrict\", $pdistrict , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$result4 = $this->change(\"user_login\", \"user_pzip\", $pzip , $_SESSION['userid']);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( $result == false || $result1 == false || $result2 == false || $result3 == false || $result4 == false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed!\");\n\t\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$this->re_direct(\"profile\", \"Successfull\");\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} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=tooBigORtooSmall\");\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} else {\n\t\t\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=ZipCode\");\n\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$this->re_direct(\"profile\", \"length=addretooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=areatooBigORtooSmall\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=area\");\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\t$this->re_direct(\"profile\", \"length=thanatooBigORtooSmall\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=thana\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"length=DistricttooBigORtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=District\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function setprofile(){\n \n \n \n $region=M('region');\n $user=D('user');\n $userinfo=M('userinfo');\n $ucenter_member=M('ucenter_member');\n $member=M('member');\n //main menu\n $channel = new \\Common\\Model\\ChannelModel();\n $menu = $channel->getMenu(\"Blog\");\n $this->assign('menu', $menu);\n $uid = I('get.uid');\n $choice = I('get.type');\n if(!(session('username') || cookie('username'))){\n $url = \"http://\".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].\"?s=/Home/User/login.html\";\n header('Location:'.$url);\n }\n if(IS_POST){\n //判断是否已存在信息\n $isset=$userinfo->where(\"user_id=$uid\")->find();\n $array=I('post.');\n $judge1=$ucenter_member->where(\"id=$uid\")->setField('username',$array['nickname']);\n $judge2=$member->where(\"uid=$uid\")->setField('nickname',$array['nickname']);\n $save['user_id']=$uid;\n $save['sex']=$array['sex'];\n $save['introduce']=$array['introduce'];\n $save['sign']=$array['sign'];\n $save['create_time']=$save['update_time']=time();\n if($array['town']){\n $save['region_id']=$array['town'];\n }else {\n $save['region_id']=$array['city'];\n }\n if($isset){\n $judge3=$userinfo->where(\"user_id=$uid\")->save($save);\n }else {\n $judge3=$userinfo->add($save);\n }\n }\n \n //判断有没有填写过个人信息\n $user_info=M('ucenter_member')->alias('u')\n ->where(\"u.id=$uid\") \n ->join('lsgoweb_userinfo i on u.id=i.user_id','left')\n ->field('i.sex,i.introduce,i.sign,i.region_id,u.username')\n ->find();\n if($user_info['region_id']){\n $path=$region->where(array(id=>$user_info['region_id']))->find();\n $path_id=explode('.',$path['path_id']);\n $path_name=explode('.',$path['path_name']);\n }\n $province=$region->where(\"parent=86\")->select();\n $this->assign('path_name',$path_name);\n $this->assign('path_id',$path_id);\n $this->assign('nickname',$user_info['username']);\n $this->assign('province',$province);\n $this->assign('sex',$user_info['sex']);\n $this->assign('introduce',$user_info['introduce']);\n $this->assign('sign',$user_info['sign']);\n $this->assign('urlinfo',$this->getMenu2($uid));\n $this->assign('judge',$this->showchoice($choice));\n $this->assign('info',$user->info($uid));\n \n $this->display('setprofile');\n }", "public function profile($param1 = \"\", $param2 = \"\") {\n\t\tif ($param1 == 'update_profile') {\n\t\t\t$response = $this->user_model->update_profile();\n\t\t\techo $response;\n\t\t}\n\t\tif ($param1 == 'update_password') {\n\t\t\t$response = $this->user_model->update_password();\n\t\t\techo $response;\n\t\t}\n\n\t\t// showing the Smtp Settings file\n\t\tif(empty($param1)){\n\t\t\t$page_data['folder_name'] = 'profile';\n\t\t\t$page_data['page_title'] = 'manage_profile';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\t}", "public function edit_profile() {\n $this->load->helper('form');\n $this->load->library('form_validation');\n \n $username = $this->session->userdata('username');\n \n if(empty($username)) {\n # The user is not logged in, show them the login page\n $this->firephp->error(\"Username is empty!\");\n $this->login();\n }\n else {\n # DEBUG: Display retrived username in console\n $this->firephp->info($username, \"Username retrieved from session\");\n \n # Get the user from the database\n $user = $this->user_model->get_user($username);\n \n $data['title'] = 'Edit your profile';\n $data['user'] = $user;\n $data['username'] = $username;\n \n $data['done'] = FALSE;\n $data['wrong_password'] = FALSE;\n \n # Set the form validation rules\n $this->form_validation->set_rules('edit-email', 'Email',\n 'valid_email|is_unique[user.email]');\n $this->form_validation->set_rules('edit-password-new', 'New Password',\n 'matches[edit-password-newconf]');\n \n if($this->form_validation->run() == FALSE) {\n $this->load->view('templates/header', $data);\n $this->load->view('user/edit_profile', $data);\n $this->load->view('templates/footer');\n }\n else {\n # Everything checks out\n # Assign the inputs to variables if there are anything inputted.\n # If not, just use the current var of the user\n \n $email_input = $this->input->post('edit-email');\n $about_input = $this->input->post('edit-about');\n $password_input = $this->input->post('edit-password-new');\n \n # Check if there's an input in the email field\n if(empty($email_input)) {\n $email = $user->email;\n }\n else {\n $email = $email_input;\n }\n # Check if there's input in the about field\n if(empty($about_input)) {\n $about = $user->about;\n }\n else {\n $about = $about_input;\n }\n # Check if there's input in the password field\n if(empty($password_input)) {\n $password = $user->password;\n }\n else {\n # Check if the old password is correct\n $old_password_input = $this->input->post('edit-password-old');\n $old_password = hash(\"sha256\", $old_password_input);\n \n if($old_password == $user->password) {\n $password = hash(\"sha256\", $password_input);\n }\n else {\n # Set a flag for a wrong password\n $data['wrong_password'] = TRUE;\n $password = $user->password;\n }\n }\n \n # Create the user that we will be putting into the database\n $input = array(\n 'email'=>$email,\n 'about'=>$about,\n 'password'=>$password\n );\n \n # Perform the query\n $this->user_model->edit_user($user->id, $input);\n \n # Update the model we're going to pass\n $user = $this->user_model->get_user($username);\n $data['user'] = $user;\n \n $data['title'] = $user->username.\"'s\".\" profile\";\n \n # Load important user data into data superarray\n $data['username'] = $user->username;\n \n $data['done'] = TRUE;\n \n # Go back to the User's Profile\n $this->load->view('templates/header', $data);\n $this->load->view('user/edit_profile', $data);\n $this->load->view('templates/footer');\n }\n }\n }", "public function update_profile(Request $request) {\n //type can be: mobile/phone/email\n $type = $request->type;\n //this new value is already validated in javascript\n $new_value = $request->new_value;\n $user = User::find($request->user_id);\n //dd($user);\n switch ($type) {\n case 'mobile':\n $user->gsm = $new_value;\n break;\n case 'phone':\n $user->tel = $new_value;\n break;\n case 'email':\n $user->email = $new_value;\n break;\n }\n\n $user->save();\n return 'success';\n }", "public function setProfileAction($header_data,$post_data){ \n if( !isset($post_data['username']) || !isset($post_data['birthday']) || !isset($post_data['gender']) || !isset($post_data['hobbies']) || !isset($post_data['about_me'])) {\n Library::logging('alert',\"API : setProfile : \".ERROR_INPUT.\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_INPUT, null);\n } else {\n try {\n $user = Users::findById($header_data['id']);\n $user->username = $post_data['username'];\n $user->birthday = $post_data['birthday'];\n $user->gender = $post_data['gender'];\n $user->hobbies = $post_data['hobbies'];\n $user->about_me = $post_data['about_me'];\n if ($user->save() == false) {\n foreach ($user->getMessages() as $message) {\n $errors[] = $message->getMessage();\n }\n Library::logging('error',\"API : setProfile : \".$errors.\" : user_id : \".$header_data['id']);\n Library::output(false, '0', $errors, null);\n } else {\n Library::output(true, '1', USER_PROFILE, null);\n }\n } catch (Exception $e) {\n Library::logging('error',\"API : setProfile : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n } \n }\n }", "public function profil()\n {\n $User = $this->session->read('User');\n\n if ($this->issetPostSperglobal('compte')) {\n if ($this->issetArrayPostSuperglobal('compte', 'lastname') &&\n $this->issetArrayPostSuperglobal('compte', 'firstname') &&\n $this->issetArrayPostSuperglobal('compte', 'email') &&\n $this->issetArrayPostSuperglobal('compte', 'password') &&\n $this->issetArrayPostSuperglobal('compte', 'password_confirm'))\n {\n if (!empty($this->getArrayPostSuperglobal('compte', 'lastname')) &&\n !empty($this->getArrayPostSuperglobal('compte', 'firstname')) &&\n !empty($this->getArrayPostSuperglobal('compte', 'email')))\n {\n $Validator = new Validator($this->getArrayPost('compte'));\n $Validator->isEmail('email', \"L'adresse email doit être une adresse email valide.\");\n if (!empty(trim($this->getArrayPostSuperglobal('compte', 'password')))) {\n if (!empty(trim($this->getArrayPostSuperglobal('compte', 'password_confirm')))) {\n $Validator->isPassword('password', \"Les mot de passe ne sont pas valides.\");\n $Validator->isConfirmed('password', \"Les mot de passe sont différents.\");\n } else {\n $this->session->writeFlash('danger', \"Le champ confirmation du mot de passe est vide alors que le champ mot de passe ne l'est pas.\");\n }\n } else {\n $this->setArrayPostSuperglobal('compte', 'password', null);\n $this->setArrayPostSuperglobal('compte', 'password_confirm', null);\n }\n if ($Validator->isValid()) {\n $this->users_manager->update(\n $this->getArrayPostSuperglobal('compte', 'lastname'),\n $this->getArrayPostSuperglobal('compte', 'firstname'),\n $this->getArrayPostSuperglobal('compte', 'email'),\n $this->getArrayPostSuperglobal('compte', 'password'),\n $User\n );\n $this->session->writeFlash('success', \"Vos informations ont été mise à jour avec succès.\");\n } else {\n $errors = $Validator->getErrors();\n foreach ($errors as $champs => $message) {\n $this->session->writeFlash('danger', $message);\n }\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($this->getArrayPost('compte'));\n $this->render('profil', ['head'=>['title'=>'Profil', 'meta_description'=>''], '_post'=>isset($_post) ? $_post : ''], 'admin');\n }\n\n if ($this->issetPostSperglobal('social')) {\n $empty_link = 0;\n foreach ($this->getArrayPost('social') as $link) {\n if (empty($link)) {\n $empty_link++;\n }\n }\n if ($empty_link === count($this->getArrayPost('social')) && empty($this->getArrayFilesSuperglobal('avatar', 'name', 0))) {\n $this->session->writeFlash('danger', \"Vous avez soumis le formulaire Social sans rien remplir.\");\n }\n\n if ($empty_link < count($this->getArrayPost('social'))) {\n $this->users_manager->updateInfos($this->getArrayPost('social'), $User->getIdUser());\n $this->session->writeFlash('success', \"Vos informations ont été mise à jour avec succès.\");\n }\n\n if (!empty($this->getArrayFilesSuperglobal('avatar', 'name', 0))) {\n $files = $this->upload('avatar', $this->getArrayFiles('avatar'), $User->getIdUser());\n if (empty($files['response'])) {\n $this->users_manager->saveUpload($files['moved_files'], $User->getIdUser());\n $this->session->writeFlash('success', \"Votre photo de profil a été mise à jour avec succès.\");\n }\n }\n\n $this->render('profil', ['head'=>['title'=>'Profil', 'meta_description'=>'']], 'admin');\n }\n\n if ($this->issetPostSperglobal('delete')) {\n $id_user = intval($this->getPostSuperglobal('delete'));\n if ($id_user === $User->getIdUser()) {\n $this->posts_manager->deletedAuthor($id_user);\n $this->users_manager->delete($User->getIdUser(), $User->getEmail());\n $this->session->writeFlash('success', \"Votre compte a été supprimé avec succès. Un mail de confirmation vous sera envoyé.\");\n $this->redirect('accueil');\n }\n $this->session->writeFlash('danger', \"Le numéro d'utilisateur pour la suppression du compte ne vous correspond pas.\");\n $this->render('profil', ['head'=>['title'=>'Profil', 'meta_description'=>'']], 'admin');\n }\n }", "function itstar_save_extra_user_profile_fields( $user_id ) {\n $saved = false;\n if ( current_user_can( 'edit_user', $user_id ) ) {\n update_user_meta( $user_id, 'birthday', $_POST['birthday'] );\n update_user_meta( $user_id, 'birthmonth', $_POST['birthmonth'] );\n update_user_meta( $user_id, 'birthyear', $_POST['birthyear'] );\n update_user_meta( $user_id, 'phone', $_POST['phone'] );\n update_user_meta( $user_id, 'job', $_POST['job'] );\n $saved = true;\n }\n return true;\n}", "public function profileAction()\n {\n //Get session info\n $auth = $this->session->get('auth');\n\n //Query the active user\n $user = Users::findFirst($auth['id']);\n if ($user == false) {\n $this->_forward('index/index');\n }\n\n $request = $this->request;\n\n if (!$request->isPost()) {\n Tag::setDefault('name', $user->name);\n Tag::setDefault('email', $user->email);\n } else {\n\t //1)get all the input fields\n\t //2) if password fields are empty then do normal saving stuff\n\t //3)if password fields are not empty then match it with the database, then check the new password and retyped password fields. the save everything\n $name = $request->getPost('name', 'string');\n $email = $request->getPost('email', 'email');\n\t $currentPassword= $request->getPost('password');\n $newPassword= $request->getPost('newpassword');\n\t $repeatPassword= $request->getPost('repeatpassword');\n\t if ($currentPassword=='' && $newPassword=='' && $repeatPassword==''){\n\t\t$name = strip_tags($name);\n \t$user->name = $name;\n \t$user->email = $email;\n\t\tif ($user->save() == false) {\n \tforeach ($user->getMessages() as $message) {\n \t$this->flash->error((string) $message);\n\t }\n\t\t} else {\n $this->flash->success('Your profile information was updated successfully');\n }\t\t\n\t }else {\n\t\tif (sha1($currentPassword) != $user-> password){\n\t\t\t $this->flash->error(\"The current password is wrong\" );\n\t\t}else{ \n\t\t\tif ($newPassword != $repeatPassword){\n\t\t\t\t$this->flash->error('The new password does not match with retyped password');\n\t\t\t}elseif ($newPassword=='' && $repeatPassword==''){\n\t\t\t\t$this->flash->error('New password should not be empty');\n\t\t\t}elseif (strlen($newPassword) < 8 ){\n\t\t\t\t$this->flash->error('New password length should be not less than 8 characters');\n\t\t\t}else{\n\t\t\t\t$name = strip_tags($name);\n \t\t\t$user->name = $name;\n \t\t\t$user->email = $email;\n\t\t\t\t$user->password= sha1($newPassword);\n\t\t\t\tif ($user->save() == false) {\n \t\t\tforeach ($user->getMessages() as $message) {\n \t\t\t\t$this->flash->error((string) $message);\n \t\t\t}\n \t\t\t} else {\n \t\t\t$this->flash->success('Your profile information/password was updated successfully');\n \t\t\t }\n }\n\t\t}\n\t \n\t }\n\n }\n }", "protected function readUserProfile()\n {\n if (isset($_GET['code'])) {\n $params = array(\n 'client_id' => $this->clientId,\n 'client_secret' => $this->clientSecret,\n 'redirect_uri' => $this->redirectUri,\n 'grant_type' => 'authorization_code',\n 'code' => $_GET['code']\n );\n\n $tokenInfo = $this->post('https://accounts.google.com/o/oauth2/token', $params);\n\n if (isset($tokenInfo['access_token']) && isset($tokenInfo['id_token']))\n {\n $params = array('id_token' => $tokenInfo['id_token']);\n $validateToken = $this->get('https://www.googleapis.com/oauth2/v1/tokeninfo', $params);\n\n if (!isset($validateToken['email'])) {\n return false;\n }\n\n $params = array('access_token' => $tokenInfo['access_token']);\n $userInfo = $this->get('https://www.googleapis.com/plus/v1/people/me', $params);\n\n if (isset($userInfo['kind']) && $userInfo['kind'] == 'plus#person')\n {\n $this->parseUserData($userInfo);\n\n $this->userInfo['email'] = $validateToken['email'];\n\n if (isset($this->response['birthday']))\n {\n $birthDate = explode('-', $this->response['birthday']);\n $this->userInfo['birthDay'] = isset($birthDate[2]) ? $birthDate[2] : null;\n $this->userInfo['birthMonth'] = isset($birthDate[1]) ? $birthDate[1] : null;\n $this->userInfo['birthYear'] = isset($birthDate[0]) ? $birthDate[0] : null;\n }\n\n return true;\n }\n }\n }\n\n return false;\n }", "function personal_info() {\n if (!$this->session->userdata('logged_in')) {\n redirect('logout');\n }\n\n $data1 = $this->show_User_data();\n $data4 = $this->applifinan_data();\n $data2 = $this->show_user_history();\n $data3 = $this->referee_spon_data();\n $data = $data2 + $data1 + $data3 + $data4;\n $data['active2'] = TRUE;\n\n $this->form_validation->set_rules('surname', 'surname', 'required|max_length[20]|alpha|xss_clean');\n $this->form_validation->set_rules('other_name', 'Other name', 'required|max_length[40]|alpha|xss_clean');\n $this->form_validation->set_rules('title', 'title', 'required|max_length[10]|xss_clean');\n $this->form_validation->set_rules('datebirth', 'Date of birth', 'trim|required|exact_length[10]|xss_clean');\n $this->form_validation->set_rules('disab', 'disable', 'required|max_length[20]|xss_clean');\n $this->form_validation->set_rules('perm_address', 'Permanet Address', 'required|max_length[30]|xss_clean');\n $this->form_validation->set_rules('landline', 'landline', 'trim|exact_length[10]|numeric|xss_clean|callback_landline_check');\n $this->form_validation->set_rules('mobile', 'mobile', 'required|exact_length[10]|numeric|xss_clean');\n $this->form_validation->set_rules('fax', 'fax', 'min_length[14]|max_length[16]|alpha_dash|xss_clean|callback_fax_check');\n $this->form_validation->set_rules('email', 'email', 'required|max_length[40]|valid_email|xss_clean');\n $this->form_validation->set_rules('coun_birth', 'country', 'required|max_length[80]|xss_clean');\n $this->form_validation->set_rules('nation', 'nationality', 'required|max_length[40]|xss_clean');\n $this->form_validation->run();\n\n if (isset($_POST['savcont'])) {\n $datebirth= $this->input->post('datebirth');\n if ($this->form_validation->run() == FALSE || substr($datebirth, 6)>= date('Y')) {\n $data['error']='<p>Your date of birth cant be that day please try again.</p>';\n $this->load->view('application/capplication', $data);\n } else {\n\n $data['active3'] = TRUE;\n unset($data['active2']);\n $this->load->model('Application_form');\n Application_form::insert_other_info($datebirth);\n $this->load->view('application/capplication', $data);\n }\n } elseif (isset($_POST['save'])) {\n $datebirth= $this->input->post('datebirth');\n if($this->form_validation->run() == FALSE ||substr($datebirth, 6) >= date('Y')){\n $data['error']='<p>Your date of birth cant be that day please try again.</p>';\n $this->load->view('application/capplication', $data); \n } else {\n $this->load->model('Application_form');\n Application_form::insert_other_info($datebirth);\n $this->load->view('application/capplication', $data);\n }\n } elseif(isset($_POST['back'])){\n $data['active1'] = TRUE;\n unset($data['active2']);\n $this->load->view('application/capplication', $data);\n }else {\n $this->load->view('application/capplication', $data);\n }\n }", "abstract protected function getUserProfile();", "function __updateCustomerprofile($postrequest)\n\t{\n\t\n\t\t\t//\techo '<pre>';print_r($this->session->userdata['customer']['email']);exit;\n\t\t //$customer = $this->session->userdata['pos_customer_id'];\n\t\t \n\t\t \n\t\t if(count($_POST) > 0)\n\t\t\t{\n\t\t\t\t$cid=$postrequest['customer'];\n\t\t\t\t$firstname=$postrequest['firstname'];\n\t\t\t\t$lastname=$postrequest['lastname'];\n\t\t\t\t$street_line_1=$postrequest['street_line_1'];\n\t\t\t\t$street_line_2=$postrequest['street_line_2'];\n\t\t\t\t$floor=$postrequest['floor'];\n\t\t\t\t$calling_bell=$postrequest['calling_bell'];\n\t\t\t\t$zip=$postrequest['zip'];\n\t\t\t\t$mobile=$postrequest['mobile'];\n\t\t\t\t\n\t\t\t\t $email=$postrequest['email'];\n\t\t\t\t$confirm_email=$postrequest['confirm_email'];\n\t\t\t\t$subscribe=$postrequest['subscribe'];\n\t\t\t\n\t\t\t\tif($email != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL) === false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->session->set_flashdata('notice-error', $this->data['lang']['lang_invalid_email']);\n\t\t\t\t\t\t\tredirect('/admin/customer/profile/');\n\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql=\"SELECT * FROM a_email WHERE email='\".trim($email).\"' AND customer!='\".$cid.\"'\";\n\t\t\t\t\t\t\t$query=$this->db->query($sql);\n\t\t\t\t\t\t\t$status=$query->num_rows();\n\t\t\t\t\t\t\tif(intval($status) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->session->set_flashdata('notice-error', \"E-post id finnes allerede.\");\n\t\t\t\t\t\t\t\tredirect('/admin/customer/profile/');\n\t\t\t\t\t\t\t\texit;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($cid)\n\t\t\t\t{\n\t\t\t\t\t//$result=$this->general_model->isValidZip($zip); //check its a valid zip\n\t\t\t\t\t//if($result)\n\t\t\t\t\t//{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$fields=array('firstname'=>$firstname,'lastname'=>$lastname,'employee'=>$this->session->userdata['current_staff']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->customer_model->addCustomer($fields,$cid);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($email != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->customer_model->updateEmail($email,$cid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($mobile != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->customer_model->updateMobile($mobile,$cid);\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$this->customer_model->updateAddress($street_line_1,$street_line_2,$floor,$calling_bell,$zip,$cid);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($subscribe == 'Ja')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$saldostatus = $this->payments_model->getSaldostatus($cid);\n\t\t\t\t\t\t\tif(intval($saldostatus) == 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$paymentarray=array(\n\t\t\t\t\t\t\t\t'type'=>'in',\n\t\t\t\t\t\t\t\t'in_type'=>'visa',\n\t\t\t\t\t\t\t\t'in_status'=>'paid',\n\t\t\t\t\t\t\t\t'customer'=>$cid,\n\t\t\t\t\t\t\t\t'amount'=>0,\n\t\t\t\t\t\t\t\t'regtime'=>date('Y-m-d H:i:s'),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$this->payments_model->addCustomerPayment($paymentarray);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->payments_model->updateCustomerBalance($cid,0,'paid');\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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->session->set_flashdata('notice-success', $this->data['lang']['lang_profile_update']);\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$data=$this->general_model->getAvailableArea($zip);\n\t\n\t\t\t\t\t\tif(!empty($data)){\n\t\t\t\t\t\t\t$newdata = array('zipdata' => $data);\n\t\t\t\t\t\t\t$this->session->set_userdata($newdata);\n\t\t\t\t\t\n\t\t\t\t\t\t\t$newdata = array('service_available' => '1');\n\t\t\t\t\t\t\t$this->session->unset_userdata('service_available');\n\t\t\t\t\t\t\t$this->session->set_userdata($newdata);\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\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->session->set_flashdata('notice-error', $this->data['lang']['lang_service_not_available']);\n\t\t\t\t\t\t\t$newdata = array('service_available' => '0');\n\t\t\t\t\t\t\t$this->session->unset_userdata('service_available');\n\t\t\t\t\t\t\t$this->session->set_userdata($newdata);\n\t\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//redirect('/admin/customer/profile/');\n\t\t\t\t//exit;\n\t\t\n\t\t\t}\n\t\t\t//profiling::\n\t\t\t$this->data['controller_profiling'][] = __function__;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t $data=$this->customer_model->getCustomerinfo($cid);\n\t\t// print_r($data);exit;\n\t\t//$data['partner_branch_name_short'] = substr($data['partner_branch'] ,0,3);\n\t\t//print_r($data);exit;\n\t\t\n\t\t $newdata = array('customer' => $data);\n\t\t $this->session->set_userdata($newdata);\n\t\t \n\t\t $response = array('response'=>\"success\",\"customer\"=>$cid,\"message\" => 'Account has been created successfully...!');\n\t\t\t\techo json_encode($response);exit;\n\t\t\n\t}", "function _process_user_info()\n\t{\n\t\t$user_info = null;\n\t\t$code = $this->input->get('code');\n\n\t\t//Google redirects with code insead of post\n\t\tif( $code )\n\t\t{\n\t\t\t$user_info = get_user_info( $this->input->get('code') );\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$user_info['email'] = trim($this->input->post('email'));\n\t\t\t$user_info['username'] = trim($this->input->post('username'));\n\t\t}\n\n\t\treturn $user_info;\n\t}", "public function updateProfile($request, $response){\n\t $isError = false;\n\t $op_id = $request->getParam('id');\n\t $op_fullname = $request->getParam('op_fullname');\n\t $op_fname = $request->getParam('op_fname');\n\t $op_lname = $request->getParam('op_lname');\n\t $op_email = $request->getParam('op_email');\n\t $op_phone = $request->getParam('op_phone');\n\t $op_emailExist = Models\\Operators::where('op_email', '=', $op_email)->where('op_id', '!=', $op_id)->first();\n\t if(empty($op_fullname)){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please enter your full name'));\n\t\t exit();\n\t }elseif(empty($op_fname)){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please enter your first name'));\n\t\t exit();\n\t }elseif(empty($op_lname)){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please enter your last name'));\n\t\t exit();\n\t }else if( empty($op_email) ){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please enter your email'));\n\t\t exit();\n\t }else if(!isValidEmail($op_email)){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'error', \n\t\t 'message' => 'Please enter valid email.'));\n\t\t exit();\n\t }else if(isValidEmail($op_email) && $op_emailExist){\n\t\t $isError = true;\n\t\t echo json_encode(array(\"status\" => 'duplicate', \n\t\t 'message' => 'Email (<strong>'.$op_email. '</strong>) already exist.'));\n\t\t exit();\t \n\t }else{\n\t\t $isError = false; \n\t }\n\t \n\t \n\t if(!$isError ){\n\t\t // update to users table\n\t\t $data = array('op_fullname' => $op_fullname,\n\t\t 'op_fname' => $op_fname,\n\t\t\t\t\t\t 'op_lname' => $op_lname,\n\t\t\t\t\t\t 'op_email' => $op_email,\n\t\t\t\t\t\t 'op_phone' => $op_phone);\t\t \n\t\t $opUpdate = Models\\Operators::where('op_id', '=', $op_id)->update($data);\n\t\t // Now get this user latest updated data and put in session\n\t\t $operator = Models\\Operators::where('op_id', '=', $op_id)->first();\n\t\t \n\t\t // Overwrite session values here\n\t\t\t$_SESSION['isAdmin'] = 'Okay';\n\t\t\t$_SESSION['adminId'] = $operator->op_id;\n\t\t\t$_SESSION['adminName'] = $operator->op_fullname;\n\t\t\t$_SESSION['adminEmail'] = $operator->op_email;\n\t\t\t$_SESSION['isOperator'] = 'Okay';\n\t\t\t\n\t\t return $response\n ->withHeader('Content-type','application/json')\n ->write(json_encode(array('status' => TRUE)));\n\t }\n\t}", "private function __setProfileFormData() {\n\t\t$adminUser = $this->Auth->user();\n\n\t\t$this->request->data['User'] = $adminUser;\n\t\t$this->request->data['User']['old_email'] = $adminUser['email'];\n\n\t\t$dob = $adminUser['date_of_birth'];\n\t\tif (!is_null($dob) && ($dob !== '')) {\n\t\t\tlist($dobYear, $dobMonth, $dobDay) = explode('-', $dob);\n\t\t\t$formattedDob = sprintf('%s-%s-%s', $dobMonth, $dobDay, $dobYear);\n\t\t\t$this->request->data['User']['date_of_birth'] = $formattedDob;\n\t\t}\n\n\t\t$gender = $adminUser['gender'];\n\n\t\t$profileImg = Common::getUserThumb($adminUser['id'], $adminUser['type'], 'medium', 'user_pic');\n\n\t\t$superAdminStatus = __('No');\n\t\tif (intval($adminUser['type']) === User::ROLE_SUPER_ADMIN) {\n\t\t\t$superAdminStatus = __('Yes');\n\t\t}\n\n\t\t$timezoneList = $this->Timezone->get_timezone_list();\n\n\t\t// form details\n\t\t$formId = 'AdminProfileEditForm';\n\t\t$changePasswordFormId = 'AdminChangePasswordForm';\n\t\t$changePasswordFields = $this->__listAdminUserChangePasswordFormFields();\n\t\t$inputDefaults = array(\n\t\t\t'label' => false,\n\t\t\t'div' => false\n\t\t);\n\n\t\t// validation\n\t\t$modelName = 'User';\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminChangePasswordForm->validate, $changePasswordFormId);\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminProfileForm->validate, $formId);\n\n\t\t$title_for_layout = 'Edit Profile';\n\n\t\t$this->set(compact('title_for_layout', 'modelName', 'changePasswordFields', 'formId', 'changePasswordFormId', 'timezoneList', 'inputDefaults', 'gender', 'profileImg', 'superAdminStatus'));\n\t}", "public function confirm($email, $password, $phone, $users = null, $layer_visible = null, $readonly = false, $full_request)\n\t{\n\t\t$sql = \"SELECT * FROM tbl_user WHERE var_email = '\" . clean_data($email) . \"'\";\n\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\tif(($row = mysql_fetch_array($result))&&($email != \"\"))\n\t\t{\n\t\t\t//Email exists\n\t\t\t\n\t\t\t//Check if the password already exists\n\t\t\t$user_id = $row['int_user_id'];\n\t\t\tif($row['var_pass'] == NULL) {\n\t\t\t\t//No password already, so presumably we need to store it\n\t\t\t\t$sql = \"UPDATE tbl_user SET var_pass = '\" . md5(clean_data($password)) . \"' WHERE int_user_id = \" . $user_id;\n\t\t\t\tmysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\t\t\t\n\t\t\t\t//Update phone if necessary too\n\t\t\t\tif($phone != \"\") {\n\t\t\t\t\t//f($phone != \"Your Phone\") {\n\t\t\t\t\t\t$sql = \"UPDATE tbl_user SET var_phone = \" . clean_data($phone) . \" WHERE int_user_id = \" . $user_id;\n\t\t\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\t\t\t} else {\n\t\t\t\t\t\t//A blank phone - we want to remove any old phone number\n\t\t\t\t\t\t$sql = \"UPDATE tbl_user SET var_phone = NULL WHERE int_user_id = \" . $user_id;\n\t\t\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\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\t//Set our session variable\n\t\t\t\t$_SESSION['logged-user'] = $user_id;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Handle any plugin generated settings\n\t $returns = $this->save_plugin_settings($user_id, $full_request, \"SAVE\");\n if(strcmp($returns, \"RELOAD\") == 0) {\n $reload = \",RELOAD\";\n }\n\t\t\t\t\n\t\t\t\treturn \"STORED_PASS\" . $reload;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//A password already - compare with existing password\n\t\t\t\tif(md5($password) == $row['var_pass']) {\n\t\t\t\t\n\t\t\t\t\t//Yup, a match - lets sign us in\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$_SESSION['logged-user'] = $user_id;\n\t\t\t\t\t$_SESSION['logged-email'] = clean_data($email);\t\t\t//This is here to confirm the email matches the logged in\n\t\t\t\t\t\n\t\t\t\t\t//Update phone if necessary too\n\t\t\t\t\tif($phone != \"\") {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$sql = \"UPDATE tbl_user SET var_phone = \" . clean_data($phone) . \" WHERE int_user_id = \" . $user_id;\n\t\t\t\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//A blank phone - we want to remove any old phone number\n\t\t\t\t\t\t\t$sql = \"UPDATE tbl_user SET var_phone = NULL WHERE int_user_id = \" . $user_id;\n\t\t\t\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\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//Get the current layer - use to view \n\t\t\t\t\t$ly = new cls_layer();\n\t\t\t\t\t$layer_info = $ly->get_layer_id($layer_visible);\n\t\t\t\t\tif($layer_info) {\n\t\t\t\t\t\t$_SESSION['authenticated-layer'] = $layer_info['int_layer_id'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Get the group user if necessary\n\t\t\t\t\t$this->get_group_user();\n\t\t\t\t\t\n\t\t\t\t\t//Udate the group if necessary too \n\t\t\t\t\tif($_SESSION['logged-group-user'] == $_SESSION['layer-group-user']) {\n\t\t\t\t\t\tif($users) {\n\t\t\t\t\t\t\t$this->update_subscriptions($users);\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//Handle any plugin generated settings\n\t $returns = $this->save_plugin_settings($user_id, $full_request, \"SAVE\");\n\t if(strcmp($returns, \"RELOAD\") == 0) {\n\t $reload = \",RELOAD\";\n\t \n\t }\n\t\t\t\t\n\t\t\t\t\treturn \"LOGGED_IN\" . $reload; \n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t\t//Incorrect password\n\t\t\t\t\treturn \"INCORRECT_PASS\";\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t//Incorrect email - so, this is a new user\n\t\t\t$ly = new cls_layer(); \n\t\t\t$ip = $ly->getRealIpAddr(); //get new user's ip address\t\n\t\t\t\n\t\t\t$sh = new cls_ssshout();\n\t\t\t\n\t\t\t$user_id = $sh->new_user($email, $ip);\t\t//Sends off confirmation email\n\t\t\t\n\t\t\t\n\t\t\t//No password already, so presumably we need to store it\n\t\t\tif($password) {\n\t\t\t\t$sql = \"UPDATE tbl_user SET var_pass = '\" . md5(clean_data($password)) . \"' WHERE int_user_id = \" . $user_id;\n\t\t\t\tmysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\t\t\n\t\t\t\t//Set our session variable\n\t\t\t\t$_SESSION['logged-user'] = $user_id;\n\t\t\t}\n\t\t\t\n\t\t\t//Handle any plugin generated settings\n\t\t\t$returns = $this->save_plugin_settings($user_id, $full_request, \"NEW\");\n if(strcmp($returns, \"RELOAD\") == 0) {\n $reload = \",RELOAD\";\n }\n\t\t\t\n\t\t\t\n\t\t\treturn \"NEW_USER\" . $reload;\n\t\t}\n\t}", "public function update(Request $request) {\n\n// if (!Auth::check()) {\n// return redirect('admin');\n// }\n $userInfo = Auth::user();\n $User = User::findOrFail($userInfo->id);\n\n\n\n // validate\n $validator = Validator::make($request->only(['name', 'email', 'mobile']), [\n 'name' => 'required',\n 'email' => 'required|unique:users,email,' . $userInfo->id,\n 'mobile' => 'sometimes|numeric|digits:8',\n ]);\n\n \n // validation failed \n if ($validator->fails()) {\n return redirect('admin/user/profile')\n ->withErrors($validator)->withInput();\n } else {\n\n $input = $request->only(['name', 'email', 'civilid', 'mobile']);\n\n\n $User->fill($input)->save();\n\n //logActivity\n LogActivity::addToLog('User - ' . $userInfo->username, 'updated profile');\n\n Session::flash('message', config('global.updatedRecords'));\n return redirect('admin/user/profile');\n }\n }", "public function save_profile_info($attributes) \n {\n $user_data = $this->user->get_user_by_id($attributes['user_id']);\n $message = \"\";\n try {\n \n $action = $attributes['action'];\n \n if($action == \"basic-info\") {\n $first_name = $this->_helper->nohtml($attributes['first_name']);\n $middle_name = $this->_helper->nohtml($attributes['middle_name']);\n $last_name = $this->_helper->nohtml($attributes['last_name']);\n \n $this->user->update_user_info('users', ['id' => $attributes['user_id']], [\n 'first_name' => $first_name, \n 'last_name' => $middle_name\n ]);\n \n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'middlename' => $last_name\n ]);\n \n $message = $first_name.' '.$middle_name.' '.$last_name;\n } else if($action == \"save-location\") {\n $this->user->update_user_info('usercontactinfo', ['user_id' => $attributes['user_id']], [\n 'address' => $attributes['location']\n ]);\n \n } else if($action == \"save-religion\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'religion' => $attributes['my-religion']\n ]);\n \n } else if($action == \"save-political\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'politics' => $attributes['my-politics']\n ]);\n \n } else if($action == \"save-blood-type\") {\n $this->user->update_user_info('userbasicinfo', ['user_id' => $attributes['user_id']], [\n 'bloodtype' => $attributes['my-bloodtype']\n ]);\n \n } else if($action == \"save-contact\") {\n $this->user->save_user_contacts(['user_id' => $attributes['user_id']], [\n 'contact' => $attributes['contact']\n ]);\n \n } else if($action == \"save-links\") {\n $this->user->save_user_links(['user_id' => $attributes['user_id']], [\n 'linktitle' => $attributes['linktitle'],\n 'linkurl' => $attributes['linkurl']\n ]);\n \n } else if($action == \"save-work-history\") {\n $current = isset($attributes['is_current']) ? 0 : $attributes['yearended'];\n \n $this->user->insert_user_info('userworkhistory', [\n 'user_id' => $attributes['user_id'],\n 'companyname' => $attributes['companyname'],\n 'position' => $attributes['position'],\n 'location' => $attributes['location'],\n 'yearstarted' => $attributes['yearstarted'],\n 'yearended' => $current\n ]);\n } else if($action == \"save-education-history\") {\n $current = isset($attributes['is_graduated']) ? 0 : $attributes['yearended'];\n \n $this->user->insert_user_info('usereduccollege', [\n 'user_id' => $attributes['user_id'],\n 'schoolname' => $attributes['schoolname'],\n 'course' => $attributes['course'],\n 'location' => \"\",\n 'yearstarted' => $attributes['yearstarted'],\n 'yearended' => $current\n ]);\n } else if($action == \"save-general-history\") {\n $this->user->insert_user_info('usergeneralinfo', [\n 'user_id' => $attributes['user_id'],\n 'general_info' => $attributes['general_info']\n ]);\n }\n \n return [\n 'status' => true,\n 'message' => $message\n ];\n } catch (Exception $ex) {\n return [\n 'status' => false,\n 'message' => $ex->getMessage()\n ];\n }\n }", "public function getUserProfile() {\n\n\t\t$data = $this->api->get( 'people/~:('. implode(',', $this->config['fields']) .')?format=json' );\n\n\t\t// if the provider identifier is not received, we assume the auth has failed\n\t\tif ( ! isset( $data->id ) ) {\n\t\t\tthrow new Exception( \"User profile request failed! {$this->providerId} api returned an invalid response: \" . Hybrid_Logger::dumpData( $data ), 6 );\n\t\t}\n\n\t\t// # store the user profile.\n\t\t$this->user->profile->identifier = ( property_exists ( $data, 'id' ) ) ? $data->id : '';\n\t\t$this->user->profile->firstName = ( property_exists ( $data, 'firstName' ) ) ? $data->firstName : '';\n\t\t$this->user->profile->lastName = ( property_exists ( $data, 'lastName' ) ) ? $data->lastName : '';\n\t\t$this->user->profile->profileURL = ( property_exists ( $data, 'publicProfileUrl' ) ) ? $data->publicProfileUrl : '';\n\t\t$this->user->profile->email = ( property_exists ( $data, 'emailAddress' ) ) ? $data->emailAddress : '';\n\t\t$this->user->profile->emailVerified = ( property_exists ( $data, 'emailAddress' ) ) ? $data->emailAddress : '';\n\t\t$this->user->profile->photoURL = ( property_exists ( $data, 'pictureUrl' ) ) ? $data->pictureUrl : '';\n\t\t$this->user->profile->description = ( property_exists ( $data, 'summary' ) ) ? $data->summary : '';\n\t\t$this->user->profile->country = ( property_exists ( $data, 'country' ) ) ? strtoupper( $data->country ) : '';\n\t\t$this->user->profile->displayName = trim( $this->user->profile->firstName . ' ' . $this->user->profile->lastName );\n\n\t\tif ( property_exists( $data, 'phoneNumbers' ) && property_exists( $data->phoneNumbers, 'phoneNumber' ) ) {\n\t\t\t$this->user->profile->phone = (string) $data->phoneNumbers->phoneNumber;\n\t\t} else {\n\t\t\t$this->user->profile->phone = null;\n\t\t}\n\n\t\tif ( property_exists( $data, 'dateOfBirth' ) ) {\n\t\t\t$this->user->profile->birthDay = (string) $data->dateOfBirth->day;\n\t\t\t$this->user->profile->birthMonth = (string) $data->dateOfBirth->month;\n\t\t\t$this->user->profile->birthYear = (string) $data->dateOfBirth->year;\n\t\t}\n\n\t\treturn $this->user->profile;\n\t}" ]
[ "0.6865107", "0.6760915", "0.6693186", "0.6607638", "0.65992683", "0.6598564", "0.6589131", "0.6582348", "0.65752137", "0.6554394", "0.65168", "0.65044767", "0.64987355", "0.64942634", "0.6465414", "0.64508015", "0.64167124", "0.6413793", "0.6397808", "0.63634586", "0.636122", "0.6307841", "0.6282338", "0.628049", "0.6277992", "0.6277969", "0.6277175", "0.62691075", "0.6225625", "0.6219851", "0.62182426", "0.6185383", "0.6180261", "0.61706316", "0.6166516", "0.6140553", "0.61359316", "0.61284715", "0.61162746", "0.6112662", "0.61105263", "0.6108779", "0.6108718", "0.6107971", "0.6107947", "0.60995424", "0.6084633", "0.6075312", "0.6063731", "0.60565394", "0.6045827", "0.60438454", "0.60431176", "0.6023311", "0.6021811", "0.6005634", "0.6002364", "0.59965825", "0.5988946", "0.59872216", "0.59851277", "0.5977538", "0.5965867", "0.59614456", "0.59578615", "0.59569275", "0.5950033", "0.5946371", "0.5939515", "0.5937568", "0.5924812", "0.592157", "0.59196967", "0.59172314", "0.59059465", "0.58991635", "0.58928764", "0.58927363", "0.5889128", "0.5889007", "0.5888973", "0.5888698", "0.58867687", "0.58843774", "0.58842033", "0.58824575", "0.5881781", "0.5881769", "0.58793044", "0.58766794", "0.58723366", "0.5867992", "0.5866752", "0.58630085", "0.5862553", "0.5862188", "0.58592176", "0.58561885", "0.58430743", "0.5839867" ]
0.69319075
0
this method changes password for user password and repeat_password is mandatory fields
public function changePasswordAction(){ $data = $this->getRequestData(); $user = Object_User::getById($this->getDeviceSession()->getUserId()); if(isset($data['password']) && isset($data['repeat_password'])){ if($data['password'] === $data['repeat_password']){ $user->setPassword($data['password']); } else { $this->setErrorResponse('password and repeat_password should match!'); } } else { $this->setErrorResponse('password and repeat_password is mandatory fields!'); } $this->_helper->json(array('updated' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function changePassword() {}", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function setPassword(){\n\t}", "public function setPassword($newPassword);", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "function update_password()\n {\n }", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "public function actionChangepassword()\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\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\n\t\tif(isset($_POST['SiteUser']))\n\t\t{\t\n\t\t\tif(trim($_POST['SiteUser']['password']) != '') {\n\t\t\t\t$record->password = $_POST['SiteUser']['password'];\n\t\t\t\t\n\t\t\t} \t\t\n\t\t\tif(trim($_POST['SiteUser']['password']) == trim($_POST['SiteUser']['repeat_password'])) {\n\t\t\t\t$record->repeat_password = $record->password;\n\t\t\t}\t\n\t\t\t\n\t\t\tif($record->validate()) {\n\t\t\t\t$record->repeat_password = $record->password = crypt($record->password);\n\t\t\t\tif($record->save())\n\t\t\t\t\t$this->redirect(array('personal'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$record->repeat_password = $record->password = '';\n\t\t\t}\n\n\t\t}\t\n\n\t\t$this->render('changepassword',array('record'=>$record));\n\t}", "public function setPassword($newPassword){\n\t}", "public function testUpdatePasswordNotGiven(): void { }", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "public function setPasswordField($password = true) {}", "public function setPassword($value);", "public function modifpassword($user,$passwd){\n \n }", "public function changeUserPassword($uid,$newPassword);", "public function change_password($data, $user_id) {\r\n\r\n // Start Backend Validation\r\n if (empty($data['old-pwd'])) {\r\n $this->errors['old-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n }\r\n\r\n if (empty($data['new-pwd'])) {\r\n $this->errors['new-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n } elseif (strlen($data['new-pwd']) < 8) {\r\n $this->errors['new-pwd'] = 'يجب على كلمة السر أن تتكون من 8 أحرف فأكثر';\r\n }\r\n\r\n if ($data['confirm-pwd'] != $data['new-pwd']) {\r\n $this->errors['confirm-pwd'] = 'كلمتا السر غير متطابقتان';\r\n }\r\n\r\n if (empty($this->errors)) {\r\n // Sanitize Data\r\n $old_pwd = sha1(filter_var($data['old-pwd'], FILTER_SANITIZE_STRING));\r\n $new_pwd = sha1(filter_var($data['new-pwd'], FILTER_SANITIZE_STRING));\r\n\r\n $user = $this->select('users', 'id', $user_id)->fetch_assoc();\r\n\r\n if ($user['password'] === $old_pwd) { // If Passwords Are Mached\r\n $connection = DB::connect();\r\n\r\n // Update The Password\r\n $stmt = \"UPDATE users SET password = '$new_pwd' WHERE id = '$user_id'\";\r\n $result = $connection->query($stmt);\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n header('location: ' . $profile_url);\r\n\r\n } else {\r\n $this->errors['old-pwd'] = 'كلمة السر غير صحيحة';\r\n }\r\n\r\n }\r\n\r\n }", "protected function changePassword()\n {\n if (empty($this->password)) {\n return;\n }\n $this->validateOnly('password', ['password' => 'min:8|confirmed']);\n $this->user->update([\n 'password' => Hash::make($this->password),\n ]);\n $this->password = null;\n $this->password_confirmation = null;\n }", "function change_password()\n {\n if ($user = $this->authorized(USER))\n {\n $descriptive_names = array(\n 'current_password' => 'Current Password',\n 'new_password' => 'New Password',\n 'new_password_confirm' => 'Confirm Password'\n );\n\n $rules = array(\n 'current_password' => ($user['group_id']==0)?'clean':'required|clean',\n 'new_password' => 'required|clean',\n 'new_password_confirm' => 'required|clean'\n );\n\n $this->loadLibrary('form.class');\n $form = new Form();\n\n $form->dependencies['title'] = \"Change Password\";\n $form->dependencies['form'] = 'application/views/change-password.php';\n $form->dependencies['admin_reset'] = false;\n $form->dependencies['client_id'] = $user['id'];\n $form->form_fields = $_POST;\n $form->descriptive_names = $descriptive_names;\n $form->view_to_load = 'form';\n $form->rules = $rules;\n\n if ($fields = $form->process_form())\n {\n\n $this->loadModel('UserAuthentication');\n\n\n if ($this->UserAuthentication->change_password($user['id'], $fields['current_password'], $fields['new_password'], $fields['new_password_confirm']))\n {\n $this->alert(\"Password Updated\", \"success\");\n $this->redirect(\"portal/home\");\n }\n else\n {\n $this->alert(\"Error: Password Not Updated\", \"error\");\n $this->redirect(\"portal/home\");\n }\n }\n }\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\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 $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "public function changePassword(PasswordChangeForm $form, User $user);", "public function setPassword($userid, $password);", "public function updatePassword(UserInterface $user);", "public function update_password($id, $password);", "public function changePassword($username, $password);", "function change_password($password){\n\t\tif( isset($_POST[$password]) ){\n\t\t\t$new_password = $_POST[$password];\n\n\t\t\t$result = user::change_password($new_password);\n\t\t}\n\t}", "function changePass() {\n\t\t$id = $this->AuthExt->User('id');\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Invalid user', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t//don't allow hidden variables tweaking get the group and username \n\t\t\t//form the system in case an override occured from the hidden fields\n\t\t\t$this->data['User']['role_id'] = $this->AuthExt->User('role_id');\n\t\t\t$this->data['User']['username'] = $this->AuthExt->User('username');\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('The password change has been saved', 'flash_success');\n\t\t\t\t$this->redirect(array('action' => 'index', 'controller' => ''));\n\t\t\t} else {\n\t\t\t\tprint_r($this->data);\n\t\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t\t$this->data['User']['password'] = null;\n\t\t\t\t$this->data['User']['confirm_passwd'] = null;\n\t\t\t\t$this->Session->setFlash('The password could not be saved. Please, try again.', 'flash_failure');\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t$this->data['User']['password'] = null;\n\t\t}\n\t\t$roles = $this->User->Role->find('list');\n\t\t$this->set(compact('roles'));\n\t}", "public function actionPassword()\n {\n if (is_null($this->password)) {\n self::log('Password required ! (Hint -p=)');\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->email) && is_null($this->id)) {\n self::log('User ID or Email required ! (Hint -e= or -i=)');\n return ExitCode::DATAERR;\n }\n\n $model = User::find()->where([\n 'OR',\n [\n 'email' => $this->email\n ],\n [\n 'id' => $this->id\n ]\n ])->one();\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n $validator = new TPasswordValidator();\n\n $model->password = $this->password;\n\n $validator->validateAttribute($model, \"password\");\n\n if ($model->errors) {\n\n self::log($model->errorsString);\n\n return ExitCode::DATAERR;\n }\n\n $model->setPassword($this->password);\n\n if (! $model->save()) {\n\n self::log('Password not changed ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Password successfully changed !');\n\n return ExitCode::OK;\n }", "public function change_password()\n {\n $this->form_validation->set_rules('password2', 'Password', 'required|trim|min_length[3]|matches[password3]', ['min_length' => MY_USERPASSWORDTOOSHORT, 'matches' => MY_USERPASSNOTMATCHED]);\n $this->form_validation->set_rules('password3', 'Password', 'required|trim|matches[password2]');\n\n if ($this->form_validation->run() == true) {\n $password = $this->input->post('password');\n $user = $this->user_model->get_profile($_SESSION['uid']);\n if (password_verify($password, $user['password'])) {\n $data = [];\n $data['uid'] = $_SESSION['uid'];\n $data['password'] = $this->input->post('password2');\n $this->user_model->user_change_password($data);\n $this->session->set_flashdata('message', genAlert(MY_USERPASSWORDCHANGED));\n } else {\n $this->session->set_flashdata('message', genAlert(MY_USERPASSNOTMATCHED, 'danger'));\n }\n }\n $breadcrumb_items = [\n 'Dashboard' => 'dashboard',\n 'Profile' => 'profile'\n ];\n $this->breadcrumb->add_item($breadcrumb_items);\n $data['breadcrumb'] = $this->breadcrumb->generate();\n $data['namaview'] = 'profile/change_password';\n $data['pagetitle'] = 'Ganti Password';\n\n $this->load->view('templates/dashboard.php', $data);\n }", "public function changePassword(User $user, string $newPassword): void;", "public function setpasswordAction(){\n $req=$this->getRequest();\n $cu=$this->aaac->getCurrentUser();\n $password=$this->getRequest()->getParam('password');\n $record=Doctrine_Query::create()->from('Users')->addWhere('ID=?')->fetchOne(array($req->getParam('id'))); \n $record->password=md5($password);\n if(!$record->trySave()){\n $this->errors->addValidationErrors($record);\n }\n $this->emitSaveData(); \n }", "function password($id = null) {\n\n\t\t/**\n\t\t * Check if maintenance is on.\n\t\t * Call the \"Maintenance\" component to check.\n\t\t */\n\t\t$this->Maintenance->check();\t\t\n\n\t\t/**\n\t\t * If $id is not set and $this->data is empty, an error message is displayed.\n\t\t * $this->data = Datas from the form\n\t\t * $id = The user ID\n\t\t */\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user password.', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'password', $id));\n\t\t}\n\t\t/**\n\t\t * Check if the user try to edit an another user password.\n\t\t * If yes, the user is redirect to the index page.\n\t\t */\n\t\telseif ($id != $this->Auth->user('id')) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user password', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Save the user password after edit.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Insert the change password action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ Password ]</strong> ' . __d('core', 'Access panel password has been changed.', true), 'CORE', $_SERVER[\"REMOTE_ADDR\"]);\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * If the user password is edited, 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 password has been changed.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user password is not edited, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user password has not been changed.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Display datas.\n\t\t */\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t}\n\n\t}", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "public function changePwd(){\n $uesr_id=$_SESSION['admin_id'];\n\t\t$sql=\"select * from users where id='$uesr_id'\";\n\t\t$query = mysqli_query($this->connrps, $sql);\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$username = $row['username'];\n\t\t\t$password = $row['password'];\n\t\t}\n\t\t$cur_password=base64_encode($_POST['currentPassword']);\n\t\t$new_pwd=base64_encode($_POST['newPassword']);\n\t\t$confirm_pwd=base64_encode($_POST['confirmPassword']);\n\t\tif ($cur_password != $password) {\n\t\t\t$message= \"Current password does not matched.\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else if ($new_pwd != $confirm_pwd) {\n\t\t\t$message= \"Confirm password does not matched\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else {\n\t\t\t$query_updt = \"UPDATE users SET password = '$new_pwd' WHERE id='$uesr_id'\";\n\t\t\t$query_updt = mysqli_query($this->connrps, $query_updt);\n\t\t\t$message= \"New password has been updated successfully\";\n\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\treturn 1;\n\t\t}\n\t}", "private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function user_changed_password($user_id, $new_password) {\n \n }", "function changepass_firsttime()\n {\n $userId = $this->userInfo('user_id');\n \n $result = $this->update('user', array('password' => $this->value('password'), 'modified' => date('Y-m-d H:i:s')), \" user_id = \".$userId);\n \n if($result === TRUE)\n {\n //this will prevent user from being logged out automatically. (as it happens in old implementation)\n $_SESSION['password'] = $this->value('password');\n \n //update the patient_history table with \"password change\" action to 'complete'\n $data = array(\n 'patient_id' => $userId,\n 'action_type' => 'first time login',\n 'action' => 'password change', \n 'action_status' => 'complete',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $data);\n \n echo \"{success:true, message:'Password updated successfully'}\";\n }\n else\n {\n echo \"{success:false, message:'Password update failure'}\";\n }\n }", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function password_change() {\n if (!empty($this->session->userdata('user_session'))) {\n $user_id = $this->User_Model->get_loggedin_user_id();\n $user = $this->User_Model->get_user($user_id);\n if (!empty($user)) {\n $this->data['title'] = \"Update User Password\";\n $this->data['user_type_list'] = $this->get_user_types();\n $this->data['user'] = $user;\n $employee_information = $this->Employee_Model->get_employee($user->employee_id);\n $this->data['employee_information'] = $employee_information;\n $this->load->view('header');\n $this->load->view('navigation');\n $this->load->view('user/update_my_password', $this->data);\n } else {\n redirect(base_url('user'));\n }\n } else {\n redirect(base_url('user_login'));\n }\n }", "public function changePassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('password', 'Altes Passwort', 'required');\n $this->form_validation->set_rules('new_password', 'Neues Passwort', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n\t\tif (!password_verify(\n\t\t\t$this->input->post('password'),\n\t\t\t$this->user_model->getValue('hashed_password'))) \n\t\t{\n\t\t\t$this->error(404, 'Verification error');\n\t\t}\n\t\t\n\t\t/*\n \tif ($this->user_model->getValue('confirmed') == 0) {\n \t\t$this->error(402, 'Account not confirmed');\n \t}\n \t*/\n \t\n \t$this->user_model->setValue(\n \t\t'hashed_password',\n \t\tpassword_hash($this->input->post('new_password'), PASSWORD_DEFAULT));\n \t\t\n \tif (! $this->user_model->updatePassword()) {\n \t\t$this->error(400, 'Password could not be updated');\n \t}\n \t\n $data['new password'] = 'set';\n $this->response($data);\n }", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "public function change_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->change_password($this->input->post());\n\n if ($res['success'] && !isset($res['invalid_fields'])) {\n $this->_flash_message('パスワードを変更しました');\n redirect('setting');\n return;\n }\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n $view_data['post'] = $this->input->post();\n }\n\n $this->_render($view_data);\n }", "function admin_password($id = null) {\n\n\t\t/**\n\t\t * If $id is not set and $this->data is empty, an error message is displayed.\n\t\t * $this->data = Datas from the form\n\t\t * $id = The user ID\n\t\t */\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user.', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'password'));\n\t\t}\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Save the user password after edit.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Select the subdomain name with the ID.\n\t\t\t\t * It's necessary for the insert in the \"robot\" table.\n\t\t\t\t * @var string\n\t\t\t\t */\n\t\t\t\t$data = $this->Robot->search($id, 'User');\n\n\t\t\t\t/**\n\t\t\t\t * Insert the edit action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $data['User']['name'] . ' ]</strong> ' . __d('core', 'User password changed by (' . $this->Auth->user('name') . ').', true) , 'CORE', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * If the new user password is edited, 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 password has been changed.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user password is not edited, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user password has not been changed.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Display datas.\n\t\t */\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t}\n\n\t}", "public function updatePassword(ExtendedUserInterface $user);", "public function change_password() {\n header('Content-Type: application/json');\n $this->autoRender = false;\n $this->User->recursive = -1;\n if ($this->request->is('post')) {\n $user = $this->User->findByEmail($this->request->data['User']['email'], array('User.id', 'User.email', 'User.password'));\n if (!empty($user)) {\n $oldPassword = AuthComponent::password($this->request->data['User']['old_password']);\n if ($user['User']['password'] == $oldPassword) {\n $newPassword = $this->request->data['User']['new_password'];\n $data = array(\n 'id' => $user['User']['id'],\n 'password' => AuthComponent::password($newPassword)\n );\n $this->User->save($data);\n die(json_encode(array('success' => true, 'msg' => 'Succeed to change password')));\n \n } else \n die(json_encode(array('success' => false, 'msg' => 'Wrong old password')));\n \n } else\n die(json_encode(array('success' => false, 'msg' => 'Email address not found.')));\n }\n }", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function savepasswordAction(){\n\t\t$request = $this->_request->getParams();\n\t\t\n\t\t$error = false;\n\t\t$oValidationHelper = new Helpers_Usermanagement_Validate();\n\t\t\n\t\tif(!$oValidationHelper->ifPasswordMatch($request['user_password'],$request['password2'])){\n\t\t\t$error = true;\n\t\t\t$this->_messages->setMessage('Passwords entered do not match','error','user_password');\n\t\t}\t\n\t\t\n\t\tif($this->_validator->validate('passreset_form',$request) && !$error){\n\t\t\t$this->_auth->user_password = md5($request['user_password']);\n\t\t\t$this->_auth->save();\n\t\t\t$this->_messages->setMessage('Password has been updated');\t\t\t\n\t\t\t$this->_redirect('/usermanagement/profile/passwordform');\n\t\t}else{\n\t\t\tforeach ( $this->_validator->getErrors () as $field=>$error ) {\n\t\t\t\t$this->_messages->setMessage ( $error, 'error' , $field);\n\t\t\t}\n\t\t\t$this->_redirect('/usermanagement/profile/passwordform/?error=1');\n\t\t}\n\t}", "function update_paypassword()\n {\n }", "public function editUserPassword($user_password_old, $user_password_new, $user_password_repeat)\n {\n if (empty($user_password_new) || empty($user_password_repeat) || empty($user_password_old)) {\n $this->errors[] = MESSAGE_PASSWORD_EMPTY;\n // is the repeat password identical to password\n } elseif ($user_password_new !== $user_password_repeat) {\n $this->errors[] = MESSAGE_PASSWORD_BAD_CONFIRM;\n // password need to have a minimum length of 6 characters\n } elseif (strlen($user_password_new) < 6) {\n $this->errors[] = MESSAGE_PASSWORD_TOO_SHORT;\n\n // all the above tests are ok\n } else {\n // database query, getting hash of currently logged in user (to check with just provided password)\n $select = $this->getUserData($_SESSION['user_email']);\n\n // if this user exists\n if (isset($select[\"user_password_hash\"])) {\n\n // using PHP 5.5's password_verify() function to check if the provided passwords fits to the hash of that user's password\n if (password_verify($user_password_old, $select[\"user_password_hash\"])) {\n\n // now it gets a little bit crazy: check if we have a constant HASH_COST_FACTOR defined (in config/hashing.php),\n // if so: put the value into $hash_cost_factor, if not, make $hash_cost_factor = null\n $hash_cost_factor = (defined('HASH_COST_FACTOR') ? HASH_COST_FACTOR : null);\n\n // crypt the user's password with the PHP 5.5's password_hash() function, results in a 60 character hash string\n // the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using PHP 5.3/5.4, by the password hashing\n // compatibility library. the third parameter looks a little bit shitty, but that's how those PHP 5.5 functions\n // want the parameter: as an array with, currently only used with 'cost' => XX.\n $user_password_hash = password_hash($user_password_new, PASSWORD_DEFAULT, array('cost' => $hash_cost_factor));\n\n // write users new hash into database\n $update = $this->db->query(\n 'UPDATE users SET user_password_hash = :user_password_hash WHERE user_id = :user_id',\n array(\n \"user_password_hash\"=>$user_password_hash,\n \"user_id\"=>$_SESSION['user_id']\n )\n );\n\n // check if exactly one row was successfully changed:\n if ($update > 0) {\n $this->messages[] = MESSAGE_PASSWORD_CHANGED_SUCCESSFULLY;\n } else {\n $this->errors[] = MESSAGE_PASSWORD_CHANGE_FAILED;\n }\n } else {\n $this->errors[] = MESSAGE_OLD_PASSWORD_WRONG;\n }\n } else {\n $this->errors[] = MESSAGE_USER_DOES_NOT_EXIST;\n }\n }\n }", "public function newpass()\n {\n if(isset($_POST['LastPassword']) && isset($_POST['NewPassword']))\n {\n if(!empty($_POST['LastPassword']) && !empty($_POST['NewPassword']))\n {\n $this->_oldPass = md5($_POST['LastPassword']);\n $this->_newPassMD5 = md5($_POST['NewPassword']);\n $this->_id = $_SESSION['user_id'];\n $this->_email = $_SESSION['user_email'];\n\n $user = $this->model->checkPassword($this->_id);\n if(!empty($user))\n {\n if($this->_oldPass == $user['Password'])\n {\n if($this->model->changePassword($this->_email, $this->_newPassMD5))\n {\n // Si ok (true) alors on renvoi sur la page de profil\n $messageFlash = 'Your new password has been updated !';\n $this->coreSetFlashMessage('sucess', $messageFlash, 6);\n header('Location:?module=profile');\n exit();\n }\n else\n {\n // Erreur !\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'An error occur. Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Mauvais password\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'Wrong password ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Pas de user\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'An error occur ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Pas de password\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'No password send ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }\n else\n {\n // Pas de post\n define(\"TITLE_HEAD\", \"An error occur.\");\n $messageFlash = 'No password send ! Please try again.';\n $this->coreSetFlashMessage('error', $messageFlash, 3);\n header('Location:?module=password&action=change');\n exit();\n }\n }", "public function setPassword(string $password): void\n {\n }", "public function update_password() {\n $this->authenticate->check();\n $data['title'] = translate('change_password');\n $city_join = array(\n array(\n 'table' => 'app_services',\n 'condition' => 'app_city.city_id=app_services.city',\n 'jointype' => 'inner'\n )\n );\n $top_cities = $this->model_customer->getData('app_city', 'app_city.*', 'app_services.status=\"A\"', $city_join, 'city_id', 'city_id', '', 12, array(), '', array(), 'DESC');\n $data['topCity_List'] = $top_cities;\n $this->load->view('front/profile/change_password', $data);\n }", "public function changePassword(User $user){\n //username+emp-id+current-year\n $password = $user->username.$user->profile->emp_id.\\Carbon\\Carbon::now()->year;\n $user->update(['password' => $password]);\n return redirect()\n ->back()\n ->with('status','Password reseted');\n }", "public function setNewPassword()\n {\n PasswordResetModel::setNewPassword(\n Request::post('user_name'), Request::post('user_password_reset_hash'),\n Request::post('user_password_new'), Request::post('user_password_repeat')\n );\n Redirect::to('index');\n }", "function changePassword($data){\r\n if(!empty($this->user_id) || $this->matchPasswordForUsername($data['userName'],$data['code'])){\r\n if(!empty($this->user_id)){\r\n $data['userName'] = $this->user_profile['username'];\r\n }\r\n if($data['newpwd']==$data['newpwdagn']){\r\n\r\n\t\t\t// check if the password is strong\r\n\t\t\tif(!$this->isPasswordStrong($data['newpwd'])){\r\n\t\t\t\t$this->setStdError('weak_password');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n // if the password is one of last n passwords\r\n if($this->isOneOfLastNPasswords($data['newpwd'])){\r\n $this->setError('Your password is one of last '.$this->app_config['password_no_repeat'].' passwords.');\r\n return false;\r\n }\r\n\r\n global $pdo;\r\n try{\r\n $update=$pdo->prepare(\"UPDATE users SET `password`=?, `status` = 1 WHERE id= ?\");\r\n $userid = $this->getUserIdFromUsername($data['userName']);\r\n $update->execute(array($this->getPasswordHashOfUser($data['userName'],$data['newpwd']), $userid));\r\n //update the password log\r\n if(empty($this->user_id)){\r\n $this->user_id = $userid;\r\n }\r\n $this->updatePasswordLog($this->getPasswordHashOfUser($data['userName'],$data['newpwd']));\r\n\r\n $this->updatePasswordResetQueue($userid);\r\n\t\t\t\t\t$log = debug_backtrace();\r\n\t\t\t\t\t$this->createActionLog($log);\r\n return true;\r\n }\r\n catch(PDOException $e){\r\n $this->setError($e->getMessage());\r\n return false;\r\n }\r\n\r\n }else{\r\n $this->setError(\"Passwords entered do not match. Please check and type again.\");\r\n return false;\r\n }\r\n }\r\n else{\r\n $this->setError(\"Password was not reset.\");\r\n return false;\r\n }\r\n }", "public function change_password() {\n $this->check_auth();\n $id = $this->input->post('id');\n $email = $this->input->post('email');\n $pass = $this->input->post('password');\n $new_pass = $this->input->post('new_password');\n if (!empty($id) && !empty($email) && !empty($pass) && !empty($new_pass)) {\n if (intval($id) === intval($this->user_id)) {\n $user = $this->ion_auth_model->login($email, $pass);\n if (!$user) {\n return $this->send_error('INVALID_LOGIN');\n }\n $update['salt'] = $this->ion_auth_model->salt();\n $update['password'] = $this->ion_auth_model->hash_password($new_pass, $update['salt']);\n if (!$this->users_model->where(array('id' => $this->user_id, 'email' => $email))->update($update)) {\n return $this->send_error('UPDATE_ERROR');\n }\n $user = $this->ion_auth_model->login($email, $new_pass);\n if (!$user) {\n return $this->send_error('RELOGIN_FAIL');\n }\n $key = $this->users_model->set_privatekey(true);\n if (!$key) {\n $this->ion_auth->logout();\n return $this->send_error('ERROR');\n }\n return $this->send_response(array(\n 'privatekey' => $key,\n 'user_id' => $this->ion_auth->user()->row()->id\n ));\n }\n }\n return $this->send_error('ERROR');\n }", "public function testUpdatePasswordsDontMatch(): void { }", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function update_password() {\n\t\t$cur_password=$this->input->post('current_password');\n\t\t$new_password=$this->input->post('new_password');\n\t\t$confirm_password=$this->input->post('confirm_password');\n $role_id=$this->session->userdata('role_id');\n $email_id=$this->session->userdata('email_id');\n \n\t\t$this->form_validation->set_rules('current_password', 'Current Password', 'trim|required');\n \t\t$this->form_validation->set_rules('new_password', 'New password', 'trim|required|matches[confirm_password]');\n \t\t$this->form_validation->set_rules('confirm_password', 'Confirm Password', 'trim|required');\n\t\t\n\t\t\n\t\tif($this->form_validation->run() == FALSE) {\n \n $data['category'] = $this->Cat->get_category();\n $data['roles'] = $this->users->get_roles();\n $data['country'] = $this->users->get_country();\n $this->load->view('website_template/header', $data);\n if($role_id=='4'){\n $this->load->view('website/user/change_password', $data);\n }else if($role_id=='6'){\n $this->load->view('website/agent/change_password', $data);\n }\n \n $this->load->view('website_template/footer');\n\t\t\t\n\t\t} else {\n\t\t\t $query = $this->users->checkOldPass($cur_password,$role_id,$email_id);\n if($query==1){\n $savequery = $this->users->saveNewPass($new_password,$email_id,$role_id);\n if($savequery){\n $this->session->set_flashdata('msg', 'Password updated successfully');\n if($role_id=='4'){\n redirect('user/change_password');\n }else if($role_id=='6'){\n redirect('agent/profile');\n }\n }\n }else{\n $this->session->set_flashdata('msg', 'Incorrect password ,Please check.');\n }\n \n\t\t}\n\t}", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "function changeUserPassword($argArrPOST) {\n //print_r($argArrPOST);\n $objValid = new Validate_fields;\n $objCore = new Core();\n $objValid->check_4html = true;\n\n $objValid->add_text_field('Current Password', $argArrPOST['frmPassword'], 'text', 'y', 20);\n $objValid->add_text_field('New Password', strip_tags($argArrPOST['frmNewPassword']), 'text', 'y', 20);\n $objValid->add_text_field('Confirm New password', strip_tags($argArrPOST['frmNewConfPassword']), 'text', 'y', 20);\n\n if ($objValid->validation()) {\n $varErrorMsgFirst = 'Please enter required fields!';\n } else {\n $varErrorMsg = $objValid->create_msg();\n }\n\n if ($varErrorMsg) {\n $objCore->setErrorMsg($varErrorMsg);\n return false;\n }\n\n $arrUserFlds = array('Password');\n $varUserWhere = ' 1 AND pkUserID = \\'' . $_SESSION['ASP_UserID'] . '\\'';\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n //echo $arrUserList[0]['Password'];echo \"<br/>\";\n //echo $argArrPOST['frmPassword'];die;\n if ($arrUserList[0]['Password'] == md5(trim($argArrPOST['frmPassword']))) {\n $varUsersWhere = ' pkUserID =' . $_SESSION['ASP_UserID'];\n $arrColumnAdd = array(\n 'Password' => md5(trim($argArrPOST['frmNewPassword'])),\n 'UserModifiedDate' => 'now()'\n );\n\n $varUserID = $this->update(TABLE_USERS, $arrColumnAdd, $varUsersWhere);\n\n $objCore->setSuccessMsg(FRONT_END_PASSWORD_SUCC_CHANGE);\n return true;\n } else {\n $objCore->setErrorMsg(FRONT_END_INVALID_CURENT_PASSWORD);\n return false;\n }\n }", "function setPassword( $user, $password ) {\n global $shib_pretend;\n\n return $shib_pretend;\n }", "public function changePassword() {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'change_password';\n\t\t$data['pageName'] = 'Change Password';\n\t\tif($data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\tif($data['common_data']['user_data']['account_type'] == FACEBOOK_ACCOUNT_TYPE){\n\t\t\theader(\"Location: \".ROUTE_ERROR_PAGE);\n\t\t\tdie();\n\t\t}\n\n\t\t$data['tutor_details'] = $this->profile_model->getTutorDetailsById($data['common_data']['user_id']);\n\t\t//Getting all payment details\n\t\t$data['payment_details'] = $this->payment_model->getPaymentDetailsById($data['common_data']['user_id']);\n\t\t$data['tutor_badges'] = $this->user_model->getTutorBadges($data['common_data']['user_id']);\n\t\t$data['badges'] = $this->user_model->getBadges();\n\n\t\t$template['body_content'] = $this->load->view('frontend/profile/change-password', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "function setPassword($password) {\n return false;\n }", "public function changepassword() {\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->phone_no) && !empty($request_data->user_token) && !empty($request_data->old_password) && !empty($request_data->new_password) && !empty($request_data->confirm_password):\n\n // Check if phone no exists\n $data = $this->User->findUser($request_data->phone_no);\n\n // Check if record exists\n if (count($data) != 0) {\n // Check uuid entered is valid\n if ($data[0]['User']['verified'] === false) {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User not verified';\n } elseif ($request_data->user_token != $data[0]['User']['user_token']) { // User Token is not valid\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User Token is invalid';\n } elseif (md5($request_data->old_password) != $data[0]['User']['password']) { // User password is matching or not.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Password did not match';\n } elseif (trim($request_data->new_password) == trim($request_data->old_password)) { // New password is not equal to old password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to old password.';\n } elseif (trim($request_data->new_password) != trim($request_data->confirm_password)) { // New password is not equal to confirm password.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'New Password is not equal to confirm password.';\n } else {\n\n $dataArray = array();\n $dataArray['User']['_id'] = $data[0]['User']['_id'];\n $dataArray['User']['password'] = md5(trim($request_data->new_password));\n\n if ($this->User->save($dataArray)) {\n $success = true;\n $status = SUCCESS;\n $message = 'Settings has been changed.';\n } else {\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Phone no. not registered.';\n }\n break;\n // User Token blank in request\n case!empty($request_data) && empty($request_data->user_token):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Token cannot be blank.';\n break;\n // Phone no. blank in request\n case!empty($request_data) && empty($request_data->phone_no):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Phone no. cannot be blank.';\n break;\n // Old Password blank in request\n case!empty($request_data) && empty($request_data->old_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Old password cannot be blank.';\n break;\n // New Password blank in request\n case!empty($request_data) && empty($request_data->new_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'New password cannot be blank.';\n break;\n // Confirm Password blank in request\n case!empty($request_data) && empty($request_data->confirm_password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Confirm password cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }", "public function password()\n {\n }", "public function change_user_password() {\n \n // Check if data was submitted\n if ( $this->CI->input->post() ) {\n\n // Add form validation\n $this->CI->form_validation->set_rules('current_password', 'Current Password', 'trim');\n $this->CI->form_validation->set_rules('new_password', 'New Password', 'trim');\n $this->CI->form_validation->set_rules('repeat_password', 'Repeat Password', 'trim');\n \n\n // Get data\n $current_password = $this->CI->input->post('current_password');\n $new_password = $this->CI->input->post('new_password');\n $repeat_password = $this->CI->input->post('repeat_password');\n\n // Check form validation\n if ($this->CI->form_validation->run() === false) {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('please_fill_all_required_fields')\n );\n\n echo json_encode($data);\n\n } else {\n \n // Verify if new password match the repeat password\n if ( $new_password !== $repeat_password ) {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('password_password')\n );\n\n echo json_encode($data);\n \n } else if ( $new_password === $current_password ) {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('no_password_difference')\n );\n\n echo json_encode($data); \n \n } else if ( ( strlen($new_password) < 6 ) || ( strlen($new_password) > 20 ) ) {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('mm25')\n );\n\n echo json_encode($data); \n \n } else if ( preg_match('/\\s/', $new_password) ) {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('mm26')\n );\n\n echo json_encode($data); \n \n } else if ( !$this->CI->user->check( $this->CI->session->userdata['username'], $current_password ) ) {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('incorrect_current_password')\n );\n\n echo json_encode($data); \n \n } else {\n \n $this->CI->db->where('username', $this->CI->session->userdata['username']);\n\n $data = array(\n 'password' => $this->CI->bcrypt->hash_password($new_password)\n );\n\n $this->CI->db->update('users', $data);\n\n if ( $this->CI->db->affected_rows() ) {\n\n $data = array(\n 'success' => TRUE,\n 'message' => $this->CI->lang->line('password_changed')\n );\n\n echo json_encode($data);\n\n } else {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('password_not_changed')\n );\n\n echo json_encode($data); \n \n }\n \n }\n \n }\n \n }\n \n }", "function updateUserPassword()\n {\n $id = $this->input->post('id');\n $password = $this->input->post('password');\n\n //$resultPas = $this->user_model->matchOldPassword($id, $password);\n\n $usersData = array('password' => getHashedPassword($password), 'updatedBy' => $this->vendorId,\n 'update_time' => date('Y-m-d H:i:s'));\n\n $result = $this->user_model->changePassword($id, $usersData);\n\n if ($result > 0) {\n $this->session->set_flashdata('success', '密码更新成功.');\n echo(json_encode(array('status' => TRUE)));\n } else {\n $this->session->set_flashdata('error', '密码更新失败.');\n echo(json_encode(array('status' => FALSE)));\n }\n\n //redirect('userListing');\n }", "function admin_change_password() {\r\n\r\n $this->layout = 'default';\r\n\r\n $this->checklogin();\r\n\r\n// echo ' e10adc39491e240';\r\n// echo \"<br>\".$new = $this->encrypt_data(123456);\r\n// echo \"<br>old \".$old = $this->decrypt_data($new);\r\n\r\n if(!empty($this->data))\r\n {\r\n //$this->pre($this->data);\r\n //exit;\r\n\r\n $errorarray = array();\r\n\r\n if (isset($this->data['User']['oldpwd']) && (trim($this->data['User']['oldpwd']) == '' || trim($this->data['User']['oldpwd']=='Password'))) {\r\n $errorarray['enter_oldpwd'] = ENTER_OLD_PASSWORD;\r\n }\r\n else\r\n {\r\n $check_len_pass = strlen(trim($this->data['User']['oldpwd']));\r\n\r\n if($check_len_pass<5)\r\n $errorarray['oldpwd_minlen'] = PASSWORD_LENGTH;\r\n else\r\n {\r\n $check_user = $this->User->find('first', array('conditions' => array('status' => 0, 'password'=>md5($this->data['User']['oldpwd']) ,'id'=>$this->Session->read(md5(SITE_TITLE).'USERID'))));\r\n\r\n// $this->pre($check_user);\r\n// exit;\r\n if(empty($check_user))\r\n {\r\n $errorarray['pass_not_match'] = OLDNOTMATCH;\r\n }\r\n }\r\n }\r\n\r\n if (isset($this->data['User']['newpwd']) && (trim($this->data['User']['newpwd']) == '' || trim($this->data['User']['newpwd']=='Password'))) {\r\n $errorarray['newpass'] = ENTER_NEW_PASSWORD;\r\n }\r\n else\r\n {\r\n $check_len_pass = strlen(trim($this->data['User']['newpwd']));\r\n\r\n if($check_len_pass<5)\r\n $errorarray['newpass_minlen'] = NEW_PASSWORD_LENGTH;\r\n }\r\n if (isset($this->data['User']['confirmpwd']) && (trim($this->data['User']['confirmpwd']) == '' || trim($this->data['User']['confirmpwd']) == 'Password')) {\r\n $errorarray['confpass'] = ENTER_CONFPASS;\r\n }\r\n else\r\n {\r\n $check_len_confpass = strlen(trim($this->data['User']['confirmpwd']));\r\n\r\n if($check_len_confpass<5)\r\n $errorarray['confpass_minlen'] = CONF_PASSWORD_LENGTH;\r\n }\r\n\r\n if (trim($this->data['User']['newpwd']) != '' && trim($this->data['User']['confirmpwd']) != '' && strlen(trim($this->data['User']['newpwd']))>=5 && strlen(trim($this->data['User']['confirmpwd']))>=5 && trim($this->data['User']['newpwd']) != trim($this->data['User']['confirmpwd'])) {\r\n $errorarray['conflict'] = NEWCONFPASS;\r\n }\r\n\r\n\r\n $this->set('errorarray',$errorarray);\r\n\r\n if(empty($errorarray))\r\n {\r\n// $this->pre($errorarray);\r\n// exit;\r\n\r\n $update_user_dtl['User']['id'] = $this->Session->read(md5(SITE_TITLE).'USERID');\r\n $update_user_dtl['User']['password'] = md5($this->data['User']['newpwd']);\r\n $update_user_dtl['User']['encrypt_password'] = $this->encrypt_pass($this->data['User']['newpwd']);\r\n\r\n //$this->pre($this->Session->read());\r\n\r\n $name = $this->Session->read(md5(SITE_TITLE).'USERNAME');\r\n $email = $this->Session->read(md5(SITE_TITLE).'USEREMAIL');\r\n $new_pass = $this->data['User']['newpwd'];\r\n\r\n //$this->email_client_changepassword($name,$email,$new_pass);\r\n// $this->pre($update_user_dtl);\r\n// exit;\r\n\r\n $this->User->save($update_user_dtl);\r\n $this->redirect(DEFAULT_ADMINURL . 'users/change_password/succhange');\r\n }\r\n// $this->pre($errorarray);\r\n// exit;\r\n }\r\n }", "public function setPassword(string $employeeId, string $password);", "public function password($data){\n\n\n \t$q = \"SELECT password FROM user_table WHERE password='$data[current_pass]'\";\n\n \t$result = $this->connection->query($q);\n\n \t // check if current password is correct\n\n \tif($result->num_rows >0){\n\n \n \t\t$id = $_SESSION['id'];\n\n\t \t\tif($data['new_pass']==$data['re_pass'])\n\t \t\t{\n\n\t \t\t\tif(strlen($data['new_pass'])<8){\n\n\t\t\t\t$_SESSION['message'] = \"Password must contain 8 letters\";\n\t\t\t\t $_SESSION['msg_type'] = \"danger\";\n\t\t\t\t}else{\n\n\t \t\t$q=\"UPDATE user_table SET password='$data[new_pass]' WHERE id='$id'\";\n\n\t \t\t$result = $this->connection->query($q);\n\n\t \t\t$_SESSION['message'] = \"Successfully changed\";\n\t \t\t$_SESSION['msg_type'] = \"success\";\n\n\t\t \t}\n\t \n\n\t \t}\n\t \telse\n\t \t{\n\n\t \t\t$_SESSION['message'] = \"New password does not match\";\n\t \t\t$_SESSION['msg_type'] = \"warning\";\n \n\t \t}\n\t }\n\t else\n\t {\n\n\t \t$_SESSION['message']= \"Invalid current password\";\n\t \t$_SESSION['msg_type'] = \"danger\";\n \n\t }\n }", "public function changePassword(){\n require_once \"./application/models/input_manager.php\";\n\n //Genero un array che conterà gli eventuali errori\n $errors = array();\n\n //Verifico il metodo di richiesta\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n //Verifico che tutti i campi siano stati compilati e che non siano vuoti\n if(isset($_POST['password']) && !empty($_POST['password']) &&\n isset($_POST['repassword']) && !empty($_POST['repassword']) &&\n isset($_POST['email']) && !empty($_POST['email'])){\n\n //Creo un nuovo input manager e testo i campi inseriti\n $im = new input_manager();\n\n $email = filter_var($im->checkInput($_POST['email']), FILTER_SANITIZE_EMAIL);\n $password = filter_var($im->checkInput($_POST['password']), FILTER_SANITIZE_STRING);\n $repassword = filter_var($im->checkInput($_POST['repassword']), FILTER_SANITIZE_STRING);\n\n //Verifico che la lunghezza dei campi corrisponda con quella consentita e che non contengano valori non validi\n if(!(strlen($email) > 0 && strlen($email) <= 50) || !filter_var($email, FILTER_VALIDATE_EMAIL)){\n array_push($errors, \"L'email deve essere formattata nel seguente modo: [email protected]\");\n }\n if(!(strlen($password) >= 8) || !preg_match('/^[\\p{L}a-zA-Z\\d._\\-*%&!?$@+#+,;:]+$/', $password)){\n array_push($errors, \"La password deve essere almeno lunga 8 caratteri\");\n }\n\n //Se sono di lunghezze sbagliate o contengono caratteri illegali ritorno l'errore\n if(count($errors) != 0){\n $_SESSION['errors'] = $errors;\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n\n //Verifico che la password sia di almeno 8 caratteri\n if(!(strlen($password) >= 8)){\n //Genero l'errore\n array_push($errors, \"La password deve essere almeno lunga 8 caratteri\");\n $_SESSION['errors'] = $errors;\n\n //Riporto l'utente alla pagina per mostrargli l'errore\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n\n //Verifico che le due password siano uguali\n if($password == $repassword){\n //Imposto la nuova password nel database\n (new utente_model)->setPassword($email, $password);\n (new utente_model)->setFirstLogin($email);\n\n //Indirizzo l'utente alla pagina di login\n header('Location: ' . URL . 'login');\n exit();\n }else{\n //Se sono diverse genero l'errore\n array_push($errors, \"Le password devono essere uguali\");\n $_SESSION['errors'] = $errors;\n\n //Riporto l'utente alla pagina per mostrargli l'errore\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n }else{\n //Se non vengono inseriti tutti i dati genero l'errore\n array_push($errors, \"Inserire la nuova password\");\n $_SESSION['errors'] = $errors;\n\n //Riporto l'utente alla pagina per mostrargli l'errore\n header('Location: ' . URL . 'firstLogin');\n exit();\n }\n }\n }", "public function password($user_uuid)\n {\n $this->load->helper(array('form', 'url'));\n $this->load->library('vision_users');\n $this->load->library('form_validation');\n $this->load->model('users_m');\n \n $view_data['success_msg'] = '';\n $view_data['error_msg'] = '';\n \n $user = $this->users_m->get_user_by_uuid($user_uuid);\n \n // check to see if user has accepted their terms first\n if (intval($user['terms_accepted']) != 1)\n {\n redirect('/signup/confirm/' . $user['uuid']);\n exit();\n }\n \n // check to see if they have already set a password\n if ($user['password'] != '')\n {\n redirect('/signup/s/' . $user['uuid']);\n exit();\n }\n \n $this->form_validation->set_rules('new', 'Password', 'required|min_length[8]|max_length[20]|matches[new_confirm]');\n $this->form_validation->set_rules('new_confirm', 'Confirm Password', 'required');\n \n if ($this->form_validation->run() == FALSE)\n {\n // display the form & set the flash data error message if there is one\n //$view_data['error_msg'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message');\n }\n else\n { \n $user = $this->users_m->get_user_by_uuid($user_uuid);\n \n if ($user['password'] != '')\n {\n $update_data = array('password' => '');\n \n $this->users_m->update_user($user['id'], $update_data);\n }\n \n $email = $user['email'];\n \n $old_password = '';\n $new_password = $this->input->post('new', TRUE);\n \n $change = $this->vision_users->change_password($email, $old_password, $new_password);\n \n if ($change['type'] == 'success')\n { \t\n redirect('/signup/s/' . $user['uuid']);\n }\n else\n {\n $view_data['error_msg'] = $change['message'];\n }\n }\n \n $view_data['user_uuid'] = $user_uuid;\n \n $this->load->view('signup/password', $view_data);\n }", "public function setPassword($password)\n {\n $this->new_password = $password;\n $this->pass = Yii::$app->security->generatePasswordHash($password);\n }", "public function updatepassword() {\n $request = Request::all();\n $rules = ['old_password' => 'required', 'password' => 'required|confirmed|min:6'];\n $v = Validator::make($request, $rules);\n if ($v->fails()) {\n return redirect()->back()->withErrors($v->errors());\n }\n $user = User::find(Auth::user()->id);\n if (!Hash::check($request['old_password'], $user->password)) {\n return redirect()->back()->withErrors([\"old_password\" => [0 => \"The old password does not match.\"]]);\n }\n\n $user->password = bcrypt($request['password']);\n $user->save();\n return redirect()->back()->with('status', 'Your password changed succesfully');\n }", "function update_buyer_password() {\n\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t$this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[20]|matches[password_confirmation]');\n\t\t$this->form_validation->set_rules('password_confirmation', 'Password Confirmation', 'required');\n\t\t\n\t if ($this->form_validation->run() == true) {\n\t \t \n\t\t $password = $this->input->post('password');\n\t\t $user_id = $this->input->post('user_id');\n\n\t\t\tif ($this->ion_auth->update_buyer_password($password,$user_id)) {\n\t\t\t\tredirect('site/buyer_update_success');\n\t\t\t} else {\n\t\t\t\tredirect('site/account_management_buyer');\n\t\t\t}\n\n\t\t} else {\n\t\t\t\n\t\t\t$user_id = $this->session->userdata('user_id');\n\t\t\t$this->load->model('data_model');\n\t\t\t$data['buyers_account_data'] = $this->data_model->get_buyers_account_data($user_id);\n\t\t\t$this->load->view('account_management_buyer_view', $data);\n\t }\n}", "public function update()\n {\n $new_password = $this->input->post('inputNewPassword');\n if ($this->authentication->change_password($new_password))\n {\n $this->flash_message('Password Akun Berhasil di Update');\n } else {\n $this->flash_message('Password Akun Gagal di Update');\n }\n redirect($this->data['user'].'/editPassword');\n }", "public function updatePassword(passRequest $request){\n \n \n \t$user = Auth::user();\n \t$oldPassword = $request['passwordold'];\n $newPassword = $request['password'];\n\n if (Hash::check($oldPassword, $user->password)) {\n $request->user()->fill(['password'=>Hash::make($newPassword)])->save();\n return redirect()->action('ItemsController@index');\n }\n else\n {\n \treturn redirect()->back()->with('alert','Thay đổi không thành công');\n }\n }", "public function changePassword(){\n $user=User::find(auth()->id());\n $user->password=bcrypt(request('new_password'));\n $user->save();\n return response()->json('Password Updated Successfully');\n }", "public function change_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['login'])){\n // try verifying the user\n if($this->User->login($_POST['username'], $_POST['old_pass'])) {\n if($_POST['new_pass']==$_POST['new_pass_verify']){\n $this->User->setPassword($User->getId(), $_POST['new_pass']);\n session_write_close();\n header(\"Location: \".app::site_url(''));\n exit(0);\n } else {\n $flash = \"I'm sorry, but the new passwords did not match.\";\n }\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array('flash' => $flash);\n }", "public function setPasswordAction()\n {\n $userId = $this->params()->fromRoute('userId', null);\n $token = $this->params()->fromRoute('token', null);\n\n if ($userId === null || $token === null) {\n return $this->notFoundAction();\n }\n\n $user = $this->getUserMapper()->findById($userId);\n\n if (!$user) {\n return $this->notFoundAction();\n }\n\n $record = $this->getUserRegistrationMapper()->findByUser($user);\n\n if (!$record || !$this->userRegistrationService->isTokenValid($user, $token, $record)) {\n // Invalid Token, Lets surprise the attacker\n return $this->notFoundAction();\n }\n\n if ($record->isResponded()) {\n // old link, password is already set by the user\n return $this->redirectToPostVerificationRoute();\n }\n\n $form = $this->getServiceLocator()->get('HtUserRegistration\\SetPasswordForm');\n\n if ($this->getRequest()->isPost()) {\n $form->setData($this->getRequest()->getPost());\n if ($form->isValid()) {\n $this->userRegistrationService->setPassword($form->getData(), $record);\n\n return $this->redirectToPostVerificationRoute();\n }\n }\n\n return array(\n 'user' => $user,\n 'form' => $form\n );\n }", "public function changePasswordAction()\n {\n $errors = [];\n if(!empty($_POST)){\n $user = Auth::getUser();\n\n $userValidation = new UserValidation($_POST, ['password']);\n $errors = $userValidation->getNamedErrors();\n\n if(empty($errors)){\n if(password_verify($_POST['oldpass'], $user->password)){\n $user->changePassword($_POST['password']);\n Extra::setMessageCookie(\"Password changed successfully.\");\n $this->redirect(\"/manage-account/\");\n }\n $errors['oldpass'] = \"Password you entered is incorrect.\";\n }\n }\n View::renderTemplate(\"LoggedUser/change-password.html\", [\n 'errors' => $errors\n ]);\n }", "public function updatePassword()\n {\n $session = \\Config\\Services::session();\n if ($session->status != 'pengguna') {\n return redirect()->to('/dashboard');\n }\n\n\n $model = new PenggunaModel();\n helper('form');\n $this->form_validation = \\Config\\Services::validation();\n\n\n $password = password_hash($this->request->getPost('password'), PASSWORD_DEFAULT);\n\n $data = [\n 'NIK' => $this->request->getPost('NIK'),\n 'password' => $this->request->getPost('password'),\n 'password2' => $this->request->getPost('password2'),\n ];\n\n $id = $this->request->getPost('NIK');\n\n if ($this->form_validation->run($data, 'editPassword') == FALSE) {\n $error = $this->form_validation->listErrors();\n session()->setFlashdata('error', '<br><small class=\"red-text\">\n ' . $error . '</small>');\n return redirect()->to($_SERVER['HTTP_REFERER']);;\n } else {\n $data['password'] = $password;\n unset($data['password2']);\n $model->updatePengguna($data, $id);\n session()->setFlashdata('tipe', 'password');\n session()->setFlashdata('success', 'diubah');\n return redirect()->to('http://localhost:8080/profile/');\n }\n }", "public function changePassword()\n {\n $this->validateOnly('password', [\n 'password' => 'bail|nullable|required_with:password_confirmation|string|confirmed',\n 'current_password' => 'bail|required',\n ]);\n\n if (!Hash::check($this->current_password, $this->user->password)) {\n $this->addError('current_password', 'Your current password is incorrect.');\n return;\n }\n\n $this->user->password = bcrypt($this->password);\n $this->user->save();\n $this->toast('Password has been changed!', 'success');\n $this->emit('password-updated');\n $this->reset(['password', 'password_confirmation', 'current_password']);\n }", "public function setpassword_process() { \n $code = $this->uri->segment(2); \n $userData = $this->common->_getRow('user',array('code' => $code));\n if ($userData) {\n if ($this->input->server('REQUEST_METHOD') === \"POST\") {\n $this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[6]');\n $this->form_validation->set_rules('confirm_password', 'Confirm Password', 'trim|required|matches[password]');\n if ($this->form_validation->run() != FALSE) {\n $password = md5($this->input->post('password'));\n $updateData = $this->common->update('user',array('userID' => $userData['userID']),array('code' => '', 'password' => $password));\n if ($updateData) {\n $this->app->message('Your password has been reset successfully.', 'success');\n }\n }\n }\n } else {\n $this->app->message('Your reset password link has been expired.', 'error');\n }\n redirect(base_url());\n }", "public function postReset()\n {\n /////////////////////////////////////////\n // Make validation rules and validates //\n /////////////////////////////////////////\n $rules= [\n 'oldpassword' => 'required',\n 'password' => 'required|confirmed',\n ];\n\n $validator = Validator::make(Input::all(),$rules);\n \n // Input valid?\n if ( ! $validator->passes()) {\n Flash::error($validator->messages());\n return Redirect::back();\n }\n\n $checkPassword = array(\n 'email' =>Auth::user()->email, \n 'password'=>Input::get('oldpassword'),\n 'active' =>1 \n );\n\n //Old password valid?\n if( !$errors=Auth::attempt($checkPassword)){\n\n Flash::error('Old password you provided is not valid');\n return Redirect::back();\n }\n \n \n $credentials = array('email' => $checkPassword['email']);\n\n $user = User::find(Auth::user()->id);\n $user->password = Hash::make(Input::get('password'));\n\n if ($user->save()) {\n Flash::success('Your password has been changed');\n return Redirect::to('publisher');\n }\n \n dd('byanze!');\n Auth::login($user);\n Flash::success('You password has been changed successfully ');\n return Redirect::to('publisher');\n\n }", "public function updatePwd(){\n if(\n !empty($_POST['pwd1']) &&\n !empty($_POST['pwd2']) &&\n $_POST['pwd1'] == $_POST['pwd2']){\n $pwd = $_POST['pwd1'];\n $id = $_SESSION['userID'];\n $user = new User();\n $user->updatePwd($pwd, $id);\n }\n else {\n echo \"false\";\n }\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function partner_change_password()\n {\n $this->partner_model->check_login();\n $user_id = $this->session->userdata('user_id'); \n if(!empty($_POST) && isset($_POST))\n {\n $info = array('password' => md5($this->input->post('newpassword'))); \n $this->db->where('id', $user_id);\n $this->db->where('role_id',4);\n $this->db->update('users', $info); \n $this->session->set_flashdata('message',\"Password has been changed successfully\"); \n redirect(base_url().'company/partner_change_password'); \n }\n $this->load->view('partner_change_password');\n }", "public function update_password($service_name = '',$password = ''){\n\t\t\n\t\tself::delete_password($service_name);\n\t\tself::set_password($service_name,$password);\n\t\t\n\t\treturn;\n\t}", "public function editUserPasswordChk() {\r\n\r\n $table_to_pass = 'mst_users';\r\n $fields_to_pass = array('user_id', 'user_password');\r\n $condition_to_pass = array(\"user_password\" => base64_encode($this->input->post('old_user_password')));\r\n $arr_login_data = $this->user_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\r\n if (count($arr_login_data)) {\r\n echo 'true';\r\n } else {\r\n echo 'false';\r\n }\r\n }" ]
[ "0.8361884", "0.7911512", "0.7806682", "0.77983814", "0.76666105", "0.7660128", "0.76538527", "0.76482564", "0.76303697", "0.7619053", "0.755062", "0.75267404", "0.75108135", "0.7507412", "0.74795854", "0.7438106", "0.74295264", "0.7383053", "0.7378999", "0.73785174", "0.7370705", "0.7370705", "0.7370705", "0.7350545", "0.73443896", "0.7338563", "0.7330453", "0.7318272", "0.7306189", "0.72976273", "0.72860557", "0.72491014", "0.72355705", "0.72300935", "0.7229956", "0.7225124", "0.7219033", "0.72127485", "0.71975267", "0.71960425", "0.7185353", "0.71822184", "0.71775603", "0.7176464", "0.7175998", "0.716873", "0.7156813", "0.7153471", "0.71523684", "0.7151869", "0.71474355", "0.71466625", "0.7137489", "0.71363777", "0.7132722", "0.7127945", "0.7109041", "0.7105073", "0.7080187", "0.70749444", "0.7074912", "0.70745474", "0.70713997", "0.70674103", "0.7063445", "0.7055263", "0.70509404", "0.7046611", "0.70377946", "0.7032705", "0.7030024", "0.70291233", "0.70052403", "0.69928503", "0.6990142", "0.6984615", "0.6982011", "0.6978857", "0.69743925", "0.6974297", "0.6971105", "0.6963609", "0.69634527", "0.69621205", "0.69564945", "0.6956248", "0.6956195", "0.6954801", "0.6953982", "0.69485646", "0.6940032", "0.69384223", "0.6937275", "0.6935541", "0.69339657", "0.6933633", "0.69332397", "0.6931455", "0.69307894", "0.69301397" ]
0.8359503
1
this method allows user to set his device_token device_token is mandatory field
public function setDeviceTokenAction(){ $data = $this->getRequestData(); $this->getDeviceSession()->getUserId(); if($data['device_token']){ $session = Workapp_Session::getBySessionUid($data['session_uid']); if ($session) { $session->addDeviceToken($data['device_token']); } else { $this->setErrorResponse('This device has no running session which is required by service'); } } else { $this->setErrorResponse('device_token is mandatory field for this request!'); } $this->_helper->json(array('added' => true)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }", "private function set_device(){\n\t\n\t}", "public function actionSetToken()\n {\n if (isset($this->request['token'])) {\n /* @var $userDetails UserDetails */\n $userDetails = UserDetails::model()->findByAttributes(['user_id' => $this->user->id]);\n $userDetails->push_token = $this->request['token'];\n if ($userDetails->save())\n $this->_sendResponse(200, CJSON::encode(['status' => true]));\n else\n $this->_sendResponse(400, CJSON::encode(['status' => false]));\n } else\n $this->_sendResponse(400, CJSON::encode(['status' => false, 'message' => 'Token variable is required.']));\n }", "public function setDevice(Device $device);", "function updateDeviceIdToken($id,$deviceToken,$authToken,$deviceType='')\n {\n $req = $this->db->select('userId')->where('userId',$id)->get('users');\n if($req->num_rows())\n {\n $this->db->update('users',array('deviceToken'=>''),array('userId !='=>$id,'deviceToken'=>$deviceToken));\n $this->db->update('users',array('deviceToken'=>$deviceToken,'authToken'=>$authToken,'deviceType'=>$deviceType),array('userId'=>$id));\n return TRUE;\n }\n return FALSE;\n }", "public function actionUpdateDeviceToken() {\n //validate webservice\n $requiredParams = ['user_id', 'device_type', 'device_token'];\n try {\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n //Fetch access token from HEAD\n $access_token = Yii::$app->request->headers->get('access_token');\n\n $response = [];\n //Fetch existing record\n $accessTokenDetails = UsersAccessTokens::find()->where(['user_id' => $post['user_id'], 'access_token' => $access_token])->one();\n if (!empty($accessTokenDetails)) {\n $accessTokenDetails->device_type = !empty($post['device_type']) ? $post['device_type'] : Yii::$app->params['DEVICE_TYPE']['android'];\n $accessTokenDetails->device_token = !empty($post['device_token']) ? $post['device_token'] : '';\n $accessTokenDetails->save(false);\n return CommonApiHelper::return_success_response(\"Device token has been updated successfully.\", \"\", []);\n } else {\n return CommonApiHelper::return_error_response('Sorry, Please try again.');\n }\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response('Sorry, Please try again.');\n }\n }", "public function setDeviceTokenAction($header_data,$data){\n if( !isset($data['device_token']) ) {\n Library::logging('alert',\"API : setDeviceToken : \".ERROR_INPUT.\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_INPUT, null);\n }\n try{\n $db = Library::getMongo();\n $query = $db->execute('db.users.update({\"device_token\" :\"'.$data[\"device_token\"].'\" }, {$set:{\"device_token\" :\"\"}}, {multi:true} )');\n if($query['ok'] == 0) {\n Library::logging('error',\"API : setDeviceToken (request sent query) mongodb error: \".$query['errmsg'].\" \".\": user_id : \".$userId);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n $user = Users::findById($header_data['id']);\n $user->device_token = $data['device_token']; // token used to send push notification to device\n $user->os = $header_data[\"os\"];\n if( $user->save() ){\n \n require 'components/JAXL3/jaxl.php';\n $client = new JAXL(array(\n 'jid' => $user->jaxl_id,\n 'pass' => $user->jaxl_password,\n 'log_level' => JAXL_ERROR\n ));\n $client->require_xep(array(\n '0077' // registration\n ));\n \n $client->add_cb('on_auth_success', function() {\n $client = $_SESSION[\"client\"];\n $os = $_SESSION[\"os\"];\n $deviceToken = $_SESSION[\"device_token\"];\n $appID = $_SESSION[\"appID\"];\n $client->xeps['0077']->registerPushToken( $os, $deviceToken, $appID, function(){\n Library::output(true, '1', DEVICE_TOKEN_UPDATED, null );\n });\n });\n $client->add_cb('on_auth_failure', function() {\n $userId = $_SESSION[\"userId\"];\n Library::logging('error',\"API : setDeviceToken -> registerPushToken : \".JAXL_AUTH_FAILURE.\" : user_id : \".$userId);\n Library::output(true, '1', DEVICE_TOKEN_UPDATED, null );\n });\n $client->add_cb('on_disconnect', function() {\n Library::output(true, '1', DEVICE_TOKEN_UPDATED, null );\n });\n $_SESSION[\"client\"] = $client;\n $_SESSION[\"userId\"] = $header_data['id'];\n $_SESSION[\"device_token\"] = $user->device_token;\n $_SESSION[\"os\"] = $user->os == 1 ? \"android\" : \"ios\";\n $_SESSION[\"appID\"] = $user->os == 1 ? \"\" : \"com.sociabile.sociabile\"; // requires actual app ID\n $client->start();\n /******* code for subscribe(add) user end **************************************/\n \n// Library::output(true, '1', DEVICE_TOKEN_UPDATED, null );\n }else{\n foreach ($user->getMessages() as $message) {\n $errors[] = $message->getMessage();\n }\n Library::logging('error',\"API : setDeviceToken : \".$errors.\" : user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n } catch (Exception $e) {\n Library::logging('error',\"API : setDeviceToken : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }", "public static function set_token_access() {\n if (SesLibrary::_get('_uuid') || SesLibrary::_get('_uuid') == null) {\n $param = [\n 'uri' => config('app.base_api_uri') . '/generate-token-access?deviceid=' . SesLibrary::_get('_uuid'),\n 'method' => 'GET'\n ];\n $this->__init_request_api($param);\n }\n }", "public function creating(Device $device)\n {\n $device->api_token = bcrypt(Str::random(32));\n }", "public function registerdevice_post()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"POST\")\n\t\t{\n\t\t\t$this->response('Not Acceptable',406);\n\t\t}\n\n\t\t$token = $this->input->post('token');\n\t\t$user_key = $this->input->post('user_key');\n\t\t$platform = $this->input->post('platform');\n\t\t$timezone = $this->input->post('timezone');\n\t\t$latitude = $this->input->post('latitude');\n\t\t$longitude = $this->input->post('longitude');\n\t\t\n\t\tif( empty( $token ) ){\n\t\t\t//Error Response: Requires Device Token\n\t\t\t$this->response( array('status'=>'failed','error' => 'Device Token is required'), 200);\n\t\t}\n\t\t/*else if(empty( $user_key )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'User key is required'), 200);\n\t\t}\n\t\telse if(empty( $timezone )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'Timezone is required'), 200);\n\t\t}\n\t\telse if(empty( $latitude )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'latitude is required'), 200);\n\t\t}\n\t\telse if(empty( $longitude )){\n\t\t\t$this->response( array('status'=>'failed','error' => 'longitude is required'), 200);\n\t\t}*/\n\t\telse{\n\t\t\t//Check it exists\n\t\t\t//If Exists Update\n\t\t\t//Or Insert new\n\t\t\t$this->load->model('Table_model');\n\n\t\t\t$values=array();\n\t\t\t$values['token']= $token;\n\t\t\t$values['user_key'] = $user_key;\n\t\t\t$values['platform'] = ($platform!='')?$platform:'';\n\t\t\t$values['timezone'] = ($timezone!='')?$timezone:''; \n\t\t\t$values['latitude'] = ($latitude!='')?$latitude:''; \n\t\t\t$values['longitude'] = ($longitude!='')?$longitude:'';\n\n\t\t\t$message = $this->Table_model->InsertOrUpdateDevice( $values );\n\n\t\t\t$this->response( $message, 200);\n\t\t}\n\t}", "public function setMdeDeviceId(?string $value): void {\n $this->getBackingStore()->set('mdeDeviceId', $value);\n }", "public function setToken($token){\n $this->token = $token;\n }", "public function setToken(string $token): void;", "public function setToken($token);", "public function setDevice(Device $device)\n {\n $this->device = $device;\n }", "function setToken($token)\n {\n $this->token = $token;\n }", "public function setToken($token)\n {\n $tokenValidator = new \\Paggi\\SDK\\TokenValidation(); //self::$container->get('TokenValidation');\n if ($tokenValidator->isValidToken($token)) {\n self::$token = $token;\n $this->setPartnerIdByToken($token);\n return true;\n }\n return false;\n }", "public function sendDeviceToken(Request $request){\n $token = new DeviceToken();\n error_log(json_encode(Carbon::now()));\n DeviceToken::where('expiry', '<=', Carbon::now())->delete();\n //Create Token string as long as one in not taken\n $bytes = random_bytes(30);\n $tokenString = bin2hex($bytes);\n //Save new token with new expiricy\n $token->token = $tokenString;\n $datetime = new Datetime();\n $token->expiry = $datetime->add(new DateInterval('PT2M'));\n Auth::user()->deviceToken()->save($token);\n return response()->json([\"device_token\" => $token], 201);\n }", "public function set($token);", "public function testSetValidToken(): void\n {\n // setup\n $this->testValidConnect();\n\n $data = [\n 'token' => $this->sessionId\n ];\n\n $url = self::$serverPath . '/token/' . $this->sessionId . '/';\n\n // test body\n $result = $this->postHttpRequest($data, $url);\n\n // assertions\n $this->assertEquals(isset($result->session_id), true, 'Connection failed');\n }", "protected function updateDeviceTokenRequest($api_key, $device_token, $device_type)\n {\n // verify the required parameter 'api_key' is set\n if ($api_key === null || (is_array($api_key) && count($api_key) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $api_key when calling '\n );\n }\n // verify the required parameter 'device_token' is set\n if ($device_token === null || (is_array($device_token) && count($device_token) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $device_token when calling '\n );\n }\n // verify the required parameter 'device_type' is set\n if ($device_type === null || (is_array($device_type) && count($device_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $device_type when calling '\n );\n }\n\n $resourcePath = '/rapi/update_device_token';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // form params\n if ($api_key !== null) {\n $formParams['api_key'] = ObjectSerializer::toFormValue($api_key);\n }\n // form params\n if ($device_token !== null) {\n $formParams['device_token'] = ObjectSerializer::toFormValue($device_token);\n }\n // form params\n if ($device_type !== null) {\n $formParams['device_type'] = ObjectSerializer::toFormValue($device_type);\n }\n // body params\n $_tempBody = null;\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/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\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\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 }", "abstract public function setDeviceInfo(Horde_ActiveSync_Device $data, array $dirty = array());", "public function setDeviceId(?string $value): void {\n $this->getBackingStore()->set('deviceId', $value);\n }", "function checkDeviceToken()\n {\n $sql = $this->db->select('id')->where('deviceToken', $deviceToken)->get('users');\n if($sql->num_rows())\n {\n $id = array();\n foreach($sql->result() as $result)\n {\n $id[] = $result->id;\n }\n $this->db->where_in('id', $id);\n $this->db->update('users',array('deviceToken'=>''));\n\n if($this->db->affected_rows() > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n return true;\n }", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function setToken()\n\t{\n\t\t $args = phpSmug::processArgs( func_get_args() );\n\t\t $this->oauth_token = $args['id'];\n\t\t $this->oauth_token_secret = $args['Secret'];\n\t}", "public function add_device_token_detail($data) {\n # Delete the old device entry \n $this->db->where(\"device_id\", $data['device_id']);\n $this->db->delete(\"device_detail\");\n\n #==========================================================\n # insert the device detail\n $this->db->insert(\"device_detail\", $data);\n }", "public function updatedevice($token ,$email)\n{\n\n\n$query = mysql_query(\"UPDATE `user` SET `device_id` = '$token' WHERE `email` = '$email' \");\nif($query){\n\n return 1;\n}else \n\nreturn 0;\n\n\n}", "function updateDeviceTokens($token, $data){\r\n global $pdo;\r\n\t\t$update = $pdo->prepare(\"UPDATE device_registry \r\n\t\t\tSET apn_token = ?, c2dm_device_id = ?, wp7_channel_url = ?\r\n\t\t\tWHERE token=?\");\r\n $update->execute(array($data['apn_token'], $data['c2dm_device_id'], $data['wp7_channel_url'], $token));\r\n\t\t$log = debug_backtrace();\r\n\t\t$this->createActionLog($log);\r\n\t}", "public function createUserDevice(Request $request) {\n $authUser = Auth::user();\n if($request->device_token) {\n $this->userDevice->firstOrCreate(['user_id' => $authUser->id, 'device_token' => $request->device_token]);\n }\n $data = [\n 'status' => 200,\n 'massage' => \"successful !\"\n ];\n return response()->json($data);\n }", "public function SetDevice(&$device) {\n $this->device = $device;\n return true;\n }", "private function initTokenData() {\n $accessToken = \\Libs\\Util\\AccessTokenReader::instance($this->request);\n if (!$accessToken->isValid()) {\n return FALSE;\n }\n $this->tokenData = $accessToken;\n $this->access_token = $accessToken->token;\n $this->user_id = $accessToken->user_id;\n $this->client_id = $accessToken->client_id;\n $this->device_token = $accessToken->device_token == NULL ? '' : $accessToken->device_token;\n $this->imei = $accessToken->imei;\n $this->udid = $accessToken->udid;\n $this->mac = $accessToken->mac;\n $this->platform = $this->getPlatform();\n }", "public function setTokenValidDate()\n {\n $this->tokenValidDate = new DateTime('+ 2 hours');\n }", "public function setToken($token): void\n {\n $this->token = $token;\n }", "public function login()\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('email', 'Email', 'required|valid_email|max_length[128]|xss_clean|trim');\n // $this->form_validation->set_rules('password', 'Password', 'required|max_length[32]|');\n\n if($this->form_validation->run() == FALSE)\n {\n echo json_encode(array('status' => \"failed\", 'msg' => \"Validation failed.\"));\n }\n else\n {\n $email = $this->input->post('email');\n $password = $this->input->post('password');\n $FCM = $this->input->post('token');\n \n $result = $this->customer_model->login($email, $password);\n\n if ($result) {\n if($FCM != ''){\n $check = $this->db->get_where('tbl_device_tokens',array(\"id\"=>$result->id))->row_array();\n if(!empty($check))\n {\n $this->db->update('tbl_device_tokens',array('token'=>$FCM),array('id'=>$result->id));\n }\n else{\n $this->db->insert('tbl_device_tokens',array('id'=>$result->id,'token'=>$FCM));\n }\n \n }\n \n echo json_encode(array('status' => \"success\", 'msg' => \"Login Success\", 'userInfo' => $result));\n } else {\n if($FCM != '' && $email != '') {\n $name = ucwords(strtolower(explode('@', $email)[0]));\n $checkSameEmail = $this->customer_model->checkEmailExists($email);\n /* Register new user */\n if (!$checkSameEmail) {\n $userInfo = array('username' => $name, 'email' => $email, /*'isDjs'=>$dj,*/ 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'));\n\n $insert_id = $this->customer_model->register($userInfo);\n\n $this->db->insert('tbl_device_tokens',array('id'=>$insert_id,'token'=>$FCM));\n\n $result = $this->customer_model->getExitUser($email, $FCM);\n\n echo json_encode(array('status' => \"success\", 'msg' => \"Login Success\", 'userInfo' => $result));\n } else {\n $result = $this->customer_model->getExitUser($email, $FCM);\n echo json_encode(array('status' => \"success\", 'msg' => \"Login Success\", 'userInfo' => $result));\n }\n }else{\n echo json_encode(array('status' => \"failed\", 'msg' => \"Email or password mismatch\"));\n }\n \n }\n }\n\n exit(1);\n }", "public function generateTokenAction($header_data,$data){ \n if( !isset($data['device_id']) ) {\n Library::logging('alert',\"API : generateToken : \".ERROR_INPUT.\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_INPUT, null);\n } else {\n try {\n $user_id = $header_data['id'];\n $device_id = $data['device_id'];\n $security = new \\Phalcon\\Security();\n $user = Users::findById($user_id);\n if($user) {\n $result = array();\n // generate new hash\n $hash = KEY.'-'.$device_id;\n $hash = $security->hash($hash); \n $user->hash = $hash;\n $user->save();\n\n $result['token'] = $hash;\n\n Library::output(true, '1', TOKEN_MSG, $result);\n } else {\n Library::output(false, '0', USER_NOT_REGISTERED, null);\n }\n } catch (Exception $e) {\n Library::logging('error',\"API : generateToken : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }\n }", "public function setaccess_token($value);", "public function setToken($token, $token_secret) {}", "function update_device_token($user, $device_token) \n{\n global $conn;\n $user_id = $user['user_id'];\n // var_dump($device_token);\n $q['query'] = \"UPDATE `user_master` SET `device_token`='$device_token' WHERE user_id = '$user_id'\";\n $q['run'] = $conn->query($q['query']);\n\n return $q['run'];\n}", "public function setAuthToken($token)\n {\n $this->authToken = $token;\n }", "private function _populateToken()\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 }", "public function create_device()\n\t{\n\t\t$this->data['title'] = \"Create Device\";\n\t\t\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('/', 'refresh');\n\t\t}\n\t\t\n\t\t// validate form input\n\t\t\n\t\t$this->form_validation->set_rules('mac_address', \"Mac Address\", 'trim|required|strtoupper|is_unique[devices.mac_address]');\n\t\t$this->form_validation->set_rules('company_id', \"Company Name\", 'trim|required');\n\t\t$this->form_validation->set_rules('installation_address', \"Installation Address\", 'trim|required|strtoupper');\n\t\t$this->form_validation->set_rules('installation_date', \"Installation Date\", 'trim|required|strtoupper');\n\t\t$this->form_validation->set_rules('pic_name', \"PIC Name\", 'trim|strtoupper');\n\t\t$this->form_validation->set_rules('pic_contact', \"PIC Contact\", 'trim|strtoupper');\n\t\t$this->form_validation->set_rules('working_day', \"Working Day\", 'trim|required|strtoupper');\n\t\t\n\t\tif ($this->form_validation->run() === TRUE)\n\t\t{\n\t\t\t// check to see if we are creating the user\n\t\t\t// redirect them back to the admin page\n\t\t\t$data = array(\n 'mac_address' => strtoupper($this->input->post('mac_address')),\n 'company_id' => strtoupper($this->input->post('company_id')),\n 'installation_address' => strtoupper($this->input->post('installation_address')),\n\t\t\t\t'installation_date' => $this->input->post('installation_date'),\n\t\t\t\t'pic_name' => strtoupper($this->input->post('pic_name')),\n\t\t\t\t'pic_contact' => strtoupper($this->input->post('pic_contact')),\n\t\t\t\t'working_day' => strtoupper($this->input->post('working_day'))\n );\n\t\t\tif($this->devices_model->set_device($data)){\n\t\t\t\t$this->session->set_flashdata('message', \"Device Created Successfully\");\n\t\t\t\tredirect(\"devices\", 'refresh');\n\t\t\t} else {\n\t\t\t\t$this->data['message'] = \"Unable to create device, please try again\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create user form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message'));\n\t\t}\n\t\t\t$this->data['mac_address'] = [\n\t\t\t\t'name' => 'mac_address',\n\t\t\t\t'id' => 'mac_address',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('mac_address'),\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$company_data = $this->companies_model->get_companies(false, 'company_name');\n\t\t\t$CompanyArray = array();\n\t\t\tforeach ($company_data as $company)\n\t\t\t{\n\t\t\t\t$CompanyArray[$company[\"id\"]] = $company[\"company_name\"];\n\t\t\t}\n\t\t\t$CompanyArray[NULL] = NULL;\n\t\t\t\n\t\t\t$this->data['company_id'] = [\n\t\t\t\t'name' => 'company_id',\n\t\t\t\t'id' => 'company_id',\n\t\t\t\t'data' => $CompanyArray,\n\t\t\t];\n\t\t\t$this->data['installation_address'] = [\n\t\t\t\t'name' => 'installation_address',\n\t\t\t\t'id' => 'installation_address',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('installation_address'),\n\t\t\t\t'placeholder' => 'E.g: Pearl Point, Ground Floor, Powerplant',\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$this->data['installation_date'] = [\n\t\t\t\t'name' => 'installation_date',\n\t\t\t\t'id' => 'installation_date',\n\t\t\t\t'type' => 'date',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('installation_date'),\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$this->data['pic_name'] = [\n\t\t\t\t'name' => 'pic_name',\n\t\t\t\t'id' => 'pic_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('pic_name')\n\t\t\t];\n\t\t\t$this->data['pic_contact'] = [\n\t\t\t\t'name' => 'pic_contact',\n\t\t\t\t'id' => 'pic_contact',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('pic_contact')\n\t\t\t];\n\t\t\t$this->data['working_day'] = [\n\t\t\t\t'name' => 'working_day',\n\t\t\t\t'id' => 'working_day',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'class' => 'form-control form-control-user',\n\t\t\t\t'value' => $this->form_validation->set_value('working_day'),\n\t\t\t\t'placeholder' => \"E.g:\\nMon to Sat: 9am - 5pm\\nSun: 9am - 2pm\",\n\t\t\t\t'required'=>'yes'\n\t\t\t];\n\t\t\t$this->data['page'] = \"devices\";\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'header', $this->data);\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'side', $this->data);\n\t\t\t$this->load->view('devices'. DIRECTORY_SEPARATOR . 'create_device', $this->data);\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'adminfooter', $this->data);\n\t\t\t$this->load->view('templates' . DIRECTORY_SEPARATOR . 'footer', $this->data);\n\t}", "public function __construct($device)\n {\n $this->device = $device;\n }", "private static function set_token() {\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Generate a random token of 64 length\n\t\t\t$token = self::generate_token(64);\n\t\t\t// Store it in the $_SESSION\n\t\t\t$session->set('csrf_token', $token);\n\t\t}", "public function setToken(string $token): void\n {\n $this->token = $token;\n }", "public function add_device( $did = '', $model = '', $hversion = '', $sversion = '', $type = '', $builder = '', $reg_device = '' ) {\n\t\tglobal $wpdb;\n\t\tglobal $rpids_api;\n \n try {\n // Process the parameters\n if( @$did != '' ) {\n $did = sanitize_text_field( $did );\n } else {\n $did = '0';\n }\n \n if( @$model != '' ) {\n $model = sanitize_text_field( $model );\n }\n \n if( @$hversion != '' ) {\n $hversion = sanitize_text_field( $hversion );\n }\n \n if( @$sversion != '' ) {\n $sversion = sanitize_text_field( $sversion );\n }\n \n if( @$type != '' ) {\n $type = sanitize_text_field( $type );\n }\n \n if( @$builder != '' ) {\n $builder = sanitize_text_field( $builder );\n }\n \n if( @$reg_device != '' ) {\n $reg_device = sanitize_text_field( $reg_device );\n } else {\n $reg_device = false;\n }\n \n // Get the current user\n $current_user = wp_get_current_user();\n \n if( $reg_device ) {\n // If $builder is empty, set it to the current user's email\n if( $builder = '' ) {\n $builder = $current_user->user_email;\n }\n \n // Register the device with the central server\n $rpids_register = $rpids_api->register_device( $model, $hversion, $sversion, $type, $builder );\n \n // Success? If yes, update the did variable\n if( $rpids_register['status'] == 'success' ) {\n $did = $rpids_register['did'];\n }\n }\n \n // Should we verify the device and claim it?\n if( $did != '0' ) {\n // DID is set (and not 0)\n // Check if the device is already in the database\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_devices` WHERE `did`='\" . $did . \"';\";\n $device = $wpdb->get_row($sql, ARRAY_A);\n \n if( $device != null ) {\n // Device has already been added\n throw new Exception( 'That device has already been added.' );\n } else {\n // Connect to the central server and claim the device\n $rpids_return = $rpids_api->claim_device( $did, $current_user->user_email );\n // Why email? If the device is given away or sold, but not removed from an account, we need to know who to contact for the new owner.\n \n // Check the status of $rpids_return\n if( $rpids_return['status'] == 'otheruser') {\n // The device is claimed by someone else\n throw new Exception( 'That device ID is already claimed. If you received the device used make sure the previous owner has transferred ownership.' );\n } elseif( $rpids_return['status'] == 'notfound') {\n // DID not found\n throw new Exception( 'That Device ID was not found. The device must be registered before you can add it.');\n } elseif( $rpids_return['status'] != 'success' ) {\n // Other error\n throw new Exception( 'Well that\\'s strange. Something went wrong, but we have no clue what.' );\n }\n \n // Looks like status == success\n // Get the device details\n $rpids_results = $rpids_api->get_device_info( $did );\n \n // Update the device info variables\n $model = sanitize_text_field( $rpids_results['model'] );\n $hversion = sanitize_text_field( $rpids_results['hversion'] );\n $sversion = sanitize_text_field( $rpids_results['sversion'] );\n $type = sanitize_text_field( $rpids_results['type'] );\n $builder = sanitize_text_field( $rpids_results['builder'] );\n }\n }\n \n // Now, add the device to the database\n $wpdb->insert( rpids_tableprefix() . \"rpids_devices\",\n array(\n \"did\" => $did,\n \"model\" => $model,\n\t\t\t\t \"hversion\" => $hversion,\n\t\t\t\t \"sversion\" => $sversion,\n\t\t\t\t \"type\" => $type,\n\t\t\t\t \"builder\" => $builder\n )\n );\n \n // Return success\n if( $reg_device ) {\n return (object) array(\n \"status\" => \"success\",\n \"message\" => \"Device registered and added.\"\n );\n }\n\t\t} catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n\t}", "public function setRememberToken($value){\n $this->token=$value;\n }", "abstract public function setNextAuthToken($token);", "function device_post()\n {\n // // Authenticate user (by session)\n // // Check if a user is currently logged in\n if(!$this->session->userdata('LoggedIn')){\n die(\"Login Required\");\n }\n\n if(!$this->get('id')){\n $this->response(NULL, 400);\n }\n\n // Load the device model\n $this->load->model('device_model');\n \n // Get the required device parameters from the POST data\n $postDevice = $this->post('device');\n $device_driver = $this->device_model->getDriverCode($this->get('id'));\n\n // Load the device driver library\n $deviceParams = array('id' => $this->get('id'), 'model' => 'HS110');\n $this->load->library('drivers/'.$device_driver, $deviceParams);\n\n // Send the command the the device\n $commandResult = $this->$device_driver->controlDevice($postDevice);\n\n // build up some response data\n // $data['jsonArray'] = array(\"device\" => $set_devinfo);\n $data = $commandResult;\n\n // print_r($data);\n\n // Check the response is not empty\n if(!empty($commandResult['response']) && ($commandResult['response']['error'] === 0)){\n // The command was sent and received by the device\n // Update the database\n $this->device_model->updateDevice($data);\n }else{\n // print(\"error\");\n // print_r($commandResult['response']);\n }\n\n // If the data array is not empty then display the response\n if($data)\n {\n $this->response($data, 200); // 200 being the HTTP response code\n }\n \n else\n {\n $this->response(NULL, 404);\n }\n }", "public function recuperaToken()\n {\n // por eso para propositos de prueba solo se usara el primer cliente\n $this->cliente=Cliente::find(1)->token;\n }", "public function login(){ \n if(Auth::attempt(['email' => request('email'), 'password' => request('password')])) {\n $user = Auth::user(); \n if($user->status == 0)\n return response()->json([\n 'status'=>0,\n 'base_url' => $this->base_url,\n 'message'=>'Inactive User'\n ], $this->errorCode);\n $token = $user->createToken('District10')->accessToken; \n if(request('device_token') && request('device_type')) { \n $dtUpdated = DeviceToken::updateOrCreate(\n ['device_type' => request('device_type'), 'email_id' => request('email')],\n ['device_token' => request('device_token')]\n );\n }\n return response()->json([\n 'status'=>1,\n 'base_url' => $this->base_url,\n 'message' => 'Success',\n 'token' => $token,\n 'userDetail' => $user\n ], $this->successCode);\n } else { \n return response()->json([\n 'status'=>0,\n 'base_url' => $this->base_url,\n 'message'=>'Unauthorised'\n ], $this->errorCode); \n } \n }", "public function validate($param, $isUser = false){\n\t\t$this->param = $param;\n\t\t\n\t\t$authorization_temp = null;\n\t\t// HTTP_DEVICETOKEN\n\t\t$device_token = $this->param->getServer('HTTP_DEVICETOKEN');\n\t\tif($device_token != 'no-device'){\n\t\t\t$device_token = $this->param->getServer('HTTP_DEVICEID') . '---' . $device_token;\n\t\t}\n\n\t\tif($device_token === '---'){\n\t\t\t$device_token = $this->param->getParam('Devicetoken');\n\t\t\tif($device_token != 'no-device'){\n\t\t\t\t$device_token = $this->param->getParam('Deviceid') . '---' . $device_token;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t\twe use session on web app, token is not needed here\n\t\t\twe only use token for unsecure request\n\t\t\t$check = null; null = mobile , 1 = WEB \n\n\t\t\tif(!$this->param->getServer('HTTP_DEVICETOKEN')){\n\t\t\t\t$check = 1;\n\t\t\t}\n\t\t*/\n\t\t$result = [\n\t\t\t'error' => 1,\n\t\t\t'message' => $this->_lang->getLang('api_invalid_devicetoken'),\n\t\t\t'payload' => null,\n\t\t];\n\t\t\n\t\t$token = $this->getBearer();\n\n\t\tif(is_array($token) && count($token) == 3){\n\t\t\t$this->setSecret($this->siteConfig->getData('site_api_secret'));\n\t\t\t$fullToken = implode('.', $token);\n\n\t\t\t\n\t\t\t$payload = $this->validateToken($fullToken, $device_token/*, $check*/);\n\t\n\t\t\t$payload['devicetoken'] = $device_token;\n\t\t\tif($payload['error'] == 0){\n\t\t\t\tif($isUser){\n\t\t\t\t\tif(!isset($payload['payload']['jti'])) {\n\t\t\t\t\t\t$payload['error'] = 1;\n\t\t\t\t\t\t$payload['message'] = $this->_lang->getLang('login_no');\n\t\t\t\t\t\t$payload['payload'] = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*$user = $this->_userEntity->getByColumn(['id', $payload['jti']], 1);\n\t\t\t\t\t\tif(!$user){\n\t\t\t\t\t\t\t$payload['mesage'] = $this->_lang->getLang('loginaccount_not_found_no');\n\t\t\t\t\t\t\t$payload['payload'] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$payload['mesage'] = $this->_lang->getLang('success');\n\t\t\t\t\t\t\t$payload['user'] = $user;\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$result = $payload;\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function validator(Request $request)\n {\n\n $validator = $this->validate(request(),[\n 'name_usuario' => 'required',\n 'email' => 'email|required',\n 'nombre' => 'required',\n 'paterno' => 'required',\n 'materno' => 'required',\n 'nocontro' => 'required',\n 'password' => 'required',\n ]);\n // dd($request);\n $token=Tokenalumno::where('numerocontrol',$request->nocontro)->first();\n // dd($token->id);\n $name=Alumno::where('name_usuario',$request->name_usuario)->first();\n $email=Alumno::where('email',$request->email)->first();\n if($token!=null && $name== null&& $email== null)\n {\n if($token->uso==0)\n {\n $docente=Alumno::create([\n 'name_usuario' => $request->name_usuario,\n 'email' => $request->email,\n 'nombre' => $request->nombre,\n 'paterno' => $request->paterno,\n 'materno' => $request->materno,\n // 'id_profe'=>$token->profe,\n 'tokenalumnos_id'=> $token->id,\n 'nocontro' => $request->nocontro,\n 'grupo'=>$token->grupo,\n 'acceso'=>0, \n 'password' => Hash::make($request->password), \n ]);\n $token->uso=1;\n // $token->id_usuario=$request->email;\n $token->save();\n return redirect(\"loginAlumno\");\n }else\n {\n return redirect(\"registroAlumno\");\n }\n\n }\n else\n {\n return view('alumno.registro');\n }\n\n\n }", "public abstract function registerDevice();", "public function setConfirmationTokenAttribute($value)\n {\n // if null - dont generate and set null in table\n if (is_null($value)) {\n $this->attributes['confirmation_token'] = null;\n }\n else {\n $this->attributes['confirmation_token'] = $this->getUniqueConfirmationToken();\n }\n }", "function setAuthToken($AuthToken)\n {\n \t$this->_authToken =$AuthToken;\n }", "public function testSetDeviceToken($token, $exception)\n {\n if ($exception) {\n $this->setExpectedException('InvalidArgumentException');\n }\n\n $message = new Message();\n\n $message->setDeviceToken($token);\n $this->assertEquals($message->getDeviceToken(), $token);\n }", "public function setDeviceId($deviceId)\n {\n $this->deviceId = $deviceId;\n }", "protected function createGenericRecord(AndroidDevice $model){\n\n try{\n $model->deviceId = Input::get(StringConstants::DEVICEID);\n\n\n $androidDevice = AndroidDevice::where('deviceId',$model->deviceId)->first();\n\n if(count($androidDevice)==1) {\n /*OrCreate(['deviceId'=>\n $model->deviceId,'pushRegId'=>Input::get(StringConstants::PUSHREGID),'deviceType'=>Input::get(StringConstants::DEVICETYPE)\n ,'osType'=>Input::get(StringConstants::OSTYPE),'osVersion'=>Input::get(StringConstants::OSVERSION)\n ,'deviceModelName'=> Input::get(StringConstants::DEVICEMODELNAME)]);*/\n\n $androidDevice->deviceId = $model->deviceId;\n\n $androidDevice->pushRegId = Input::get(StringConstants::PUSHREGID);\n\n $androidDevice->deviceType = Input::get(StringConstants::DEVICETYPE);\n\n $androidDevice->osType = Input::get(StringConstants::OSTYPE);\n\n $androidDevice->osVersion = Input::get(StringConstants::OSVERSION);\n\n $androidDevice->deviceModelName = Input::get(StringConstants::DEVICEMODELNAME);\n\n $androidDevice->appVersion = Input::get(StringConstants::APPVERSION);\n\n $androidDevice->update();\n }else{\n\n $androidDevice = new AndroidDevice();\n\n $androidDevice->deviceId = $model->deviceId;\n\n $androidDevice->pushRegId = Input::get(StringConstants::PUSHREGID);\n\n $androidDevice->deviceType = Input::get(StringConstants::DEVICETYPE);\n\n $androidDevice->osType = Input::get(StringConstants::OSTYPE);\n\n $androidDevice->osVersion = Input::get(StringConstants::OSVERSION);\n\n $androidDevice->deviceModelName = Input::get(StringConstants::DEVICEMODELNAME);\n\n $androidDevice->appVersion = Input::get(StringConstants::APPVERSION);\n\n $androidDevice->save();\n\n\n }\n\n } catch (Exception $e) {\n\n throw new Exception($e->getMessage(),\"500\");//response()->json(['error' => 'User already exists.'], HttpResponse::HTTP_CONFLICT);\n\n }\n\n $accessToken = $this->auth->fromUser($androidDevice);\n\n return response()->json([\n 'accessToken' => $accessToken\n ] ,200);\n\n }", "public function setTokenAttribute($token)\n {\n $this->attributes['token'] = bcrypt($token);\n }", "public function setAccessToken($token);", "public function setTokenAttribute($value)\n {\n $this->attributes['token'] = encrypt($value);\n }", "public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }", "public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }", "public function registerTokenMobile($token) {\n $data = array(\n 'updated_at' => time(),\n 'email' => $token->email,\n 'token' => $token->token\n );\n if ($this->db->insert(\"Tokens\", $data)) {\n return '\"true\"';\n } else {\n return '\"false\"';\n }\n }", "public function checkIOSCustomers(){\n $user = Customer::where('id', $this->authUser->id)->first();\n if (!empty($user) && count($user->toArray()) > 0) {\n $user->device_token = '';\n $user->acesstype = \"mobile\";\n $user->device_type = $this->request->device_type;\n return ($user->save()) ? $user->makeHidden([ 'id','access_token' ]) : 0;\n }else{\n return false;\n }\n }", "public function setLoginId(): void\n {\n }", "public function authenticateDevice($username, $password, $app_token=null){\r\n\t\tif(($this->ua == 'mobile') && (!$this->isValidToken($app_token))){\r\n\t\t\t$this->setStdError('invalid_app_token');\r\n\t\t\treturn false;\r\n\t\t}\r\n global $pdo;\r\n\tif($this->authenticate($username, $password)){\r\n\t//update device determined by app_token\r\n\t\tif($this->ua == 'mobile')\r\n\t\t$this->updateMyDevice($app_token);\r\n\r\n\t\t$this->user_type = $this->getUserType();\r\n\t\t$this->_setUserProfile();\r\n\r\n\t\t$log = debug_backtrace();\r\n\t\t$this->createActionLog($log);\r\n return true;\r\n }\r\n else{\r\n $this->setStdError(\"auth_failure\");\r\n return false;\r\n }\r\n}", "private function validateTokenRequest(): bool\n {\n $validator = new Validator([\n 'required' => ':attribute — обязательное поле.',\n 'numeric' => ':attribute — поле должно содержать только цифры.',\n ]);\n\n $validator->addValidator('plain', new PlainRule());\n\n $validation = $validator->make([\n 'shop_id' => $this->getRouteParam('id'),\n 'secret_key' => $this->http_request->query->get('secret_key'),\n ], [\n 'shop_id' => 'required|numeric',\n 'secret_key' => 'required|plain',\n ]);\n\n $validation->setAliases([\n 'shop_id' => 'Идентификатор магазина',\n 'secret_key' => 'Секретный ключ',\n ]);\n\n $validation->validate();\n\n if ($validation->fails()) {\n $errors = $validation->errors()->toArray();\n\n foreach ($errors as $key => $error) {\n foreach ($error as $message) {\n $this->errors[] = [\n 'code' => 'invalid-field',\n 'message' => $message,\n 'field' => $key,\n ];\n }\n }\n\n return false;\n }\n\n return true;\n }", "function store_device_token($user, $device_token)\n{\n global $conn;\n $user_id = $user['user_id'];\n $q['query'] = \"INSERT INTO `device_tokens`(`user_id`, `device_token`) \n VALUES('$user_id', '$device_token')\";\n $q['run'] = $conn->query($q['query']);\n\n return $q['run'];\n}", "public function forDeviceTokens()\n {\n $this->router->group([], function ($router) {\n $router->post('{version}/devices/{deviceToken}/registrations/{websitePushId}', [\n 'uses' => 'TokenController@store',\n ]);\n\n $router->delete('{version}/devices/{deviceToken}/registrations/{websitePushId}', [\n 'uses' => 'TokenController@destroy',\n ]);\n });\n }", "public function assign ()\n {\n $this->request->data['serial'] = $this->request->data('serial_number');\n $errors = AppModel::validationErrors(['location_id', 'user_id', 'type', 'serial', 'ts'], $this->request->data, false);\n if (!empty($errors)) {\n throw new Swarm\\RequestValidationException(SwarmErrorCodes::getFirstError($errors));\n }\n\n $locationId = $this->request->data['location_id'];\n $deviceType = $this->request->data['type'];\n $serialNumber = $this->request->data['serial'];\n\n $deviceModel = $this->getDevice();\n $device = $deviceModel->find('first', ['conditions' => ['Device.serial' => $serialNumber]]);\n try {\n $this->_checkDevice($device, $deviceType, true);\n $device = $deviceModel->find('first', ['conditions' => ['Device.serial' => $serialNumber]]);\n $deviceModel->read(null, $device['Device']['id']);\n $deviceModel->save(['Device' => ['location_id' => $locationId]], true, ['location_id']);\n $deviceAssigned = true;\n $message = 'Device updated successfully';\n }\n catch (Exception $e) {\n $deviceAssigned = false;\n $message = $e->getMessage();\n }\n\n return new JsonResponse(['body' => [\n 'device_assigned' => $deviceAssigned,\n 'message' => $message\n ]]);\n }", "public function store_device($device)\n {\n // We need a header to continue; \n if(! isset($_SERVER['HTTP_AUTHORIZATION']))\n {\n return 'failed';\n }\n \n // Get the key from the header.\n $parts = explode('_', $_SERVER['HTTP_AUTHORIZATION']);\n \n // Clear any old entries\n DB::table('UserToDevice')->where('UserToDeviceAppleToken', trim($device))->delete();\n \n // Add entry.\n DB::table('UserToDevice')->insert([\n 'UserToDeviceAccountId' => trim($parts[1]),\n 'UserToDeviceType' => 'Apple Push', \n 'UserToDeviceAppleToken' => trim($device),\n 'UserToDeviceUpdatedAt' => date('Y-m-d H:i:s'),\n 'UserToDeviceCreatedAt' => date('Y-m-d H:i:s')\n ]);\n \n return 'success';\n }", "public function setToken()\n {\n if (session()->has('drive-access-token')) {\n $accessToken = session()->get('drive-access-token');\n $this->setAccessToken($accessToken);\n if ($this->isAccessTokenExpired()) {\n $accessToken = $this->fetchAccessTokenWithRefreshToken($this->getRefreshToken());\n session()->put('drive-access-token', $accessToken);\n }\n }\n }", "public function setOAuthToken($token)\n {\n $this->oauthToken->setToken($token);\n }", "public function setToken($token, $token_secret = null) {\n\n\t\tparent::setToken($token, $token_secret);\n\t}", "public function setPaymentToolToken($value)\n {\n return $this->setParameter('paymentToolToken', $value);\n }", "public static function checkTokenRequestParam(): void\n {\n global $token_mismatch, $token_provided;\n\n $token_mismatch = true;\n $token_provided = false;\n\n if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {\n return;\n }\n\n if (isset($_POST['token']) && is_scalar($_POST['token']) && strlen((string) $_POST['token']) > 0) {\n $token_provided = true;\n $token_mismatch = ! @hash_equals($_SESSION[' PMA_token '], (string) $_POST['token']);\n }\n\n if (! $token_mismatch) {\n return;\n }\n\n // Warn in case the mismatch is result of failed setting of session cookie\n if (isset($_POST['set_session']) && $_POST['set_session'] !== session_id()) {\n trigger_error(\n __(\n 'Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin.'\n ),\n E_USER_ERROR\n );\n }\n\n /**\n * We don't allow any POST operation parameters if the token is mismatched\n * or is not provided.\n */\n $allowList = ['ajax_request'];\n Sanitize::removeRequestVars($allowList);\n }", "public function authClientUser(){\n\n\t\t$token = Input::get('token');\n\t\t$tokenExists = TokenModel::where('token = ?', $token)\n\t\t\t\t\t\t\t\t\t->all();\n\t\t//invalid token used/no access token provided\n\t\tif (!$tokenExists->num_rows()) {\t\t \n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!1');\n\t\t}\n\t\t//check for expired token\n\t\telseif ($tokenExists->result_array()[0]['logout'] === true) {\n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!2');\n\t\t}\n\t\t//unathorized user access to admin controller\n\t\telseif ($tokenExists->result_array()[0]['user_role'] != 3 AND $tokenExists->result_array()[0]['user_role'] != 4) {\n\t\t\theader('HTTP/1.0 401 Unauthorized'); \n\t\t\tdie('Restricted access!');\n\t\t}\n\t\telse {\n\t\t\t//check for expired timestamp\n\t\t\t$token = $tokenExists->result_array()[0];\n\t\t\t$timestamp = strtotime($token['date_modified'] OR $token['date_created']);\n\n\t\t\tif (($timestamp + $token['duration']) > time()) {\n\t\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\t\tdie('Login required!3');\n\t\t\t}\n\n\t\t\t//extend token lifespan\n\t\t\tTokenModel::where('id = ?', $token['id'])\n\t\t\t\t\t\t->save(array(\n\t\t\t\t\t\t\t'duration' => 3600\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t//set the value of the client id\n\t\t\t$this->client_id = $token['client_id'];\n\n\t\t}\n\n\t}", "public function __construct($app_version=0, $os_version=0, $device_name='', $device_id='') {\n\n\t\t$this->app_version = intval($app_version); //The version of your app that is authenticating. (integer)\n\t\t$this->os_version = intval($os_version); //The version of the OS that is running on the user's device. (integer)\n\t\t$this->device_name = $device_name; //A string the identifies the make and model of the user's device.\n\t\t$this->device_id = $device_id; //A string that uniquly identifies this user. Used for counting total unique users and nothing else.\n\n\t\t$this->state = \"xyz\"; //this is used to prevent cross site request forgery and should be unique for each request.\n\t\t//It is your job to store this state somewhere so that you can compare it to what the server echos back to you\n\t\t//after authorizing your app.\n\t}", "public function setApiToken($api_token)\n {\n $this->api_token = $api_token;\n }", "public function setDeviceId($val)\n {\n $this->_propDict[\"deviceId\"] = $val;\n return $this;\n }", "public function setPasswordRequiredType(?AndroidDeviceOwnerRequiredPasswordType $value): void {\n $this->getBackingStore()->set('passwordRequiredType', $value);\n }", "function setDevId($value)\n {\n $this->_props['DevId'] = $value;\n }", "public function actionCheck()\n\t{\n\t\t$arr = array('controller'=>$this->id, 'action'=>$this->action->id,'status' =>'NOK');\n\t\t$headers = AuthSession::getHead();\n\t\t$auth_code = isset($headers['auth_code']) ? $headers['auth_code'] : null;\n\t\tif ( $auth_code == null ) $auth_code = Yii::app()->request->getQuery('auth_code');\n\t\tif ( $auth_code == '(null)' ) $auth_code = null; //DONE FOR IPHONE AND DONT CHANGE THE ORDER\n\t\t$arr['temp_device_auth_code'] = $auth_code;\n\t\tif($auth_code != null){\n\t\t\t$auth_session = AuthSession::model()->findByAttributes(array('auth_code'=>$auth_code));\n\t\t\tif($auth_session != null){\n\t\t\t\t$arr['status'] = 'OK';\n\t\t\t\t$user = Yii::app()->user->model;\n\t\t\t\t$arr['status']='OK';\n\n\t\t\t\t$arr['success']='you have successfully Login';\n\t\t\t\t//\n\t\t\t\tif(isset($_POST['AuthSession']['device_token'])){\n\t\t\t\t\t$auth_session->device_token = $_POST['AuthSession']['device_token'];\n\t\t\t\t\tif($auth_session->saveAttributes(array('device_token'))){\n\t\t\t\t\t\t$arr['auth_session']='Auth Session updated Updated device token';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$err = '';\n\t\t\t\t\t\tforeach( $auth_session->getErrors() as $error){\n\t\t\t\t\t\t\t$err .= implode( \".\",$error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$arr['error'] = $err;\n\t\t\t\t\t\t//$arr['status'] = 'NOK';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$arr['device_token'] = 'Device token is not updated ';\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$arr['error'] = 'auth_code is not found';\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t$arr['error'] = 'Auth code not found in the header or query string.';\n\t\t$this->sendJSONResponse($arr);\n\t}", "public static function setToken($token)\n {\n self::$_data[self::KEY_TOKEN] = $token;\n }", "public function set() {\n\t\t$this->token = uniqid(rand(), true);\n\n\t\t$this->time = time();\n\n\t\t$this->$referer = $_SERVER['HTTP_REFERER'];\n\n\t\tif ($this->isEnable()) {\n\t\t\t$_SESSION['token'] = $this->token;\n\t\t\t$_SESSION['token_time'] = $this->time;\n\t\t\t$_SESSION['token_referer'] = $this->$referer;\n\t\t}\n\t}", "public function setSessionTokenFromRegistry() {}", "public function set_api_token( $api_token ) {\n\t\t$this->api_token = $api_token;\n\t}", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.aospDeviceOwnerDeviceConfiguration');\n }", "public function edit(Device $device)\n {\n //\n }", "public function edit(Device $device)\n {\n //\n }", "public function edit(Device $device)\n {\n //\n }", "public function update_device( $device_id = '', $did = '', $model = '', $hversion = '', $sversion = '', $type = '', $builder = '' ) {\n global $wpdb;\n\t\tglobal $rpids_api;\n \n try {\n // Process the parameters\n if( @$device_id != '' ) {\n $device_id = sanitize_text_field( $device_id );\n } else {\n throw new Exception( 'Device ID is required.' );\n }\n \n if( @$did != '' ) {\n $did = sanitize_text_field( $did );\n } else {\n $did = '0';\n }\n \n if( @$model != '' ) {\n $model = sanitize_text_field( $model );\n }\n \n if( @$hversion != '' ) {\n $hversion = sanitize_text_field( $hversion );\n }\n \n if( @$sversion != '' ) {\n $sversion = sanitize_text_field( $sversion );\n }\n \n if( @$type != '' ) {\n $type = sanitize_text_field( $type );\n }\n \n if( @$builder != '' ) {\n $builder = sanitize_text_field( $builder );\n }\n \n // Get the current user\n $current_user = wp_get_current_user();\n \n // Should we verify the device and claim it?\n $sql = \"SELECT * FROM `\" . rpids_tableprefix() . \"rpids_devices` WHERE `id`='\" . $device_id . \"';\";\n $device = $wpdb->get_row($sql, ARRAY_A);\n \n if( $device != null ) {\n // Device does not exist\n throw new Exception( 'Device ID does not exist.' );\n }\n \n if( $device['did'] != '0' ) {\n // Connect to the central server and claim the device\n $rpids_return = $rpids_api->update_device_info( $did, $model, $hversion, $sversion, $type, $builder );\n // Why email? If the device is given away or sold, but not removed from an account, we need to know who to contact for the new owner. \n // Check the status of $rpids_return. If it isn't success, change the DID to 0 and quietly fail.\n if( $rpids_return['status'] != 'success' ) {\n $did = '0';\n }\n \n // Looks like status == success\n }\n \n // Now, update the device in the database\n $new_device_info = array();\n if( @$did != '' ) {\n $new_device_info['did'] = $did;\n }\n \n if( @$model != '' ) {\n $new_device_info['model'] = $model;\n }\n \n if( @$hversion != '' ) {\n $new_device_info['hversion'] = $hversion;\n }\n \n if( @$sversion != '' ) {\n $new_device_info['sversion'] = $sversion;\n }\n \n if( @$type != '' ) {\n $new_device_info['type'] = $type;\n }\n \n if( @$builder != '' ) {\n $new_device_info['builder'] = $builder;\n }\n \n if( !$wpdb->update( rpids_tableprefix() . \"rpids_devices\", $new_device_info, array( 'id' => $device_id ) ) ) {\n throw new Exception( 'Error when updating the database. New info not saved.' );\n } else {\n return (object) array(\n \"status\" => \"success\",\n \"message\" => \"Device updated.\"\n );\n }\n\t\t} catch ( Exception $e ) {\n return (object) array(\n\t\t\t\t\"status\" => \"error\",\n\t\t\t\t\"message\" => $e->getMessage()\n\t\t\t);\n }\n }", "public function setValidWebAccessToken($token = null)\n {\n // Check for the PreWebAccessToken\n if (session()->has('consumer_token')) {\n // Remove the PreWebAccessToken\n $requestToken = session()->pull('consumer_token');\n } else {\n $requestToken = $token;\n }\n // Set the validatable WebAccessToken\n session()->put('api_consumer_token', $requestToken);\n }", "public function setSyncToken($value){\n return $this->setParameter('sync_token', $value);\n }", "public function setManagedDeviceId($val)\n {\n $this->_propDict[\"managedDeviceId\"] = $val;\n return $this;\n }", "public function setManagedDeviceId($val)\n {\n $this->_propDict[\"managedDeviceId\"] = $val;\n return $this;\n }", "public function setToken($config)\n {\n $this->_token = Yii::createObject($config);\n }" ]
[ "0.65079063", "0.6488449", "0.64489806", "0.64147264", "0.6294113", "0.6202067", "0.6197368", "0.6125309", "0.608477", "0.6084462", "0.60504645", "0.5986843", "0.59641856", "0.59604293", "0.5936098", "0.584383", "0.58092165", "0.5789918", "0.5788791", "0.57479554", "0.57412755", "0.5738045", "0.5729451", "0.5677963", "0.56777227", "0.56777227", "0.5647566", "0.56391984", "0.56297076", "0.5625717", "0.56244254", "0.56158143", "0.5603015", "0.5582969", "0.5565592", "0.5564468", "0.55637634", "0.55191404", "0.55093026", "0.5497143", "0.548283", "0.54750645", "0.5473144", "0.54724663", "0.5457008", "0.5449462", "0.5438989", "0.5391425", "0.5388026", "0.538609", "0.5362911", "0.5358655", "0.5355945", "0.535294", "0.53241324", "0.5303798", "0.53008634", "0.52848864", "0.52815497", "0.5279414", "0.5277795", "0.5252813", "0.5234508", "0.5219242", "0.5219242", "0.52132446", "0.52080715", "0.5207303", "0.5204676", "0.51987654", "0.5193396", "0.5174821", "0.51689047", "0.51685387", "0.5160366", "0.5151274", "0.5149757", "0.5130022", "0.51253474", "0.5120798", "0.5112201", "0.5111168", "0.5104276", "0.5093145", "0.5092752", "0.50891227", "0.5083388", "0.5071378", "0.50707316", "0.50589734", "0.5053282", "0.5045939", "0.5045939", "0.5045939", "0.5044132", "0.5043176", "0.5042753", "0.5037413", "0.5037413", "0.50272304" ]
0.80904794
0
Columna de la tabla de la base de datos que el campo representara
public function setDBColName(string $field): self { $this->field = trim($field); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getColumnName();", "public function getColumn(): string;", "public function getColumna() {\n return $this->columna;\n }", "abstract public function tableColumns();", "abstract public static function columnData();", "public function modelColumn();", "private function getColumn(): string\n {\n return $this->getUsernameColumnName();\n }", "public function getColumnModel();", "abstract public static function get_column_name(): string;", "public function getTableFields()\n {\n return array(\n array(\"Field\" => \"uid_empresa\", \"Type\" => \"int(10)\", \"Null\" => \"NO\", \"Key\" => \"PRI\", \"Default\" => \"\", \"Extra\" => \"auto_increment\"),\n array(\"Field\" => \"endeve_id\", \"Type\" => \"varchar(60)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"pago_no_obligatorio\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"nombre\", \"Type\" => \"varchar(100)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"nombre_comercial\", \"Type\" => \"varchar(200)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"representante_legal\", \"Type\" => \"varchar(512)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"cif\", \"Type\" => \"varchar(20)\", \"Null\" => \"NO\", \"Key\" => \"UNI\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"pais\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_pais\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"direccion\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"localidad\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"provincia\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"cp\", \"Type\" => \"int(8)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"accion\", \"Type\" => \"timestamp\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"CURRENT_TIMESTAMP\", \"Extra\" => \"\"),\n array(\"Field\" => \"updated\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_provincia\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_municipio\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"convenio\", \"Type\" => \"varchar(255)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"created\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"aviso_caducidad_subcontratas\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"color\", \"Type\" => \"varchar(10)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"email\", \"Type\" => \"varchar(255)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_enterprise\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"logo\", \"Type\" => \"tinytext\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"skin\", \"Type\" => \"varchar(300)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"dokify\", \"Extra\" => \"\"),\n array(\"Field\" => \"lang\", \"Type\" => \"varchar(2)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"es\", \"Extra\" => \"\"),\n array(\"Field\" => \"activo_corporacion\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"pago_aplicacion\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"receive_summary\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"date_last_summary\", \"Type\" => \"int(16)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"license\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_validation_partner\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"partner_validation_price\", \"Type\" => \"float\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"partner_validation_price_urgent\", \"Type\" => \"float\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"validation_languages\", \"Type\" => \"varchar(250)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"cost\", \"Type\" => \"float\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"pay_for_contracts\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"invoice_periodicity\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_attached\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_validated\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_rejected\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"req_expired\", \"Type\" => \"int(9)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_transfer_pending\", \"Type\" => \"int(1)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"kind\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"min_app_version\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"2\", \"Extra\" => \"\"),\n array(\"Field\" => \"prevention_service\", \"Type\" => \"varchar(20)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_idle\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"corporation\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_referrer\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"requirement_count\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"invoice_count\", \"Type\" => \"int(11)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_referrer\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_manager\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"is_self_controlled\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"1\", \"Extra\" => \"\"),\n array(\"Field\" => \"has_custom_login\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n array(\"Field\" => \"header_img\", \"Type\" => \"tinytext\", \"Null\" => \"YES\", \"Key\" => \"\", \"Default\" => \"\", \"Extra\" => \"\"), array(\"Field\" => \"uid_manager\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"uid_referrer\", \"Type\" => \"int(11)\", \"Null\" => \"YES\", \"Key\" => \"MUL\", \"Default\" => \"\", \"Extra\" => \"\"),\n array(\"Field\" => \"requirements_origin_company_cloneables\", \"Type\" => \"int(1)\", \"Null\" => \"NO\", \"Key\" => \"\", \"Default\" => \"0\", \"Extra\" => \"\"),\n );\n }", "protected function getColumn()\n {\n return DB::select(\n 'SELECT\n\t\t\t\t\t\t\t c.COLUMN_NAME\n\t\t\t\t\t\t\t,c.COLUMN_DEFAULT\n\t\t\t\t\t\t\t,c.IS_NULLABLE\n\t\t\t\t\t\t\t,c.DATA_TYPE\n\t\t\t\t\t\t\t,c.CHARACTER_MAXIMUM_LENGTH\n\t\t\t\t\t\t\t,pk.CONSTRAINT_TYPE AS EXTRA\n\t\t\t\t\t\t\tFROM INFORMATION_SCHEMA.COLUMNS AS c\n\t\t\t\t\t\t\tLEFT JOIN (\n\t\t\t\t\t\t\t SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME, tc.CONSTRAINT_TYPE\n\t\t\t\t\t\t\t FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc\n\t\t\t\t\t\t\t INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku ON tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME\n\t\t\t\t\t\t\t) AS pk ON c.TABLE_CATALOG = pk.TABLE_CATALOG\n\t\t\t\t\t\t\t AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA\n\t\t\t\t\t\t\t AND c.TABLE_NAME = pk.TABLE_NAME\n\t\t\t\t\t\t\t AND c.COLUMN_NAME = pk.COLUMN_NAME\n\t\t\t\t\t\t\tWHERE c.TABLE_NAME = ? AND c.TABLE_CATALOG = ? ',\n [$this->tableName, $this->databaseName]\n );\n }", "public function tableColumns($table,$column);", "function getColumnasFomTable($tabla)\n{\n $query = \"SELECT cols.ordinal_position as posicion,cols.column_name as nombre,cols.data_type\"\n .\" FROM information_schema.columns cols\"\n .\" WHERE\"\n .\" cols.table_name=?\"\n .\" and cols.column_name not in ('created_at', 'updated_at')\"\n .\" order by posicion\";\n\n $lista = \\DB::select($query, [$tabla]);\n $columnas = array();\n foreach($lista as $item){\n $columnas[$item->nombre] = str_oracion($item->nombre);\n }\n\n return $columnas;\n}", "public function getDataColumn()\n {\n return $this->dataColumn;\n }", "public function getTabla(){\n return $this->table;\n }", "public function getColumn(): string\n {\n return $this->column;\n }", "public function getColumn() { return $this->column; }", "static function columns($instancia = null) {\n if ($instancia) {\n return fields_of($instancia->_tablename());\n } else {\n return fields_of(self::getInstance()->_tablename());\n }\n }", "public function getTableField()\n {\n $this->getForeignKeys();\n\n return [\n 'field' => '',\n 'type' => '',\n 'length' => '',\n 'unsigned' => '',\n 'null' => false,\n 'auto_increment' => false,\n 'collation' => '',\n 'has_default' => false,\n 'default' => null,\n 'comment' => '',\n // 'primary' => true,\n // 'generated' => 0,\n 'on_update' => '',\n 'on_delete' => '',\n '_types_' => $this->getFieldTypes(),\n '_length_required_' => false,\n '_collation_hidden_' => true,\n '_unsigned_hidden_' => false,\n '_on_update_hidden_' => true,\n '_on_delete_hidden_' => true\n ];\n }", "public function getColumn(): string\n {\n return $this->_column;\n }", "function dbTableField($tableName) {\n $data = array();\n $sql = \"SHOW COLUMNS FROM \" . $tableName;\n $result = mysql_query($sql);\n $i = 0;\n while ($row = mysql_fetch_assoc($result)) {\n $data[$i]['Field'] = $row['Field'];\n $data[$i]['Type'] = $row['Type'];\n $data[$i]['Null'] = $row['Null'];\n $data[$i]['Key'] = $row['Key'];\n $data[$i]['Default'] = $row['Default'];\n $data[$i]['Extra'] = $row['Extra'];\n $i++;\n }\n\n return $data;\n }", "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "public function getRecordTypeColumnName() {}", "public function columnMap()\n {\n return array(\n 'diaMesAno' => 'diaMesAno'\n );\n }", "public function getPageIdColumnName() {}", "function column(){\n\t\t$column_array = array(\n\t\t\t\t0 => 'A.date_add',//default order sort\n\t\t\t\t1 => 'A.po_number',\n\t\t\t\t2 => 'A.po_date',\n\t\t\t\t3 => 'B.nama_supplier',\t\t\n\t\t\t\t4 => 'A.state_received',\t\n\t\t\t\t5 => 'A.active',\t\n\t\t\t\t6 => 'A.add_by',\n\t\t\t\t7 => 'A.date_add',\n\t\t);\n\t\treturn $column_array;\n\t}", "function tableData(){\n\t\t$entity_type = in(\"entity_type\");\t\t\n\t\t$table = $entity_type()->getTable();\n\t\t$test = in('test');\n\n\t\t// Table's primary key\n\t\t$primaryKey = 'id';\n\n\t\t// Array of database columns which should be read and sent back to DataTables.\n\t\t// The `db` parameter represents the column name in the database, while the `dt`\n\t\t// parameter represents the DataTables column identifier. In this case simple\n\t\t// indexes\n\t\t$columns = array(\n\t\t\tarray( \t'db' => 'id',\n\t\t\t\t\t'dt' => 0 \n\t\t\t\t ),\n\t\t\tarray( \t'db' => 'created', \n\t\t\t\t\t'dt' => 1, \n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t),\n\t\t\tarray( \t'db' => 'updated',\n\t\t\t\t\t'dt' => 2,\n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t ),\n\t\t);\n\t\t\n\t\t$additional_columns = self::getAdditionalFields( $entity_type );\n\t\t\n\t\t$columns = array_merge( $columns, $additional_columns );\n\n\t\t// SQL server connection information\n\t\t$sql_details = array(\n\t\t\t'user' => 'root',\n\t\t\t'pass' => '7777',\n\t\t\t'db' => 'ci3',\n\t\t\t'host' => 'localhost'\n\t\t);\n\t\n\t\trequire( 'theme/admin/scripts/ssp.class.php' );\t\t\n\t\t$date_from = in(\"date_from\");\n\t\t$date_to = in(\"date_to\");\n\t\t$extra_query = null;\n\t\tif( !empty( $date_from ) ){\n\t\t\t$stamp_from = strtotime( $date_from );\n\t\t\t$extra_query .= \"created > $stamp_from\";\n\t\t}\n\t\tif( !empty( $date_to ) ){\n\t\t\t$stamp_to = strtotime( $date_to.\" +1 day\" ) - 1;\n\t\t\tif( !empty( $extra_query ) ) $extra_query .= \" AND \";\n\t\t\t$extra_query .= \"created < $stamp_to\";\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\techo json_encode(\n\t\t\tSSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, $extra_query )\n\t\t);\n\t}", "function generateCol() {\n\t\n\t\t$str = \"{id: '\".$this->getId().\"',\";\n\t\tif($this->getLabel()) {\n\t\t\t$str.=\"label: '\".str_replace(\"'\",\"\\'\",$this->getLabel()).\"',\";\n\t\t}\t\t\n\t\t$str.=\"type: '\".$this->getGoogleType().\"',\";\n\t\t\n\t\t$str = substr($str,0,-1);\t\t\n\t\t$str.=\"}\";\n\t\n\t\treturn $str;\n\t\n\t}", "public function getCreatorColumnName() {}", "function getTabla() {\r\n return $this->tabla;\r\n }", "public function tabla()\n {\n\n \treturn Datatables::eloquent(Encargos::query())->make(true);\n }", "private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }", "protected function columnType()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $column = $this->ask('Enter the desired column');\n $this->checkInput($column);\n $this->service->columnType($table, $column);\n }", "public function getListColumns(){\n\treturn \"id, codice_categoria, codice, descrizione\";\n}", "public function modifyTable() {\n $table = $this->getTable();\n\n $table->addColumn([\n 'name' => $this->getParameter('table_column'),\n 'type' => 'VARCHAR'\n ]);\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getColumn()\n {\n return $this->column;\n }", "public function getCreationDateColumnName() {}", "public function getColumn($name)\r\n {\r\n }", "function table()\n {\n return array('pattern' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,\n 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL);\n }", "public function getColumn()\n {\n return $this->get('Column');\n }", "public function getPrimaryKeyColumn() : string\n {\n return $this->primaryKey;\n }", "private static function fnColumnToField($i) {\n if ( $i == 0 )\n return \"c.customers_id\";\n else if ( $i == 1 )\n return \"c.customers_lastname\";\n else if ( $i == 2 )\n return \"c.customers_firstname\";\n else if ( $i == 3 )\n return \"c.customers_group_id\";\n else if ( $i == 4 )\n return \"c.date_account_created\";\n }", "function allinea_db(){\n\t\tif ($this->attributes['BYTB']!='' ) $this->fields_value_bytb($this->attributes['BYTB']);\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\n\t\t\t\t$ret[$i]=\"{$key} NUMBER\";\n\t\t\t\t$i++;\n\t\t\t\t$ret[$i]=\"D_{$key} VARCHAR2(200 CHAR)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse return ;\n\t}", "function camposBD(){\n//\t\tSELECT idFactura, nombreTienda AS tienda, fecha, numfactura AS Factura FROM tblfacturas \n//\t\tINNER JOIN tbltiendas ON tbltiendas.idtblTienda = tblfacturas.idtblTienda\n\t\t$fields = array();\n\t\t$fields[] = 'idFactura';\t\n\t\t$fields[] = 'fecha';\t\n\t\t$fields[] = 'tienda';\t\n\t\t$fields[] = 'numFactura';\t\n\t\t/*$fields[] = 'opcion';\t*/\n\t\t/*$fields[] = 'comentario';*/\t\n\t\treturn $fields;\n\t}", "public function getTableDatatype()\r\n\t{\r\n\t\treturn $this->Table_Column->Table_Datatype;\r\n\t}", "public function getLanguageIdColumnName() {}", "public function get_column_detail()\n\t{\n\t\t$ret_fields\t=\t'';\n\t\t$fields\t\t=\t$this->get_fields_info();\n\t\tif ( $fields )\n\t\t{\n\t\t\tforeach( $fields as $field )\n\t\t\t{\n\t\t\t\t$ret_fields\t=\t$ret_fields.', '.$this->table.'.'.$field->name;\n\t\t\t}\n\t\t}\n\n\t\treturn $ret_fields;\n\t}", "protected function get_column_info()\n {\n }", "protected function getColumns(){\n\t\ttry {\n\t\t\t$_db = init::getInstance()->dbh();\n\n\t\t\t$res = $_db->prepare(\"SHOW FIELDS FROM \".$this->_table);\n\n\t\t\t$res->execute();\n\n\t\t\twhile( $r = $res->fetch() ){\n\n\t\t\t\tself::$_fields[$this->_table][] = $r['Field'];\n\n\t\t\t\t//get the type\n\t\t\t\tif( strpos($r['Type'], '(') !== false ){\n\t\t\t\t\t$type = substr($r['Type'], 0, strpos($r['Type'],'('));\n\t\t\t\t} else {\n\t\t\t\t\t$type = $r['Type'];\n\t\t\t\t}\n\n\t\t\t\t//inizialize the default value\n\t\t\t\tif( !empty($r['Default']) ){\n\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = $r['Default'];\n\n\t\t\t\t} elseif( $r['Null'] == 'YES' ){\n\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = null;\n\n\t\t\t\t} else {\n\t\t\t\t\tswitch( strtoupper($type) ){\n\t\t\t\t\t\t//numeric\n\t\t\t\t\t\tcase \"BIT\":\n\t\t\t\t\t\tcase \"TINYINT\":\n\t\t\t\t\t\tcase \"BOOL\":\n\t\t\t\t\t\tcase \"BOOLEAN\":\n\t\t\t\t\t\tcase \"SMALLINT\":\n\t\t\t\t\t\tcase \"MEDIUMINT\":\n\t\t\t\t\t\tcase \"INT\":\n\t\t\t\t\t\tcase \"INTEGER\":\n\t\t\t\t\t\tcase \"BIGINT\":\n\t\t\t\t\t\tcase \"FLOAT\":\n\t\t\t\t\t\tcase \"DOUBLE\":\n\t\t\t\t\t\tcase \"DECIMAL\":\n\t\t\t\t\t\tcase \"DEC\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = 0;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t//string\n\t\t\t\t\t\tcase \"CHAR\":\n\t\t\t\t\t\tcase \"VARCHAR\":\n\t\t\t\t\t\tcase \"BINARY\":\n\t\t\t\t\t\tcase \"VARBINARY\":\n\t\t\t\t\t\tcase \"TINYBLOB\":\n\t\t\t\t\t\tcase \"TINYTEXT\":\n\t\t\t\t\t\tcase \"BLOB\":\n\t\t\t\t\t\tcase \"TEXT\":\n\t\t\t\t\t\tcase \"MEDIUMBLOB\":\n\t\t\t\t\t\tcase \"MEDIUMTEXT\":\n\t\t\t\t\t\tcase \"LONGBLOB\":\n\t\t\t\t\t\tcase \"LONGTEXT\":\n\t\t\t\t\t\tcase \"ENUM\":\n\t\t\t\t\t\tcase \"SET\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t//date\n\t\t\t\t\t\tcase \"DATE\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000-00-00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"DATETIME\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000-00-00 00:00:00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"TIMESTAMP\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000-00-00 00:00:00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"TIME\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '00:00:00';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"YEAR\":\n\t\t\t\t\t\t\t\tself::$_defvalues[$this->_table][ $r['Field'] ] = '0000';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tthrow new Exception('unknow column type');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch ( PDOException $e ){\n\t\t\terreur_pdo( $e, get_class( $this ), __FUNCTION__ );\n\t\t}\n\t}", "protected function get_column_info()\n {\n }", "private function getFieldsOnTable()\n{\n\n $returnArray=array(); \n foreach ($this->tableStructure as $ind => $fieldArray) { \n $returnArray[$fieldArray['columnName']]=$fieldArray['columnName'];\n }\n \n return $returnArray; \n}", "public function getNameColumn()\n {\n return $this->nameColumn;\n }", "public function getColumnDetails( $tablename, $columnname );", "public function getTableColumns()\n\t{\n\t}", "public function getAccessibleColumn(){\n return [\n 'ref'=>'Ref',\n 'productName'=>'Supply For',\n 'admission_price'=>'Admission Price',\n 'quantity' => 'quantity',\n 'status'=>'Status',\n 'supply_date' => 'Supply Date',\n 'started_at' => 'Started At',\n 'ended_at' => 'Ended At',\n 'other'=>''\n ];\n }", "private function setFields(): string\n {\n $sql = '';\n\n foreach (array_keys($this->data) as $key) {\n $sql .= '`' . $key . '` = ? , ';\n }\n return rtrim($sql, ', ');\n }", "public function getTypeColumn(): string\n {\n if (! isset($this->typeColumn)) {\n return 'type';\n }\n\n return $this->typeColumn;\n }", "public function column()\r\n {\r\n if (!empty($this->configs->column))\r\n return $this->configs->column;\r\n\r\n return ZArrayHelper::merge(parent::column(), [\r\n \r\n 'user' => function (Form $column) {\r\n\r\n $column->title = Az::l('Пользователь');\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'amount' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество потоков');\r\n \r\n return $column;\r\n },\r\n \r\n \r\n \r\n\r\n\r\n\r\n ], $this->configs->replace);\r\n }", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'id' \t\t => '%d',\n\t\t\t'name' \t\t => '%s',\n\t\t\t'date_created' \t=> '%s',\n\t\t\t'date_modified' => '%s',\n\t\t\t'status'\t\t=> '%s',\n\t\t\t'ical_hash'\t\t=> '%s'\n\t\t);\n\n\t}", "public function table_attributes() {\n return static::find_by_sql(\"SHOW COLUMNS FROM \".static::$table_name);\n }", "protected function _field_data($table)\n {\n return 'SELECT TOP 1 * FROM ' . $this->protect_identifiers($table);\n }", "protected function tableModel()\n {\n }", "public function columnMap()\n {\n return [\n 'id_comentario' => 'id_comentario',\n 'comentario' => 'comentario',\n 'fecha_comentario' => 'fecha_comentario',\n 'id_reporte' => 'id_reporte',\n 'id_usuario' => 'id_usuario'\n ];\n }", "public function getTableColumns() { return $this->table->getColumns(); }", "private function _getColumn($table)\n\t{\n\t\t$result = $this->db->list_fields($table);\n\n\t\treturn $result;\n\t}", "function listPage_tableField(){\n $this->data_view['tableField'] = array(\n array('name'=>'id','title'=>'Mã'),\n array('name'=>'image','title'=>'Hình','type'=>'image','linkDetail'=>true),\n array('name'=>'title','title'=>'Tên','linkDetail'=>true),\n array('name'=>'c_title','title'=>'Loại'),\n array('name'=>'price','title'=>'Giá','type'=>'number'),\n array('name'=>'price_promotion','title'=>'Giá giảm','type'=>'number','hidden'=>true),\n array('name'=>'views','title'=>'Lượt xem','type'=>'number'),\n array('name'=>'is_active','title'=>'Trạng thái','type'=>'status'),\n array('name'=>'is_stock','title'=>'Còn hàng','type'=>'status','hidden'=>true),\n array('name'=>'is_special','title'=>'Nổi bật','type'=>'status','hidden'=>true)\n );\n }", "public function getAccessibleColumn(){\n return [\n 'name'=>'Name',\n 'price'=>'Price',\n 'updated_price_at'=>'Updated Price At',\n 'copy_number'=>'Quantity',\n // 'view'=>'View',\n 'categoryName'=>'Category',\n\n 'columnCount' => '',\n // 'brands' => 'Brands',\n\n // 'imageCount'=>'Images',\n // 'commentCount'=>'Comment',\n // 'upVoteCount'=> 'Up Vote',\n // 'downVoteCount'=> 'Down Vote'\n // 'category_id'=>'Category',\n ];\n }", "public function getTranslationOriginColumnName() {}", "public function columns($table_name);", "function describir_campos($tabla_x,$bd_x=\"\"){\r\n\t\tif($bd_x!=\"\"){\r\n\t\t\t$bd = $bd_x.\".\";\r\n\t\t}#end if\r\n\t\t$query_x = \"SHOW FIELDS FROM \".$bd.$tabla_x;\r\n\t\t$result = mysqli_query($this->conexion,$query_x);\r\n\t\tif($result){\r\n\t\t\t$n_filas = mysqli_num_rows($result);\r\n\t\t\t$this->serial[$tabla_x] = \"\";\r\n\t\t\tfor ($i=0;$i<$n_filas;$i++){\r\n\t\t\t\t$row_x = mysqli_fetch_array($result);\r\n\t\t\t\tif($i==0){\r\n\t\t\t\t\t$this->campo_clave = $row_x[0];\r\n\t\t\t\t}#end if\r\n\t\t\t\t$this->nombre[$i] = $row_x[0];\r\n\t\t\t\t$this->tipo[$i] = $row_x[1];\r\n\t\t\t\tif($row_x[\"Key\"] == \"PRI\"){\r\n\t\t\t\t\t$this->campo_clave = $row_x[0];\r\n\t\t\t\t}#end if\r\n\t\t\t}#end next i\r\n\t\t}#end if result\r\n\t}", "public function nomCol($nomTabla): array {\n $campos = [];\n if ($this->conexion == null) {\n $this->conexion = $this->conexion();\n }\n $consulta = \"select * from $nomTabla\";\n $r = $this->conexion->query($consulta);\n $camposObj = $r->fetch(PDO::FETCH_ASSOC);\n foreach ($camposObj as $nomCol => $campo) {\n $campos[] = $nomCol;\n }\n return $campos;\n }", "abstract function getProfileColumnName($field_name);", "public function getTableContent() {\n\t\treturn \"<tr data-key='\" . $this -> getKey() . \"'><td>\" . $this -> key . \"</td><td contenteditable='true'>\" . $this -> value . \"</td><td>\" . $this -> dataType . \"</td></tr>\";\n\t}", "private function createDataRowForColumns(){\n\t\t$DataRows = [];\n\t\tforeach (\\DB::select('show columns from ' . $this->model->getTable() ) as $column)\n\t\t\t$DataRows[] = (new DataRowColumn)->setModel($this->model)->setField($column->Field)->fillModel();\n\n\t\t$this->DataType->dataRows()->saveMany($DataRows);\n\t}", "public function getColumnId(): string\n {\n return $this->getColumn('id', 'id');\n }", "protected function get_select_id_col_name() {\n return \"accession\";\n }", "public function fnColumnToField( $i )\n\t{\n\t\tif ( $i == 0 ||$i == 1 )\n\t\t\treturn \"nombre\";\n\t\telse if ( $i == 2 )\n\t\t\treturn \"edad\";\n\t\telse if ( $i == 3 )\n\t\t\treturn \"equipo\";\n\t\telse if ( $i == 4 )\n\t\t\treturn \"puesto\";\n\t}", "public static function getColumns(): array {\n return ['invoice_id', 'appointment_id', 'create_time', 'update_time', 'state', 'tax_rate',\n 'amount_due', 'amount_payed', 'discount_rate'];\n }", "function get_fields_in_table( ){\n\t\t\t\t $result = mysql_query(\"SHOW COLUMNS FROM \".$this->db.\".\".$this->table.\"\");\n\t\t\t\tif (!$result) {\n\t\t\t\t echo 'Could not run query: ' . mysql_error();\n\t\t\t\t exit;\n\t\t\t\t}\n\t\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\t while ($row = mysql_fetch_assoc($result)) {\n\t\t\t\t \n\t\t\t\t //$a_fields[]=$row;\n\t\t\t\t $a_fields[]=$row['Field'].\" | \".$row['Type'];\n\t\t\t\t \n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\treturn $a_fields;\n\t\t\t }", "public function referenceColumnName();", "abstract public function getColsFields();", "public static function columns_data($table, $column) {\n $columns = static ::columns($table);\n foreach($columns as $_column) {\n if (strtolower($_column['Field']) == strtolower($column)) {\n return $_column;\n }\n }\n throw new Exception(\"No Column Found\");\n }", "function get_columns() {\n\t\t$columns = [\n\t\t\t'jumlahHTTPS' => 'Jumlah Domain HTTPS',\n\t\t\t'totalDomain' => 'Total Domain', \n\t\t\t'jumlahCert' => 'Jumlah Sertifikat Aktif',\n\t\t\t'totalCert' => 'Total Sertifikat'\n\t\t];\n\n\t\treturn $columns;\n\t}", "public function get_columns() {\n\t\treturn array(\n\t\t\t'payment' => 'Payment',\n\t\t\t'status' => 'Status',\n\t\t\t'category' => 'Category',\n\t\t\t'due' => 'Due',\n\t\t\t'amount' => 'Amount',\n\t\t\t'method' => 'Method',\n\t\t\t// 'vendor' => 'Vendor',\n\t\t\t'attachments' => 'Attachments',\n\t\t\t'event' => 'Event',\n\t\t);\n\t}", "public function getColumnDefinition($column){ }", "public function getColumnDDL(Column $col);", "public function columnMap()\n {\n return [\n 'id_categoria' => 'id_categoria',\n 'titulo' => 'titulo',\n 'descripcion' => 'descripcion'\n ];\n }", "public function getColumnTypes();", "public function get_columns() {\n\t\treturn array(\n\t\t\t'id' => '%d',\n\t\t\t'user_id' => '%d',\n\t\t\t'username' => '%s',\n\t\t\t'name' => '%s',\n\t\t\t'email' => '%s',\n\t\t\t'product_count' => '%d',\n\t\t\t'sales_count'\t => '%d',\n\t\t\t'sales_value'\t => '%f',\n\t\t\t'status'\t\t => '%s',\n\t\t\t'notes' => '%s',\n\t\t\t'date_created' => '%s',\n\t\t);\n\t}", "function listColumns($tablename);", "final public function col():Col\n {\n return $this->table()->col($this->col);\n }", "function column($real) {\n\t\tif (is_array($real)) {\n\t\t\t$col = $real['name'];\n\t\t\tif (isset($real['limit'])) {\n\t\t\t\t$col .= '('.$real['limit'].')';\n\t\t\t}\n\t\t\treturn $col;\n\t\t}\n\n\t\t$col = str_replace(')', '', $real);\n\t\t$limit = $this->length($real);\n\t\tif (strpos($col, '(') !== false) {\n\t\t\tlist($col, $vals) = explode('(', $col);\n\t\t}\n\n\t\tif (in_array($col, array('date', 'time', 'datetime', 'timestamp'))) {\n\t\t\treturn $col;\n\t\t}\n\t\tif (($col == 'tinyint' && $limit == 1) || $col == 'boolean') {\n\t\t\treturn 'boolean';\n\t\t}\n\t\tif (strpos($col, 'int') !== false) {\n\t\t\treturn 'integer';\n\t\t}\n\t\tif (strpos($col, 'char') !== false || $col == 'tinytext') {\n\t\t\treturn 'string';\n\t\t}\n\t\tif (strpos($col, 'text') !== false) {\n\t\t\treturn 'text';\n\t\t}\n\t\tif (strpos($col, 'blob') !== false || $col == 'binary') {\n\t\t\treturn 'binary';\n\t\t}\n\t\tif (strpos($col, 'float') !== false || strpos($col, 'double') !== false || strpos($col, 'decimal') !== false) {\n\t\t\treturn 'float';\n\t\t}\n\t\tif (strpos($col, 'enum') !== false) {\n\t\t\treturn \"enum($vals)\";\n\t\t}\n\t\treturn 'text';\n\t}", "private function tbl_guiones_registro_tipo_formulario() {\r\n\t\t\t$this->guiones_registro_tipo = $this->esquema->createTable('GUIONES_REGISTRO_TIPO');\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del tipo de Guion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_tipo->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "function table()\n {\n\n $db = $this->getDatabaseConnection();\n $dbtype = $db->phptype; // Database type is stored here. Crazy but true.\n\n return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,\n 'yubikey_id' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,\n 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL,\n 'modified' => ($dbtype == 'mysql' || $dbtype == 'mysqli') ?\n DB_DATAOBJECT_MYSQLTIMESTAMP + DB_DATAOBJECT_NOTNULL :\n DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME\n );\n }", "public function getName()\n {\n return $this['column_name'];\n }", "public function toColumn() {\r\n\t\treturn $this->PDOStatement->fetchAll(PDO::FETCH_COLUMN,0);\r\n\t}", "public function getColumnDefinition(\\Phalcon\\Db\\ColumnInterface $column) : string\n {\n $columnSql = '';\n $type = $column->getType();\n if (is_string($type)) {\n $columnSql .= $type;\n $type = $column->getTypeReference();\n }\n\n switch ($type) {\n case Column::TYPE_INTEGER:\n if (empty($columnSql)) {\n $columnSql .= 'INT';\n }\n\n// $columnSql .= '('.$column->getSize().')';\n// if ($column->isUnsigned()) {\n// $columnSql .= ' UNSIGNED';\n// }\n break;\n\n case Column::TYPE_DATE:\n if (empty($columnSql)) {\n $columnSql .= 'DATE';\n }\n break;\n\n case Column::TYPE_VARCHAR:\n if (empty($columnSql)) {\n $columnSql .= 'NVARCHAR';\n }\n $columnSql .= '('.$column->getSize().')';\n break;\n\n case Column::TYPE_DECIMAL:\n if (empty($columnSql)) {\n $columnSql .= 'DECIMAL';\n }\n $columnSql .= '('.$column->getSize().','.$column->getScale().')';\n// if ($column->isUnsigned()) {\n// $columnSql .= ' UNSIGNED';\n// }\n break;\n\n case Column::TYPE_DATETIME:\n if (empty($columnSql)) {\n $columnSql .= 'DATETIME';\n }\n break;\n\n case Column::TYPE_TIMESTAMP:\n if (empty($columnSql)) {\n $columnSql .= 'TIMESTAMP';\n }\n break;\n\n case Column::TYPE_CHAR:\n if (empty($columnSql)) {\n $columnSql .= 'CHAR';\n }\n $columnSql .= '('.$column->getSize().')';\n break;\n\n case Column::TYPE_TEXT:\n if (empty($columnSql)) {\n $columnSql .= 'NTEXT';\n }\n break;\n\n case Column::TYPE_BOOLEAN:\n if (empty($columnSql)) {\n $columnSql .= 'BIT';\n }\n break;\n\n case Column::TYPE_FLOAT:\n if (empty($columnSql)) {\n $columnSql .= 'FLOAT';\n }\n $size = $column->getSize();\n if ($size) {\n// $scale = $column->getScale();\n// if ($scale) {\n// $columnSql .= '('.size.','.scale.')';\n// } else {\n $columnSql .= '('.size.')';\n// }\n }\n// if ($column->isUnsigned()) {\n// $columnSql .= ' UNSIGNED';\n// }\n break;\n\n case Column::TYPE_DOUBLE:\n if (empty($columnSql)) {\n $columnSql .= 'NUMERIC';\n }\n $size = $column->getSize();\n if ($size) {\n $scale = $column->getScale();\n $columnSql .= '('.$size;\n if ($scale) {\n $columnSql .= ','.$scale.')';\n } else {\n $columnSql .= ')';\n }\n }\n// if ($column->isUnsigned()) {\n// $columnSql .= ' UNSIGNED';\n// }\n break;\n\n case Column::TYPE_BIGINTEGER:\n if (empty($columnSql)) {\n $columnSql .= 'BIGINT';\n }\n $size = $column->getSize();\n if ($size) {\n $columnSql .= '('.$size.')';\n }\n// if ($column->isUnsigned()) {\n// $columnSql .= ' UNSIGNED';\n// }\n break;\n\n case Column::TYPE_TINYBLOB:\n if (empty($columnSql)) {\n $columnSql .= 'VARBINARY(255)';\n }\n break;\n\n case Column::TYPE_BLOB:\n case Column::TYPE_MEDIUMBLOB:\n case Column::TYPE_LONGBLOB:\n if (empty($columnSql)) {\n $columnSql .= 'VARBINARY(MAX)';\n }\n break;\n\n default:\n if (empty($columnSql)) {\n throw new Exception('Unrecognized MsSql data type at column '.$column->getName());\n }\n\n $typeValues = $column->getTypeValues();\n if (!empty($typeValues)) {\n if (is_array($typeValues)) {\n $valueSql = '';\n foreach ($typeValues as $value) {\n $valueSql .= '\"'.addcslashes($value, '\"').'\", ';\n }\n $columnSql .= '('.substr(valueSql, 0, -2).')';\n } else {\n $columnSql .= '(\"'.addcslashes($typeValues, '\"').'\")';\n }\n }\n break;\n }\n\n return $columnSql;\n }", "public function column() : int\n {\n return $this->column;\n }", "public function table()\n {\n return $this->table;\n }", "function tableInfo($table) {\r\n\t\t$res = $this->db->Execute($this->db->metaColumnsSQL);\r\n\t\t$info = $res->FetchRow();\r\n\t\t$newInfo = array('Typ' => $info['Engine'],\r\n\t\t\t\t\t\t 'Kodowanie' => $info['Collation'],\r\n\t\t\t\t\t\t 'Ilość rekordów' => $info['Rows'],\r\n\t\t\t\t\t\t 'Data utworzenia' => $info['Create_time'],\r\n\t\t\t\t\t\t 'Data ostatniej modyfikacji' => $info['Update_time'],\r\n\t\t\t\t\t\t 'Następny numer' => empty($info['Auto_increment']) ? 1 : $info['Auto_increment']\r\n\t\t\t\t\t\t);\r\n\t\treturn $newInfo;\r\n\t}" ]
[ "0.6744112", "0.67002887", "0.6674286", "0.6618721", "0.65801996", "0.6523949", "0.64745504", "0.64733726", "0.6466312", "0.6460589", "0.64378077", "0.6423638", "0.6411212", "0.638224", "0.6373354", "0.6356444", "0.63527304", "0.63400584", "0.62895215", "0.62887055", "0.62015784", "0.61862993", "0.61838144", "0.61683804", "0.6159135", "0.61497194", "0.6143998", "0.6138547", "0.6135332", "0.6119526", "0.60825855", "0.6081009", "0.60754937", "0.6073419", "0.60644937", "0.606127", "0.606127", "0.6025751", "0.6011768", "0.59967256", "0.59948444", "0.59854144", "0.5982526", "0.5980414", "0.5976456", "0.5974312", "0.59697866", "0.59665936", "0.596561", "0.5964342", "0.596425", "0.5961599", "0.59607136", "0.59407777", "0.5933877", "0.5932118", "0.59227365", "0.592027", "0.59144527", "0.5912925", "0.5897302", "0.5889382", "0.58852243", "0.5884454", "0.5883816", "0.58822674", "0.5880745", "0.58802664", "0.5876886", "0.5869294", "0.58682686", "0.58654946", "0.5864174", "0.58627874", "0.58544886", "0.5852674", "0.5851447", "0.5850425", "0.5843013", "0.5833558", "0.5826186", "0.58218795", "0.5821729", "0.5819372", "0.5819152", "0.5816486", "0.58146757", "0.58131653", "0.5810588", "0.580615", "0.5804845", "0.5800554", "0.579788", "0.57944524", "0.57919425", "0.5789223", "0.57787305", "0.5773054", "0.57712275", "0.5764682", "0.5761697" ]
0.0
-1
Descripcion del campo Optional
public function setDescription($description): self { $this->extras['description'] = $description; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDescription()\n {\n return null;\n }", "public function getDesciption();", "public function getDescription(): ?string;", "public function description($value = null)\n \t{\n \t\tif ($value != null) $this->_description = $value;\n \t\telse return $this->_description;\n \t}", "public function getDescription() {\n\t\treturn null;\n\t}", "public function getDescription(): ?string\n {\n return $this->description;\n }", "public function getDescription(): ?string\n {\n return $this->description;\n }", "public function getDescription(): ?string\n {\n return $this->description;\n }", "public function getDescription(): ?string\n {\n return $this->description;\n }", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescripcion(){\n return $this->Descripcion;\n }", "public function getOptionalContent() {}", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "private function AddOptionalParamsField()\n {\n $name = 'OptionalParameters';\n $field = new Textarea($name, $this->OptionalParamsText());\n $this->AddField($field);\n $this->SetTransAttribute($name, 'placeholder');\n }", "public static function description()\n {\n return \"be falsy.\";\n }", "public function getDescriptionAttribute(string $value = null) :?string\n {\n return !is_null($value) ?ucfirst($value) : $value;\n }", "public static function getDescription()\n {\n return null;\n }", "public function getDescription() : ?string\n {\n return $this->description;\n }", "public function getDescription()\n {\n return $this->__get(self::FIELD_DESCRIPTION); \n }", "public function getDescription()\n { \n return $this->description;\n }", "public function getDescription() {\n\t\treturn \"No description yet\";\n\t}", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescription(): string\n {\n return '';\n }", "public function getDescription()\n {\n return $this->getParameter('description');\n }", "public function getDescription()\n {\n return $this->description;\n }", "public function getDescription(): ?DescriptionDescriptor;", "public function briefDescription($value = null)\n \t{\n \t\tif ($value != null) $this->_briefDescription = $value;\n \t\telse return $this->_briefDescription;\n \t}", "public function getDescription(): ?string\n {\n if (count($this->description) == 0) {\n return null;\n }\n return $this->description['value'];\n }", "public function getDescription(){\n return $this->description;\n }", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function setDescription($value);", "public function setDescription($value) {\n\t\tif($value == \"\") { $value = \"None\"; }\n\t\tself::$_description = $value;\n\t}", "public function getDescripcion()\n {\n return $this->descripcion;\n }", "public function getDescription()\n {\n return;\n }", "public function getDescription():string;", "public function description()\r\n {\r\n }", "public abstract function getDescription();", "public function description();", "public function description();", "public function getDescripcion() {\n return $this->descripcion;\n }", "public function description(): string;", "public function description(): string;", "public function getDescription(): string {\n return \"$this->description\";\n }", "public static function getDescription() {\n return '';\n }", "function getDescription() {\n return $this->description;\n }", "public function getDescription(): string\n {\n return 'Se crea el campo anexos del sistema';\n }", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription() {\n return $this->description;\n }", "public function description()\n {\n if (@$this->data[\"description\"]) {\n return $this->data[\"description\"];\n }\n return null;\n }", "public function getDescription()\n {\n return $this->description;\n }", "public function isOptional()\n {\n return false;\n }", "public function setDesc($val){ return $this->setField('desc',$val); }", "public function option_description_string() {\n return '';\n }", "public function getDescription(){\n return $this->description;\n }", "public function getDescription(){\n return $this->description;\n }", "public function getDescription()\n{\nreturn $this->Description;\n}" ]
[ "0.7016641", "0.7001614", "0.69684774", "0.6930787", "0.68867505", "0.6688923", "0.6688923", "0.6688923", "0.6688923", "0.66692626", "0.66692626", "0.66692626", "0.66692626", "0.66692626", "0.66692626", "0.66692626", "0.66692626", "0.66692626", "0.6669168", "0.6669168", "0.6669168", "0.66279083", "0.6610324", "0.6599427", "0.6567092", "0.65625924", "0.6547647", "0.65436935", "0.652685", "0.65095377", "0.6487751", "0.6472943", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6454025", "0.6451811", "0.6447043", "0.6442132", "0.64416796", "0.6438192", "0.64379203", "0.64324594", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.64241564", "0.6412773", "0.64085126", "0.6398161", "0.63951916", "0.6386496", "0.6371075", "0.6350865", "0.6349728", "0.6349728", "0.6344412", "0.63337064", "0.63337064", "0.6328657", "0.63280964", "0.6326357", "0.6324886", "0.63237554", "0.63237554", "0.63237554", "0.63237554", "0.63237554", "0.63237554", "0.63233584", "0.63183486", "0.6311873", "0.6292804", "0.6285632", "0.6276704", "0.6269399", "0.6269399", "0.62662303" ]
0.0
-1